CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM CC Toolkits for Fluid-Structure Interaction (https://www.cfd-online.com/Forums/openfoam-cc-toolkits-fluid-structure-interaction/)
-   -   [solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" (https://www.cfd-online.com/Forums/openfoam-cc-toolkits-fluid-structure-interaction/126706-support-thread-solid-mechanics-solvers-added-openfoam-extend.html)

sita February 7, 2020 05:45

RBF(Mesh)MotionSolver in solids4foam
 
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:

Originally Posted by jcappola (Post 726639)
Hi All,

I'm using the foam-extend 4.0 bazaar to do FSI on flexible airfoils and I am having some trouble with mesh motion. It seems that the fsiFoam solver has only been implemented with RBF point interpolation and while RBFMeshMotionSolver is in the library, fsiFoam refuses to use it when I patch it into the dynamicMeshDict.

After the first time step's solid predictor I get the following error when the cell motion step occurs:

Code:

--> FOAM FATAL ERROR:
Problem with fluid mesh motion solver selection

    From function fluidSolidInterface::moveFluidMesh()
    in file fluidSolidInterface/fluidSolidInterface.C at line 1922.

FOAM aborting

I am wondering if someone has been able to patch in the RBFMeshMotionSolver for fsiFoam and could give some hints on how to move forward as the .moveFluidMesh() call only allows for fe/fv motionSolvers to be used and is hard coded.

Thanks,

Jon


bigphil February 7, 2020 17:04

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
        {

...

Then constant/fluid/dynamicMeshDict can be set as (for example):
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;
}

I haven't looked into the "best" settings but the beamInCrossFlow/linearGeometryElasticBeam tutorial runs in serial with these settings. I am not sure what the difference between fixed and static patches are. Parallel does not seem to work yet, so I will have to dig further to find out why (feel free to!).

Philip

sita February 9, 2020 02:35

Hi Philip,

Perfect, I'll have a look a that, thanks!

Sita

sita February 10, 2020 06:16

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

bigphil February 10, 2020 06:28

Hi Sita,

There are at least three ways you can do this:
  1. Use "git checkout development" to change to the development branch, and you can then use "git checkout master" to change back
  2. Create a second clone of the entire repo and change this repo to the development branch
  3. Copy the code segment into the relevant file in the master branch

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

sita February 10, 2020 07:01

Hi Philip,

Thanks a lot for your quick reply, I'll go for the first option so.

Sita

bigphil February 10, 2020 07:06

Quote:

Originally Posted by sita (Post 757473)
Hi Philip,

Thanks a lot for your quick reply, I'll go for the first option so.

Sita

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).

sita February 10, 2020 08:52

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)

Does this look familiar to you?

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.

bigphil February 10, 2020 09:36

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;

to
Code:

//solver velocityLaplacian;
solver RBFMeshMotionSolver;


sita February 10, 2020 14:17

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

sita February 11, 2020 05:46

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...

sita February 13, 2020 04:14

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
but that line is also there when I use velocityLaplacian, and in that case gravity is picked up alright. Just to be sure I copied g into constant, but that didn't have any noticeable effect.

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

I'm using a system installed ParaView 5.4, because I didn't manage to get the Third Party version installed. As also the PVFoamReader wouldn't build somehow, I'm using paraFoam -builtin (or just "touch case.foam && paraview case.foam"). Could that be causing these errors?

Thanks in advance,
Sita

bigphil February 13, 2020 07:19

Quote:

Originally Posted by sita (Post 757678)
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...

Glad to made progress.

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

bigphil February 13, 2020 07:25

Quote:

Originally Posted by sita (Post 757978)
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
but that line is also there when I use velocityLaplacian, and in that case gravity is picked up alright. Just to be sure I copied g into constant, but that didn't have any noticeable effect.

Some of the solidModel implementations may not include gravity (most do but some may not) so you may need to check for the one you are using. The choice of fluid mesh motion solver "should" not affect solid in any way.

Feel free to upload a small test case here demonstrating the problem.


Quote:

Originally Posted by sita (Post 757978)
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

I'm using a system installed ParaView 5.4, because I didn't manage to get the Third Party version installed. As also the PVFoamReader wouldn't build somehow, I'm using paraFoam -builtin (or just "touch case.foam && paraview case.foam"). Could that be causing these errors?

Thanks in advance,
Sita

I also use the ParaView binaries from the ParaView website. This warning can be ignored but I have not looked into what is causing it.

sita February 17, 2020 04:03

4 Attachment(s)
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

Flowkersma February 17, 2020 04:09

Hi Sita,

Can you try removing the "frontAndBackPlanes" patch from the dynamicMeshDict/staticPatches dictionary?

Best, Mikko

sita February 17, 2020 05:21

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?

Flowkersma February 17, 2020 08:28

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

sita February 17, 2020 09:12

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

sita February 19, 2020 02:47

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!

indicating that the solver is struggling to converge. And indeed a little while later the simulation crashes. As Philip suggested, I tried under-relaxation of D (and Deqn, and DD, and DDeqn) in system/solid/fvSolution, but so far the warnings keep coming up, and the simulation keeps crashing. Does anyone have any tips to improve things?

Many thanks,
Sita

tschenkel February 19, 2020 05:50

3 Attachment(s)
Hi,

Yes the new solvers in solids4foam seem to have lower numerical diffusion than the ones in the FluidSolidInteraction toolkit (bazaar). This is good, since I get a better match on the QNET-FSI validation case, which is a more realistic version of the Hron-Turek benchmark, based on experimental results. I get within 10% of frequency on a setup similar to the Hron-Turek benchmark tutorial, where the old FSI toolkit was struggling to get in the same regime.

Unfortunately the new toolkit is a lot less stable (well, obviously, if it has lower diffusion), so the HronTurek benchmark is really tricky to get working.

a) Underrelaxation helps, not only on D (i did not actually need to do that), but in the FSI underrelaxation (I went down by more of an order of magnitude), which is only used for the first three FSI loops, with the IQN method, then IQN takes over. But if the first loops are too far out, it won't converge.

I set max FSI loops to 50, but it should converge within around 20-30, the 50 is just for the unruly timesteps.

You have to check the FSI residuals, so I do a

Code:

grep "FSI residual" solids4foam.logfile | tail -n 500 > FSI-residuals
and plot that residual file in gnuplot:

Code:

set logscale y

set xlabel "Iteration"
set ylabel "R"
set grid

plot "< tail -n 500 FSI-residuals | cut -d' ' -f7 | tr -d ','" title 'FSI Res' with lines ls 2

This one is nice:

Attachment 74941

And this one is not (that's two or three time steps leading up to the problem you describe):

Attachment 74943

BTW, there may be an issue with the coupling, I do get weird artefacts in the structure of my QNET case:

Attachment 74940

Pressures are vertex values, sigma is cell based.

Material model is unsNonLinearGeometryTotalLagrangian, StVenantKirchhoff (rho-1360, E 16e6, nu 0.48).

The weird artefacts seem to be correlated with the mesh size on the fluid side. I can imagine that these could trigger instabilities in the solid solver.

tschenkel February 19, 2020 06:33

Quote:

Originally Posted by sita (Post 758393)
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

I guess that was due to the fluid mesh not deforming, but the solid solver working on the undeformed mesh. So with the mesh movement inhibited, you basically have a 1-way coupling. So the solid will calculate a steady state deformation based on the current (time dependent) flow. But the solid motion will not influence the vortex shedding (which is still there, since the Re=200 case will have an oscillatory mode even with a fixed blade).

sita February 19, 2020 07:46

Material linearity enforced for stability
 
Hi Torsten,

Thanks for the tip! Reducing the FSI under-relaxation by a factor of 10 didn't help, even in combination with under-relaxation of D, Deqn, DD, and DDeqn. But I'll play around with the settings a bit further, see if I can get things running.

Regards,
Sita


EDIT: I'm at an FSI relaxation factor of 0.001 now, with under-relaxation of D, Deqn, DD, and DDeqn all at 0.5, but still no luck. I've tried both Aitken and IQNILS, but my run keeps crashing. I didn't think this would be such a hard case, Hron Turek FSI 1 (i.e. steady flow) with gravity in negative y (I wanted to test large deformation). Anything else I can try?

tschenkel February 19, 2020 07:52

Quote:

Originally Posted by sita (Post 758716)
Hi Torsten,

Thanks for the tip! Reducing the FSI under-relaxation by a factor of 10 didn't help, even in combination with under-relaxation of D, Deqn, DD, and DDeqn. But I'll play around with the settings a bit further, see if I can get things running.

Regards,
Sita

BTW, forgot to mention, the errors (or rather warnings about enforcing linear model) you get are no problem, if they go away in the final FSI loops. As long as the final loop is using the correct equations, the results should be fine.

bigphil February 19, 2020 10:36

Quote:

Originally Posted by sita (Post 758716)
EDIT: I'm at an FSI relaxation factor of 0.001 now, with under-relaxation of D, Deqn, DD, and DDeqn all at 0.5, but still no luck. I've tried both Aitken and IQNILS, but my run keeps crashing. I didn't think this would be such a hard case, Hron Turek FSI 1 (i.e. steady flow) with gravity in negative y (I wanted to test large deformation). Anything else I can try?

One comment on using equation relaxation for the solid solvers: I have found the solution to be very sensitive to the value used; generally values less than 0.99 should not be used as the solver tends to prematurely converge (to the wrong answer). Using field relaxation does not have this same sensitivity.

sita February 20, 2020 09:54

Material linearity enforced for stability
 
Hi Philip,

Thanks, that's good to now. For now I'm afraid premature convergence isn't a problem though; it looks like the solver uses the maximum number of iterations at each time step, without properly converging.

Is there anything else I should try to get my case running properly?

Many thanks,
Sita

sita February 24, 2020 07:23

Material linearity enforced for stability
 
Hi all,

I'm still struggling to get my case running (see previous posts), it keeps warning me that Material linearity was enforced for stability, and then crashes after a while.

I've been trying to increase the number of iterations, using nIterations in unsNonLinearGeometryTotalLagrangianCoeffs, but it looks like that's not being picked up. What's the proper way to set the (maximum) number of iterations for unsNonLinearGeometryTotalLagrangian?

Also, looking through the code for unsNonLinearGeometryTotalLagrangian, I noticed a parameter stabilisePressure, which is false by default. What's the function of stabilisePressure?

Thanks in advance,
Sita


EDIT: After some more testing, I noticed that the coupling start time makes a difference. If I set it to t = 0 (i.e. coupled = yes), even the original Hron Turek FSI 1 case (steady deformation, no gravity) crashes fairly soon. This isn't the case in the old fsiFoam, does anyone know what's the difference?


Setting the coupling start time to t = 0.1, the case runs alright for g = -2 m/s2, but still not for higher, more earth-like values. Any tips, anyone?

tschenkel February 26, 2020 08:05

Strange damping in perfectly elastic materials
 
1 Attachment(s)
Hi,

I'm looking into the HronTurek benchmark solids side of things and have discovered a strange damping.

Setup is as per the tutorial case, but solid only (so CSM2 from the paper, but as a transient case):

NeoHookean Material
E = 5.6e6
nu = 0.4
rho = 1000

unsNonLinearTotalLagrangian


Case description:

Beam of length 0.6m and thickness (height) of 0.02m is fixed at the left side

At t=0 the structure is released in a constant gravity field of (0 -9.81 0).

The simulation runs nicely, but the oscillation is damped.

If I understand correctly there should be no damping in this setup:

- no fluid surrounding the structure, so no external damping
- neoHookeanElastic or StVenantKirchhoffElastic material should be perfect elastic, so no internal damping

So the only damping I can see can come from discretisation errors. I tried a finer mesh, which does improve things very slightly, and going from second order (linear) to third order (cubic):

Code:

34c34,35
<    default            Gauss linear;
---
>  //  default            Gauss linear;
>    default            Gauss cubicCorrected;
40,41c41,42
<    laplacian(DD,D)    Gauss linear newSkewCorrected 1;
<    laplacian(DDD,DD)  Gauss linear newSkewCorrected 1;
---
>    laplacian(DD,D)    Gauss cubic newSkewCorrected 1;
>    laplacian(DDD,DD)  Gauss cubic newSkewCorrected 1;

But there is only a slight improvement with refinement and none with order.

Am I missing something?

Attachment 75121

bigphil February 26, 2020 10:01

This damping comes from the time discretisation (d2dt2 and ddt).

Euler is only 1st order accurate. You should perform a time-step size sensitivity analysis, and may also try "backward" which is 2nd order accurate (but introduces a lot of dispersion errors).

Either way, Euler with a very small time-step will show minimal time discretisation errors.

Philip

EDIT: FE methods often use trapezoidal or Newmark methods or some combination: these could be implemented

tschenkel February 26, 2020 10:37

1 Attachment(s)
Quote:

Originally Posted by bigphil (Post 759652)
This damping comes from the time discretisation (d2dt2 and ddt).

Euler is only 1st order accurate. You should perform a time-step size sensitivity analysis, and may also try "backward" which is 2nd order accurate (but introduces a lot of dispersion errors).

Either way, Euler with a very small time-step will show minimal time discretisation errors.

Philip

EDIT: FE methods often use trapezoidal or Newmark methods or some combination: these could be implemented



Thanks a lot, I am on backward already, so had thought d2t2 would be alright. Time step analysis was next on the list.

As a fluid dynamicist, I have to ask a possibly stupid question: What is the solids equivalent to the Courant number?

EDIT:

It does require quite small time steps, but does work (reduced timestep from 1e-3 to 1e-4s). There is still a little bit of damoing, but it's a lot better:

Attachment 75131

bigphil February 26, 2020 11:18

Quote:

Originally Posted by tschenkel (Post 759656)
As a fluid dynamicist, I have to ask a possibly stupid question: What is the solids equivalent to the Courant number?

Courant number refers to the speed at which information passes through the domain i.e. Courant of 1 means one cell per time step. The Courant number in a solid is based on the speed of sound in the solid (diffusion waves rather than convection waves). For an elastic solid, the speed of sound is approximately sqrt(E/rho) where E is the Young's modulus and rho is the density: actually this is the lower "unconstrained" speed of sound; replace E with (2*mu + lambda) for plane-strain and 3-D, where mu and lambda are Lame parameters.

The speed of sound in solids is typically higher than fluids so the wave speed is high; this means to stick to a Courant number of less than 1 requires very small time steps (especially as you refine the mesh).

However, the stability of implicit solution methodologies (like in unsNonLinGeomTotalLag) does not depend on the Courant number. In contrast, explicit solution methodologies (like in explicitLinGeomSolid) do require the Courant to be less than 1 for stability.

For your time sensitivity analysis, there is probably no need to approach the Courant number, although if you do use such a small time-step then the diffusion error due to the time-step size should be very small.

Philip

tschenkel February 26, 2020 11:34

Quote:

Originally Posted by bigphil (Post 759665)
Courant number refers to the speed at which information passes through the domain i.e. Courant of 1 means one cell per time step. The Courant number in a solid is based on the speed of sound in the solid (diffusion waves rather than convection waves). For an elastic solid, the speed of sound is approximately sqrt(E/rho) where E is the Young's modulus and rho is the density: actually this is the lower "unconstrained" speed of sound; replace E with (2*mu + lambda) for plane-strain and 3-D, where mu and lambda are Lame parameters.

The speed of sound in solids is typically higher than fluids so the wave speed is high; this means to stick to a Courant number of less than 1 requires very small time steps (especially as you refine the mesh).

However, the stability of implicit solution methodologies (like in unsNonLinGeomTotalLag) does not depend on the Courant number. In contrast, explicit solution methodologies (like in explicitLinGeomSolid) do require the Courant to be less than 1 for stability.

For your time sensitivity analysis, there is probably no need to approach the Courant number, although if you do use such a small time-step then the diffusion error due to the time-step size should be very small.

Philip

Thanks for confirmation of the wave propagation speed as the characteristic speed for this case. I'm using implicit methods, so no need for Co=1, but I usually use it as an asymptote for errors.

EDIT:

Quick time step estimate:

SOS = sqrt(E/rho) = sqrt(5.6e-6 Pa / 1000 kg/m^3) = 75 m/s

for Co = 1:

deltat = deltax/V = 0.0033m/75m/s = 4.4e-5s

so we are close with the 1e-4s. Will try 2e-5 and see if that gives close to zero damping.

tschenkel February 27, 2020 05:41

1 Attachment(s)
Quote:

Originally Posted by tschenkel (Post 759667)

Quick time step estimate:

SOS = sqrt(E/rho) = sqrt(5.6e-6 Pa / 1000 kg/m^3) = 75 m/s

for Co = 1:

deltat = deltax/V = 0.0033m/75m/s = 4.4e-5s

so we are close with the 1e-4s. Will try 2e-5 and see if that gives close to zero damping.

Update:

There is still a fair amount of damping for a time step of 2e-5 s.

Attachment 75145

A lot less than for 1e-3 or 1e-4, but still there.

bigphil February 27, 2020 05:47

1 Attachment(s)
Hi Torsten,

The damping error should reduce based on the order of accuracy of the time discretisation: for 1st order Euler, halving the time step will half the error; for 2nd order schemes, halving the time step will reduce the error by a factor of 4.

See the attached image comparing different time schemes for an oscillating beam using a cell-centre finite volume approach (from this thesis).

Philip

sita March 2, 2020 02:48

Material linearity enforced for stability
 
5 Attachment(s)
Hi everyone,

Good, it looks like I'm slowly getting there with my Hron-Turek FSI 1 case with gravity. Delaying the onset of coupling to 0.01 s seemed to help (can't delay it too much though, as around t = 0.24 s the flexible plate would fall out of my domain).

Still, the simulation crashes after just over 0.7 s, and the results start looking funny after some 0.3 s. The tip displacement starts oscillating, as can be seen in the attached plot. Also, at t = 0.4 s waves appear in the plate shape, and the fluid mesh deformation doesn't seem to keep up with the solid mesh deformation (see attached screenshots, one is coloured by p (fluid) and sigma_eq (solid)). With increasing time, the plate shape returns to something looking more physically realistic, and the fluid and solid mesh deformations seem to catch up. But just when I thought things might be getting back to normal and stable, both the interface displacement and the velocity magnitude blow up and the simulation crashes.

This looks like I should be paying more attention to my simulation settings. Is there anything in particular that I should be changing to get stable, physically realistic results?

Many thanks,
Sita


P.S. Adding relaxation only seems to make things worse (both FSI relaxation and D/DD relaxation)

sita March 3, 2020 10:01

Material linearity enforced for stability
 
1 Attachment(s)
Brief update: with RBFMeshMotionSolver, the simulation crashes even more spectacularly, at t = 0.402 s this time (see attached screenshot).

I'm getting a bit desperate, why is this case so much harder in solids4Foam than in fsiFoam (foam-extend-3.1)? Any tips anyone?

Thanks!
Sita

bigphil March 3, 2020 10:53

Hi Sita,

Can you attach a simple example case to reproduce the problem?

Philip

sita March 4, 2020 04:31

Material linearity enforced for stability
 
1 Attachment(s)
Hi Philip,

Sure, here you go. I haven't changed an awful lot since last time I uploaded it (post #496), but clearly the changes that I did make worked out rather disastrously.

Some additional notes:
- With a lower gravity value the case runs just fine
- With a linear elastic material model the case is stable as well, but as then I had to use linear deformation too, the tip displacement in x-direction was negligible, which clearly is not physically correct here.

Thanks in advance for having a look,
Sita

Daniel_Khazaei March 4, 2020 10:44

Quote:

Originally Posted by sita (Post 760394)
Hi Philip,

Sure, here you go. I haven't changed an awful lot since last time I uploaded it (post #496), but clearly the changes that I did make worked out rather disastrously.

Thanks in advance for having a look,
Sita

Hi Sita,

I have looked through the attached case and made three minor changes:

1- file: fsiProperties:
  • disabled couplingStartTime and set coupled to yes.
2- file: 0/U
  • inlet: change the transition period of transitionalParabolicVelocity to a non-zero value, e.g. 0.2
The case is currently running but it's too soon to judge the outcome.

Regards,
D. Khazaei

sita March 4, 2020 13:34

Material linearity enforced for stability
 
Hi Daniel,

Thanks a lot for your suggestions! I initially set coupled to yes, and disabled couplingStartTime, just like you did now, but I didn't yet try playing with this transition period of the inlet velocity. With the transition period kept at 0, even the case without gravity (i.e. the original Hron-Turek FSI 1 benchmark) wouldn't run, so I'm definitely going to try playing with this transition period.

Cheers,
Sita


All times are GMT -4. The time now is 20:22.