From 87bba9ae14894aa286fbc13031e240064886a181 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Wed, 11 Dec 2019 20:25:18 +0000 Subject: [PATCH] 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. --- .../solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C | 7 ++++++- .../solvers/incompressible/pimpleFoam/pimpleFoam.C | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index d6b0163349f..69eb579d705 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -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()) { diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C index 9c9fb3bb2bd..282c75e9544 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C @@ -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()) { -- GitLab