# Too much iterations for k, epsilon with Pointwise mesh

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 13, 2015, 05:08 #21 Senior Member     Philipp Join Date: Jun 2011 Location: Germany Posts: 1,297 Rep Power: 25 Edit: I just made some pictures of your residuals over iteration / time. This looks ugly. I will post the picture. __________________ The skeleton ran out of shampoo in the shower.

 October 13, 2015, 05:26 #22 Senior Member     Philipp Join Date: Jun 2011 Location: Germany Posts: 1,297 Rep Power: 25 output.png This is how the residuals of your case look like. __________________ The skeleton ran out of shampoo in the shower.

 October 13, 2015, 06:17 #23 New Member   Jason Join Date: May 2015 Posts: 14 Rep Power: 9 Philipp, The solver I use is 'interFoam' and it is multiphase(water, air in this case) and unsteady solver. interFoam use VOF(Volume of fluid) method to capture water interface(Freesurface). In VOF, if I understands it correctly, solve 1 transport equation and 1 continuity equation that containing Alpha ( If Alpha is 0 : cell is gas phase(air), 1 : cell is full of water and value between 0 and 1 is interface.. I'll try under-relaxation factor on alpha! The problem I solve is a floating square box with freestream..(Water flow past a square box) Residuals in the picture you uploaded shows sudden rise of continuity..I don't know why but there should be something wrong.. by the way, which tool you used to draw residual plot? Did you used GNU plot? If so, can I see the script you used? Many thanks, Jason

 October 13, 2015, 06:21 #24 Senior Member     Philipp Join Date: Jun 2011 Location: Germany Posts: 1,297 Rep Power: 25 Hi, Yes it is gnuplot. Copy the code to a file called "plotscript" in the same directory as your log file is. You can run it with "gnuplot plotscript" during runtime, the plot will redone every 1 second. If you want to plot a picture just delete the "#" in the first two lines and comment out the last lines "reread" and "pause 1". Everything should be self-explanatory, but if you don't understand it, just ask... Code: ```#set terminal png size 800,600 enhanced font "Helvetica,12" #set output 'output.png' set logscale y set title "Residuals" set ylabel 'Residual' set xlabel 'Iteration' set key outside set grid set yrange[1e-14:10] nCorrectors=3 nNonOrthogonalCorrectors=1 nCont = nCorrectors nP = (nNonOrthogonalCorrectors+1)*nCont nPSkip = nP-1 nContSkip = nCont-1 plot "< cat log | grep 'Solving for alpha.water' | cut -d' ' -f9 | tr -d ','" title 'alpha' with linespoints,\ "< cat log | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with linespoints,\ "< cat log | grep 'Solving for epsilon' | cut -d' ' -f9 | tr -d ','" title 'epsilon' with linespoints,\ "< cat log | grep 'time step continuity errors :' | cut -d' ' -f9 | tr -d ','" every nCont::nContSkip title 'continuity' with linespoints,\ "< cat log | grep 'Solving for p_rgh' | cut -d' ' -f9 | tr -d ','" every nP::nPSkip title 'p' with linespoints lc 8 pause 1 #xmax = GPVAL_DATA_X_MAX+2 #xmin = xmax-20 #set xrange [xmin:xmax] reread``` If you change the solver settings you must always also change the plotscript (OuterCorrections,...) Frenk_T and Turin Turambar like this. __________________ The skeleton ran out of shampoo in the shower.

 October 13, 2015, 06:24 #25 Senior Member     Philipp Join Date: Jun 2011 Location: Germany Posts: 1,297 Rep Power: 25 The sudden rise comes from the next time step (every 15 iterations). This is quite normal for PIMPLE. It is not good, that the residuals don't converge appreciably. Is there any change that you can run a steady state solution prior? Such as SIMPLE for initialization? __________________ The skeleton ran out of shampoo in the shower.

 October 13, 2015, 06:42 #26 New Member   Jason Join Date: May 2015 Posts: 14 Rep Power: 9 Philipp, The scrip you gave me works well! Thanks! Well, I've never tried SIMPLE algorithm for initialization..

 October 15, 2015, 23:44 #27 Senior Member   Elham Join Date: Oct 2009 Posts: 184 Rep Power: 14 Hi, I had a very awfull number of iteration for p-rgh, around 190, and after changing relTol from 0 to 0.001 it is great, around 10. Thanks for your advice. tigger likes this.

 October 16, 2015, 02:17 #28 Senior Member     Philipp Join Date: Jun 2011 Location: Germany Posts: 1,297 Rep Power: 25 Great, but does it converge now? __________________ The skeleton ran out of shampoo in the shower.

 October 16, 2015, 02:52 #29 Senior Member   Elham Join Date: Oct 2009 Posts: 184 Rep Power: 14 Unfortunately, I didn't pay attention to the second attempt for solving p-rgh which is still have high No iteration. MULES: Solving for alpha.water MULES: Solving for alpha.water MULES: Solving for alpha.water Phase-1 volume fraction = 2.111971e-05 Min(alpha1) = 0 Max(alpha1) = 0.9974017 GAMG: Solving for p_rgh, Initial residual = 0.05853901, Final residual = 5.498377e-05, No Iterations 6 time step continuity errors : sum local = 3.274181e-09, global = 1.346159e-14, cumulative = -6.08748e-09 GAMG: Solving for p_rgh, Initial residual = 0.0001254836, Final residual = 9.72051e-07, No Iterations 80 time step continuity errors : sum local = 5.814538e-11, global = 5.793274e-17, cumulative = -6.08748e-09 ExecutionTime = 80707.64 s ClockTime = 81027 s

 October 16, 2015, 03:17 #30 Senior Member     Philipp Join Date: Jun 2011 Location: Germany Posts: 1,297 Rep Power: 25 You could try a different smoother for the GAMG. Code: ```p { solver GAMG; tolerance 1e-12; relTol 0.1; smoother DICGaussSeidel; nPreSweeps 0; nPostSweeps 1; nFinestSweeps 2; scaleCorrection true; directSolveCoarsestLevel false; cacheAgglomeration on; agglomerator faceAreaPair; nCellsInCoarsestLevel 500; mergeLevels 1; maxIter 100; }``` I meant the PIMPLE algorithm, not the linear solvers, sorry. Does PIMPLE converge now? __________________ The skeleton ran out of shampoo in the shower. Last edited by RodriguezFatz; October 16, 2015 at 04:52.

 Tags convergence, diverge, interfoam