From c29b9fc023a3b803c4b8267c30246f55c8e5b551 Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Tue, 11 Jun 2013 11:17:08 +0100
Subject: [PATCH] ENH: Updated wall function update when applying external
 weights (e.g. ACMI)

---
 .../epsilonWallFunctionFvPatchScalarField.C                    | 3 +++
 .../omegaWallFunction/omegaWallFunctionFvPatchScalarField.C    | 3 +++
 .../epsilonWallFunctionFvPatchScalarField.C                    | 3 +++
 .../omegaWallFunction/omegaWallFunctionFvPatchScalarField.C    | 3 +++
 4 files changed, 12 insertions(+)

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 1b3e4ce3d14..3f1ab4a2c22 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
@@ -464,6 +464,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs
 
     FieldType& epsilon = const_cast<FieldType&>(dimensionedInternalField());
 
+    scalarField& epsilonf = *this;
+
     // only set the values if the weights are < 1 - tolerance
     forAll(weights, faceI)
     {
@@ -475,6 +477,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs
 
             G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI];
             epsilon[cellI] = w*epsilon[cellI] + (1.0 - w)*epsilon0[cellI];
+            epsilonf[faceI] = epsilon[cellI];
         }
     }
 
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 929ca245982..2f4e11dc20f 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
@@ -481,6 +481,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs
 
     FieldType& omega = const_cast<FieldType&>(dimensionedInternalField());
 
+    scalarField& omegaf = *this;
+
     // only set the values if the weights are < 1 - tolerance
     forAll(weights, faceI)
     {
@@ -492,6 +494,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs
 
             G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI];
             omega[cellI] = w*omega[cellI] + (1.0 - w)*omega0[cellI];
+            omegaf[faceI] = omega[cellI];
         }
     }
 
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 7fb6fcfb96e..dc08123d264 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
@@ -464,6 +464,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs
 
     FieldType& epsilon = const_cast<FieldType&>(dimensionedInternalField());
 
+    scalarField& epsilonf = *this;
+
     // only set the values if the weights are < 1 - tolerance
     forAll(weights, faceI)
     {
@@ -475,6 +477,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs
 
             G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI];
             epsilon[cellI] = w*epsilon[cellI] + (1.0 - w)*epsilon0[cellI];
+            epsilonf[faceI] = epsilon[cellI];
         }
     }
 
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 6b8504a4e9b..69f8ffd1705 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
@@ -479,6 +479,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs
 
     FieldType& omega = const_cast<FieldType&>(dimensionedInternalField());
 
+    scalarField& omegaf = *this;
+
     // only set the values if the weights are < 1 - tolerance
     forAll(weights, faceI)
     {
@@ -490,6 +492,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs
 
             G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI];
             omega[cellI] = w*omega[cellI] + (1.0 - w)*omega0[cellI];
+            omegaf[faceI] = omega[cellI];
         }
     }
 
-- 
GitLab