CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Problems with interDyMFoam (

myheroisalex September 19, 2009 09:51

Problems with interDyMFoam
Hello Open-Foam-Users around the world,

I'm a student from germany and I try to get familiar with the Open-Foam-Software.

What I need to simulate is a ship driving into a sluice chamber. So I set up a test-case with a simple Box (as a ship) in a simple 3D-Geometry with two phases for water and air.
I created the Mesh with Salome and placed boundary-conditions, mesh movement etc. (with much (!) help from the turorials).

But a problem occurs: When running the case the max. courant number gets bigger with every timestep, due to really high velocities 'induced' somehow. Example: 0.5 m/s mesh-movement and velocities of 56 m/s after 1 second. With 0 m/s movement, so nothing is moving, velocities about 0.44 m/s after 1s (That image is taken at 1s time:
I tried so much variations of boundaries and other setting, but nothing seem to help. Even the limitation of the courant number results in smaller and smaller timesteps.

My case in detail:


- internalField uniform (0 0 0)
- walls: fixed value at (0 0 0)
- The top of the channel, thought as an atmosphere with: pressureInletOutletVelocity at ( 0 0 0)
- moving walls (the ship): movingWallVelocity at (0 a 0) [a as the desired movement]

- internalField uniform 0
- walls: buoyantPressure at uniform 0
- The top as atmosphere:
type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
value uniform 0;
- moving walls: buoyantPressure at uniform 0

- internal nonuniform (done with setFields)
- all boundaries: zeroGradient

0/cellMotionUy and pointMotionUy:
- internalfield 0
- moving walls: fixed value a (desired velocity)
- all others fixed value 0


dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ( "" );
solver velocityComponentLaplacian y;
diffusivity directional ( 200 1 0 ); //uniform?


application interDyMFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 1;
deltaT 0.01;
writeControl adjustableRunTime;
writeInterval 0.1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.1;
maxDeltaT 0.01;


default Euler;
default Gauss linear;
grad(U) Gauss linear;
grad(alpha1) Gauss linear;

div(rho*phi,U) Gauss limitedLinearV 1;
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss vanLeer;
default Gauss linear corrected;
default linear;
default corrected;
default no;


solver PCG;
preconditioner DIC;
tolerance 1e-10;
relTol 0;
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0.05;
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0;
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;

solver PCG;
preconditioner DIC;
tolerance 1e-08;
relTol 0;
momentumPredictor no;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
nAlphaCorr 1;
nAlphaSubCycles 2;
cAlpha 1;
pRefCell (0.1 0.1 4.9);
pRefValue 0;

So, does anyone has a hint for me what to do?

Thank you for your attention and your answers ;)

jhoepken September 20, 2009 08:09

Hi Michael,

This is not a precise answer, I am totally aware of that ;). Have you tried to run the case in interFoam? Just leave the boundaries as they are and try to solve the case without moving the vessel. If it runs more or less fine, you can guess that the reason for the strange velocities might be related to the mesh motion. Doing this simulation in interFoam, you will have to adjust the BC for the ship accordingly.
Secondly, you have created an unstructured grid with Salome? Try to increase the nNonOrthogonalCorrectors in the PISO loop, because a value of 0 represents a pure orthogonal grid.
If you find out, that the case runs fine in interFoam, you should change the dynamicMesh solver and the respective settings.


myheroisalex September 20, 2009 18:32

Hi Jens,

thank you for your reply!

My Mesh is made in Salome with following algorithms:
3D: Hexahedron (i,j,k)
2D: Quadrangle (Mapping)
1D: Wire discretisation with 0.25 max. size Hypothesis

I computed every Block I needed and put them together with Salome's 'Build Compound' utility.

So there I dont expect quite good orthonality.

checkMesh says:

Checking geometry...
Overall domain bounding box (0 0 0) (20 145 5)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (0 0 0) OK.
Max cell openness = 0 OK.
Max aspect ratio = 1 OK.
Minumum face area = 0.0625. Maximum face area = 0.0625. Face area magnitudes OK.
Min volume = 0.015625. Max volume = 0.015625. Total volume = 9060. Cell volumes OK.
Mesh non-orthogonality Max: 0 average: 0
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 0 OK.

I tried, as you suggested, to run the case in interFoam, but the problem also occurs. But the velocities increase not that fast as if in interDyMFoam (about the half).

I also scaled the problem down to a 1:10 model an made a mesh with a wire discretisation of 0.025m. Problem remains the same.

Setting the nNonOrthogonalCorrectors number to 5 oder 10 does not influence the problem.

Mesh movement, like 0.5m/s, lead to strange velocities about 56 m/s after 1s simulation-time (and ~10 m/s after 0.5s).

It seems to me as if every step towards mesh movement boost the unwanted velocities from nowhere, but nothing semms to be total responsible. I think there is something with the mesh, but I can not see where the mistake may be and checkMesh gives its OK to me.

So far,


jhoepken September 22, 2009 04:22

Hi Michael,

I have absolutely no clue about Salome, since I've never ever worked with it. Is your grid complex? If not, I would suggest to build a similar one with an other grid generator? Maybe blockMesh is sufficient for your purpose?
I guessed, that the reason for this kind of behaviour would be related to the dynamic mesh, but this is apparently not the case.
My procedure would be to get interFoam running on the case and afterwards switch to interDyMFoam.


myheroisalex September 22, 2009 19:02

Hi Jens,

thank you for your attention ;)

I now made a simple cube with a certain water level in it (so just the free surface an no movement) and did some runs (1s):

1) Salome-Mesh: 'induced' max. velocity: 0.005 m/s
2) Block-Mesh: 0.015 m/s
3) Dam-Break tutorial with water all over the domain: 0.01 m/s

Its interesting to see that everywhere is velocity induced. I think thats due to the atmosphere-boundary (every example has the same atmo-bc from the dam-break tuto).

So its something with that Bc or with the Salome 'compound-mesh'-tool.

I will do further test-runs and keep you (all here) up to date!


All times are GMT -4. The time now is 16:19.