From bbea318a26ab817a6607e2327dc75daf3519f5b2 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Sun, 20 Mar 2011 22:03:20 +0000 Subject: [PATCH] Added zero gradient evaluation of wall function fields when called in absence of G --- .../epsilonWallFunctionFvPatchScalarField.C | 9 +++++++++ .../omegaWallFunctionFvPatchScalarField.C | 9 +++++++++ .../epsilonWallFunctionFvPatchScalarField.C | 9 +++++++++ .../omegaWallFunctionFvPatchScalarField.C | 9 +++++++++ 4 files changed, 36 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 d4176e8d8..1eb15e12a 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -174,6 +174,15 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() return; } + // If G field is not present, execute zero gradient evaluation + // HJ, 20/Mar/2011 + if (!db().foundObject(GName_)) + { + zeroGradientFvPatchScalarField::updateCoeffs(); + + return; + } + const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar Cmu25 = pow(Cmu_, 0.25); 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 44998e87b..7c108671e 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -179,6 +179,15 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() return; } + // If G field is not present, execute zero gradient evaluation + // HJ, 20/Mar/2011 + if (!db().foundObject(GName_)) + { + zeroGradientFvPatchScalarField::evaluate(); + + return; + } + const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()]; 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 c62b0999a..925fa660f 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -169,6 +169,15 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() return; } + // If G field is not present, execute zero gradient evaluation + // HJ, 20/Mar/2011 + if (!db().foundObject(GName_)) + { + zeroGradientFvPatchScalarField::evaluate(); + + return; + } + const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()]; 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 c07f7b835..db039e559 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -174,6 +174,15 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() return; } + // If G field is not present, execute zero gradient evaluation + // HJ, 20/Mar/2011 + if (!db().foundObject(GName_)) + { + zeroGradientFvPatchScalarField::evaluate(); + + return; + } + const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()];