From fb00cd2bc938dc0883af0e463fdb4008263d77f4 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Sun, 18 May 2014 21:19:58 +0100
Subject: [PATCH] wallFunctions: Handle moving meshes

---
 .../epsilonWallFunctionFvPatchScalarField.C            | 10 +++++-----
 .../omegaWallFunctionFvPatchScalarField.C              | 10 +++++-----
 .../epsilonWallFunctionFvPatchScalarField.C            | 10 +++++-----
 .../omegaWallFunctionFvPatchScalarField.C              | 10 +++++-----
 .../epsilonWallFunctionFvPatchScalarField.C            | 10 +++++-----
 .../omegaWallFunctionFvPatchScalarField.C              | 10 +++++-----
 6 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
index 226d6ab39d6..2513312e2e1 100644
--- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
@@ -96,11 +96,6 @@ void epsilonWallFunctionFvPatchScalarField::setMaster()
 
 void epsilonWallFunctionFvPatchScalarField::createAveragingWeights()
 {
-    if (initialised_)
-    {
-        return;
-    }
-
     const volScalarField& epsilon =
         static_cast<const volScalarField&>(this->dimensionedInternalField());
 
@@ -108,6 +103,11 @@ void epsilonWallFunctionFvPatchScalarField::createAveragingWeights()
 
     const fvMesh& mesh = epsilon.mesh();
 
+    if (initialised_ && !mesh.changing())
+    {
+        return;
+    }
+
     volScalarField weights
     (
         IOobject
diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
index 375d4c6c449..c8f8b93fc62 100644
--- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
@@ -98,11 +98,6 @@ void omegaWallFunctionFvPatchScalarField::setMaster()
 
 void omegaWallFunctionFvPatchScalarField::createAveragingWeights()
 {
-    if (initialised_)
-    {
-        return;
-    }
-
     const volScalarField& omega =
         static_cast<const volScalarField&>(this->dimensionedInternalField());
 
@@ -110,6 +105,11 @@ void omegaWallFunctionFvPatchScalarField::createAveragingWeights()
 
     const fvMesh& mesh = omega.mesh();
 
+    if (initialised_ && !mesh.changing())
+    {
+        return;
+    }
+
     volScalarField weights
     (
         IOobject
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
index b0899d12f6e..1bf17b6fad6 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
@@ -98,11 +98,6 @@ void epsilonWallFunctionFvPatchScalarField::setMaster()
 
 void epsilonWallFunctionFvPatchScalarField::createAveragingWeights()
 {
-    if (initialised_)
-    {
-        return;
-    }
-
     const volScalarField& epsilon =
         static_cast<const volScalarField&>(this->dimensionedInternalField());
 
@@ -110,6 +105,11 @@ void epsilonWallFunctionFvPatchScalarField::createAveragingWeights()
 
     const fvMesh& mesh = epsilon.mesh();
 
+    if (initialised_ && !mesh.changing())
+    {
+        return;
+    }
+
     volScalarField weights
     (
         IOobject
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
index 4fa243302b1..89d4782aa3b 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
@@ -100,11 +100,6 @@ void omegaWallFunctionFvPatchScalarField::setMaster()
 
 void omegaWallFunctionFvPatchScalarField::createAveragingWeights()
 {
-    if (initialised_)
-    {
-        return;
-    }
-
     const volScalarField& omega =
         static_cast<const volScalarField&>(this->dimensionedInternalField());
 
@@ -112,6 +107,11 @@ void omegaWallFunctionFvPatchScalarField::createAveragingWeights()
 
     const fvMesh& mesh = omega.mesh();
 
+    if (initialised_ && !mesh.changing())
+    {
+        return;
+    }
+
     volScalarField weights
     (
         IOobject
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
index 9a8841f7849..2437271e266 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
@@ -98,11 +98,6 @@ void epsilonWallFunctionFvPatchScalarField::setMaster()
 
 void epsilonWallFunctionFvPatchScalarField::createAveragingWeights()
 {
-    if (initialised_)
-    {
-        return;
-    }
-
     const volScalarField& epsilon =
         static_cast<const volScalarField&>(this->dimensionedInternalField());
 
@@ -110,6 +105,11 @@ void epsilonWallFunctionFvPatchScalarField::createAveragingWeights()
 
     const fvMesh& mesh = epsilon.mesh();
 
+    if (initialised_ && !mesh.changing())
+    {
+        return;
+    }
+
     volScalarField weights
     (
         IOobject
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
index 066f03a0b7c..ebc195ece68 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
@@ -100,11 +100,6 @@ void omegaWallFunctionFvPatchScalarField::setMaster()
 
 void omegaWallFunctionFvPatchScalarField::createAveragingWeights()
 {
-    if (initialised_)
-    {
-        return;
-    }
-
     const volScalarField& omega =
         static_cast<const volScalarField&>(this->dimensionedInternalField());
 
@@ -112,6 +107,11 @@ void omegaWallFunctionFvPatchScalarField::createAveragingWeights()
 
     const fvMesh& mesh = omega.mesh();
 
+    if (initialised_ && !mesh.changing())
+    {
+        return;
+    }
+
     volScalarField weights
     (
         IOobject
-- 
GitLab