
[Sponsors] 
PIMPLE at twoLiquidMixingFoam  p_rgh divergence  slow solving 

LinkBack  Thread Tools  Search this Thread  Display Modes 
July 26, 2019, 02:49 
PIMPLE at twoLiquidMixingFoam  p_rgh divergence  slow solving

#1 
Member

Greetings to all!
I am still new to OpenFOAM and actually work on my thesis. I am facing a problem with twoLiquidMixingFoam by using PIMPLE. Ich wanted to try out PIMPLE because I'd like to speed up my simulation an get a higher stability. But at the moment I can't generate a fast an stable PIMPLE solution. I think the problem is the p_rgh which does not converge. So the residualControll can't work an the advantage from the PIMPLE algorythm is not given anymore. So here my concret questions. 1) What can I do when my p_rgh is not sinking with PIMPLE? PISO is working fine, but also slow! 2) How can I speed up the PIMPLE in general? 3) Is there an easy Way to get a higher deltaT than 1E06? I would be very happy if there is someone who can help me with this. Here are my Options: fvSolution Code:
solvers { "alpha.*" { nAlphaCorr 1; nAlphaSubCycles 1; cAlpha 1; solver smoothSolver; smoother GaussSeidel; tolerance 1e4; relTol 0; nSweeps 1; } //If not using GAMG for pressure choose PCG Solver. For faster Solving tol:1e4 and relTol 0.05. p_rgh { solver PCG; preconditioner DIC; tolerance 1e3; //StartVals:1e5,StartVals:1e6 relTol 0.001; //StartVals:0.01,StartVals:0.001 minIter 3; maxIter 100; } p_rghFinal { solver PCG; preconditioner DIC; tolerance 1e4; //StartVals:1e5,StartVals:1e6 relTol 0.000; //StartVals:0.01,StartVals:0.001 minIter 5; //maxIter 100; } //For the Velocity  coupled (increasing stability). U { type coupled; solver PBiCCCG; preconditioner DILU; tolerance (1e3 1e3 1e3); relTol (0.1 0.1 0.1); minIter 3; maxIter 100; } UFinal { type coupled; solver PBiCCCG; preconditioner DILU; tolerance (1e4 1e4 1e4); relTol (0 0 0); minIter 3; maxIter 100; } "(komega)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e03; relTol 0.1; } "(komega)Final" { $U; tolerance 1e04; relTol 0.1; } } PIMPLE { nNonOrthogonalCorrectors 3; nCorrectors 3; nOuterCorrectors 50; turbOnFinalIterOnly false; residualControl { U 5e03; p_rgh 5e03; k 5e03; omega 5e03; alpha.adblue 5e03; ".*" 5e03; } } relaxationFactors { fields { p 0; pFinal 1; } equations { "(Ukepsilon)" 0.7; "(Ukepsilon)Final" 1; } } Code:
ddtSchemes { default Euler; } gradSchemes { default cellLimited Gauss linear 0.5; grad(U) cellLimited Gauss linear 0.5; } divSchemes { default none; div(rhoPhi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phi,k) Gauss upwind; div(phi,omega) Gauss upwind; div(phi,e) Gauss upwind; div((nuEff*dev2(T(grad(U))))) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } /* divSchemes { default none; div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; div(rhoPhi,U) Gauss upwind; //linear; div(phi,alpha) Gauss vanLeer; div(phi,k) Gauss upwind; //limitedLinear 1; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; }*/ laplacianSchemes { default Gauss linear limited 0; //Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default limited 0; } wallDist { method meshWave; } Code:
application twoLiquidMixingFoam; startFrom latestTime; startTime 0; stopAt endTime; //endTime; writeNow; endTime 20; deltaT 0.0000000005; writeControl adjustableRunTime; writeInterval 0.00005; purgeWrite 0; writeFormat binary; writePrecision 7; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep on; maxCo 0.5; maxAlphaCo 0.5; maxDeltaT 1; functions { #includeFunc residuals #includeFunc pressureDifferencePatch } If you need more information to help me let me know it.
__________________
Greetings Philipp Conen 

August 1, 2019, 20:20 

#2 
New Member
Gavin Ridley
Join Date: Jan 2019
Location: Tennessee, USA
Posts: 25
Rep Power: 4 
Hi,
Your relaxation factor for p appears to be zero. Do you know why underrelaxation is desired? You should set that factor to be around 0.20.5 or 0.51 depending on whether you use vanilla PIMPLE or consistent PIMPLE respectively. Could you try changing that relaxation factor to say, 0.2? By the way, a rule of thumb to get decent convergence is relax_U+relax_p=1. I'm not sure why mathematically this works well, but it seems to. 

August 5, 2019, 09:10 

#3 
Member

Dear Gavin,
thank you for reply to my question. I understood underrelaxtion as a function of stability and calculation speed. So I used 0 for a highly stable calculation. I also used 0.1/0.3 and 1 as underrelaxtionfactor. With 1 the speed was high an p decreased. But p decreased very very slow an only up to 0.98. So this lead to no win in this case. But I try again and save your thumb rule in my head. Thank you really much. I subscribe back in some days.
__________________
Greetings Philipp Conen 

August 6, 2019, 01:26 

#4 
Member

Dear Gavin,
I let the calculation run over night. A URF = 0.2 doesnt change my Problem of slow and unstable calculation. Code:
PIMPLE: Iteration 50 DILUPBiCG: Solving for Ux, Initial residual = 0.001560208, Final residual = 1.034981e13, No Iterations 2 DILUPBiCG: Solving for Uy, Initial residual = 0.001074642, Final residual = 9.620375e14, No Iterations 2 DILUPBiCG: Solving for Uz, Initial residual = 0.001472009, Final residual = 4.359329e14, No Iterations 2 DICPCG: Solving for p_rgh, Initial residual = 0.2390144, Final residual = 0.01121177, No Iterations 175 DICPCG: Solving for p_rgh, Initial residual = 0.01796031, Final residual = 0.0008353669, No Iterations 9 DICPCG: Solving for p_rgh, Initial residual = 0.003443909, Final residual = 0.0009118244, No Iterations 1 DICPCG: Solving for p_rgh, Initial residual = 0.001411461, Final residual = 0.0007466737, No Iterations 1 time step continuity errors : sum local = 2.034207e10, global = 8.159711e12, cumulative = 1.751579e06 DICPCG: Solving for p_rgh, Initial residual = 0.001202807, Final residual = 0.0006922544, No Iterations 1 DICPCG: Solving for p_rgh, Initial residual = 0.0008900349, Final residual = 0.0008900349, No Iterations 0 DICPCG: Solving for p_rgh, Initial residual = 0.0008900349, Final residual = 0.0008900349, No Iterations 0 DICPCG: Solving for p_rgh, Initial residual = 0.0008900349, Final residual = 0.0008900349, No Iterations 0 time step continuity errors : sum local = 2.425377e10, global = 1.069591e11, cumulative = 1.75159e06 DICPCG: Solving for p_rgh, Initial residual = 0.0008933383, Final residual = 0.0008933383, No Iterations 0 DICPCG: Solving for p_rgh, Initial residual = 0.0008933383, Final residual = 0.0008933383, No Iterations 0 DICPCG: Solving for p_rgh, Initial residual = 0.0008933383, Final residual = 0.0008933383, No Iterations 0 DICPCG: Solving for p_rgh, Initial residual = 0.0008933383, Final residual = 9.720371e05, No Iterations 70 time step continuity errors : sum local = 2.648834e11, global = 6.587787e12, cumulative = 1.751597e06 DILUPBiCG: Solving for omega, Initial residual = 2.603568e07, Final residual = 2.998042e10, No Iterations 1 DILUPBiCG: Solving for k, Initial residual = 2.077727e08, Final residual = 5.145305e12, No Iterations 1 ExecutionTime = 48113.92 s ClockTime = 50635 s fieldValueDelta pressureDifferencePatch write: subtract(p) = 9.150395e+33 Courant Number mean: 3.484067e07 max: 1.177855 Interface Courant Number mean: 0 max: 0 deltaT = 3.205731e22 Time = 7.30141e05 Code:
residualControl { U 5e06; p_rgh 5e03; k 5e06; omega 5e06; alpha.adblue 5e06; ".*" 5e06; }
__________________
Greetings Philipp Conen 

August 6, 2019, 12:14 

#5 
New Member
Gavin Ridley
Join Date: Jan 2019
Location: Tennessee, USA
Posts: 25
Rep Power: 4 
OK, I see your problem. It's OK to have nonlinear tolerances set around 1e3 (what's in the convergence control part of fvSolution), but your linear tolerances have to be way below that. Look at your p_rgh linear solve section (the part where you can select PCG or GAMG). Your tolerance is 1e3. This is way too high. This needs to be 1e8, or even 1e10 if you want to get linear nonlinear residual around 1e7. In my experience, depending on the mesh, the linear residuals should be about three orders of magnitude smaller than the nonlinear residuals.
By the way, you may want to post the results of checkMesh, since that can SERIOUSLY impact solution convergence. (Especially if dropping your linear convergence criterion still doesn't help) 

August 16, 2019, 08:18 

#6 
Member

Dear Gavin,
sorry for my late reply, but thanks for your answer! I tought I close calculations with PIMPLE, but I would like to try out your ideas. So here are my new fvSolutions: Code:
solvers { "alpha.*" { nAlphaCorr 1; nAlphaSubCycles 1; cAlpha 1; solver smoothSolver; smoother GaussSeidel; tolerance 1e8; relTol 0; nSweeps 1; } //If not using GAMG for pressure choose PCG Solver. For faster Solving tol:1e4 and relTol 0.05. p_rgh { solver PCG; preconditioner DIC; tolerance 1e8; //StartVals:1e5,StartVals:1e6 relTol 0.001; //StartVals:0.01,StartVals:0.001 } p_rghFinal { solver PCG; preconditioner DIC; tolerance 1e8; //StartVals:1e5,StartVals:1e6 relTol 0.000; //StartVals:0.01,StartVals:0.001 } //For the Velocity  coupled (increasing stability). U { type coupled; solver PBiCCCG; preconditioner DILU; tolerance (1e8 1e8 1e8); relTol (0.1 0.1 0.1); } UFinal { type coupled; solver PBiCCCG; preconditioner DILU; tolerance (1e8 1e8 1e8); relTol (0 0 0); } "(komega)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e08; relTol 0.1; } "(komega)Final" { $U; tolerance 1e08; relTol 0.1; } } PIMPLE { nNonOrthogonalCorrectors 1; nCorrectors 3; nOuterCorrectors 20; turbOnFinalIterOnly false; residualControl { U 5e03; p_rgh 5e03; k 5e03; omega 5e03; alpha.adblue 5e03; ".*" 5e03; } } relaxationFactors { fields { p 0.2; pFinal 1; } equations { "(Ukepsilon)" 0.2; "(Ukepsilon)Final" 1; } } Code:
Mesh stats points: 1720306 faces: 4913997 internal faces: 4744352 cells: 1604851 faces per cell: 6.018222 boundary patches: 6 point zones: 0 face zones: 0 cell zones: 0 Overall number of cells of each type: hexahedra: 1501520 prisms: 45802 wedges: 0 pyramids: 0 tet wedges: 216 tetrahedra: 0 polyhedra: 57313 Breakdown of polyhedra by number of faces: faces number of cells 4 13322 5 11049 6 11441 7 13 8 132 9 10444 10 3 11 101 12 6080 13 4 14 44 15 3991 17 3 18 686 Checking topology... Boundary definition OK. Cell to face addressing OK. Point usage OK. Upper triangular ordering OK. Face vertices OK. Number of regions: 1 (OK). Checking patch topology for multiply connected surfaces... Patch Faces Points Surface topology fans 71745 86100 ok (nonclosed singly connected) inlet_adblue 26 39 ok (nonclosed singly connected) inlet_exhgas 4116 4347 ok (nonclosed singly connected) outlet 4277 4573 ok (nonclosed singly connected) sheet 3315 4329 ok (nonclosed singly connected) wall 86166 90014 ok (nonclosed singly connected) Checking geometry... Overall domain bounding box (0.15985 0.15985 1.687) (0.15985 0.15985 0.5) Mesh has 3 geometric (nonempty/wedge) directions (1 1 1) Mesh has 3 solution (nonempty) directions (1 1 1) Boundary openness (2.59768e16 2.335864e16 1.8714e16) OK. Max cell openness = 3.274699e16 OK. Max aspect ratio = 9.2792 OK. Minimum face area = 9.54776e08. Maximum face area = 3.987172e05. Face area magnitudes OK. Min volume = 1.279944e09. Max volume = 1.729588e07. Total volume = 0.1752509. Cell volumes OK. Mesh nonorthogonality Max: 58.76045 average: 6.463263 Nonorthogonality check OK. Face pyramids OK. Max skewness = 3.728606 OK. Coupled point location match (average 0) OK. Mesh OK. Many thanks!
__________________
Greetings Philipp Conen 

August 16, 2019, 08:50 

#7 
Member

Dear Gavin,
as I can see the residualControl still does not work. Here is my log of the solver: Code:
ExecutionTime = 2664.28 s ClockTime = 2706 s ... PIMPLE: Iteration 19 DILUPBiCCCG: Solving for Ux, Initial residual = 4.711859e05, Final residual = 3.277177e07, No Iterations (1 1 1) DILUPBiCCCG: Solving for Uy, Initial residual = 4.83186e05, Final residual = 3.355973e07, No Iterations (1 1 1) DILUPBiCCCG: Solving for Uz, Initial residual = 0.0001946199, Final residual = 1.360958e06, No Iterations (1 1 1) DICPCG: Solving for p_rgh, Initial residual = 5.80858e05, Final residual = 9.92059e08, No Iterations 343 DICPCG: Solving for p_rgh, Initial residual = 8.136671e06, Final residual = 9.744144e08, No Iterations 8 time step continuity errors : sum local = 4.032735e11, global = 8.69936e13, cumulative = 9.328705e07 DICPCG: Solving for p_rgh, Initial residual = 1.862189e05, Final residual = 9.564784e08, No Iterations 337 DICPCG: Solving for p_rgh, Initial residual = 5.483464e06, Final residual = 8.795988e08, No Iterations 7 time step continuity errors : sum local = 3.640707e11, global = 9.436154e13, cumulative = 9.328715e07 DICPCG: Solving for p_rgh, Initial residual = 2.539553e06, Final residual = 8.357301e08, No Iterations 5 DICPCG: Solving for p_rgh, Initial residual = 1.733912e06, Final residual = 8.640904e08, No Iterations 3 time step continuity errors : sum local = 3.576518e11, global = 1.191871e12, cumulative = 9.328727e07 smoothSolver: Solving for omega, Initial residual = 5.109694e07, Final residual = 1.162782e09, No Iterations 1 smoothSolver: Solving for k, Initial residual = 2.773506e05, Final residual = 4.273729e09, No Iterations 1 PIMPLE: Iteration 20 DILUPBiCCCG: Solving for Ux, Initial residual = 0.0002354442, Final residual = 1.899741e12, No Iterations (4 4 4) DILUPBiCCCG: Solving for Uy, Initial residual = 0.0002425355, Final residual = 1.873183e12, No Iterations (4 4 4) DILUPBiCCCG: Solving for Uz, Initial residual = 0.0008617877, Final residual = 5.906528e12, No Iterations (4 4 4) DICPCG: Solving for p_rgh, Initial residual = 0.153554, Final residual = 0.0001499837, No Iterations 350 DICPCG: Solving for p_rgh, Initial residual = 0.07839407, Final residual = 7.580352e05, No Iterations 333 time step continuity errors : sum local = 1.608803e08, global = 1.087189e10, cumulative = 9.329814e07 DICPCG: Solving for p_rgh, Initial residual = 0.04337104, Final residual = 4.208997e05, No Iterations 348 DICPCG: Solving for p_rgh, Initial residual = 0.007981723, Final residual = 7.981384e06, No Iterations 342 time step continuity errors : sum local = 1.83341e09, global = 1.948213e13, cumulative = 9.329816e07 DICPCG: Solving for p_rgh, Initial residual = 0.004048247, Final residual = 3.857835e06, No Iterations 350 DICPCG: Solving for p_rgh, Initial residual = 0.001300558, Final residual = 9.93526e08, No Iterations 371 time step continuity errors : sum local = 2.305758e11, global = 8.214406e14, cumulative = 9.329817e07 DILUPBiCCCG: Solving for omega, Initial residual = 5.757286e05, Final residual = 2.727271e07, No Iterations 1 DILUPBiCCCG: Solving for k, Initial residual = 0.0004608179, Final residual = 1.510417e06, No Iterations 1 ExecutionTime = 2664.28 s ClockTime = 2706 s By the way I would like to ask what you mean with linaer and nonlinear.
__________________
Greetings Philipp Conen 

August 16, 2019, 08:59 
geometry

#8 
New Member
ramona
Join Date: Apr 2019
Posts: 4
Rep Power: 4 
Hello
could you plz somebody help me how can I choose inlet and outlet for geometry in openfoam? 

August 16, 2019, 09:03 
openfoam

#9 
New Member
ramona
Join Date: Apr 2019
Posts: 4
Rep Power: 4 
hello every one
could you please tell me which class is good for openfoam I am new in this field and I want to learn openfoam and get certificate best regards ____________ Ramona 

August 16, 2019, 09:08 

#10 
Member

Dear Ramona,
I think this Thread is not the best place for this question. But I allready answered to your inlet/outlet question. The secound question I do not understand. What do you mean with class?
__________________
Greetings Philipp Conen 

August 16, 2019, 11:03 

#11 
New Member
Gavin Ridley
Join Date: Jan 2019
Location: Tennessee, USA
Posts: 25
Rep Power: 4 
As for linear and nonlinear, maybe that isn’t the exactly correct term to use. Inner and outer pressurevelocity coupling iterations would be more correct to say, since the pressurevelocity coupled problem is a purely linear one. If you want more details on that coupling, I recommend checking out either Ferziger and Perric’s book or alternatively Patankar and Spalding’s if you want something more mathematically mild.
So, a few things. In your relaxation terms, you have both field and equation relaxation. Your equation relaxation can usually be 1, since this is usually not the unstable part of the problem. Field relaxation is what you need. You should see a pretty solid speedup when you remove equation relaxation. Of course, if you find that this makes your solve crash, you should add back some equation relaxation. Stabilization of the linear solve can usually be done with modest underrelaxation factors of .7 or .9, usually not low like .2. I see that you’re using the the coupled velocity solver. I’ve not messed with that; it does the pressurevelocity coupling in a wholly different way from the usual CFD solve. This may have to do with why stuff here is working different than what I’m used to (segregated p/U coupling). Another possibility could be your nonorthogonal terms making an issue. Does your fvSchemes use a corrected laplacian scheme? If so, you may also want to consider underrelaxing the nonorthogonal correction term, which is done in the fvSchemes file. You may also want to have two nonorthogonal corrections rather than just one, given that your mesh nonorthogonality is around 50. 

August 16, 2019, 11:10 
thank you

#12 
New Member
ramona
Join Date: Apr 2019
Posts: 4
Rep Power: 4 
Dear Pconen
I am very new with openfoam I used to use sim scale and for openfoam I want to learn step by step and I am looking for good source for start to learn openfoam thank you I saw your answered for inlet and outlet thanks 

August 19, 2019, 03:15 

#13 
Member

Dear Gavin,
thank you very much! At the moment I have hard work with my thesis. But I will try your ideas as soon as possible. Thanks!
__________________
Greetings Philipp Conen 

Tags 
divergence, pimple, p_rgh, slow, twoliquidmixingfoam 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
chtMultiRegionSimpleFoam: maximum number of iterations excedeed.  Nkl  OpenFOAM Running, Solving & CFD  19  October 10, 2019 02:42 
decompose dependent solution  arionfard  OpenFOAM  3  December 10, 2018 09:36 
Adapt Fluent Mesh to weirOverflow tutorial  WaterHammer1985  OpenFOAM Running, Solving & CFD  2  July 5, 2018 02:37 
Segmentation fault when using reactingFOAM for Fluids  Tommy Floessner  OpenFOAM Running, Solving & CFD  4  April 22, 2018 12:30 
Moving mesh  Niklas Wikstrom (Wikstrom)  OpenFOAM Running, Solving & CFD  122  June 15, 2014 06:20 