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

Solution control in pimpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 26, 2019, 06:09
Default Solution control in pimpleFoam
  #1
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
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
sita is offline   Reply With Quote

Old   June 30, 2019, 15:26
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
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
clapointe is offline   Reply With Quote

Old   July 1, 2019, 02:09
Default
  #3
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
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
sita is offline   Reply With Quote

Old   July 1, 2019, 07:25
Default
  #4
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
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
clapointe is offline   Reply With Quote

Old   July 1, 2019, 14:28
Default
  #5
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
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?
sita is offline   Reply With Quote

Old   July 1, 2019, 15:22
Default
  #6
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
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
clapointe is offline   Reply With Quote

Old   July 2, 2019, 02:12
Default
  #7
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
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
sita is offline   Reply With Quote

Old   July 2, 2019, 07:13
Default
  #8
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
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;
        }
    }
Caelan
clapointe is offline   Reply With Quote

Old   July 2, 2019, 08:45
Default
  #9
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
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 02:27. Reason: Additional info
sita is offline   Reply With Quote

Old   March 14, 2021, 08:52
Default
  #10
New Member
 
Germany
Join Date: Nov 2020
Location: Aachen
Posts: 2
Rep Power: 0
Anuraag is on a distinguished road
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;
}
}
Anuraag is offline   Reply With Quote

Old   March 15, 2021, 12:05
Default
  #11
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 669
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Originally Posted by sita View Post
Does anyone know what the steady, transient, mixed steady-state/transient options in pimpleControl.C mean, and how to access these?
The pimple solvers are inherently transient solvers. You can run them in true transient mode with ddtSchemes such as Euler, or in a special pseudo-transient mode using "local time stepping" or LTS. LTS is used for time-stepping towards a steady solution, where you don't care about solution accuracy en route to the steady state; can be useful for buoyancy dominated flows, for example. Control the choice of either via the ddtScheme entry in fvSchemes (eg Euler or localEuler).

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.
Tobermory is offline   Reply With Quote

Old   March 15, 2021, 12:28
Default
  #12
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
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;
No clue what that would mean, it just made me curious.

Cheers,
Sita
sita is offline   Reply With Quote

Old   March 15, 2021, 12:36
Default
  #13
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 669
Rep Power: 14
Tobermory will become famous soon enough
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_;
             }
in other words, one of mesh.steady() or mesh.transient() must be true. This means that the "mixed steady-state/transient" condition can never occur, and is a dinosaur fragment of code!
Tobermory is offline   Reply With Quote

Old   March 15, 2021, 13:13
Default
  #14
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
Neat! Never realised that Doxygen had this hyperlink functionality, looks like I'm a bit of a dinosaur too... Thanks for the tip!
sita is offline   Reply With Quote

Old   March 15, 2021, 15:07
Default
  #15
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 669
Rep Power: 14
Tobermory will become famous soon enough
That's the beauty of this forum - I am always discovering new things and new tricks.
Tobermory 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
Converging the solution aja1345 FLUENT 13 June 14, 2022 23:46
[General] Plotting solution vector from Matlab in Paraview crg123 ParaView 0 November 20, 2016 12:19
2way FSi, Initialize with steady solution, Fluent, Transient Sturcural, System Coupli mmkkeshavarzi FLUENT 0 June 22, 2016 08:26
Filtering DNS solutions Vs projecting filtered DNS solution juliom Main CFD Forum 5 May 19, 2016 16:06
Wall functions Abhijit Tilak Main CFD Forum 6 February 5, 1999 01:16


All times are GMT -4. The time now is 04:02.