From bd7ace5b2e0aa2764aefff9c2913c6d0dc5229be Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 3 Aug 2009 15:26:41 +0100 Subject: [PATCH 1/5] added updated() check --- .../mutkWallFunction/mutkWallFunctionFvPatchScalarField.C | 5 +++++ .../nutkWallFunction/nutkWallFunctionFvPatchScalarField.C | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C index b7580a5d7a..5ab8324cda 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C @@ -191,6 +191,11 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField void mutkWallFunctionFvPatchScalarField::updateCoeffs() { + if (updated()) + { + return; + } + operator==(calcMut()); fixedValueFvPatchScalarField::updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C index 722016a2e7..dbb07712d8 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -200,6 +200,11 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField void nutkWallFunctionFvPatchScalarField::updateCoeffs() { + if (updated()) + { + return; + } + operator==(calcNut()); fixedValueFvPatchScalarField::updateCoeffs(); From f6ba88b32cc82140ffc055c89aa059f2c6455b20 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 3 Aug 2009 15:29:14 +0100 Subject: [PATCH 2/5] using neater writeEntryIfDifferent syntax --- .../buoyantPressureFvPatchScalarField.C | 2 +- .../flowRateInletVelocityFvPatchVectorField.C | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C index 12544a105f..a6ae6f1ee6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C @@ -136,7 +136,7 @@ void buoyantPressureFvPatchScalarField::updateCoeffs() void buoyantPressureFvPatchScalarField::write(Ostream& os) const { fixedGradientFvPatchScalarField::write(os); - os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; + writeEntryIfDifferent(os, "rho", "rho", rhoName_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index 5cc373e78d..2da4d21c66 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -159,14 +159,8 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchField::write(os); os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl; - if (phiName_ != "phi") - { - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; - } - if (rhoName_ != "rho") - { - os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; - } + writeEntryIfDifferent(os, "phi", "phi", phiName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); writeEntry("value", os); } From 53e81535d8319097c942b2dd27a3a261b29f8f4a Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 3 Aug 2009 15:43:45 +0100 Subject: [PATCH 3/5] added updated() check and calling ancestor updateCoeffs() --- .../alphatWallFunctionFvPatchScalarField.C | 7 +++++++ .../epsilonWallFunctionFvPatchScalarField.C | 7 +++++++ .../omegaWallFunctionFvPatchScalarField.C | 7 +++++++ .../epsilonWallFunctionFvPatchScalarField.C | 7 +++++++ .../omegaWallFunctionFvPatchScalarField.C | 7 +++++++ 5 files changed, 35 insertions(+) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C index ad2115cdb1..dbc93fc8cb 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C @@ -111,10 +111,17 @@ alphatWallFunctionFvPatchScalarField void alphatWallFunctionFvPatchScalarField::updateCoeffs() { + if (updated()) + { + return; + } + const scalarField& mutw = patch().lookupPatchField(mutName_); operator==(mutw/Prt_); + + fixedValueFvPatchScalarField::updateCoeffs(); } 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 dc6f2a3644..4a2b5b6d31 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -169,6 +169,11 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField void epsilonWallFunctionFvPatchScalarField::updateCoeffs() { + if (updated()) + { + return; + } + const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar Cmu25 = pow(Cmu_, 0.25); @@ -224,6 +229,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() } } + fixedInternalValueFvPatchField::updateCoeffs(); + // TODO: perform averaging for cells sharing more than one boundary face } 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 f377694b21..84ac6ba060 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -169,6 +169,11 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField void omegaWallFunctionFvPatchScalarField::updateCoeffs() { + if (updated()) + { + return; + } + const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()]; @@ -222,6 +227,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() } } + fixedInternalValueFvPatchField::updateCoeffs(); + // TODO: perform averaging for cells sharing more than one boundary face } 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 93cad8188c..96815c3931 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -164,6 +164,11 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField void epsilonWallFunctionFvPatchScalarField::updateCoeffs() { + if (updated()) + { + return; + } + const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()]; @@ -213,6 +218,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() } } + fixedInternalValueFvPatchField::updateCoeffs(); + // TODO: perform averaging for cells sharing more than one boundary face } 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 300b0aaf4f..105ee1de71 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -164,6 +164,11 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField void omegaWallFunctionFvPatchScalarField::updateCoeffs() { + if (updated()) + { + return; + } + const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar yPlusLam = rasModel.yPlusLam(kappa_, E_); const scalarField& y = rasModel.y()[patch().index()]; @@ -212,6 +217,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() } } + fixedInternalValueFvPatchField::updateCoeffs(); + // TODO: perform averaging for cells sharing more than one boundary face } From 3945ff97b1a0f03da5a80785bc6c1050b3719692 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 3 Aug 2009 15:55:33 +0100 Subject: [PATCH 4/5] renamed LES nuSgs/muSgs BCs to mirror RAS convention --- .../compressible/LES/Make/files | 2 +- ...USpaldingWallFunctionFvPatchScalarField.C} | 29 +++++++------ ...USpaldingWallFunctionFvPatchScalarField.H} | 43 +++++++++---------- .../incompressible/LES/Make/files | 2 +- ...USpaldingWallFunctionFvPatchScalarField.C} | 34 +++++++-------- ...USpaldingWallFunctionFvPatchScalarField.H} | 43 +++++++++---------- 6 files changed, 76 insertions(+), 77 deletions(-) rename src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/{muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C => muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C} (86%) rename src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/{muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H => muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.H} (76%) rename src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/{nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C => nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C} (85%) rename src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/{nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H => nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.H} (76%) diff --git a/src/turbulenceModels/compressible/LES/Make/files b/src/turbulenceModels/compressible/LES/Make/files index 331f60eb87..27beea2967 100644 --- a/src/turbulenceModels/compressible/LES/Make/files +++ b/src/turbulenceModels/compressible/LES/Make/files @@ -15,7 +15,7 @@ vanDriestDelta/vanDriestDelta.C wallFunctions=derivedFvPatchFields/wallFunctions muSgsWallFunctions=$(wallFunctions)/muSgsWallFunctions -$(muSgsWallFunctions)/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C +$(muSgsWallFunctions)/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C alphaSgsWallFunctions=$(wallFunctions)/alphaSgsWallFunctions $(alphaSgsWallFunctions)/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C similarity index 86% rename from src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C rename to src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C index c31ac8815c..18c25ca90a 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "muSgsWallFunctionFvPatchScalarField.H" +#include "muSgsUSpaldingWallFunctionFvPatchScalarField.H" #include "LESModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" @@ -41,7 +41,8 @@ namespace LESModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField +muSgsUSpaldingWallFunctionFvPatchScalarField:: +muSgsUSpaldingWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF @@ -56,9 +57,10 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField {} -muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField +muSgsUSpaldingWallFunctionFvPatchScalarField:: +muSgsUSpaldingWallFunctionFvPatchScalarField ( - const muSgsWallFunctionFvPatchScalarField& ptf, + const muSgsUSpaldingWallFunctionFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper @@ -73,7 +75,8 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField {} -muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField +muSgsUSpaldingWallFunctionFvPatchScalarField:: +muSgsUSpaldingWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -89,9 +92,10 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField {} -muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField +muSgsUSpaldingWallFunctionFvPatchScalarField:: +muSgsUSpaldingWallFunctionFvPatchScalarField ( - const muSgsWallFunctionFvPatchScalarField& mwfpsf + const muSgsUSpaldingWallFunctionFvPatchScalarField& mwfpsf ) : fixedValueFvPatchScalarField(mwfpsf), @@ -103,9 +107,10 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField {} -muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField +muSgsUSpaldingWallFunctionFvPatchScalarField:: +muSgsUSpaldingWallFunctionFvPatchScalarField ( - const muSgsWallFunctionFvPatchScalarField& mwfpsf, + const muSgsUSpaldingWallFunctionFvPatchScalarField& mwfpsf, const DimensionedField& iF ) : @@ -120,7 +125,7 @@ muSgsWallFunctionFvPatchScalarField::muSgsWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void muSgsWallFunctionFvPatchScalarField::evaluate +void muSgsUSpaldingWallFunctionFvPatchScalarField::evaluate ( const Pstream::commsTypes ) @@ -190,7 +195,7 @@ void muSgsWallFunctionFvPatchScalarField::evaluate } -void muSgsWallFunctionFvPatchScalarField::write(Ostream& os) const +void muSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); writeEntryIfDifferent(os, "U", "U", UName_); @@ -207,7 +212,7 @@ void muSgsWallFunctionFvPatchScalarField::write(Ostream& os) const makePatchTypeField ( fvPatchScalarField, - muSgsWallFunctionFvPatchScalarField + muSgsUSpaldingWallFunctionFvPatchScalarField ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.H similarity index 76% rename from src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H rename to src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.H index 38f20535d3..9dbe8f0443 100644 --- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsWallFunction/muSgsWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.H @@ -24,18 +24,19 @@ License Class Foam::compressible::LESModels:: - muSgsWallFunctionFvPatchScalarField + muSgsUSpaldingWallFunctionFvPatchScalarField Description - Spalart Allmaas wall function boundary condition for compressible flows + Wall function boundary condition for walls, based on velocity, using + Spaldings law to give a continuous muSgs profile to the wall (y+ = 0). SourceFiles - muSgsWallFunctionFvPatchScalarField.C + muSgsUSpaldingWallFunctionFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef muSgsWallFunctionFvPatchScalarField_H -#define muSgsWallFunctionFvPatchScalarField_H +#ifndef muSgsUSpaldingWallFunctionFvPatchScalarField_H +#define muSgsUSpaldingWallFunctionFvPatchScalarField_H #include "fixedValueFvPatchFields.H" @@ -49,10 +50,10 @@ namespace LESModels { /*---------------------------------------------------------------------------*\ - Class muSgsWallFunctionFvPatchScalarField Declaration + Class muSgsUSpaldingWallFunctionFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class muSgsWallFunctionFvPatchScalarField +class muSgsUSpaldingWallFunctionFvPatchScalarField : public fixedValueFvPatchScalarField { @@ -77,20 +78,20 @@ class muSgsWallFunctionFvPatchScalarField public: //- Runtime type information - TypeName("muSgsWallFunction"); + TypeName("muSgsUSpaldingWallFunction"); // Constructors //- Construct from patch and internal field - muSgsWallFunctionFvPatchScalarField + muSgsUSpaldingWallFunctionFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - muSgsWallFunctionFvPatchScalarField + muSgsUSpaldingWallFunctionFvPatchScalarField ( const fvPatch&, const DimensionedField&, @@ -98,20 +99,20 @@ public: ); //- Construct by mapping given - // muSgsWallFunctionFvPatchScalarField + // muSgsUSpaldingWallFunctionFvPatchScalarField // onto a new patch - muSgsWallFunctionFvPatchScalarField + muSgsUSpaldingWallFunctionFvPatchScalarField ( - const muSgsWallFunctionFvPatchScalarField&, + const muSgsUSpaldingWallFunctionFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - muSgsWallFunctionFvPatchScalarField + muSgsUSpaldingWallFunctionFvPatchScalarField ( - const muSgsWallFunctionFvPatchScalarField& + const muSgsUSpaldingWallFunctionFvPatchScalarField& ); //- Construct and return a clone @@ -119,14 +120,14 @@ public: { return tmp ( - new muSgsWallFunctionFvPatchScalarField(*this) + new muSgsUSpaldingWallFunctionFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - muSgsWallFunctionFvPatchScalarField + muSgsUSpaldingWallFunctionFvPatchScalarField ( - const muSgsWallFunctionFvPatchScalarField&, + const muSgsUSpaldingWallFunctionFvPatchScalarField&, const DimensionedField& ); @@ -138,11 +139,7 @@ public: { return tmp ( - new muSgsWallFunctionFvPatchScalarField - ( - *this, - iF - ) + new muSgsUSpaldingWallFunctionFvPatchScalarField(*this, iF) ); } diff --git a/src/turbulenceModels/incompressible/LES/Make/files b/src/turbulenceModels/incompressible/LES/Make/files index 186324fde3..dae51c090a 100644 --- a/src/turbulenceModels/incompressible/LES/Make/files +++ b/src/turbulenceModels/incompressible/LES/Make/files @@ -32,7 +32,7 @@ kOmegaSSTSAS/kOmegaSSTSAS.C wallFunctions=derivedFvPatchFields/wallFunctions nuSgsWallFunctions=$(wallFunctions)/nuSgsWallFunctions -$(nuSgsWallFunctions)/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C +$(nuSgsWallFunctions)/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libincompressibleLESModels diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C similarity index 85% rename from src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C rename to src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C index 1d66afbc65..cde42da5f3 100644 --- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "nuSgsWallFunctionFvPatchScalarField.H" +#include "nuSgsUSpaldingWallFunctionFvPatchScalarField.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -40,8 +40,8 @@ namespace LESModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -nuSgsWallFunctionFvPatchScalarField:: -nuSgsWallFunctionFvPatchScalarField +nuSgsUSpaldingWallFunctionFvPatchScalarField:: +nuSgsUSpaldingWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF @@ -55,10 +55,10 @@ nuSgsWallFunctionFvPatchScalarField {} -nuSgsWallFunctionFvPatchScalarField:: -nuSgsWallFunctionFvPatchScalarField +nuSgsUSpaldingWallFunctionFvPatchScalarField:: +nuSgsUSpaldingWallFunctionFvPatchScalarField ( - const nuSgsWallFunctionFvPatchScalarField& ptf, + const nuSgsUSpaldingWallFunctionFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper @@ -72,8 +72,8 @@ nuSgsWallFunctionFvPatchScalarField {} -nuSgsWallFunctionFvPatchScalarField:: -nuSgsWallFunctionFvPatchScalarField +nuSgsUSpaldingWallFunctionFvPatchScalarField:: +nuSgsUSpaldingWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -88,10 +88,10 @@ nuSgsWallFunctionFvPatchScalarField {} -nuSgsWallFunctionFvPatchScalarField:: -nuSgsWallFunctionFvPatchScalarField +nuSgsUSpaldingWallFunctionFvPatchScalarField:: +nuSgsUSpaldingWallFunctionFvPatchScalarField ( - const nuSgsWallFunctionFvPatchScalarField& nwfpsf + const nuSgsUSpaldingWallFunctionFvPatchScalarField& nwfpsf ) : fixedValueFvPatchScalarField(nwfpsf), @@ -102,10 +102,10 @@ nuSgsWallFunctionFvPatchScalarField {} -nuSgsWallFunctionFvPatchScalarField:: -nuSgsWallFunctionFvPatchScalarField +nuSgsUSpaldingWallFunctionFvPatchScalarField:: +nuSgsUSpaldingWallFunctionFvPatchScalarField ( - const nuSgsWallFunctionFvPatchScalarField& nwfpsf, + const nuSgsUSpaldingWallFunctionFvPatchScalarField& nwfpsf, const DimensionedField& iF ) : @@ -119,7 +119,7 @@ nuSgsWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void nuSgsWallFunctionFvPatchScalarField::evaluate +void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate ( const Pstream::commsTypes ) @@ -183,7 +183,7 @@ void nuSgsWallFunctionFvPatchScalarField::evaluate } -void nuSgsWallFunctionFvPatchScalarField::write(Ostream& os) const +void nuSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); writeEntryIfDifferent(os, "U", "U", UName_); @@ -199,7 +199,7 @@ void nuSgsWallFunctionFvPatchScalarField::write(Ostream& os) const makePatchTypeField ( fvPatchScalarField, - nuSgsWallFunctionFvPatchScalarField + nuSgsUSpaldingWallFunctionFvPatchScalarField ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.H similarity index 76% rename from src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H rename to src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.H index d1dbeb5fc9..2d122bacac 100644 --- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsWallFunction/nuSgsWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.H @@ -24,18 +24,19 @@ License Class Foam::incompressible::LESModels:: - nuSgsWallFunctionFvPatchScalarField + nuSgsUSpaldingWallFunctionFvPatchScalarField Description - Spalart Allmaras wall function boundary condition for incompressible flows + Wall function boundary condition for walls, based on velocity, using + Spaldings law to give a continuous nuSgs profile to the wall (y+ = 0) SourceFiles - nuSgsWallFunctionFvPatchScalarField.C + nuSgsUSpaldingWallFunctionFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef nuSgsWallFunctionFvPatchScalarField_H -#define nuSgsWallFunctionFvPatchScalarField_H +#ifndef nuSgsUSpaldingWallFunctionFvPatchScalarField_H +#define nuSgsUSpaldingWallFunctionFvPatchScalarField_H #include "fixedValueFvPatchFields.H" @@ -49,10 +50,10 @@ namespace LESModels { /*---------------------------------------------------------------------------*\ - Class nuSgsWallFunctionFvPatchScalarField Declaration + Class nuSgsUSpaldingWallFunctionFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class nuSgsWallFunctionFvPatchScalarField +class nuSgsUSpaldingWallFunctionFvPatchScalarField : public fixedValueFvPatchScalarField { @@ -74,20 +75,20 @@ class nuSgsWallFunctionFvPatchScalarField public: //- Runtime type information - TypeName("nuSgsWallFunction"); + TypeName("nuSgsUSpaldingWallFunction"); // Constructors //- Construct from patch and internal field - nuSgsWallFunctionFvPatchScalarField + nuSgsUSpaldingWallFunctionFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - nuSgsWallFunctionFvPatchScalarField + nuSgsUSpaldingWallFunctionFvPatchScalarField ( const fvPatch&, const DimensionedField&, @@ -95,20 +96,20 @@ public: ); //- Construct by mapping given - // nuSgsWallFunctionFvPatchScalarField + // nuSgsUSpaldingWallFunctionFvPatchScalarField // onto a new patch - nuSgsWallFunctionFvPatchScalarField + nuSgsUSpaldingWallFunctionFvPatchScalarField ( - const nuSgsWallFunctionFvPatchScalarField&, + const nuSgsUSpaldingWallFunctionFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - nuSgsWallFunctionFvPatchScalarField + nuSgsUSpaldingWallFunctionFvPatchScalarField ( - const nuSgsWallFunctionFvPatchScalarField& + const nuSgsUSpaldingWallFunctionFvPatchScalarField& ); //- Construct and return a clone @@ -116,14 +117,14 @@ public: { return tmp ( - new nuSgsWallFunctionFvPatchScalarField(*this) + new nuSgsUSpaldingWallFunctionFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - nuSgsWallFunctionFvPatchScalarField + nuSgsUSpaldingWallFunctionFvPatchScalarField ( - const nuSgsWallFunctionFvPatchScalarField&, + const nuSgsUSpaldingWallFunctionFvPatchScalarField&, const DimensionedField& ); @@ -135,11 +136,7 @@ public: { return tmp ( - new nuSgsWallFunctionFvPatchScalarField - ( - *this, - iF - ) + new nuSgsUSpaldingWallFunctionFvPatchScalarField(*this, iF) ); } From 8336c33aa2c410d5d80007883f54fe12d4aa9496 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 3 Aug 2009 18:58:17 +0100 Subject: [PATCH 5/5] added reading of kappa on dictionary read --- .../incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C | 1 + .../incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C | 1 + .../incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C | 1 + 3 files changed, 3 insertions(+) diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index 7230b20dc9..33cdeec360 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -293,6 +293,7 @@ bool LaunderGibsonRSTM::read() if (RASModel::read()) { Cmu_.readIfPresent(coeffDict()); + kappa_.readIfPresent(coeffDict()); Clg1_.readIfPresent(coeffDict()); Clg2_.readIfPresent(coeffDict()); C1_.readIfPresent(coeffDict()); diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C index 50a9aecf89..7e9a54bfd8 100644 --- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C @@ -241,6 +241,7 @@ bool LienLeschzinerLowRe::read() sigmak_.readIfPresent(coeffDict()); sigmaEps_.readIfPresent(coeffDict()); Cmu_.readIfPresent(coeffDict()); + kappa_.readIfPresent(coeffDict()); Am_.readIfPresent(coeffDict()); Aepsilon_.readIfPresent(coeffDict()); Amu_.readIfPresent(coeffDict()); diff --git a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C index 009d87b295..1cc7867625 100644 --- a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -335,6 +335,7 @@ bool SpalartAllmaras::read() if (RASModel::read()) { sigmaNut_.readIfPresent(coeffDict()); + kappa_.readIfPresent(coeffDict()); Cb1_.readIfPresent(coeffDict()); Cb2_.readIfPresent(coeffDict());