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/)
-   -   interFoam wave propagation and explosion of Courant number and residuals (https://www.cfd-online.com/Forums/openfoam-solving/218445-interfoam-wave-propagation-explosion-courant-number-residuals.html)

ChiaraViola June 20, 2019 11:42

interFoam wave propagation and explosion of Courant number and residuals
 
2 Attachment(s)
Hello openFOAM users! I am new to openFOAM and also new in this forum.

I am trying to make a simulation of regular waves propagation against an impermeable dike using interFoam but it is more than one month that I am not able to finish my run. I'm using a laminar model. I really hope that someone can help me to understand what i'm doing wrong.

I want to modify the tutorial from waveExample using both StokesI and StokesV theories adding an obstacle in stl format that is my dike. I changed the dimensions of the tutorial since I want to simulate a model scale problem. I had several errors with snappyHexMesh but now I think it works well since I don't have any errors and the checkMesh says that everythink is OK. I'm interested in a 2D problem but due to snappyHexMesh errors I had to create a 3D case and I set my lateral faces (front and back) as patch instead of empty and I want to consider them as open sea and not as wall because I remember that with empty type I got several errors but I don't remember what kind of errors they were.

I tried to run in parallel on my laptop with 4 processors and also in serial but I my simulations never reach the end of 20 seconds.

Now, when I start the run, I don't have any error message but after 2 or 3 days of running I have an explosion of the Courant number and the residuals and I think I've tried everything I understood about OpenFOAM but I still have no results and no any idea about what is going wrong. In the past tests after several iteration I had the error related to floating point but now the solver is running for days but it's blocked on the same time step.

I thought it could be a problem related to the boundary conditions but i didn't change them from the tutorial except for the lateral sides and I set my obstacle as wall. :confused:

Any kind of help is highly appreciated! :)
PS: I'm working on ubuntu 18.04.2 LTS and openFOAM v1812 version.

Best regards,

Chiara


Here it is possible to see my last iterations:

Code:

PIMPLE: iteration 1
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144587  Min(alpha.water) = -4.83978e-06  Max(alpha.water) = 1.05476
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144587  Min(alpha.water) = -1.20682e-08  Max(alpha.water) = 1.05474
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144586  Min(alpha.water) = -1.17575e-08  Max(alpha.water) = 1.05472
Updating StokesV wave model for patch inlet
Updating shallowWaterAbsorption wave model for patch outlet
DICPCG:  Solving for p_rgh, Initial residual = 0.0110037, Final residual = 0.000119618, No Iterations 5
DICPCG:  Solving for p_rgh, Initial residual = 0.000119827, Final residual = 1.08106e-05, No Iterations 15
time step continuity errors : sum local = 2.71305e-06, global = 2.46732e-09, cumulative = 0.000126835
DICPCG:  Solving for p_rgh, Initial residual = 1.14898e-05, Final residual = 1.12811e-06, No Iterations 44
DICPCG:  Solving for p_rgh, Initial residual = 1.1281e-06, Final residual = 8.34745e-07, No Iterations 5
time step continuity errors : sum local = 2.09471e-07, global = 2.92403e-09, cumulative = 0.000126838
DICPCG:  Solving for p_rgh, Initial residual = 1.01653e-06, Final residual = 4.85196e-07, No Iterations 5
GAMG:  Solving for p_rgh, Initial residual = 4.85196e-07, Final residual = 5.68095e-09, No Iterations 5
time step continuity errors : sum local = 1.42558e-09, global = -2.21529e-10, cumulative = 0.000126838
PIMPLE: iteration 2
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144587  Min(alpha.water) = -0.00106242  Max(alpha.water) = 1.05476
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144587  Min(alpha.water) = -0.0010097  Max(alpha.water) = 1.05473
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144586  Min(alpha.water) = -0.000959591  Max(alpha.water) = 1.05471
Updating StokesV wave model for patch inlet
DICPCG:  Solving for p_rgh, Initial residual = 0.000276663, Final residual = 2.8651e-06, No Iterations 5
DICPCG:  Solving for p_rgh, Initial residual = 2.86468e-06, Final residual = 7.33919e-07, No Iterations 5
time step continuity errors : sum local = 1.83962e-07, global = -3.28297e-10, cumulative = 0.000126838
DICPCG:  Solving for p_rgh, Initial residual = 8.84302e-07, Final residual = 4.67304e-07, No Iterations 5
DICPCG:  Solving for p_rgh, Initial residual = 4.67304e-07, Final residual = 3.07381e-07, No Iterations 5
time step continuity errors : sum local = 7.70472e-08, global = -5.25822e-10, cumulative = 0.000126837
DICPCG:  Solving for p_rgh, Initial residual = 3.08887e-07, Final residual = 1.91071e-07, No Iterations 5
GAMG:  Solving for p_rgh, Initial residual = 1.91071e-07, Final residual = 1.11243e-09, No Iterations 5
time step continuity errors : sum local = 2.7884e-10, global = -1.00294e-10, cumulative = 0.000126837
PIMPLE: converged in 2 iterations
ExecutionTime = 92059.4 s  ClockTime = 92106 s

Courant Number mean: 0.00624004 max: 0.509682
Interface Courant Number mean: 0.000303199 max: 0.404414
deltaT = 0.000915501
Time = 12.129

PIMPLE: iteration 1
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144586  Min(alpha.water) = -5.35741e-06  Max(alpha.water) = 1.05469
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144586  Min(alpha.water) = -1.40226e-08  Max(alpha.water) = 1.05467
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144585  Min(alpha.water) = -1.27883e-08  Max(alpha.water) = 1.05464
Updating StokesV wave model for patch inlet
Updating shallowWaterAbsorption wave model for patch outlet
DICPCG:  Solving for p_rgh, Initial residual = 0.0110179, Final residual = 0.000120469, No Iterations 5
DICPCG:  Solving for p_rgh, Initial residual = 0.000120677, Final residual = 1.15472e-05, No Iterations 15
time step continuity errors : sum local = 2.8992e-06, global = 2.1739e-09, cumulative = 0.000126839
DICPCG:  Solving for p_rgh, Initial residual = 1.22061e-05, Final residual = 1.16741e-06, No Iterations 43
DICPCG:  Solving for p_rgh, Initial residual = 1.1674e-06, Final residual = 8.35719e-07, No Iterations 5
time step continuity errors : sum local = 2.0981e-07, global = 2.58869e-09, cumulative = 0.000126842
DICPCG:  Solving for p_rgh, Initial residual = 1.02409e-06, Final residual = 4.87693e-07, No Iterations 5
GAMG:  Solving for p_rgh, Initial residual = 4.87693e-07, Final residual = 5.78942e-09, No Iterations 5
time step continuity errors : sum local = 1.45345e-09, global = -2.36671e-10, cumulative = 0.000126841
PIMPLE: iteration 2
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144586  Min(alpha.water) = -0.00138511  Max(alpha.water) = 1.05469
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144586  Min(alpha.water) = -0.00131392  Max(alpha.water) = 1.05466
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144585  Min(alpha.water) = -0.00124639  Max(alpha.water) = 1.05463
Updating StokesV wave model for patch inlet
DICPCG:  Solving for p_rgh, Initial residual = 0.000291126, Final residual = 2.79373e-06, No Iterations 5
DICPCG:  Solving for p_rgh, Initial residual = 2.79331e-06, Final residual = 7.36053e-07, No Iterations 5
time step continuity errors : sum local = 1.84598e-07, global = -3.46771e-10, cumulative = 0.000126841
DICPCG:  Solving for p_rgh, Initial residual = 9.25743e-07, Final residual = 4.5891e-07, No Iterations 5
DICPCG:  Solving for p_rgh, Initial residual = 4.5891e-07, Final residual = 3.24245e-07, No Iterations 5
time step continuity errors : sum local = 8.13187e-08, global = -5.43872e-10, cumulative = 0.000126841
DICPCG:  Solving for p_rgh, Initial residual = 3.32579e-07, Final residual = 1.97878e-07, No Iterations 5
GAMG:  Solving for p_rgh, Initial residual = 1.97878e-07, Final residual = 1.17233e-09, No Iterations 5
time step continuity errors : sum local = 2.94013e-10, global = -1.04298e-10, cumulative = 0.00012684
PIMPLE: converged in 2 iterations
ExecutionTime = 92080.4 s  ClockTime = 92127 s

Courant Number mean: 0.0062403 max: 0.504923
Interface Courant Number mean: 0.000302312 max: 0.403648
deltaT = 0.000915501
Time = 12.13

PIMPLE: iteration 1
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144585  Min(alpha.water) = -6.22537e-06  Max(alpha.water) = 1.0546
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144585  Min(alpha.water) = -4.22846e-08  Max(alpha.water) = 1.05458
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144584  Min(alpha.water) = -3.80532e-08  Max(alpha.water) = 1.05455
Updating StokesV wave model for patch inlet
Updating shallowWaterAbsorption wave model for patch outlet
DICPCG:  Solving for p_rgh, Initial residual = 0.0109772, Final residual = 0.000120993, No Iterations 5
DICPCG:  Solving for p_rgh, Initial residual = 0.000121207, Final residual = 1.09356e-05, No Iterations 15
time step continuity errors : sum local = 2.74231e-06, global = 2.31784e-09, cumulative = 0.000126843
DICPCG:  Solving for p_rgh, Initial residual = 1.16013e-05, Final residual = 1.15908e-06, No Iterations 43
DICPCG:  Solving for p_rgh, Initial residual = 1.15907e-06, Final residual = 8.5041e-07, No Iterations 5
time step continuity errors : sum local = 2.13239e-07, global = 2.77346e-09, cumulative = 0.000126846
DICPCG:  Solving for p_rgh, Initial residual = 1.02343e-06, Final residual = 4.93126e-07, No Iterations 5
GAMG:  Solving for p_rgh, Initial residual = 4.93126e-07, Final residual = 5.70577e-09, No Iterations 5
time step continuity errors : sum local = 1.43071e-09, global = -2.31627e-10, cumulative = 0.000126845
PIMPLE: iteration 2
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144585  Min(alpha.water) = -0.0017968  Max(alpha.water) = 1.0546
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144585  Min(alpha.water) = -0.00170086  Max(alpha.water) = 1.05457
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144584  Min(alpha.water) = -0.00161004  Max(alpha.water) = 1.05453
Updating StokesV wave model for patch inlet
DICPCG:  Solving for p_rgh, Initial residual = 0.000323175, Final residual = 9.54125e-06, No Iterations 9
DICPCG:  Solving for p_rgh, Initial residual = 9.53947e-06, Final residual = 9.32001e-07, No Iterations 16
time step continuity errors : sum local = 2.33577e-07, global = -3.29532e-10, cumulative = 0.000126845
DICPCG:  Solving for p_rgh, Initial residual = 1.09139e-06, Final residual = 4.62161e-07, No Iterations 5
DICPCG:  Solving for p_rgh, Initial residual = 4.62161e-07, Final residual = 6.44307e-07, No Iterations 5
time step continuity errors : sum local = 1.61475e-07, global = -3.33242e-10, cumulative = 0.000126845
DICPCG:  Solving for p_rgh, Initial residual = 6.60649e-07, Final residual = 3.59502e-07, No Iterations 5
GAMG:  Solving for p_rgh, Initial residual = 3.59503e-07, Final residual = 1.07345e+136, No Iterations 50
time step continuity errors : sum local = 2.69028e+135, global = -6.34714e+124, cumulative = -6.34714e+124
PIMPLE: converged in 2 iterations
ExecutionTime = 92110.6 s  ClockTime = 92157 s

Courant Number mean: 4.56044e+135 max: 9.79846e+141
Interface Courant Number mean: 3.28203e+134 max: 1.47078e+141
deltaT = 4.67165e-146
Time = 12.13

PIMPLE: iteration 1
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144584  Min(alpha.water) = -0.000136131  Max(alpha.water) = 1.05453
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144584  Min(alpha.water) = -4.49755e-06  Max(alpha.water) = 1.05453
Updating StokesV wave model for patch inlet
MULES: Solving for alpha.water
Phase-1 volume fraction = 0.144584  Min(alpha.water) = -4.47453e-06  Max(alpha.water) = 1.05453
Updating StokesV wave model for patch inlet
Updating shallowWaterAbsorption wave model for patch outlet

I had also an error message on my log file but it wasn't shown on the terminal and I don't know if it's normal:

Code:

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in /lib/x86_64-linux-gnu/libc.so.6
#3  double Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4  Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#5  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:?
#6  Foam::fvMatrix<double>::solveSegregatedOrCoupled(Foam::dictionary const&) at ??:?
#7  Foam::fvMesh::solve(Foam::fvMatrix<double>&, Foam::dictionary const&) const at ??:?
#8  ? in ~/OpenFOAM/OpenFOAM-v1812/platforms/linux64GccDPInt32Opt/bin/interFoam
#9  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#10  ? in ~/OpenFOAM/OpenFOAM-v1812/platforms/linux64GccDPInt32Opt/bin/interFoam

I also attach files related to my geometry sketch, checkMesh, fvSolution, fvScheme, log file and the 0 folder.

https://www.dropbox.com/s/owd46aybld...kMesh.log?dl=0
https://www.dropbox.com/s/r9n21x4iaw...vSolution?dl=0
https://www.dropbox.com/s/ghs117a8p2...fvSchemes?dl=0
https://www.dropbox.com/s/9ukcjsejzrw51sv/log?dl=0
https://www.dropbox.com/s/9pu588n9qf4z8mb/U?dl=0
https://www.dropbox.com/s/uic2345rvqcb936/p_rgh?dl=0
https://www.dropbox.com/s/7w8qlajzup...ater.orig?dl=0


Many thanks in advance for any suggestion!! :)

sita June 26, 2019 05:36

Hi Chiara,

From your explanation I can't immediately see what exactly is wrong, except that your simulation diverges (as you said, the Courant number is blowing up, the time step is close to zero, and the error message you included is what you usually get after a simulation diverges).

Some things that you might try are:
- adapt the tutorial case you were using without scaling it yet; many of the settings (fvSolution, fvSchemes) depend on the dimensions and velocities of your case. Once you get it to work without scaling, you can take a look at the solver settings

- try to keep your mesh 2D (instructions for 2D meshing with SnappyHexMesh can be found here https://openfoamwiki.net/index.php/S...rate_2D_meshes). The empty BC only works for 2D geometries (one cell thickness). If you still end up with a 3D geometry, you may need to take a closer look at your boundary conditions, and the thickness of your domain.
- start with a smaller time step. Even if you set adjustTimeStep to true, starting with a smaller time step may help

Hope this helps,
Sita


All times are GMT -4. The time now is 21:07.