From b535c05fa688f506a693f236a2adee4052fbf017 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Mon, 6 Mar 2017 23:15:54 +0000
Subject: [PATCH] CrankNicolsonDdtScheme, backwardDdtScheme: Ensure V00 is
 available for moving meshes

---
 .../CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H  | 12 ++++++++++--
 .../ddtSchemes/backwardDdtScheme/backwardDdtScheme.H | 12 ++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H
index 42fc3328ccb..78c343c3b4c 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H
@@ -200,7 +200,11 @@ public:
             ocCoeff_(1.0)
         {
             // Ensure the old-old-time cell volumes are available
-            mesh.V00();
+            // for moving meshes
+            if (mesh.moving())
+            {
+                mesh.V00();
+            }
         }
 
         //- Construct from mesh and Istream
@@ -220,7 +224,11 @@ public:
             }
 
             // Ensure the old-old-time cell volumes are available
-            mesh.V00();
+            // for moving meshes
+            if (mesh.moving())
+            {
+                mesh.V00();
+            }
         }
 
 
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H
index 0b9c82b6dc4..c17b1f16a40 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.H
@@ -91,7 +91,11 @@ public:
             ddtScheme<Type>(mesh)
         {
             // Ensure the old-old-time cell volumes are available
-            mesh.V00();
+            // for moving meshes
+            if (mesh.moving())
+            {
+                mesh.V00();
+            }
         }
 
         //- Construct from mesh and Istream
@@ -100,7 +104,11 @@ public:
             ddtScheme<Type>(mesh, is)
         {
             // Ensure the old-old-time cell volumes are available
-            mesh.V00();
+            // for moving meshes
+            if (mesh.moving())
+            {
+                mesh.V00();
+            }
         }
 
 
-- 
GitLab