Solution control in pimpleFoam
Hi everyone,
I've a few questions about the pimpleFoam solver (using OpenFOAM-dev, build dev-68e9c8eac2bf, on a Scientific Linux cluster). I couldn't find the answers on the OpenFOAM-Wiki (https://openfoamwiki.net/index.php/O...hm_in_OpenFOAM) or in the book by Tobias Holzmann (Mathematics, Numerics, Derivations and OpenFOAM), so I was hoping someone on this forum would be able to help me out. 1. Looking at pimpleControl.H and pimpleControl.C, it looks like pimpleFoam can run in steady-state, transient, or mixed steady-state/transient mode. Is that correct? And if so, how do I control which mode to use? 2. After running the DTCHullMoving tutorial, the log file says "PIMPLE: No convergence criteria found", which is what I expected, as none are set in this tutorial, but it also says "PIMPLE: No corrector convergence criteria found. Calculations will do 2 corrections". So, what's the difference between these? And how should I set these corrector convergence criteria, is there something similar to residualControl for that? Thanks in advance for your help, Sita |
Quick answers -- as you know, the PIMPLE algorithm as coded in foam uses outer (SIMPLE-like) and inner (PISO) iterations. The outer iterations are controlled by the PIMPLE residual control, and the inner correctors are presumably controlled by the corrector convergence criteria -- although I've never used this before. Not sure why one would not use SIMPLE to obtain a steady solution, but transient calculations can employ multiple outer iterations to obtain a quasi-steady solution for a given time step and there are a variety of reasons you may or may not want to do this. Taking a look at Tobi's write up (there are a variety of ways to find it, but here's a link Mathematics, numerics, derivations and OpenFOAMŪ)would be a good place to start seeing how using outer/inner correctors and residual control can impact a solution.
Caelan |
Hi Caelan,
Thanks for your reply. As I wrote, I couldn't find the answers to my questions in the book of Tobi (or in any of the other resources I mentioned), but perhaps I should look again. Cheers, Sita |
Sorry, I linked the wrong verion -- his newer ones include a section on the PIMPLE algorithm that should be helpful. Here's the link mathematics, numerics, derivations and openfoam - ResearchGate https://www.researchgate.net/...Holz...rivations-and-....
Caelan |
Thanks, but that's actually the one I checked. As far as I could find, it does explain about the outer and inner correction loops, but not how to set residual control for each of those separately. Also, the text seems to be slightly outdated: the correct syntax for setting residual control has changed by now (see also this post: https://www.cfd-online.com/Forums/op...kin-6-0-a.html).
Does anyone know about a more up-to-date and comprehensive pimpleFoam manual? |
Ah good. The same principles outlined in the PIMPLE section should still apply, even if the syntax as changed. It has been a while since I've looked at in detail, but from memory the (possibly qualitative) solution is shown to depend on the number of outer/inner pimple loops. If you're looking for a hard and fast rule on how to set the number of outer/inner correctors, I doubt you'll find one -- it is very likely problem (and resource) dependent. But using the controls to exit an outer -- or inner -- loop should in principle allow the simulation to decide for you when to exit based on the solution residuals. There are various threads around on the topic, but I vaguely recall seeing 1e-4 as a good value to start with -- at least for the outer loop and using just a few inner correctors should also be fine.
Caelan |
Hi Caelan,
Thanks for that. Sorry, I'm afraid my question wasn't clear. I do get the idea of the outer and inner loops, it's just that I'd like to know how/where to set the corrector convergence criteria. If you add a sub-dictionary residualControl to the PIMPLE dictionary in fvSolution, this will set the convergence criteria (nCorrectors), but it won't set the corrector convergence criteria (nOuterCorrections). Does somebody know how and where to set these? Thanks, Sita |
Oh, now I understand -- sorry for the confusion. Try searching the tutorials for "outerCorrectorResidualControl". You'll likely end up here : https://github.com/OpenFOAM/OpenFOAM...tem/fvSolution. And the relevant bit is below :
Code:
outerCorrectorResidualControl |
Awesome, thanks a million!
P.S. Cool, it works now: the log file says PIMPLE detected both the convergence criteria and the corrector convergence criteria. It's still operating in transient mode though (I figured it might say mixed steady-state/transient now). Does anyone know what the steady, transient, mixed steady-state/transient options in pimpleControl.C mean, and how to access these? |
Here's how you set the residual control for both: nCorrectors and nOuterCorrectors-, as well as the relaxation factors. This is according to OF2006 v6.
Cheers! PIMPLE { nNonOrthogonalCorrectors 1; nCorrectors 3; nOuterCorrectors 50; pRefCell 0; pRefValue 0; residualControl { p 1e-06; U 1e-06; } outerCorrectorResidualControl { p { tolerance 1e-06; relTol 0; } U { tolerance 1e-06; relTol 0; } } } relaxationFactors { fields { p 0.95; pFinal 1; } equations { U 0.9; UFinal 1; } } |
Quote:
You can select steadyState as your ddtScheme in the pimple solver, in which case all of the ddt terms will be zeroed out. Be careful with this, however, since these ddt terms provide stability and your simulation may diverge rapidly; you'll need to apply relaxation factors, like in the SIMPLE steady state solver. If you do try and use the steadyState solver, then maybe you are better off just running the simpleFoam variant of the solver (if it exists), since that will be more efficient. Otherwise consider carefully the number of outer iterations (pimple iterations) and pressure correctors that you use, and remember that simpleFoam only uses 1 of each. I am not aware of any "mixed steady-state/transient" option - that seems a contradiction! Perhaps you were referring to the LTS scheme? Good luck. |
Thanks for this comprehensive explanation, that seems to make sense.
These steady-state, transient, and mixed steady-state/transient modes are something I came across in pimpleControl.C: Code:
52 Info<< nl << algorithmName << ": Operating solver in " Cheers, Sita |
And that made me curious! If you open up pimpleControl.H in Doxygen (https://cpp.openfoam.org/v8/pimpleCo...8C_source.html), and then hover your mouse over say the hyperlink on mesh.steady(), you'll see a pop-up say that this is defined in fvSchemes.H (https://cpp.openfoam.org/v8/fvScheme...ce.html#l00140). So let's take a look at fvSchemes.H:
Code:
//- Return true if the default ddtScheme is steadyState |
Neat! Never realised that Doxygen had this hyperlink functionality, looks like I'm a bit of a dinosaur too... Thanks for the tip!
|
That's the beauty of this forum - I am always discovering new things and new tricks. ;)
|
All times are GMT -4. The time now is 14:54. |