CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Mesh motion with Boundary Layer (https://www.cfd-online.com/Forums/openfoam-solving/187478-mesh-motion-boundary-layer.html)

ashkan May 8, 2017 00:50

Mesh motion with Boundary Layer
 
1 Attachment(s)
Hi All,
I am trying to run a case of forced oscillating body (interDyMFoam) with boundary layer attached to body.

for the mesh motion I use:

Quote:

dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libfvMotionSolvers.so");
solver displacementLaplacian;

displacementLaplacianCoeffs
{
diffusivity quadratic inverseDistance 1(BA);
}
and in my 0/pointDisplacement dictionary I have

Quote:

BA
{
type oscillatingDisplacement;
amplitude (0 0 0.5);
omega 0.5;
value uniform (0 0 0);
}
However, if I remove the boundary layer, everything run without any problem. I believe this is due to mesh motion of the boundary layer. Is there any way to make that layers fixed to the body?

I would highly appreciate any comments.

Attached please find the image of the mesh section around the body.

Many thanks in advance
Ashkan

ginop May 8, 2017 21:29

Hi Ashkan,

I am only new to OpenFoam, and I am trying to learn about forced/free-floating simulations.

In your case, have you tried to set the dynamic solver as sixDoFRigidBodyMotion, instead of laplacian, and relative innerDistance (larger than your BL thickness) and outerDistance (whatever suits your case).

This way the moving mesh will happen between inner and outer distances only.

Then adding the library "libfvMotionSolvers.so" you should be able to see the oscillatingDisplacement type in your pointDisplacement file.

Hope this helps.

Regards,
Gino

ashkan May 9, 2017 03:24

Hi Gino,
Many thanks for your comment. I absolutely agree that mesh motion in the sixDoF solver should resolve the issue but I don't see how you can use sixDoF solver with forced motion as the motion if the body will be calculated inside the sixDoF solver. Have you tried this in the past?

Cheers
Ashkan

ginop May 9, 2017 08:20

I didnt look at actual forces/velocity fields. I was more interested in making it run first.
I am running OF 2.4.0, and it runs for a while for the floatingObject tutorial, with small amplitude, though I am not sure about forces and how they would measure as the mesh looks skewed.
It does crash though.
Code:

Interface Courant Number mean: 0.00193187608548 max: 0.33400205988
Courant Number mean: 0.0241882945528 max: 0.87302755635
deltaT = 0.02
Time = 1.52

PIMPLE: iteration 1

6-DoF rigid body motion
    Centre of rotation: (0.5 0.433339134335 0.1)
    Centre of mass: (0.498129329402 0.433339134335 0.349993001085)
    Orientation: (0.99997200434 0 -0.00748268239022 0 1 0 0.00748268239022 0 0.99997200434)
    Linear velocity: (0 0.00935187880997 0)
    Angular velocity: (0 -0.0396785796592 0)
Execution time for mesh.update() = 0.1 s
GAMGPCG:  Solving for pcorr, Initial residual = 1, Final residual = 1.389704988e-06, No Iterations 5
time step continuity errors : sum local = 2.59690104295e-11, global = 1.88324474663e-12, cumulative = -0.0183276545906
smoothSolver:  Solving for alpha.water, Initial residual = 0.000143941274872, Final residual = 1.32850902324e-09, No Iterations 2
Phase-1 volume fraction = 0.523023904052  Min(alpha.water) = -4.10497573861e-13  Max(alpha.water) = 1.00062364866
Applying the previous iteration compression flux
MULES: Correcting alpha.water
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.523023904052  Min(alpha.water) = -2.11109283645e-08  Max(alpha.water) = 1.00062364866
GAMG:  Solving for p_rgh, Initial residual = 0.00119559543921, Final residual = 3.94799427934e-06, No Iterations 2
time step continuity errors : sum local = 0.000324404401661, global = -4.06882892205e-06, cumulative = -0.0183317234195
PIMPLE: iteration 2

6-DoF rigid body motion
    Centre of rotation: (0.5 0.433339135277 0.1)
    Centre of mass: (0.49812831753 0.433339135277 0.349992993511)
    Orientation: (0.999971974045 0 -0.00748672988139 0 1 0 0.00748672988139 0 0.999971974045)
    Linear velocity: (0 0.00931555882598 0)
    Angular velocity: (0 -0.0399709667979 0)
Execution time for mesh.update() = 0.04 s
GAMGPCG:  Solving for pcorr, Initial residual = 1, Final residual = 9.95040035168e-06, No Iterations 5
time step continuity errors : sum local = 3.22378888437e-09, global = -2.40214320604e-09, cumulative = -0.0183317258217
smoothSolver:  Solving for alpha.water, Initial residual = 5.40657066919e-05, Final residual = 2.06608306914e-09, No Iterations 2
Phase-1 volume fraction = 0.523023903521  Min(alpha.water) = -4.09621077597e-13  Max(alpha.water) = 1.00062363893
Applying the previous iteration compression flux
MULES: Correcting alpha.water
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.523023903521  Min(alpha.water) = -1.86378177341e-08  Max(alpha.water) = 1.00062363893
GAMG:  Solving for p_rgh, Initial residual = 2.90219701896e-05, Final residual = 1.00187595433e-07, No Iterations 3
time step continuity errors : sum local = 8.20783225905e-06, global = -1.86103202824e-06, cumulative = -0.0183335868537

.
.
.

Interface Courant Number mean: 0.00131924408403 max: 0.359035942603
Courant Number mean: 0.0441513271762 max: 1.83771406487
deltaT = 0.0015658437288
Time = 1.98591

PIMPLE: iteration 1

6-DoF rigid body motion
    Centre of rotation: (0.5 0.437450171205 0.1)
    Centre of mass: (0.47784902143 0.437450171205 0.349016734675)
    Orientation: (0.996066938701 0 -0.0886039142819 0 1 0 0.0886039142819 0 0.996066938701)
    Linear velocity: (0 0.0132859271476 0)
    Angular velocity: (0 -0.47120835512 0)
Execution time for mesh.update() = 0.04 s
GAMGPCG:  Solving for pcorr, Initial residual = 1, Final residual = 1.46825482106e-06, No Iterations 5
time step continuity errors : sum local = 1.76586374725e-11, global = 3.39082740141e-13, cumulative = -0.0182947108845
smoothSolver:  Solving for alpha.water, Initial residual = 0.000130572316876, Final residual = 2.28799913873e-10, No Iterations 2
Phase-1 volume fraction = 0.523023707456  Min(alpha.water) = -3.28211245187e-11  Max(alpha.water) = 1.0005675044
Applying the previous iteration compression flux
MULES: Correcting alpha.water
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.523023707456  Min(alpha.water) = -4.62846678913e-06  Max(alpha.water) = 1.00469712448
GAMG:  Solving for p_rgh, Initial residual = 0.00114092511741, Final residual = 8.38099802926e-06, No Iterations 3
time step continuity errors : sum local = 3.59830010801e-06, global = 1.12690500482e-08, cumulative = -0.0182946996155
PIMPLE: iteration 2

6-DoF rigid body motion
    Centre of rotation: (0.5 0.437450165082 0.1)
    Centre of mass: (0.477849008882 0.437450165082 0.349016733559)
    Orientation: (0.996066934237 0 -0.0886039644726 0 1 0 0.0886039644726 0 0.996066934237)
    Linear velocity: (0 0.0133032800922 0)
    Angular velocity: (0 -0.470907088203 0)
Execution time for mesh.update() = 0.09 s
GAMGPCG:  Solving for pcorr, Initial residual = 1, Final residual = 9.56592078976e-06, No Iterations 29
time step continuity errors : sum local = 5.41026040738e-11, global = -2.42384056719e-11, cumulative = -0.0182946996397
smoothSolver:  Solving for alpha.water, Initial residual = 9.53905777487e-05, Final residual = 2.31325942545e-10, No Iterations 2
Phase-1 volume fraction = 0.523023707462  Min(alpha.water) = -3.75618563171e-11  Max(alpha.water) = 1.00056750667
Applying the previous iteration compression flux
MULES: Correcting alpha.water
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.523023707462  Min(alpha.water) = -5.0129040791e-06  Max(alpha.water) = 1.0044447332
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const at ??:?
#4  Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ??:?
#5  Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#6  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:?
#7  Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
#8  ? at ??:?
#9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10  ? at ??:?
Floating point exception (core dumped)

Perhaps it needs a tweak, or my solution is not actually the best. Another approach can be the dynamicTopoFvMesh apparently, but I am still finding my way around it.

Regards,
Gino

ashkan May 10, 2017 04:18

Hi Gino,
Thanks for your comments. I actually managed to make sixDoF solver working with forced motion (prescribed motion). To do so, I created a new solver within sixDoFSolver schemes (such as Newmark, simplectic, ...). In the new solver I then moved the body based on the prescribed motions rather than calculated accelerations.

The solver is running fine so should be a simple and working solution.

Cheers
Ashkan

ginop May 10, 2017 20:54

Good to hear that Ashkan!
And thank you very much for sharing your experience and solution to this type of problem.

I will try to follow your strategy then, and implement the solver as you suggested.

Cheers,
Gino

Maoyanjun June 22, 2017 22:22

Quote:

Originally Posted by ashkan (Post 648288)
Hi Gino,
Thanks for your comments. I actually managed to make sixDoF solver working with forced motion (prescribed motion). To do so, I created a new solver within sixDoFSolver schemes (such as Newmark, simplectic, ...). In the new solver I then moved the body based on the prescribed motions rather than calculated accelerations.

The solver is running fine so should be a simple and working solution.

Cheers
Ashkan

as I know if you are trying to simulate the prescribed motion. I think you may try the solidBodyMotionFvMesh. it has many types of prescribed motion. you can see here. http://openfoamwiki.net/index.php/Pa...mple_Interface.
and I am trying to understand how the sixdofMotion works. from your post. I know you must have understood the process of the **DyMFoam program with sixDofRigidBodymotionsolver. wish you could give a discussion about it.

ronak July 8, 2017 08:09

Mesh
 
Quote:

Originally Posted by ashkan (Post 648012)
Hi All,
I am trying to run a case of forced oscillating body (interDyMFoam) with boundary layer attached to body.

for the mesh motion I use:

and in my 0/pointDisplacement dictionary I have

However, if I remove the boundary layer, everything run without any problem. I believe this is due to mesh motion of the boundary layer. Is there any way to make that layers fixed to the body?

I would highly appreciate any comments.

Attached please find the image of the mesh section around the body.

Many thanks in advance
Ashkan

Hi there Are you going to use dynamic mesh? Is it possible to move whole domain without using dynamic mesh?

ashkan July 8, 2017 08:45

Quote:

Originally Posted by ronak (Post 656290)
Hi there Are you going to use dynamic mesh? Is it possible to move whole domain without using dynamic mesh?

Hi Ronak,
I was not trying to move my domain. I had a body moving inside a fixed domain subjected to prescribed motion with a boundary layer.

If in your case the whole domain is moving, then it is much simpler. I suggest look into sloshing tutorials in OpenFoam.

cheers
Ashkan

Emanueledes November 20, 2017 12:44

2 Attachment(s)
Hi guys,

I'm a beginner in the use of openFoam so I'm having some problems. I see that the problem here is pretty similar to mine, so I hope you can help me to fix it. I'm trying to simulate the slamming of an hull on the water by using interDyMFoam for my graduation project. I have placed the hull at a certain height from the water and let it move at the velocity of 1 m/s in the negative z direction to evaluate pressure on the hull due to the impact on the water. Now, when I run interDyMFoam, i got this error after some timesteps:

Courant Number mean: 0.00212778 max: 6.57496
Interface Courant Number mean: 1.95423e-05 max: 0.0120632
deltaT = 0.000951527
Time = 0.00565446

PIMPLE: iteration 1
DICPCG: Solving for cellMotionUz, Initial residual = 0.00875879, Final residual = 9.55665e-09, No Iterations 44
Execution time for mesh.update() = 9.36 s
GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.0598646, No Iterations 4
time step continuity errors : sum local = 8.80194e-07, global = 3.47383e-08, cumulative = -2.26463e-08
smoothSolver: Solving for alpha.water, Initial residual = 1.0246e-05, Final residual = 4.76097e-11, No Iterations 1
Phase-1 volume fraction = 0.412872 Min(alpha.water) = -1.62871e-88 Max(alpha.water) = 1
Applying the previous iteration compression flux
MULES: Correcting alpha.water
MULES: Correcting alpha.water
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.412872 Min(alpha.water) = -3.47749e-16 Max(alpha.water) = 1
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::GAMGSolver::scale(Foam::Field&, Foam::Field&, Foam::lduMatrix const&, Foam::FieldField const&, Foam::UPtrList const&, Foam::Field const&, unsigned char) const at ??:?
#4 Foam::GAMGSolver::Vcycle(Foam::PtrList const&, Foam::Field&, Foam::Field const&, Foam::Field&, Foam::Field&, Foam::Field&, Foam::Field&, Foam::Field&, Foam::PtrList&, Foam::PtrList&, unsigned char) const at ??:?
#5 Foam::GAMGSolver::solve(Foam::Field&, Foam::Field const&, unsigned char) const at ??:?
#6 Foam::fvMatrix::solveSegregated(Foam::dict ionary const&) at ??:?
#7 Foam::fvMatrix::solve(Foam::dictionary const&) in "/opt/openfoam4/platforms/linux64GccDPInt32Opt/bin/interDyMFoam"
#8 ? in "/opt/openfoam4/platforms/linux64GccDPInt32Opt/bin/interDyMFoam"
#9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10 ? in "/opt/openfoam4/platforms/linux64GccDPInt32Opt/bin/interDyMFoam"

I tried to run moveDynamicMesh and I noticed that some bad cells appeared (non-orthogonalities, negative volumes ecc..) after some timesteps, but the initial mesh is perfect. Maybe it can be a problem of the solver but I've read that velocityLaplacian is the best for these cases. Can someone help me to solve this problem? I would be really grateful. I attach my controlDict and dynamicMeshDict files. Thank you all.


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