|
[Sponsors] |
April 30, 2015, 09:42 |
A more intelligent solution control class
|
#1 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 18 |
I have always found it a bit annoying that you need to find the residual tolerances for PIMPLE loops yourself to get the solver to break the loop after convergence, so I have written a solutionControl class that recognizes converged residuals. This is done by checking that the minimum residual didn't drop atleast by a factor of x after y steps. Using this class in a solver makes it possible to break the loop at convergence using nearly a minimum amount of steps without manually finding tolerance levels. This is also beneficial for unsteady cases in which the converged residual values change with time and have to be adjusted. In a case like this, set the absolute residual tolerances to something very low which won't be reached by the solver and residual tolerances to zero so only the new method is used.
For using the class in a solver simply replace the Code:
#include pimpleControl.H Code:
#include smartControl.H |
|
April 30, 2015, 11:57 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings Chris,
Thanks for sharing. A few suggestions:
Bruno |
|
April 30, 2015, 12:38 |
|
#3 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 18 |
For integrating it into the official OpenFOAM version it would be smarter to insert the code directly into the pimpleControl class, since there is some duplicate code and the current approach requires modifications to the solvers. I went this route to maintain compatibility with future OF versions without modifying their source files. This would not be needed if it was in the official code though.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
grid dependancy | gueynard a. | Main CFD Forum | 19 | June 27, 2014 21:22 |
Solution Diverging with Trimmer Mesh | rietuk | STAR-CCM+ | 8 | February 27, 2013 04:50 |
Exact solution of Burgers equation | mcaro | Main CFD Forum | 3 | January 25, 2011 06:46 |
How to get the solution of last time step? | lzgwhy | Fluent UDF and Scheme Programming | 0 | September 15, 2010 22:23 |
Wall functions | Abhijit Tilak | Main CFD Forum | 6 | February 5, 1999 01:16 |