precice / tutorials

Various tutorial cases for the coupling library preCICE with real solvers. These files are meant to be rendered on precice.org, so don't look at the README files here.
https://www.precice.org/
GNU Lesser General Public License v3.0
103 stars 105 forks source link

peprpendicular-flap solid-openfoam case needs tuning #515

Open MakisH opened 6 months ago

MakisH commented 6 months ago

In #507, while comparing all the solver options we have, it became apparent that the solid-openfoam (solidDisplacementFoam) gives very different results than everything else. Still, it is a nice technical test that only requires OpenFOAM. The solid-solids4foam case is mostly fine already.

I have tried the following:

Some pictures that might help someone pick it up later on:

tutorials-perpendicular-flap-displacement-openfoam-watchpoints

tutorials-perpendicular-flap-displacement-openfoam-convergence-watchpoints

For now, I just give up, and document that this is an outlier at the moment.

One case use the plot-all-displacements.sh script to generate these pictures (see #507).

MakisH commented 6 months ago

Even with nCorr 10000 (mesh 6x15):

tutorials-perpendicular-flap-displacement-openfoam-watchpoints

MakisH commented 6 months ago

For solid-solids4foam, increating nCorr from 1000 to 10k given exactly the same results as before (no improvement):

tutorials-perpendicular-flap-displacement-openfoam-watchpoints

philipcardiff commented 6 months ago

I suspect another reason for the difference with openfoam-openfoam is that the 1st-order Euler ddt and d2dt schemes are used (solids4foam uses the 2nd-order backward scheme). You could try switching openfoam-openfoam to backward.

MakisH commented 6 months ago

The OpenFOAM documentation states that:

image

Maybe the d2dt2 backward is a nice solids4foam-only feature? :smile:

with:

d2dt2Schemes
{
    default         Euler;
}

ddtSchemes
{
    default         backward;
}

and with also varying the nCorr, I get the following:

openfoam-tuning

At least the ddtSchemes alone does not seem to help.

philipcardiff commented 6 months ago

Ah, OK, yes, we added a d2dt2 backward option in solids4foam.

In that case, using a smaller deltaT would improve the OpenFOAM predictions, if that is an option (probably also the solids4foam predictions).

MakisH commented 6 months ago

Decreasing the deltaT is indeed not really an option, as we wanted to have this consistent among the possible case combinations.

I compared the solid-openfoam and solid-solids4foam directories in a diff tool, and one other difference I found was the tolerances we use:

# solid-openfoam/system/fvSolution
solvers
{
    "(D|T)"
    {
        solver          GAMG;
        tolerance       1e-06;       # Made this 1e-09
        relTol          0.9;         # Made this 0.1
        smoother        GaussSeidel;
        nCellsInCoarsestLevel 20;
    }
}

# solid-solids4foam/system/fvSolution
solvers
{
    "D|DD"
    {
        solver          PCG;
        preconditioner  FDIC;
        tolerance       1e-09;
        relTol          0.1;
    }
}

I changed these tolerances, but it did not seem to improve the results.

Since we have the solid-solids4foam case, it is fine for me if this issue stays open for longer. Maybe someone else stumbles upon it and gets another idea, while it still helps as documentation.

precice-bot commented 4 months ago

This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/the-perpendicular-flap-model-using-openfoam/1695/25