
[Sponsors] 
October 18, 2017, 03:31 
interFoam  sudden simulation crash

#1 
New Member
Join Date: Apr 2017
Posts: 6
Rep Power: 9 
Hello foamers,
I am working on a channel flow simulation using interFoam version Openfoam 1606+. I use the pimple algorithm, RAS with komega sst and an adjustable time step with a Co number <0.75. My mesh is okay, i.e. checkMesh allTopology allGeometry is only concerned about a number of undertermined cells at the bottom. I compute on parallel with 4 cores. The velocity is neither known up nor downstream, yet the water levels (h_in=2.15m, h_out=1.85m) are. Thus, I run the simulation with a totalPressure BC for the inlet and outlet patch. Both patches are spatially divided in a inletWater and outletWater, where I set the BC for alpha=fixedValue=1. In order to smooth the numerical simulation, I tried to implement kind of a pressure ramp by applying the BC uniformTotalPressure for inlet and outlet patch. However, I haven't been able to succeed a single time so far. I attached a test case. The inlet ramp pressure definition for the totalpressure rises from p0 (t=0)=p_hyd+P_dyn(u_init=0.5) to p0(t=150)=p_hyd+P_dyn(u_init=2.5). For improvement of the numerical stabilisation, I also implemented a ramp for the outlet pressure. It decreases from p0 (t=0)=p_hyd+P_dyn(u_init=0.5) to p0(t=150)=p_hyd. Two things are significant: an air velocity of magnitude ~10 and a sudden change in time step and courant with a subsequent decrease of the timestep and an eventually simulation crash. The .log file shows: Courant Number mean: 0.00919418 max: 0.123878 Interface Courant Number mean: 0.000981603 max: 0.100002 deltaT = 0.00112173 Time = 125.100361974923104 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 5.98242e05, Final residual = 9.25524e09, No Iterations 1 Phase1 volume fraction = 0.698289 Min(alpha.water) = 0.0172475 Max(alpha.water) = 1.01759 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.698289 Min(alpha.water) = 0.0171559 Max(alpha.water) = 1.01759 DICPCG: Solving for p_rgh, Initial residual = 3.39988e05, Final residual = 6.75884e07, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 7.75034e07, Final residual = 7.86252e08, No Iterations 5 time step continuity errors : sum local = 8.55462e09, global = 1.63886e09, cumulative = 0.00040107 DICPCG: Solving for p_rgh, Initial residual = 6.88985e06, Final residual = 1.07104e07, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 1.21741e07, Final residual = 8.44158e08, No Iterations 1 time step continuity errors : sum local = 9.18471e09, global = 4.95856e09, cumulative = 0.000401075 DICPCG: Solving for p_rgh, Initial residual = 6.66188e06, Final residual = 8.15266e08, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 8.69901e08, Final residual = 8.69901e08, No Iterations 0 time step continuity errors : sum local = 9.46468e09, global = 2.98789e09, cumulative = 0.000401078 smoothSolver: Solving for omega, Initial residual = 7.71672e06, Final residual = 1.22808e09, No Iterations 1 smoothSolver: Solving for k, Initial residual = 0.000276498, Final residual = 6.7505e08, No Iterations 1 ExecutionTime = 47662.4 s ClockTime = 47979 s Courant Number mean: 0.00919479 max: 0.123869 Interface Courant Number mean: 0.000981905 max: 0.100002 deltaT = 0.0011217 Time = 125.101483678352707 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 6.16002e05, Final residual = 9.27208e09, No Iterations 1 Phase1 volume fraction = 0.698288 Min(alpha.water) = 0.0337563 Max(alpha.water) = 1.01759 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.698288 Min(alpha.water) = 0.0336423 Max(alpha.water) = 1.01759 DICPCG: Solving for p_rgh, Initial residual = 0.00247448, Final residual = 1.44139e05, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 1.44822e05, Final residual = 4.8083e07, No Iterations 6 time step continuity errors : sum local = 5.34279e08, global = 2.69449e08, cumulative = 0.000401105 DICPCG: Solving for p_rgh, Initial residual = 0.014491, Final residual = 0.000131111, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.000129723, Final residual = 5.01169e06, No Iterations 11 time step continuity errors : sum local = 5.70339e07, global = 9.30337e08, cumulative = 0.000401012 DICPCG: Solving for p_rgh, Initial residual = 0.99888, Final residual = 0.0415996, No Iterations 1 DICPCG: Solving for p_rgh, Initial residual = 0.0203395, Final residual = 7.34686e08, No Iterations 55 time step continuity errors : sum local = 1.50557e05, global = 4.20235e07, cumulative = 0.000400591 smoothSolver: Solving for omega, Initial residual = 0.0534182, Final residual = 3.25049e07, No Iterations 4 smoothSolver: Solving for k, Initial residual = 0.153943, Final residual = 1.74852e07, No Iterations 6 ExecutionTime = 47663.2 s ClockTime = 47979 s Courant Number mean: 2.45123 max: 31513.8 Interface Courant Number mean: 0.198036 max: 2721.96 deltaT = 2.66955e08 Time = 125.101483705048253 PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 6.87222e05, Final residual = 6.57853e10, No Iterations 1 Phase1 volume fraction = 0.698287 Min(alpha.water) = 0.480656 Max(alpha.water) = 1.01759 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.698287 Min(alpha.water) = 0.475874 Max(alpha.water) = 1.01759 DICPCG: Solving for p_rgh, Initial residual = 0.999871, Final residual = 0.0440932, No Iterations 7 DICPCG: Solving for p_rgh, Initial residual = 0.00142484, Final residual = 5.39219e05, No Iterations 24 time step continuity errors : sum local = 2.61972e08, global = 5.21343e09, cumulative = 0.000400586 DICPCG: Solving for p_rgh, Initial residual = 0.0233034, Final residual = 0.000751639, No Iterations 6 DICPCG: Solving for p_rgh, Initial residual = 0.00120166, Final residual = 5.78432e05, No Iterations 24 time step continuity errors : sum local = 2.81139e08, global = 9.87746e09, cumulative = 0.000400596 DICPCG: Solving for p_rgh, Initial residual = 0.0195959, Final residual = 0.000682388, No Iterations 6 DICPCG: Solving for p_rgh, Initial residual = 0.000989858, Final residual = 8.54182e08, No Iterations 79 time step continuity errors : sum local = 1.7333e11, global = 2.25158e12, cumulative = 0.000400596 smoothSolver: Solving for omega, Initial residual = 2.94409e06, Final residual = 3.18266e10, No Iterations 1 smoothSolver: Solving for k, Initial residual = 1.03411e07, Final residual = 5.38321e12, No Iterations 1 ExecutionTime = 47664.1 s ClockTime = 47980 s Courant Number mean: 8.66418e06 max: 0.0620378 Interface Courant Number mean: 3.62161e06 max: 0.0620378 deltaT = 3.09987e08 Time = 125.101483736046902 I changed the times of the ramps a little, yet without succes. I'm really stuck right here: it seems the error is within the BCs, yet i could imagine that improving my numerics in fvSchemes or the algorithms in fvSolution might help. However, my experience is rather shallow. I appreciate any feedback. Kind regards, fmerk 

October 20, 2017, 07:08 
solved

#2 
New Member
Join Date: Apr 2017
Posts: 6
Rep Power: 9 
I solved it by adapting the BC as follows:
 zeroGradient for U for inletAir, outletAir  fixedfluxpressure for p_rgh inletAir, outletAir However, this implies a second problem: My liquid phase, alpha.water, that should range from 01 now has values up to 200. More specifically, the respective cells are the ones at the bottom next to the the outlet, see the attached picture. Does anyone have an idea how to get rid of these high fractions numbers? Kind regards 

October 20, 2017, 13:04 

#3 
Senior Member
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 10 
i suggest you try modifying dam break tutorial
first understand BC's etc then proceed with your case 

October 25, 2017, 03:13 

#4 
New Member
Join Date: Apr 2017
Posts: 6
Rep Power: 9 
I solved my issue of the high alpha fraction by again adapting the boundary conditions.
It seems that, given one has an outlet and wants to prescribe the outlet flow height via 2 patches (outletWater and outletAir), a fixedValue for the fluid fraction alpha with 1 and 0, respectively, is not feasible. It appears that by applying 2 fixedValues for alpha at the outlet, the system is constraint. By using inletOutlet boundaries, the solver is more flexible, i.e. the alpha values are not restricted. Yet, this leads to a little lower true flow height since at the outlet interface alpha values of around 0.75 are monitored than prescribed in the first step of defining the spatial aspects of the outlet patches. Please note that these are points I found out with respect to my particular case. A general verification of the above results is not given. 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
twoPhaseEulerFoam: sudden crash  hcen  OpenFOAM Running, Solving & CFD  18  September 29, 2020 03:04 
InterFoam for continuous flow simulation  DancingButterfly  OpenFOAM Running, Solving & CFD  4  October 25, 2016 22:31 
Simulation of drop with interFoam  abdessamad  OpenFOAM Running, Solving & CFD  7  April 29, 2014 19:28 
Bigger wave height leads to crash (interFoam)  David*  OpenFOAM  6  November 14, 2011 02:53 
Interfoam... free surface simulation urgent  lostin4ever  Main CFD Forum  4  October 12, 2010 08:29 