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

Difference between solve() and solve(...finalInnerIter())?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 3 Post By jherb
  • 1 Post By akidess

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 8, 2016, 06:01
Default Difference between solve() and solve(...finalInnerIter())?
  #1
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
Hello,

can you help me understand the difference between a simple call to
Code:
p_rghEqn.solve();
and
Code:
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
?

Your help is much appreciated!
elmo555 is offline   Reply With Quote

Old   June 8, 2016, 17:59
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
The second version uses the settings for p_rghFinal in the system/fvSolutions file (for solver settings) for the last iteration in the pimple outer loop (so for the last iteration step per time step) whereas the first version *always* use the p_rgh settings. So the p_rghFinal settings are ignore in the first case.
jherb is offline   Reply With Quote

Old   June 9, 2016, 03:56
Default
  #3
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
Thanks for the quick and clear answer!

My settings for p_rgh and p_rghFinal are the same, except for the relTol, which is 0.05 and 0, respectively. So naturally, the solver needs more iterations in the last outer pimple loop because it can't stop at any relative tolerance. I was wondering if it's normal that THAT much more iterations are required:

Code:
DICPCG:  Solving for p_rgh, Initial residual = 0.0509331, Final residual = 0.00187709, 
No Iterations 3
time step continuity errors : sum local = 9.11852e-06, global = 7.5083e-06, cumulative = -0.00101879
DICPCG:  Solving for p_rgh, Initial residual = 0.00738722, Final residual = 0.000365238, 
No Iterations 80
time step continuity errors : sum local = 7.85558e-06, global = 7.48801e-06, cumulative = -0.0010113
DICPCG:  Solving for p_rgh, Initial residual = 0.00345672, Final residual = 9.48528e-08, 
No Iterations 250
time step continuity errors : sum local = 7.50304e-06, global = 7.50295e-06, cumulative = -0.0010038
Or is this suggesting that there's another problem with my code?
elmo555 is offline   Reply With Quote

Old   June 9, 2016, 04:30
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
It would say it is normal.
jherb is offline   Reply With Quote

Old   June 9, 2016, 04:40
Default
  #5
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Just look at your residuals. At first you are reducing them by 10, then in the final iteration 10'000x. Of course that will require a lot more iterations. By the way, GAMG typically shows much better performance for the solution of the pressure equation.

Quote:
Originally Posted by elmo555 View Post
Thanks for the quick and clear answer!

My settings for p_rgh and p_rghFinal are the same, except for the relTol, which is 0.05 and 0, respectively. So naturally, the solver needs more iterations in the last outer pimple loop because it can't stop at any relative tolerance. I was wondering if it's normal that THAT much more iterations are required:

Code:
DICPCG:  Solving for p_rgh, Initial residual = 0.0509331, Final residual = 0.00187709, 
No Iterations 3
time step continuity errors : sum local = 9.11852e-06, global = 7.5083e-06, cumulative = -0.00101879
DICPCG:  Solving for p_rgh, Initial residual = 0.00738722, Final residual = 0.000365238, 
No Iterations 80
time step continuity errors : sum local = 7.85558e-06, global = 7.48801e-06, cumulative = -0.0010113
DICPCG:  Solving for p_rgh, Initial residual = 0.00345672, Final residual = 9.48528e-08, 
No Iterations 250
time step continuity errors : sum local = 7.50304e-06, global = 7.50295e-06, cumulative = -0.0010038
Or is this suggesting that there's another problem with my code?
elmo555 likes this.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Reply


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
SIMPLE Algorithm Finite Difference Equations: how to discretize and solve? DA6righthand Main CFD Forum 0 August 3, 2015 12:12
Can OpenFoam solve this problem? salazardetroya OpenFOAM Running, Solving & CFD 1 July 29, 2015 22:34
Additional 2D solve at an inlet patch during each iteration of a usual 3D solve incompressible OpenFOAM Running, Solving & CFD 1 July 5, 2015 11:09
solve the scalar gradient yp5547 FLUENT 0 December 24, 2014 05:05
Difference between codes and representations titio OpenFOAM Running, Solving & CFD 3 July 3, 2009 07:58


All times are GMT -4. The time now is 17:35.