ENH: add selectable update control/interval to pimpleFoam, rhoPimpleFoam

- Allows user-defined control of when the mesh motion occurs,
  which can be especially useful in situations where the mesh motion
  is much slower than any of the fluid physics.

  For example, in constant/dynamicMeshDict:

      updateControl   runTime;
      updateInterval  0.5;

  to have mesh motion triggered every 1/2 second.

  Note that the _exact_ time that the mesh motion actually occurs may
  be slightly differently since the "runTime" triggering is fuzzy in
  nature. It will trigger when the threshold has been crossed, which
  will depend on the current time-step size.
This commit is contained in:
Andrew Heather
2019-12-11 20:25:18 +00:00
committed by Mark Olesen
parent fa57b4e45e
commit 87bba9ae14
2 changed files with 13 additions and 2 deletions

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,6 +37,10 @@ Description
Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
pseudo-transient simulations.
Note
The motion frequency of this solver can be influenced by the presence
of "updateControl" and "updateInterval" in the dynamicMeshDict.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
@ -131,7 +136,7 @@ int main(int argc, char *argv[])
}
// Do any mesh changes
mesh.update();
mesh.controlledUpdate();
if (mesh.changing())
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,6 +68,10 @@ Description
\<turbulence fields\> | As required by user selection
\endplaintable
Note
The motion frequency of this solver can be influenced by the presence
of "updateControl" and "updateInterval" in the dynamicMeshDict.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
@ -121,7 +126,8 @@ int main(int argc, char *argv[])
{
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
mesh.update();
// Do any mesh changes
mesh.controlledUpdate();
if (mesh.changing())
{