|
[Sponsors] |
June 26, 2019, 07:09 |
Solution control in pimpleFoam
|
#1 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
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 |
|
June 30, 2019, 16:26 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
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 |
|
July 1, 2019, 03:09 |
|
#3 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
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 |
|
July 1, 2019, 08:25 |
|
#4 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
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 |
|
July 1, 2019, 15:28 |
|
#5 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
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: PIMPLE residual control not workin in OF. 6.0).
Does anyone know about a more up-to-date and comprehensive pimpleFoam manual? |
|
July 1, 2019, 16:22 |
|
#6 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
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 |
|
July 2, 2019, 03:12 |
|
#7 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
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 |
|
July 2, 2019, 08:13 |
|
#8 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
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 { "(U|k|epsilon)" { relTol 0; tolerance 0.0001; } } |
|
July 2, 2019, 09:45 |
|
#9 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
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? Last edited by sita; July 3, 2019 at 03:27. Reason: Additional info |
|
March 14, 2021, 09:52 |
|
#10 |
New Member
Germany
Join Date: Nov 2020
Location: Aachen
Posts: 2
Rep Power: 0 |
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; } } |
|
March 15, 2021, 13:05 |
|
#11 | |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
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. |
||
March 15, 2021, 13:28 |
|
#12 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
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 " 53 << (mesh.steady() ? "steady-state" : mesh.transient() ? "transient" : 54 "mixed steady-state/transient") << " mode with " << nCorrPimple_ 55 << " outer corrector" << (nCorrPimple_ == 1 ? "" : "s") << nl; Cheers, Sita |
|
March 15, 2021, 13:36 |
|
#13 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
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 bool steady() const { return steady_; } //- Return true if the default ddtScheme is not steadyState bool transient() const { return !steady_; } |
|
March 15, 2021, 14:13 |
|
#14 |
Senior Member
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18 |
Neat! Never realised that Doxygen had this hyperlink functionality, looks like I'm a bit of a dinosaur too... Thanks for the tip!
|
|
March 15, 2021, 16:07 |
|
#15 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
That's the beauty of this forum - I am always discovering new things and new tricks.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
2way FSi, Initialize with steady solution, Fluent, Transient Sturcural, System Coupli | mmkkeshavarzi | FLUENT | 1 | June 28, 2024 08:03 |
Converging the solution | aja1345 | FLUENT | 13 | June 15, 2022 00:46 |
[General] Plotting solution vector from Matlab in Paraview | crg123 | ParaView | 0 | November 20, 2016 13:19 |
Filtering DNS solutions Vs projecting filtered DNS solution | juliom | Main CFD Forum | 5 | May 19, 2016 17:06 |
Wall functions | Abhijit Tilak | Main CFD Forum | 6 | February 5, 1999 02:16 |