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

Convergence criteria based on temporal statistics

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2016, 04:32
Default Convergence criteria based on temporal statistics
  #1
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 13
Rojj is on a distinguished road
Hi,

In Openfoam+ it is possible to end the simulation when relevant statistics have converged within a certain tolerance. (Case Termination Controls)


For example (see attached) I would like to stop the simulation when the residuals have not changed considerably during the last n iterations.

Is this possible with OF 3.x or 4.x?

Thanks
Attached Images
File Type: jpg convergence.jpg (50.4 KB, 24 views)
Rojj is offline   Reply With Quote

Old   December 1, 2016, 03:10
Default
  #2
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 13
Rojj is on a distinguished road
Hi there

I assume this is not possible then :-)
Rojj is offline   Reply With Quote

Old   December 1, 2016, 03:57
Default
  #3
Member
 
Lorenzo
Join Date: Oct 2015
Location: Graz
Posts: 49
Rep Power: 11
Lorenzo92 is on a distinguished road
Well it depends on the kind of simulation : are you using RANS or LES? Indeed if you are using RANS velocity is already a statistics since it is defined as temporal average, if you are using LES it is surely a good idea to monitor the life of first and second order moments ( keep an eye also on variance: pPrime2Mean, UPrime2Mean ecc ecc).
In the latter case I assume you have a stationary boundary condition , not varying with time, otherwise the flow won't reach by nature a steady state .
I other words look at moments varying with time advancing to know how far the transient phase is( if there is one of course!)

Lorenzo92
Lorenzo92 is offline   Reply With Quote

Old   December 1, 2016, 04:33
Default
  #4
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 13
Rojj is on a distinguished road
Thanks Lorenzo,

I am running a RANS simulation (External flow over buildings).

I did not know that the residual was a temporal statistics. However, sometimes the residuals tend to oscillate around a value that is very close to the convergence limit, but never get there. This would not be a problem if I could monitor the solution visually.

I am running 8 to 16 wind directions (on 8 to 16 AWS machine) at the same time and the whole process is managed programmatically via scripts. I have tried to output the solution every (say) 100 time steps and you can see that it stops changing after 300-400 (varies with case) time steps. Nevertheless the script will wait until 2000 times teps (endTime).

One solution could be to create logs, monitor the last 20 residuals with a background script and alter the controlDict endTime once some statistics is satisfied. I was hoping to find a more elegant solution like in OpenFOAM 3+.

Thanks for reading.
Rojj is offline   Reply With Quote

Old   December 1, 2016, 14:07
Default
  #5
Member
 
Lorenzo
Join Date: Oct 2015
Location: Graz
Posts: 49
Rep Power: 11
Lorenzo92 is on a distinguished road
Residuals are a measure of how much numerical solution fits the governing equations, so they are not statistics like mean or variance.

I got your issue eventually : I know that in fvSolution there is a section called "residual controls" (assuming for example you are using simpleFoam) .
You can there set the residual tolerance for each field: once it has been reached the simulation should stop automatically if I remember correctly, ignoring the endTime in controlDict.
Lorenzo92 is offline   Reply With Quote

Old   December 1, 2016, 14:29
Default
  #6
Member
 
Ruggiero Guida
Join Date: Apr 2013
Location: World
Posts: 46
Rep Power: 13
Rojj is on a distinguished road
Yes, it is what I actually use. My residuals are all 1e-4 for Ux, Uy, Uz, epsilon, k and p. See the image I attached to the first post.

The fact is that often they become lower than 1e-3, but then get very close to 1e-4 without ever reaching it and I have to wait till 1000 iteration to exit simpleFoam. Usually it is Uz and/or p that manifest this issue.
Rojj 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
Statistics for adaptive convergence whykickamoocow_7 ANSYS 0 October 1, 2012 22:28
Convergence Criteria in FLUENT mahi007 FLUENT 9 March 1, 2012 07:46
SIMPLE algorithm, convergence criteria bbasal Main CFD Forum 3 December 3, 2011 00:24
convergence criteria iuaniu CFX 3 September 24, 2009 20:20
convergence criteria swarley FLUENT 3 June 24, 2009 12:18


All times are GMT -4. The time now is 06:32.