CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Too much iterations for k, epsilon with Pointwise mesh

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 5, 2015, 03:51
Unhappy Too much iterations for k, epsilon with Pointwise mesh
  #1
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Hello, Foamers

I'm trying to solve flow past a floating square box.
The solver is interFoam(Multiphase water, air).
The domain, suface mesh, volume mesh are generated by Pointwise and I set boundary conditions as below :
Inlet, oulet, atmosphere : patch
bottom, midplane, side : symmetry
box : wall

Volume mesh is composed of tetrahedron mesh.
Mesh quality checked by checkMesh utility was fine with some skew cells.

The problem is that Iterations for alpha.water and k, epsilon is 1000 and they blow up later...
I already faced this situation when the mesh was structured mesh.. I thought unstructured mesh will be a solution for this situation but... nothing changed
Here is terminal output
Code:
Time = 0.000119976

smoothSolver:  Solving for alpha.water, Initial residual = 2.10029456432146e-06, Final residual = 0.0004465071153368, No Iterations 1000
Phase-1 volume fraction = 0.626758885470715  Min(alpha1) = 0  Max(alpha1) = 2.51427683470041
MULES: Correcting alpha.water
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.626758885470664  Min(alpha1) = 0  Max(alpha1) = 2.5111203422983
GAMG:  Solving for p_rgh, Initial residual = 1, Final residual = 0.000412756523842382, No Iterations 4
GAMG:  Solving for p_rgh, Initial residual = 0.101705754512192, Final residual = 0.000100928301496662, No Iterations 4
time step continuity errors : sum local = 3.65937145748082e-07, global = 1.53699517734662e-08, cumulative = 1.53784861589855e-08
GAMG:  Solving for p_rgh, Initial residual = 0.0312962317006745, Final residual = 1.39933880273081e-05, No Iterations 5
GAMG:  Solving for p_rgh, Initial residual = 0.00996448307785306, Final residual = 7.62790351177124e-06, No Iterations 5
time step continuity errors : sum local = 3.52922607711308e-08, global = 7.58057755027101e-10, cumulative = 1.61365439140126e-08
GAMG:  Solving for p_rgh, Initial residual = 0.00468422248968285, Final residual = 4.66016854885601e-06, No Iterations 5
GAMG:  Solving for p_rgh, Initial residual = 0.00252317454590901, Final residual = 3.49969247968792e-08, No Iterations 12
time step continuity errors : sum local = 1.63507334863481e-10, global = 2.95406036297376e-12, cumulative = 1.61394979743756e-08
smoothSolver:  Solving for epsilon, Initial residual = 0.0633688257280632, Final residual = 0.0632861832323256, No Iterations 1000
smoothSolver:  Solving for k, Initial residual = 0.999999985453537, Final residual = 1.00589685637645, No Iterations 1000
ExecutionTime = 314.36 s  ClockTime = 325 s
I guess this is because of initial condition or improper numerical scheme and numerical solver.. so, I attached my fvSolution, fvScheme, controlDict in system folder and 0.org folder..
Have anyone experienced this too much iteration problem? If so, how can I solve this problem? :confused:

Best regards,
tigger
Attached Files
File Type: gz 0.org.tar.gz (1.3 KB, 10 views)
File Type: gz system.tar.gz (1.6 KB, 19 views)
tigger is offline   Reply With Quote

Old   October 8, 2015, 09:17
Default
  #2
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
This is quite unusual... the linear solver doesn't converge at all.
Did you try to run a different solver for k and epsilon?

Code:
    "(U|k|epsilon|omega|UFinal|kFinal|epsilonFinal|omegaFinal)"    
    {
        solver           PBiCG;
        preconditioner   DILU;
        tolerance        1e-12;
        relTol           1.0e-2;
        maxIter         100;
    };
Edit: maybe you should also use that for alpha, because that doesn't converge either.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 8, 2015, 09:22
Default
  #3
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Just additionally, this is probably not the reason for your problems but you should always start a case with the uncorrected laplacian scheme, which is numerically more stable.
Code:
laplacianSchemes
{
    default         Gauss linear uncorrected;
}
tigger likes this.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 8, 2015, 10:07
Default
  #4
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19
JNSN is on a distinguished road
There is no reason why an unstructured tet mesh should work better than a structured mesh. I would never prever a tet mesh for free surface flows. Can you plot some screenshots of your mesh and from your initialized solution (especially alpha field)?
tigger likes this.
JNSN is offline   Reply With Quote

Old   October 9, 2015, 12:58
Default
  #5
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Quote:
Originally Posted by RodriguezFatz View Post
Just additionally, this is probably not the reason for your problems but you should always start a case with the uncorrected laplacian scheme, which is numerically more stable.
Code:
laplacianSchemes
{
    default         Gauss linear uncorrected;
}
Thanks for your kind comment. I'll try other solver that you recommended and then update the result. Thank you!
tigger is offline   Reply With Quote

Old   October 9, 2015, 13:00
Default
  #6
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Quote:
Originally Posted by JNSN View Post
There is no reason why an unstructured tet mesh should work better than a structured mesh. I would never prever a tet mesh for free surface flows. Can you plot some screenshots of your mesh and from your initialized solution (especially alpha field)?
Thank you JNSN! I'll update screenshot of mesh later.
tigger is offline   Reply With Quote

Old   October 10, 2015, 09:47
Default Thanks! Philipp
  #7
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Quote:
Originally Posted by RodriguezFatz View Post
This is quite unusual... the linear solver doesn't converge at all.
Did you try to run a different solver for k and epsilon?

Code:
    "(U|k|epsilon|omega|UFinal|kFinal|epsilonFinal|omegaFinal)"    
    {
        solver           PBiCG;
        preconditioner   DILU;
        tolerance        1e-12;
        relTol           1.0e-2;
        maxIter         100;
    };
Edit: maybe you should also use that for alpha, because that doesn't converge either.

I tried to use PBiCG solver you suggested
Now the K, epsilon iterations become stable

Code:
DILUPBiCG:  Solving for alpha.water, Initial residual = 9.41257114753943e-07, Final residual = 6.69250718355886e-11, No Iterations 1
Phase-1 volume fraction = 0.626760378142215  Min(alpha1) = -1.16185071173307e-06  Max(alpha1) = 1.00150910236442
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.626760378142315  Min(alpha1) = -1.16185071173307e-06  Max(alpha1) = 1.00150901821138
GAMG:  Solving for p_rgh, Initial residual = 0.000268113771479435, Final residual = 1.31199231523444e-07, No Iterations 5
GAMG:  Solving for p_rgh, Initial residual = 8.9469043939113e-05, Final residual = 8.44752800100194e-08, No Iterations 5
time step continuity errors : sum local = 1.15163397615092e-11, global = -1.29175373620592e-12, cumulative = -1.64869290559949e-06
GAMG:  Solving for p_rgh, Initial residual = 4.07512657567795e-05, Final residual = 3.94730642661602e-08, No Iterations 6
GAMG:  Solving for p_rgh, Initial residual = 3.7833103278026e-05, Final residual = 3.70998267918502e-08, No Iterations 5
time step continuity errors : sum local = 5.07003233184369e-12, global = 7.53555301266291e-13, cumulative = -1.64869215204419e-06
GAMG:  Solving for p_rgh, Initial residual = 1.44866320494826e-05, Final residual = 3.79502063541261e-08, No Iterations 4
GAMG:  Solving for p_rgh, Initial residual = 1.19072340126574e-05, Final residual = 4.81493222880152e-08, No Iterations 3
time step continuity errors : sum local = 6.55465097078055e-12, global = -4.41939941264471e-13, cumulative = -1.64869259398413e-06
DILUPBiCG:  Solving for epsilon, Initial residual = 0.000317455367614486, Final residual = 3.20877793792615e-07, No Iterations 2
DILUPBiCG:  Solving for k, Initial residual = 8.09326775207824e-09, Final residual = 8.09326775207824e-09, No Iterations 0
ExecutionTime = 12857.71 s  ClockTime = 13028 s
However, the calculation just blow up after some iterations.. sad..
You can see the residuals in attached picture.
I have to find solutions for this situation..
Anyway, Thanks again!
Attached Images
File Type: png residual.png (11.1 KB, 72 views)
tigger is offline   Reply With Quote

Old   October 10, 2015, 09:51
Wink Here is the picture
  #8
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Quote:
Originally Posted by JNSN View Post
There is no reason why an unstructured tet mesh should work better than a structured mesh. I would never prever a tet mesh for free surface flows. Can you plot some screenshots of your mesh and from your initialized solution (especially alpha field)?
Jan,

I attached alpha field screenshot. I'm not sure this picture is that you wanted to see...
Well, by the way, I had same trouble(too many iterations for k, epsilon..) when I used Hex mesh(Structured grid)...

Thanks!
tigger is offline   Reply With Quote

Old   October 12, 2015, 07:14
Default
  #9
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
You need to post the log output of the blowup (and some iterations before)...
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 12, 2015, 07:17
Default
  #10
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19
JNSN is on a distinguished road
Jason, I can't see the screenshots. Can you upload again?
JNSN is offline   Reply With Quote

Old   October 12, 2015, 07:53
Default
  #11
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Quote:
Originally Posted by RodriguezFatz View Post
You need to post the log output of the blowup (and some iterations before)...
Sorry, Here is log output as a txt file
Actually, I stopped the calculation because the residual is getting weird..

Thanks,
tigger
Attached Files
File Type: txt logfile.txt (106.2 KB, 13 views)
tigger is offline   Reply With Quote

Old   October 12, 2015, 07:54
Default
  #12
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Quote:
Originally Posted by JNSN View Post
Jason, I can't see the screenshots. Can you upload again?
Oops, I forgot to attach screenshot
Here it is

Thanks,
tigger
Attached Images
File Type: jpg alpha.water.jpg (34.1 KB, 72 views)
tigger is offline   Reply With Quote

Old   October 12, 2015, 07:56
Default
  #13
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19
JNSN is on a distinguished road
ok, can you do one more with mesh grid on?
JNSN is offline   Reply With Quote

Old   October 12, 2015, 08:04
Default
  #14
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Can you post the fvSchemes and fvSolution that you used for to get that log output?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 12, 2015, 08:22
Default
  #15
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Quote:
Originally Posted by RodriguezFatz View Post
Can you post the fvSchemes and fvSolution that you used for to get that log output?
Here it is
Attached Files
File Type: txt fvSchemes.txt (1.5 KB, 21 views)
File Type: txt fvSolution.txt (2.7 KB, 28 views)
tigger is offline   Reply With Quote

Old   October 12, 2015, 08:25
Default
  #16
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Quote:
Originally Posted by JNSN View Post
ok, can you do one more with mesh grid on?
Here are they!
Attached Images
File Type: jpg ss2.jpg (197.0 KB, 45 views)
File Type: jpg ss3.jpg (160.8 KB, 42 views)
tigger is offline   Reply With Quote

Old   October 12, 2015, 08:34
Default
  #17
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Several things:
1) You did not change the laplacian scheme to uncorrected.
2) You should use numerically safe settings for the other schemes as well, such as "Gauss upwind" instead of linearUpwind and vanLeer. If they work, you can start to introduce better schemes, one by one.
3) Using p_rghFinal with relTol 0 is a waste of time, I guess. I would commend out that "p_rghFinal" block.
4) This is a PIMPLE based solver, right? You use "nOuterCorrectors 1" which basically means, that you don't run PIMPLE but PISO. But PISO needs a Courant number of less than 1, which is already violated in the 3rd or 4th time step. Thus, you need to reduce the time step or increase the numer of outer (PIMPLE-)iterations per time step. If you do the second, you should set turbOnFinalIterOnly to "no" and also use some safer relaxation factors for the pressure (such as p 0.3) for the beginning. Try to set nOuterCorrectors 15 or so and see if that runs stable.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 12, 2015, 08:51
Default
  #18
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Quote:
Originally Posted by RodriguezFatz View Post
Several things:
1) You did not change the laplacian scheme to uncorrected.
2) You should use numerically safe settings for the other schemes as well, such as "Gauss upwind" instead of linearUpwind and vanLeer. If they work, you can start to introduce better schemes, one by one.
3) Using p_rghFinal with relTol 0 is a waste of time, I guess. I would commend out that "p_rghFinal" block.
4) This is a PIMPLE based solver, right? You use "nOuterCorrectors 1" which basically means, that you don't run PIMPLE but PISO. But PISO needs a Courant number of less than 1, which is already violated in the 3rd or 4th time step. Thus, you need to reduce the time step or increase the numer of outer (PIMPLE-)iterations per time step. If you do the second, you should set turbOnFinalIterOnly to "no" and also use some safer relaxation factors for the pressure (such as p 0.3) for the beginning. Try to set nOuterCorrectors 15 or so and see if that runs stable.
1), 2) OK, I'll try to use laplacian scheme to uncorrected! and Gauss upwind scheme
3) relTol 0 on p_rghFinal will be removed!
4) I'm using 'interFoam'solver and this solver may be based on PIMPLE algorithm.. I missed that the 'nOuterCorrector 1' means calculation is running PISO algorithm.. Thanks for your kind advice

Those 4 advice will be adopted to my case and I'll update results!
tigger is offline   Reply With Quote

Old   October 13, 2015, 04:37
Default
  #19
New Member
 
Jason
Join Date: May 2015
Posts: 14
Rep Power: 10
tigger is on a distinguished road
Well,

every advices applied to new case!
1) uncorrected laplacian scheme,
2) Gauss upwind scheme for all fvSchemes
3) relTol 0 was removed
4) nOuterCorrectors 15, turbOnFinalIterOnly no

Now, I can see that bounding k is getting bigger and bigger
Finally, the calculation blow up and openfoam do Iteration 1000 suddenly in final pimple iteration (Iteration 15)...

Here is my log file and fvSolution & fvSchemes...

* When I run simulation with turbOnFinalIterOnly yes the volume fraction went above 1.. Can someone explain how turbOnFinalIterOnly affect the pimple iteration or recommend some paper to study?
Attached Files
File Type: txt fvSchemes.txt (1.5 KB, 11 views)
File Type: txt fvSolution.txt (2.7 KB, 15 views)
File Type: txt logfile.txt (105.4 KB, 10 views)
tigger is offline   Reply With Quote

Old   October 13, 2015, 04:50
Default
  #20
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Jason, I don't know the solver you use and also don't know what it solves for
But: Is there any differential equation for "alpha" that is solved? Like a transport equation? You need to set an under-relaxation factor for PIMPLE for all the values (such as k, epsilon, p, alpha), otherwise this will probably be very unstable. Please try that. For debugging: You can have a look at the residuals "before" and "after" setting the new under-relaxation factor in the log file. If they change, you set the right value.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Reply

Tags
convergence, diverge, interfoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
a problem with convergence in buoyantSimpleFoam skuznet OpenFOAM Running, Solving & CFD 6 November 15, 2017 12:12
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 13:40
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
should Courant number always be kept below 1? wc34071209 OpenFOAM Running, Solving & CFD 16 March 9, 2014 19:31
rhoSimplecFoam Mach0.8 no pressure values CFDnewbie147 OpenFOAM Running, Solving & CFD 16 November 23, 2013 05:58


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