From 88dd3a18188e24d89591b116fffbc93617a501d9 Mon Sep 17 00:00:00 2001
From: Andrew Heather <>
Date: Fri, 24 Apr 2020 11:52:00 +0100
Subject: [PATCH] ENH: pimpleControl - added ddtCorr flag

---
 .../pimpleControl/pimpleControl.C                |  6 ++++--
 .../pimpleControl/pimpleControl.H                | 16 +++++++++++-----
 .../pimpleControl/pimpleControlI.H               |  6 ++++++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C
index e49d3c75fc1..aa4d3d6bcbb 100644
--- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C
+++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C
@@ -52,6 +52,7 @@ bool Foam::pimpleControl::read()
         pimpleDict.getOrDefault("turbOnFinalIterOnly", true);
     finalOnLastPimpleIterOnly_ =
         pimpleDict.getOrDefault("finalOnLastPimpleIterOnly", false);
+    ddtCorr_ = pimpleDict.getOrDefault("ddtCorr", true);
 
     return true;
 }
@@ -155,8 +156,9 @@ Foam::pimpleControl::pimpleControl
     corrPISO_(0),
     SIMPLErho_(false),
     turbOnFinalIterOnly_(true),
-    converged_(false),
-    finalOnLastPimpleIterOnly_(false)
+    finalOnLastPimpleIterOnly_(false),
+    ddtCorr_(true),
+    converged_(false)
 {
     read();
 
diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H
index 1433215df84..017f4675b53 100644
--- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H
+++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.H
@@ -85,19 +85,22 @@ protected:
             label corrPISO_;
 
             //- Flag to indicate whether to update density in SIMPLE
-            //  rather than PISO mode
+            //- rather than PISO mode
             bool SIMPLErho_;
 
             //- Flag to indicate whether to only solve turbulence on final iter
             bool turbOnFinalIterOnly_;
 
-            //- Converged flag
-            bool converged_;
-
             //- Flag to indicate wheter the final solver is used only on the
-            //  final pimple iter
+            //- final pimple iter
             bool finalOnLastPimpleIterOnly_;
 
+            //- Flag to indicate that ddtCorr should be applied; default = yes
+            bool ddtCorr_;
+
+            //- Converged flag
+            bool converged_;
+
 
     // Protected Member Functions
 
@@ -181,6 +184,9 @@ public:
 
             //- Return true to solve for turbulence
             inline bool turbCorr();
+
+            //- Return true to apply ddtCorr
+            inline bool ddtCorr() const;
 };
 
 
diff --git a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H
index 344db63f93e..b0fd30e6fd1 100644
--- a/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H
+++ b/src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControlI.H
@@ -143,4 +143,10 @@ inline bool Foam::pimpleControl::turbCorr()
 }
 
 
+inline bool Foam::pimpleControl::ddtCorr() const
+{
+    return ddtCorr_;
+}
+
+
 // ************************************************************************* //
-- 
GitLab