|
[Sponsors] |
February 7, 2020, 06:45 |
RBF(Mesh)MotionSolver in solids4foam
|
#481 | |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Jon,
Just wondering: did you ever get RBFMeshMotionSolver to work with fsiFoam? I'm trying to use it with solids4foam (foam-extend-4.1, Ubuntu 18.04), and got the same error message you got (Problem with fluid mesh motion solver selection), both for RBFMeshMotionSolver and RBFMotionSolver. I came across a presentation by Željko Tuković, in which he uses RBFMeshMotionSolver with solids4foam, even combined with overset grid, so apparently it's possible to get it working, but it clearly doesn't work straight out of the box. Did you find a solution? Many thanks, Sita Quote:
|
||
February 7, 2020, 18:04 |
|
#482 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34 |
Hi,
See commit bc08236 to the development branch of solids4foam: I added the following code to fluidSolidInterface.C: Code:
// Check for RBF motion solver const bool rbfMotionSolver = isA<RBFMeshMotionSolver> ( fluidMesh().lookupObject<motionSolver>("dynamicMeshDict") ); // Set motion on FSI interface if (feMotionSolver) { ... } else if (rbfMotionSolver) { // Prepare list of patch motions Field<vectorField> motion(fluidMesh().boundaryMesh().size()); // Initialise all fields to zero forAll(fluidMesh().boundaryMesh(), patchI) { motion[patchI] = vectorField ( fluidMesh().boundaryMesh()[patchI].size(), vector::zero ); } // Loop through all FSI interfaces forAll(fluid().globalPatches(), interfaceI) { // Interpolate the FSI interface point motion to the faces const vectorField interfacePatchMotion = fluidPatchesPointsDispls[interfaceI] - fluidPatchesPointsDisplsPrev[interfaceI]; // Create interpolator primitivePatchInterpolation interp ( fluidMesh().boundaryMesh()[fluidPatchIndices()[interfaceI]] ); // Set motion of FSI interface motion[fluidPatchIndices()[interfaceI]] = interp.pointToFaceInterpolate(interfacePatchMotion); } // Set motion field in RBF motion solver // Note: take displacement as opposed to velocity const_cast<RBFMeshMotionSolver&> ( fluidMesh().lookupObject<RBFMeshMotionSolver>("dynamicMeshDict") ).setMotion(motion); } else { ... Code:
dynamicFvMesh dynamicMotionSolverFvMesh; solver RBFMeshMotionSolver; diffusivity quadratic inverseDistance (interface); // Settings for the RBF solver staticPatches (top bottom left); movingPatches (interface); fixedPatches (inlet outlet); interpolation { function TPS; } coarsening { enabled no; } Philip |
|
February 9, 2020, 03:35 |
|
#483 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Philip,
Perfect, I'll have a look a that, thanks! Sita |
|
February 10, 2020, 07:16 |
|
#484 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Philip,
Sorry, just a quick question: can I build this development branch version next to the version that I already built from the master branch, or should I replace everything? Or would adding the code you mentioned to my master branch version, and re-building, work as well (i.e. without messing up my git clone)? Many thanks, Sita |
|
February 10, 2020, 07:28 |
|
#485 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34 |
Hi Sita,
There are at least three ways you can do this:
All three of these are fine. Personally, I prefer option 1. Once I have checked all tutorial still run I will merge the change into the master branch anyway. Philip |
|
February 10, 2020, 08:01 |
|
#486 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Philip,
Thanks a lot for your quick reply, I'll go for the first option so. Sita |
|
February 10, 2020, 08:06 |
|
#487 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34 |
No problem. By the way, after changing branch, you can run "git pull" to pull the latest changes from that branch ("git pull" may update all branches if your git settings are configured using the old approach).
|
|
February 10, 2020, 09:52 |
|
#488 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Philip,
Great, that worked, the error "Problem with fluid mesh motion solver selection" is gone now. Unfortunately a new error popped up: Code:
Time = 0.001, iteration: 1 Modes before clean-up (plate): 0, modes after clean-up (plate): 0 Current fsi under-relaxation factor (plate): 0.05 Maximal accumulated displacement of interface 0: 2.40967e-05 solids4Foam: fluidModels/finiteVolume/RBFMeshMotionSolver/RBFMeshMotionSolver.C:662: virtual void Fo am::RBFMeshMotionSolver::solve(): Assertion `index == nbGlobalStaticFaceCenters[Pstream::myProcNo()] ' failed. Aborted (core dumped) I'll try to run this beamInCrossFlow/linearGeometryElasticBeam tutorial first, see if I can work out how things work from there. Thanks, Sita EDIT: Woops, the beamInCrossFlow/linearGeometryElasticBeam tutorial gives me the exact same error... EDIT 2: Strange, the line of code that failed (the one with Pstream::myProcNo() ) should only be used in a parallel case (if ( Pstream::nProcs() > 1 ) ). I'm fairly sure I'm running the case in serial mode, as I haven't decomposed anything etc. |
|
February 10, 2020, 10:36 |
|
#489 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34 |
Hi Sita,
Are you running the case in serial or in parallel? As noted in my previous post, parallel is currently not working: there is something wrong in the RBFMeshMotionSolver. Philip EDIT: I have checked the linearGeometryElasticBeam case in parallel on my Ubuntu box and it does work. I have realised there is a problem with openmpi on my mac (unrelated to solids4foam). Can you try clean and re-compile solids4foam (run "wclean lib && wmake libso" in src/solids4FoamModels)? And update to development commit 699223c first, where I included some example RBF settings. You need to enable the RBF motion in linearGeometryElasticBeam tutorial by changing the following lines in the fluid/dynamicMeshDict: Code:
solver velocityLaplacian; //solver RBFMeshMotionSolver; Code:
//solver velocityLaplacian; solver RBFMeshMotionSolver; Last edited by bigphil; February 10, 2020 at 11:50. Reason: See comments at the end of the post above |
|
February 10, 2020, 15:17 |
|
#490 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Phil,
That's the thing, I actually am running the case in serial (on Ubuntu 18.04, with foam-extend-4.1), so I was really surprised that I got an error related to this "if nProc > 1" block. I already changed the dynamicMeshDict like you suggested in post #483, I'll try the cleaning and re-compiling too, tomorrow. Thanks for your help so far! Sita Last edited by sita; February 11, 2020 at 10:28. |
|
February 11, 2020, 06:46 |
|
#491 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Philip,
I just tried cleaning and re-compiling solids4foam, after updating to commit 699223, but I'm still getting the same error. As you wrote that for you the tutorial case now also works in parallel on Ubuntu, I'm starting to think that something might be wrong with my foam-extend-4.1 install (I had a good deal of trouble installing that, see also here (last page), and I'm still not sure whether everything's working as it should now). For now I'll try installing the pre-built binary of foam-extend-4.1, see if that helps. I read that the pre-built binary has some trouble with parallel cases in combination with the GAMG solver, but in fairness I'd be happy enough with just serial runs by now. Thanks, Sita EDIT: Too bad, with the foam-extend-4.1 pre-built binary it doesn't work either, still the same error... EDIT 2: Ah wait, sorry, the error isn't in this if-block; I missed a closing parenthesis. Still, can't figure out why exactly it failed; it seems the index in this for-loop (lines 653-660) doesn't reach nbGlobalStaticFaceCenters EDIT 3: Hm, commenting out those assert commands "solves" my problems for now. The results of the beamInCrossFlow/linearGeometryElasticBeam tutorial look alright, but this is not a permanent solution of course... Last edited by sita; February 12, 2020 at 04:31. |
|
February 13, 2020, 05:14 |
|
#492 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi everyone,
I've two quick questions about solids4foam/RBFMeshMotion (foam-extend-4.1, Ubuntu 18.04.3): 1. Does anyone know how I'm supposed to add gravity to a solids4foam computation with RBFMeshMotion? There's a dictionary g in constant/solid, which works fine with other mesh motion solvers, such as velocityLaplacian, but when I use RBFMeshMotion, gravity seems to be ignored. Looking through the solver log file, I noticed: Code:
g field not found in constant directory: initialising to zero 2. Whenever I'm postprocessing solids4foam results in ParaView, it's complaining about duplicated entries: Code:
ERROR: In /build/paraview-lH8wFv/paraview-5.4.1+dfsg3/VTK/IO/Geometry/vtkOpenFOAMReader.cxx, line 7484 vtkOpenFOAMReaderPrivate (0x555867625480): Error reading line 490 of /home/openfoam/foam/openfoam-4.1/tutorials/solids4foam/fluidSolidInteraction/beamInCrossFlow/overset/elasticBeam/4/solid/D_0_0: Found duplicated entries with keyword value Thanks in advance, Sita |
|
February 13, 2020, 08:19 |
|
#493 | |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34 |
Quote:
One other point to mention: I checked this case only with foam-extend-4.0; I did not check foam-extend-4.1. Maybe this may be the reason for the different behaviour. I can check with fe41 too. Philip |
||
February 13, 2020, 08:25 |
|
#494 | ||
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,093
Rep Power: 34 |
Quote:
Feel free to upload a small test case here demonstrating the problem. Quote:
|
|||
February 17, 2020, 05:03 |
|
#495 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Philip,
Thanks for getting back, sorry for the delay on my side. About the RBFMeshMotionSolver: I took another look at the results, and it looks like gravity is indeed included, but the fluid and the solid seem to be decoupled. I was messing around with the HronTurek tutorial as a testcase, changed the parameters to get the FSI1 case, and later on added gravity. When I use the velocityLaplacian solver, the results look alright (see attached plot, uA.png), but when I change to RBFMeshMotion, the solid seems to be deforming without affecting the flow (see attached image, RBF_seems_decoupled.png, and plot, uA_RBF.png). I'm also attaching my testcase, so if you have time you can take a look. I don't know, it's probably something really silly that I'm missing here, but I haven't found it yet. And about the ParaView warnings/errors: in my case the variables that cause those errors aren't loaded, I only get pointD0 etc. Is there a way to load these variables anyway? Many thanks, Sita |
|
February 17, 2020, 05:09 |
|
#496 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
Hi Sita,
Can you try removing the "frontAndBackPlanes" patch from the dynamicMeshDict/staticPatches dictionary? Best, Mikko |
|
February 17, 2020, 06:21 |
|
#497 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Mikko,
Sure, I can give that a try. Do you want me to remove it altogether, or to move it to e.g. fixedPatches? Do you happen to know the difference between staticPatches and fixedPatches, by the way? Is there a reason that removing frontAndBackPlanes from staticPatches should fix the fluid-solid coupling? I'll let you know how I get on, Sita EDIT: Cool, that actually seems to work! Thanks for the tip, can you explain it? Last edited by sita; February 17, 2020 at 08:18. |
|
February 17, 2020, 09:28 |
|
#498 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
Hi Sita,
To be honest, I do not know what is the difference between a static and a fixed patch. If a patch is either fixed or static then the nodes/cellCenters on that patch are not moving and therefore you were not getting any deformations for the 2D case. If you look at the example dynamicMeshDictionaries by the authors of the mesh deformation library, they seem to be also using both static and fixed patches for the 2D cases: cylinderFlap_FSI3 beamInCrossFlow2D Best, Mikko |
|
February 17, 2020, 10:12 |
|
#499 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi Mikko,
Yeah, I noticed those tutorials, couldn't figure out the difference either though. I still don't quite get how my flexible plate was able to bend straight through the lower wall of my domain, but I'm glad everything is working as it should now. Thanks again, Sita |
|
February 19, 2020, 03:47 |
|
#500 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Hi everyone,
I seem to be running into the same issue as Mike in post #436: as the deformation in my toy case (HronTurek FSI1 with gravity) is too large to be considered linear, I switched the solidModel in solidProperties from linearGeometryTotalDisplacement to unsNonLinearGeometryTotalLagrangian. This model wouldn't combine with the linearElastic material type in mechanicalProperties (as is indicated in Philip Cardiff's solids4foam training slides, but I tried anyway...), so I switched that to neoHookeanElastic. And so now I'm getting these warnings Code:
--> FOAM Warning : From function void Foam::neoHookeanElastic::correct(surfaceSymmTensorField& sigma) in file materialModels/mechanicalModel/mechanicalLaws/nonLinearGeometryLaws/neoHookeanElastic/neoHookeanElastic.C at line 401 Material linearity enforced for stability! Many thanks, Sita |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GPU Linear Solvers for OpenFOAM | gocarts | OpenFOAM Announcements from Other Sources | 37 | August 17, 2022 15:22 |
[Virtualization] OpenFOAM oriented tutorial on using VMware Player - support thread | wyldckat | OpenFOAM Installation | 2 | July 11, 2012 17:01 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 07:55 |
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 | wyldckat | OpenFOAM Announcements from Other Sources | 3 | September 8, 2010 07:25 |
OpenFOAM Debian packaging current status problems and TODOs | oseen | OpenFOAM Installation | 9 | August 26, 2007 14:50 |