diff --git a/src/turbulenceModels/compressible/RAS/Make/files b/src/turbulenceModels/compressible/RAS/Make/files index 4e034aed4..af0c5cd7f 100644 --- a/src/turbulenceModels/compressible/RAS/Make/files +++ b/src/turbulenceModels/compressible/RAS/Make/files @@ -17,13 +17,17 @@ alphatWallFunctions = $(wallFunctions)/alphatWallFunctions $(alphatWallFunctions)/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C mutWallFunctions = $(wallFunctions)/mutWallFunctions -$(mutWallFunctions)/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C $(mutWallFunctions)/mutWallFunction/mutWallFunctionFvPatchScalarField.C -$(mutWallFunctions)/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C -$(mutWallFunctions)/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C $(mutWallFunctions)/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C $(mutWallFunctions)/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C -$(mutWallFunctions)/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C +$(mutWallFunctions)/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C + +backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions $(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -42,6 +46,4 @@ derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupl derivedFvPatchFields/turbulentTemperatureCoupledBaffle/regionProperties.C derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C -backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C - LIB = $(FOAM_LIBBIN)/libcompressibleRASModels diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C index 740cbbc39..d44323d31 100644 --- a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C +++ b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C @@ -27,7 +27,7 @@ License #include "calculatedFvPatchField.H" #include "alphatWallFunctionFvPatchScalarField.H" -#include "mutWallFunctionFvPatchScalarField.H" +#include "mutkWallFunctionFvPatchScalarField.H" #include "mutLowReWallFunctionFvPatchScalarField.H" #include "epsilonWallFunctionFvPatchScalarField.H" #include "kqRWallFunctionFvPatchField.H" @@ -158,7 +158,7 @@ tmp autoCreateMut if (bm[patchI].isWall()) { mutBoundaryTypes[patchI] = - RASModels::mutWallFunctionFvPatchScalarField::typeName; + RASModels::mutkWallFunctionFvPatchScalarField::typeName; } else { diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C index d168dc8ca..2f8ed30f5 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C @@ -100,6 +100,25 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp mutLowReWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchI = patch().index(); + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField& muw = turbModel.mu().boundaryField()[patchI]; + const scalarField& rhow = turbModel.rho().boundaryField()[patchI]; + + const scalarField nuw = muw/rhow; + + return y*sqrt(nuw*mag(Uw.snGrad()))/nuw; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H index 3172b8d8a..7b8bfebf9 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H @@ -28,7 +28,19 @@ Description Boundary condition for turbulent (kinematic) viscosity when for use with low Reynolds number models. - Sets mut to zero, and provides an access to calculate y+. + Sets mut to zero, and provides an access function to calculate y+. + +Usage + Example of the boundary condition specification: + \verbatim + + { + type mutLowReWallFunction; + } + \endverbatim + +See also + Foam::nutWallFunctionFvPatchScalarField SourceFiles mutLowReWallFunctionFvPatchScalarField.C @@ -59,7 +71,7 @@ class mutLowReWallFunctionFvPatchScalarField { protected: - // Private member functions + // Protected Member Functions //- Calculate the turbulence viscosity virtual tmp calcMut() const; @@ -132,6 +144,12 @@ public: new mutLowReWallFunctionFvPatchScalarField(*this, iF) ); } + + + // Member functions + + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; }; diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C index af629f461..444722bbc 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C @@ -38,171 +38,6 @@ namespace compressible namespace RASModels { -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -tmp -mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus -( - const scalarField& magUp -) const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI]; - - tmp tyPlus(new scalarField(patch().size(), 0.0)); - scalarField& yPlus = tyPlus(); - - if (roughnessHeight_ > 0.0) - { - // Rough Walls - const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_; - static const scalar c_2 = 2.25/(90 - 2.25); - static const scalar c_3 = 2.0*atan(1.0)/log(90/2.25); - static const scalar c_4 = c_3*log(2.25); - - //if (KsPlusBasedOnYPlus_) - { - // If KsPlus is based on YPlus the extra term added to the law - // of the wall will depend on yPlus - forAll(yPlus, facei) - { - const scalar magUpara = magUp[facei]; - const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei]; - const scalar kappaRe = kappa_*Re; - - scalar yp = yPlusLam_; - const scalar ryPlusLam = 1.0/yp; - - int iter = 0; - scalar yPlusLast = 0.0; - scalar dKsPlusdYPlus = roughnessHeight_/y[facei]; - - // Enforce the roughnessHeight to be less than the distance to - // the first cell centre. - if (dKsPlusdYPlus > 1) - { - dKsPlusdYPlus = 1; - } - - // Additional tuning parameter (fudge factor) - nominally = 1 - dKsPlusdYPlus *= roughnessFudgeFactor_; - - do - { - yPlusLast = yp; - - // The non-dimensional roughness height - scalar KsPlus = yp*dKsPlusdYPlus; - - // The extra term in the law-of-the-wall - scalar G = 0.0; - - scalar yPlusGPrime = 0.0; - - if (KsPlus >= 90) - { - const scalar t_1 = 1 + roughnessConstant_*KsPlus; - G = log(t_1); - yPlusGPrime = roughnessConstant_*KsPlus/t_1; - } - else if (KsPlus > 2.25) - { - const scalar t_1 = c_1*KsPlus - c_2; - const scalar t_2 = c_3*log(KsPlus) - c_4; - const scalar sint_2 = sin(t_2); - const scalar logt_1 = log(t_1); - G = logt_1*sint_2; - yPlusGPrime = - (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); - } - - scalar denom = 1.0 + log(E_*yp) - G - yPlusGPrime; - if (mag(denom) > VSMALL) - { - yp = (kappaRe + yp*(1 - yPlusGPrime))/denom; - } - - } while - ( - mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 - && ++iter < 10 - && yp > VSMALL - ); - - yPlus[facei] = max(0.0, yp); - } - } - } - else - { - // Smooth Walls - forAll(yPlus, facei) - { - const scalar magUpara = magUp[facei]; - const scalar Re = rho[facei]*magUpara*y[facei]/muw[facei]; - const scalar kappaRe = kappa_*Re; - - scalar yp = yPlusLam_; - const scalar ryPlusLam = 1.0/yp; - - int iter = 0; - scalar yPlusLast = 0.0; - - do - { - yPlusLast = yp; - yp = (kappaRe + yp)/(1.0 + log(E_*yp)); - - } while - ( - mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 - && ++iter < 10 - ); - - yPlus[facei] = max(0.0, yp); - } - } - - return tyPlus; -} - - -tmp -mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcMut() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI]; - - scalarField magUp = mag(Uw.patchInternalField() - Uw); - - tmp tyPlus = calcYPlus(magUp); - scalarField& yPlus = tyPlus(); - - tmp tmutw(new scalarField(patch().size(), 0.0)); - scalarField& mutw = tmutw(); - - forAll(yPlus, facei) - { - if (yPlus[facei] > yPlusLam_) - { - const scalar Re = rho[facei]*magUp[facei]*y[facei]/muw[facei]; - mutw[facei] = muw[facei]*(sqr(yPlus[facei])/Re - 1); - } - } - - return tmutw; -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: @@ -212,10 +47,7 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const DimensionedField& iF ) : - mutWallFunctionFvPatchScalarField(p, iF), - roughnessHeight_(pTraits::zero), - roughnessConstant_(pTraits::zero), - roughnessFudgeFactor_(pTraits::zero) + mutURoughWallFunctionFvPatchScalarField(p, iF) {} @@ -228,10 +60,7 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper), - roughnessHeight_(ptf.roughnessHeight_), - roughnessConstant_(ptf.roughnessConstant_), - roughnessFudgeFactor_(ptf.roughnessFudgeFactor_) + mutURoughWallFunctionFvPatchScalarField(ptf, p, iF, mapper) {} @@ -243,10 +72,7 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const dictionary& dict ) : - mutWallFunctionFvPatchScalarField(p, iF, dict), - roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), - roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), - roughnessFudgeFactor_(readScalar(dict.lookup("roughnessFudgeFactor"))) + mutURoughWallFunctionFvPatchScalarField(p, iF, dict) {} @@ -256,10 +82,7 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& rwfpsf ) : - mutWallFunctionFvPatchScalarField(rwfpsf), - roughnessHeight_(rwfpsf.roughnessHeight_), - roughnessConstant_(rwfpsf.roughnessConstant_), - roughnessFudgeFactor_(rwfpsf.roughnessFudgeFactor_) + mutURoughWallFunctionFvPatchScalarField(rwfpsf) {} @@ -270,44 +93,10 @@ mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const DimensionedField& iF ) : - mutWallFunctionFvPatchScalarField(rwfpsf, iF), - roughnessHeight_(rwfpsf.roughnessHeight_), - roughnessConstant_(rwfpsf.roughnessConstant_), - roughnessFudgeFactor_(rwfpsf.roughnessFudgeFactor_) + mutURoughWallFunctionFvPatchScalarField(rwfpsf, iF) {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp -mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::yPlus() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - - return calcYPlus(magUp); -} - - -void mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write -( - Ostream& os -) const -{ - fixedValueFvPatchScalarField::write(os); - writeLocalEntries(os); - os.writeKeyword("roughnessHeight") - << roughnessHeight_ << token::END_STATEMENT << nl; - os.writeKeyword("roughnessConstant") - << roughnessConstant_ << token::END_STATEMENT << nl; - os.writeKeyword("roughnessFudgeFactor") - << roughnessFudgeFactor_ << token::END_STATEMENT << nl; -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H index 422069855..ba2e5d934 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardRoughWallFunction/mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H @@ -26,7 +26,9 @@ Class mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField Description - Wall function boundary condition for rough walls + This boundary condition is the same as mutURoughWallFunction. We will simply + derive from mutURoughWallFunctionFvPatchScalarField to enable backward + compatibility. SourceFiles mutSpalartAllamarasStandardWallFunctionFvPatchScalarField.C @@ -36,7 +38,7 @@ SourceFiles #ifndef compressibleMutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H #define compressibleMutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H -#include "mutWallFunctionFvPatchScalarField.H" +#include "mutURoughWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,33 +55,8 @@ Class mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField Declaration class mutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField : - public mutWallFunctionFvPatchScalarField + public mutURoughWallFunctionFvPatchScalarField { -protected: - - // Protected data - - // Roughness parameters - - //- Height - scalar roughnessHeight_; - - //- Constant - scalar roughnessConstant_; - - //- Scale factor - scalar roughnessFudgeFactor_; - - - // Protected member functions - - //- Calculate yPLus - virtual tmp calcYPlus(const scalarField& magUp) const; - - //- Calculate the turbulence viscosity - virtual tmp calcMut() const; - - public: //- Runtime type information @@ -154,60 +131,6 @@ public: ) ); } - - - // Member functions - - // Access - - //- Return the roughness height scale - const scalar& roughnessHeight() const - { - return roughnessHeight_; - } - - //- Return reference to the roughness height to allow adjustment - scalar& roughnessHeight() - { - return roughnessHeight_; - } - - //- Return the roughness constant scale - const scalar& roughnessConstant() const - { - return roughnessConstant_; - } - - //- Return reference to the roughness constant to allow adjustment - scalar& roughnessConstant() - { - return roughnessConstant_; - } - - //- Return the roughness scale factor - const scalar& roughnessFudgeFactor() const - { - return roughnessFudgeFactor_; - } - - //- Return reference to the roughness scale factor to allow - // adjustment - scalar& roughnessFudgeFactor() - { - return roughnessFudgeFactor_; - } - - - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; - - - // I-O - - //- Write - virtual void write(Ostream& os) const; }; diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C index 41d26a229..ea4638fd8 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -38,77 +38,6 @@ namespace compressible namespace RASModels { -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -tmp -mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcYPlus -( - const scalarField& magUp -) const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const fvPatchScalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI]; - - tmp tyPlus(new scalarField(patch().size(), 0.0)); - scalarField& yPlus = tyPlus(); - - forAll(yPlus, faceI) - { - scalar kappaRe = kappa_*magUp[faceI]*y[faceI]/(muw[faceI]/rhow[faceI]); - - scalar yp = yPlusLam_; - scalar ryPlusLam = 1.0/yp; - - int iter = 0; - scalar yPlusLast = 0.0; - - do - { - yPlusLast = yp; - yp = (kappaRe + yp)/(1.0 + log(E_*yp)); - - } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.01 && ++iter < 10); - - yPlus[faceI] = max(0.0, yp); - } - - return tyPlus; -} - - -tmp -mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcMut() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI]; - - tmp tyPlus = calcYPlus(magUp); - scalarField& yPlus = tyPlus(); - - tmp tmutw(new scalarField(patch().size(), 0.0)); - scalarField& mutw = tmutw(); - - forAll(yPlus, faceI) - { - if (yPlus[faceI] > yPlusLam_) - { - mutw[faceI] = - muw[faceI]*(yPlus[faceI]*kappa_/log(E_*yPlus[faceI]) - 1.0); - } - } - - return tmutw; -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: @@ -118,7 +47,19 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField const DimensionedField& iF ) : - mutWallFunctionFvPatchScalarField(p, iF) + mutUWallFunctionFvPatchScalarField(p, iF) +{} + + +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: +mutSpalartAllmarasStandardWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + mutUWallFunctionFvPatchScalarField(p, iF, dict) {} @@ -131,19 +72,7 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) -{} - - -mutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: -mutSpalartAllmarasStandardWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - mutWallFunctionFvPatchScalarField(p, iF, dict) + mutUWallFunctionFvPatchScalarField(ptf, p, iF, mapper) {} @@ -153,7 +82,7 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField const mutSpalartAllmarasStandardWallFunctionFvPatchScalarField& sawfpsf ) : - mutWallFunctionFvPatchScalarField(sawfpsf) + mutUWallFunctionFvPatchScalarField(sawfpsf) {} @@ -164,37 +93,10 @@ mutSpalartAllmarasStandardWallFunctionFvPatchScalarField const DimensionedField& iF ) : - mutWallFunctionFvPatchScalarField(sawfpsf, iF) + mutUWallFunctionFvPatchScalarField(sawfpsf, iF) {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp -mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::yPlus() const -{ - const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - - return calcYPlus(magUp); -} - - -void mutSpalartAllmarasStandardWallFunctionFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchField::write(os); - writeLocalEntries(os); - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - makePatchTypeField ( fvPatchScalarField, diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H index c397104e2..30a78664a 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasStandardWallFunction/mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H @@ -26,7 +26,9 @@ Class mutSpalartAllmarasStandardWallFunctionFvPatchScalarField Description - Wall function boundary condition for walls + This boundary condition is the same as mutUWallFunction. We will simply + derive from nutUWallFunctionFvPatchScalarField to enable backward + compatibility. SourceFiles mutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -36,7 +38,7 @@ SourceFiles #ifndef compressibleMutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H #define compressibleMutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H -#include "mutWallFunctionFvPatchScalarField.H" +#include "mutUWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,19 +55,8 @@ namespace RASModels class mutSpalartAllmarasStandardWallFunctionFvPatchScalarField : - public mutWallFunctionFvPatchScalarField + public mutUWallFunctionFvPatchScalarField { -protected: - - // Protected member functions - - //- Calculate yPLus - virtual tmp calcYPlus(const scalarField& magUp) const; - - //- Calculate the turbulence viscosity - virtual tmp calcMut() const; - - public: //- Runtime type information @@ -140,20 +131,6 @@ public: ) ); } - - - // Member functions - - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; - - - // I-O - - //- Write - virtual void write(Ostream& os) const; }; diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C index abee7fc8d..319e9174d 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -40,24 +40,46 @@ namespace RASModels // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // +tmp +mutSpalartAllmarasWallFunctionFvPatchScalarField::calcMut() const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField magGradU = mag(Uw.snGrad()); + const scalarField& rhow = turbModel.rho().boundaryField()[patchI]; + const scalarField& muw = turbModel.mu().boundaryField()[patchI]; + + return max + ( + 0.0, + rhow*sqr(calcUTau(magGradU))/(magGradU + ROOTVSMALL) - muw + ); +} + + tmp mutSpalartAllmarasWallFunctionFvPatchScalarField::calcUTau ( const scalarField& magGradU ) const { - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patch().index()]; + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; const fvPatchVectorField& Uw = - rasModel.U().boundaryField()[patch().index()]; + turbModel.U().boundaryField()[patchI]; + const scalarField magUp = mag(Uw.patchInternalField() - Uw); - scalarField magUp = mag(Uw.patchInternalField() - Uw); + const fvPatchScalarField& rhow = turbModel.rho().boundaryField()[patchI]; - const fvPatchScalarField& rhow = - rasModel.rho().boundaryField()[patch().index()]; - - const fvPatchScalarField& muw = - rasModel.mu().boundaryField()[patch().index()]; + const fvPatchScalarField& muw = turbModel.mu().boundaryField()[patchI]; const scalarField& mutw = *this; tmp tuTau(new scalarField(patch().size(), 0.0)); @@ -65,32 +87,32 @@ tmp mutSpalartAllmarasWallFunctionFvPatchScalarField::calcUTau forAll(mutw, faceI) { - scalar magUpara = magUp[faceI]; + const scalar& magUpara = magUp[faceI]; scalar ut = sqrt((mutw[faceI] + muw[faceI])*magGradU[faceI]/rhow[faceI]); if (ut > VSMALL) { - int iter = 0; + label iter = 0; scalar err = GREAT; do { - scalar kUu = min(kappa_*magUpara/ut, 50); - scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); + const scalar kUu = min(kappa_*magUpara/ut, 50); + const scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); - scalar f = + const scalar f = - ut*y[faceI]/(muw[faceI]/rhow[faceI]) + magUpara/ut + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); - scalar df = + const scalar df = y[faceI]/(muw[faceI]/rhow[faceI]) + magUpara/sqr(ut) + 1/E_*kUu*fkUu/ut; - scalar uTauNew = ut + f/df; + const scalar uTauNew = ut + f/df; err = mag((ut - uTauNew)/ut); ut = uTauNew; @@ -104,25 +126,6 @@ tmp mutSpalartAllmarasWallFunctionFvPatchScalarField::calcUTau } -tmp -mutSpalartAllmarasWallFunctionFvPatchScalarField::calcMut() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()); - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - - return max - ( - scalar(0), - rhow*sqr(calcUTau(magGradU))/(magGradU + ROOTVSMALL) - muw - ); -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // mutSpalartAllmarasWallFunctionFvPatchScalarField:: @@ -136,6 +139,18 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField {} +mutSpalartAllmarasWallFunctionFvPatchScalarField:: +mutSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + mutWallFunctionFvPatchScalarField(p, iF, dict) +{} + + mutSpalartAllmarasWallFunctionFvPatchScalarField:: mutSpalartAllmarasWallFunctionFvPatchScalarField ( @@ -149,18 +164,6 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField {} -mutSpalartAllmarasWallFunctionFvPatchScalarField:: -mutSpalartAllmarasWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - mutWallFunctionFvPatchScalarField(p, iF, dict) -{} - - mutSpalartAllmarasWallFunctionFvPatchScalarField:: mutSpalartAllmarasWallFunctionFvPatchScalarField ( @@ -189,30 +192,25 @@ mutSpalartAllmarasWallFunctionFvPatchScalarField::yPlus() const { const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField& rhow = turbModel.rho().boundaryField()[patchI]; + const scalarField& muw = turbModel.mu().boundaryField()[patchI]; return y*calcUTau(mag(Uw.snGrad()))/(muw/rhow); } -void mutSpalartAllmarasWallFunctionFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchField::write(os); - writeLocalEntries(os); - writeEntry("value", os); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, mutSpalartAllmarasWallFunctionFvPatchScalarField); +makePatchTypeField +( + fvPatchScalarField, + mutSpalartAllmarasWallFunctionFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H index d5e3c4991..bab1098a8 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutSpalartAllmarasWallFunction/mutSpalartAllmarasWallFunctionFvPatchScalarField.H @@ -141,12 +141,6 @@ public: //- Calculate and return the yPlus at the boundary virtual tmp yPlus() const; - - - // I-O - - //- Write - virtual void write(Ostream& os) const; }; diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C new file mode 100644 index 000000000..f1dfe3585 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,316 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "mutURoughWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp mutURoughWallFunctionFvPatchScalarField::calcYPlus +( + const scalarField& magUp +) const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const scalarField& muw = turbModel.mu().boundaryField()[patchI]; + const fvPatchScalarField& rho = turbModel.rho().boundaryField()[patchI]; + + tmp tyPlus(new scalarField(patch().size(), 0.0)); + scalarField& yPlus = tyPlus(); + + if (roughnessHeight_ > 0.0) + { + // Rough Walls + const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_; + static const scalar c_2 = 2.25/(90 - 2.25); + static const scalar c_3 = 2.0*atan(1.0)/log(90/2.25); + static const scalar c_4 = c_3*log(2.25); + + //if (KsPlusBasedOnYPlus_) + { + // If KsPlus is based on YPlus the extra term added to the law + // of the wall will depend on yPlus + forAll(yPlus, faceI) + { + const scalar magUpara = magUp[faceI]; + const scalar Re = rho[faceI]*magUpara*y[faceI]/muw[faceI]; + const scalar kappaRe = kappa_*Re; + + scalar yp = yPlusLam_; + const scalar ryPlusLam = 1.0/yp; + + label iter = 0; + scalar yPlusLast = 0.0; + scalar dKsPlusdYPlus = roughnessHeight_/y[faceI]; + + // Enforce the roughnessHeight to be less than the distance to + // the first cell centre. + if (dKsPlusdYPlus > 1) + { + dKsPlusdYPlus = 1; + } + + // Additional tuning parameter (fudge factor) - nominally = 1 + dKsPlusdYPlus *= roughnessFactor_; + + do + { + yPlusLast = yp; + + // The non-dimensional roughness height + scalar KsPlus = yp*dKsPlusdYPlus; + + // The extra term in the law-of-the-wall + scalar G = 0.0; + + scalar yPlusGPrime = 0.0; + + if (KsPlus >= 90) + { + const scalar t_1 = 1 + roughnessConstant_*KsPlus; + G = log(t_1); + yPlusGPrime = roughnessConstant_*KsPlus/t_1; + } + else if (KsPlus > 2.25) + { + const scalar t_1 = c_1*KsPlus - c_2; + const scalar t_2 = c_3*log(KsPlus) - c_4; + const scalar sint_2 = sin(t_2); + const scalar logt_1 = log(t_1); + G = logt_1*sint_2; + yPlusGPrime = + (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); + } + + scalar denom = 1.0 + log(E_*yp) - G - yPlusGPrime; + if (mag(denom) > VSMALL) + { + yp = (kappaRe + yp*(1 - yPlusGPrime))/denom; + } + } while + ( + mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 + && ++iter < 10 + && yp > VSMALL + ); + + yPlus[faceI] = max(0.0, yp); + } + } + } + else + { + // Smooth Walls + forAll(yPlus, faceI) + { + const scalar magUpara = magUp[faceI]; + const scalar Re = rho[faceI]*magUpara*y[faceI]/muw[faceI]; + const scalar kappaRe = kappa_*Re; + + scalar yp = yPlusLam_; + const scalar ryPlusLam = 1.0/yp; + + label iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yp; + yp = (kappaRe + yp)/(1.0 + log(E_*yp)); + + } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10); + + yPlus[faceI] = max(0.0, yp); + } + } + + return tyPlus; +} + + +tmp mutURoughWallFunctionFvPatchScalarField::calcMut() const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField& muw = turbModel.mu().boundaryField()[patchI]; + const fvPatchScalarField& rho = turbModel.rho().boundaryField()[patchI]; + + // The flow velocity at the adjacent cell centre + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + + tmp tyPlus = calcYPlus(magUp); + const scalarField& yPlus = tyPlus(); + + tmp tmutw(new scalarField(patch().size(), 0.0)); + scalarField& mutw = tmutw(); + + forAll(yPlus, faceI) + { + if (yPlus[faceI] > yPlusLam_) + { + const scalar Re = rho[faceI]*magUp[faceI]*y[faceI]/muw[faceI] + ROOTVSMALL; + mutw[faceI] = muw[faceI]*(sqr(yPlus[faceI])/Re - 1); + } + } + + return tmutw; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + mutWallFunctionFvPatchScalarField(p, iF), + roughnessHeight_(0.0), + roughnessConstant_(0.0), + roughnessFactor_(0.0) +{} + + +mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField +( + const mutURoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + roughnessHeight_(ptf.roughnessHeight_), + roughnessConstant_(ptf.roughnessConstant_), + roughnessFactor_(ptf.roughnessFactor_) +{} + + +mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + mutWallFunctionFvPatchScalarField(p, iF, dict), + roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), + roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), + roughnessFactor_(readScalar(dict.lookup("roughnessFactor"))) +{} + + +mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField +( + const mutURoughWallFunctionFvPatchScalarField& rwfpsf +) +: + mutWallFunctionFvPatchScalarField(rwfpsf), + roughnessHeight_(rwfpsf.roughnessHeight_), + roughnessConstant_(rwfpsf.roughnessConstant_), + roughnessFactor_(rwfpsf.roughnessFactor_) +{} + + +mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField +( + const mutURoughWallFunctionFvPatchScalarField& rwfpsf, + const DimensionedField& iF +) +: + mutWallFunctionFvPatchScalarField(rwfpsf, iF), + roughnessHeight_(rwfpsf.roughnessHeight_), + roughnessConstant_(rwfpsf.roughnessConstant_), + roughnessFactor_(rwfpsf.roughnessFactor_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp mutURoughWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField magUp = mag(Uw.patchInternalField() - Uw); + + return calcYPlus(magUp); +} + + +void mutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + mutWallFunctionFvPatchScalarField::write(os); + writeLocalEntries(os); + os.writeKeyword("roughnessHeight") + << roughnessHeight_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessConstant") + << roughnessConstant_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessFactor") + << roughnessFactor_ << token::END_STATEMENT << nl; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + mutURoughWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H new file mode 100644 index 000000000..3f5eb4cf0 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,237 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + Foam::compressible::RASModels::mutURoughWallFunctionFvPatchScalarField + +Description + This boundary condition provides a turbulent (dynamic) viscosity condition + when using wall functions for rough walls, based on velocity. + +Usage + \table + Property | Description | Required | Default value + roughnessHeight | roughness height | yes | + roughnessConstant | roughness constanr | yes | + roughnessFactor | scaling factor | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + + { + type mutURoughWallFunction; + roughnessHeight 1e-5; + roughnessConstant 0.5; + roughnessFactor 1; + } + \endverbatim + +See also + Foam::mutWallFunctionFvPatchScalarField + +SourceFiles + mutURoughWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef mutURoughWallFunctionFvPatchScalarField_H +#define mutURoughWallFunctionFvPatchScalarField_H + +#include "mutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class mutURoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class mutURoughWallFunctionFvPatchScalarField +: + public mutWallFunctionFvPatchScalarField +{ + // Private Data + + // Roughness model parameters + + //- Height + scalar roughnessHeight_; + + //- Constant + scalar roughnessConstant_; + + //- Scale factor + scalar roughnessFactor_; + + + // Protected Member Functions + + //- Calculate yPLus + virtual tmp calcYPlus(const scalarField& magUp) const; + + //- Calculate the turbulence viscosity + virtual tmp calcMut() const; + + +public: + + //- Runtime type information + TypeName("mutURoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + mutURoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + mutURoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // mutURoughWallFunctionFvPatchScalarField + // onto a new patch + mutURoughWallFunctionFvPatchScalarField + ( + const mutURoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + mutURoughWallFunctionFvPatchScalarField + ( + const mutURoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new mutURoughWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + mutURoughWallFunctionFvPatchScalarField + ( + const mutURoughWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new mutURoughWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the roughness height scale + const scalar& roughnessHeight() const + { + return roughnessHeight_; + } + + //- Return reference to the roughness height to allow adjustment + scalar& roughnessHeight() + { + return roughnessHeight_; + } + + //- Return the roughness constant scale + const scalar& roughnessConstant() const + { + return roughnessConstant_; + } + + //- Return reference to the roughness constant to allow adjustment + scalar& roughnessConstant() + { + return roughnessConstant_; + } + + //- Return the roughness scale factor + const scalar& roughnessFudgeFactor() const + { + return roughnessFactor_; + } + + //- Return reference to the roughness scale factor to allow + // adjustment + scalar& roughnessFactor() + { + return roughnessFactor_; + } + + + // Evaluation functions + + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; + + + // I-O + + //- Write + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C new file mode 100644 index 000000000..a48f49d7f --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C @@ -0,0 +1,194 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "mutUWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp mutUWallFunctionFvPatchScalarField::calcYPlus +( + const scalarField& magUp +) const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const fvPatchScalarField& rhow = turbModel.rho().boundaryField()[patchI]; + const fvPatchScalarField& muw = turbModel.mu().boundaryField()[patchI]; + + tmp tyPlus(new scalarField(patch().size(), 0.0)); + scalarField& yPlus = tyPlus(); + + forAll(yPlus, faceI) + { + const scalar kappaRe = + kappa_*magUp[faceI]*y[faceI]/(muw[faceI]/rhow[faceI]); + + scalar yp = yPlusLam_; + const scalar ryPlusLam = 1.0/yp; + + label iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yp; + yp = (kappaRe + yp)/(1.0 + log(E_*yp)); + + } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.01 && ++iter < 10); + + yPlus[faceI] = max(0.0, yp); + } + + return tyPlus; +} + + +tmp mutUWallFunctionFvPatchScalarField::calcMut() const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const fvPatchScalarField& muw = turbModel.mu().boundaryField()[patchI]; + + tmp tyPlus = calcYPlus(magUp); + scalarField& yPlus = tyPlus(); + + tmp tmutw(new scalarField(patch().size(), 0.0)); + scalarField& mutw = tmutw(); + + forAll(yPlus, faceI) + { + if (yPlus[faceI] > yPlusLam_) + { + mutw[faceI] = + muw[faceI]*(yPlus[faceI]*kappa_/log(E_*yPlus[faceI]) - 1.0); + } + } + + return tmutw; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + mutWallFunctionFvPatchScalarField(p, iF) +{} + + +mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + mutWallFunctionFvPatchScalarField(p, iF, dict) +{} + + +mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField +( + const mutUWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} + + +mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField +( + const mutUWallFunctionFvPatchScalarField& wfpsf +) +: + mutWallFunctionFvPatchScalarField(wfpsf) +{} + + +mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField +( + const mutUWallFunctionFvPatchScalarField& wfpsf, + const DimensionedField& iF +) +: + mutWallFunctionFvPatchScalarField(wfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp mutUWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchI = patch().index(); + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + + return calcYPlus(magUp); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, mutUWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H new file mode 100644 index 000000000..6024a3b72 --- /dev/null +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H @@ -0,0 +1,168 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + Foam::compressible::RASModels::mutkWallFunctionFvPatchScalarField + +Description + Boundary condition for turbulent (dynamic) viscosity when using wall + functions, based on velocity. + - replicates OpenFOAM v1.5 (and earlier) behaviour + +Usage + Example of the boundary condition specification: + \verbatim + + { + type mutUWallFunction; + } + \endverbatim + +See also + Foam::mutWallFunctionFvPatchScalarField + +SourceFiles + mutUWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef mutUWallFunctionFvPatchScalarField_H +#define mutUWallFunctionFvPatchScalarField_H + +#include "mutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class mutUWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class mutUWallFunctionFvPatchScalarField +: + public mutWallFunctionFvPatchScalarField +{ +protected: + + // Protected Member Functions + + //- Calculate yPLus. Helper function + tmp calcYPlus(const scalarField& magUp) const; + + //- Calculate the turbulence viscosity + virtual tmp calcMut() const; + + +public: + + //- Runtime type information + TypeName("mutUWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + mutUWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + mutUWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // mutUWallFunctionFvPatchScalarField + // onto a new patch + mutUWallFunctionFvPatchScalarField + ( + const mutUWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + mutUWallFunctionFvPatchScalarField + ( + const mutUWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new mutUWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + mutUWallFunctionFvPatchScalarField + ( + const mutUWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new mutUWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C index e776365dd..68a6cfcb1 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C @@ -38,13 +38,15 @@ namespace compressible namespace RASModels { +defineTypeNameAndDebug(mutWallFunctionFvPatchScalarField, 0); + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void mutWallFunctionFvPatchScalarField::checkType() { if (!patch().isWall()) { - FatalErrorIn("mutWallFunctionFvPatchScalarField::checkType()") + FatalErrorIn(this->type() + "FvPatchScalarField::checkType()") << "Invalid wall function specification" << nl << " Patch type for patch " << patch().name() << " must be wall" << nl @@ -62,7 +64,7 @@ scalar mutWallFunctionFvPatchScalarField::calcYPlusLam { scalar ypl = 11.0; - for (int i=0; i<10; i++) + for (label i = 0; i < 10; ++i) { ypl = log(E*ypl)/kappa; } @@ -71,38 +73,6 @@ scalar mutWallFunctionFvPatchScalarField::calcYPlusLam } -tmp mutWallFunctionFvPatchScalarField::calcMut() const -{ - const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - - const scalar Cmu25 = pow(Cmu_, 0.25); - - tmp tmutw(new scalarField(patch().size(), 0.0)); - scalarField& mutw = tmutw(); - - forAll(mutw, faceI) - { - label faceCellI = patch().faceCells()[faceI]; - - scalar yPlus = - Cmu25*y[faceI]*sqrt(k[faceCellI])/(muw[faceI]/rhow[faceI]); - - if (yPlus > yPlusLam_) - { - mutw[faceI] = muw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1); - } - } - - return tmutw; -} - - void mutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; @@ -124,7 +94,26 @@ mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField kappa_(0.41), E_(9.8), yPlusLam_(calcYPlusLam(kappa_, E_)) -{} +{ + checkType(); +} + + +mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + Cmu_(dict.lookupOrDefault("Cmu", 0.09)), + kappa_(dict.lookupOrDefault("kappa", 0.41)), + E_(dict.lookupOrDefault("E", 9.8)), + yPlusLam_(calcYPlusLam(kappa_, E_)) +{ + checkType(); +} mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField @@ -140,22 +129,9 @@ mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField kappa_(ptf.kappa_), E_(ptf.E_), yPlusLam_(ptf.yPlusLam_) -{} - - -mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF, dict), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)), - yPlusLam_(calcYPlusLam(kappa_, E_)) -{} +{ + checkType(); +} mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField @@ -168,7 +144,9 @@ mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField kappa_(wfpsf.kappa_), E_(wfpsf.E_), yPlusLam_(wfpsf.yPlusLam_) -{} +{ + checkType(); +} mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField @@ -182,36 +160,26 @@ mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField kappa_(wfpsf.kappa_), E_(wfpsf.E_), yPlusLam_(wfpsf.yPlusLam_) -{} +{ + checkType(); +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void mutWallFunctionFvPatchScalarField::updateCoeffs() { + if (updated()) + { + return; + } + operator==(calcMut()); fixedValueFvPatchScalarField::updateCoeffs(); } -tmp mutWallFunctionFvPatchScalarField::yPlus() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField kwc = k.boundaryField()[patchI].patchInternalField(); - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; - - return pow(Cmu_, 0.25)*y*sqrt(kwc)/(muw/rhow); -} - - void mutWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); @@ -220,10 +188,6 @@ void mutWallFunctionFvPatchScalarField::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, mutWallFunctionFvPatchScalarField); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace RASModels diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H index 8b71c3957..aac8b6eb8 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H @@ -25,8 +25,8 @@ Class Foam::compressible::RASModels::mutWallFunctionFvPatchScalarField Description - Boundary condition for turbulent (kinematic) viscosity when using wall - functions + Abstract base class for boundary condition for turbulent (dynamic) + viscosity when using wall functions - replicates OpenFOAM v1.5 (and earlier) behaviour SourceFiles @@ -73,7 +73,7 @@ protected: scalar yPlusLam_; - // Protected member functions + // Protected Member Functions //- Check the type of the patch virtual void checkType(); @@ -82,7 +82,7 @@ protected: virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const; //- Calculate the turbulence viscosity - virtual tmp calcMut() const; + virtual tmp calcMut() const = 0; //- Write local wall function variables virtual void writeLocalEntries(Ostream&) const; @@ -128,15 +128,6 @@ public: const mutWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new mutWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference mutWallFunctionFvPatchScalarField ( @@ -144,25 +135,13 @@ public: const DimensionedField& ); - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new mutWallFunctionFvPatchScalarField(*this, iF) - ); - } - // Member functions // Evaluation functions //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; + virtual tmp yPlus() const = 0; //- Update the coefficients associated with the patch field virtual void updateCoeffs(); diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C similarity index 63% rename from src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C rename to src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C index fe81d6ec2..aa8abab2a 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "mutRoughWallFunctionFvPatchScalarField.H" +#include "mutkRoughWallFunctionFvPatchScalarField.H" #include "RASModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" @@ -38,10 +38,9 @@ namespace compressible namespace RASModels { - // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -scalar mutRoughWallFunctionFvPatchScalarField::fnRough +scalar mutkRoughWallFunctionFvPatchScalarField::fnRough ( const scalar KsPlus, const scalar Cs @@ -64,38 +63,46 @@ scalar mutRoughWallFunctionFvPatchScalarField::fnRough } -tmp mutRoughWallFunctionFvPatchScalarField::calcMut() const +tmp mutkRoughWallFunctionFvPatchScalarField::calcMut() const { const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); - const scalar Cmu25 = pow(Cmu_, 0.25); + const scalarField& y = turbModel.y()[patchI]; + const scalarField& rhow = turbModel.rho().boundaryField()[patchI]; + const tmp tk = turbModel.k(); + const volScalarField& k = tk(); + const scalarField& muw = turbModel.mu().boundaryField()[patchI]; + + const scalar Cmu25 = pow025(Cmu_); tmp tmutw(new scalarField(*this)); scalarField& mutw = tmutw(); + const unallocLabelList& fc = patch().faceCells(); + forAll(mutw, faceI) { - label faceCellI = patch().faceCells()[faceI]; + const label faceCellI = fc[faceI]; - scalar uStar = Cmu25*sqrt(k[faceCellI]); - - scalar yPlus = uStar*y[faceI]/(muw[faceI]/rhow[faceI]); - - scalar KsPlus = uStar*Ks_[faceI]/(muw[faceI]/rhow[faceI]); + const scalar uStar = Cmu25*sqrt(k[faceCellI]); + const scalar yPlus = uStar*y[faceI]/(muw[faceI]/rhow[faceI]); + const scalar KsPlus = uStar*Ks_[faceI]/(muw[faceI]/rhow[faceI]); scalar Edash = E_; scalar yPlusLamNew = yPlusLam_; if (KsPlus > 2.25) { Edash /= fnRough(KsPlus, Cs_[faceI]); - yPlusLamNew = rasModel.yPlusLam(kappa_, Edash); + yPlusLamNew = turbModel.yPlusLam(kappa_, Edash); + } + + if (yPlus > yPlusLamNew) + { + mutw[faceI] = + muw[faceI]*(yPlus*kappa_/log(max(Edash*yPlus, 1 + 1e-4)) - 1); } if (debug) @@ -104,14 +111,9 @@ tmp mutRoughWallFunctionFvPatchScalarField::calcMut() const << ", KsPlus = " << KsPlus << ", Edash = " << Edash << ", yPlusLam = " << yPlusLam_ + << ", mutw = " << mutw[faceI] << endl; } - - if (yPlus > yPlusLamNew) - { - mutw[faceI] = - muw[faceI]*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1); - } } return tmutw; @@ -120,63 +122,63 @@ tmp mutRoughWallFunctionFvPatchScalarField::calcMut() const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -mutRoughWallFunctionFvPatchScalarField::mutRoughWallFunctionFvPatchScalarField +mutkRoughWallFunctionFvPatchScalarField::mutkRoughWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF ) : - mutWallFunctionFvPatchScalarField(p, iF), + mutkWallFunctionFvPatchScalarField(p, iF), Ks_(p.size(), 0.0), Cs_(p.size(), 0.0) {} -mutRoughWallFunctionFvPatchScalarField::mutRoughWallFunctionFvPatchScalarField +mutkRoughWallFunctionFvPatchScalarField::mutkRoughWallFunctionFvPatchScalarField ( - const mutRoughWallFunctionFvPatchScalarField& ptf, + const mutkRoughWallFunctionFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper ) : - mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), Ks_(ptf.Ks_, mapper), Cs_(ptf.Cs_, mapper) {} -mutRoughWallFunctionFvPatchScalarField::mutRoughWallFunctionFvPatchScalarField +mutkRoughWallFunctionFvPatchScalarField::mutkRoughWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : - mutWallFunctionFvPatchScalarField(p, iF, dict), + mutkWallFunctionFvPatchScalarField(p, iF, dict), Ks_("Ks", dict, p.size()), Cs_("Cs", dict, p.size()) {} -mutRoughWallFunctionFvPatchScalarField::mutRoughWallFunctionFvPatchScalarField +mutkRoughWallFunctionFvPatchScalarField::mutkRoughWallFunctionFvPatchScalarField ( - const mutRoughWallFunctionFvPatchScalarField& rwfpsf + const mutkRoughWallFunctionFvPatchScalarField& rwfpsf ) : - mutWallFunctionFvPatchScalarField(rwfpsf), + mutkWallFunctionFvPatchScalarField(rwfpsf), Ks_(rwfpsf.Ks_), Cs_(rwfpsf.Cs_) {} -mutRoughWallFunctionFvPatchScalarField::mutRoughWallFunctionFvPatchScalarField +mutkRoughWallFunctionFvPatchScalarField::mutkRoughWallFunctionFvPatchScalarField ( - const mutRoughWallFunctionFvPatchScalarField& rwfpsf, + const mutkRoughWallFunctionFvPatchScalarField& rwfpsf, const DimensionedField& iF ) : - mutWallFunctionFvPatchScalarField(rwfpsf, iF), + mutkWallFunctionFvPatchScalarField(rwfpsf, iF), Ks_(rwfpsf.Ks_), Cs_(rwfpsf.Cs_) {} @@ -184,34 +186,34 @@ mutRoughWallFunctionFvPatchScalarField::mutRoughWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void mutRoughWallFunctionFvPatchScalarField::autoMap +void mutkRoughWallFunctionFvPatchScalarField::autoMap ( const fvPatchFieldMapper& m ) { - mutWallFunctionFvPatchScalarField::autoMap(m); + mutkWallFunctionFvPatchScalarField::autoMap(m); Ks_.autoMap(m); Cs_.autoMap(m); } -void mutRoughWallFunctionFvPatchScalarField::rmap +void mutkRoughWallFunctionFvPatchScalarField::rmap ( const fvPatchScalarField& ptf, const labelList& addr ) { - mutWallFunctionFvPatchScalarField::rmap(ptf, addr); + mutkWallFunctionFvPatchScalarField::rmap(ptf, addr); - const mutRoughWallFunctionFvPatchScalarField& nrwfpsf = - refCast(ptf); + const mutkRoughWallFunctionFvPatchScalarField& nrwfpsf = + refCast(ptf); - Cs_.rmap(nrwfpsf.Cs_, addr); Ks_.rmap(nrwfpsf.Ks_, addr); + Cs_.rmap(nrwfpsf.Cs_, addr); } -void mutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const +void mutkRoughWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); writeLocalEntries(os); @@ -223,7 +225,7 @@ void mutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, mutRoughWallFunctionFvPatchScalarField); +makePatchTypeField(fvPatchScalarField, mutkRoughWallFunctionFvPatchScalarField); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.H similarity index 70% rename from src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H rename to src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.H index 26d3ce1bb..a1a293e33 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.H @@ -22,10 +22,10 @@ License along with foam-extend. If not, see . Class - Foam::compressible::RASModels::mutRoughWallFunctionFvPatchScalarField + Foam::compressible::RASModels::mutkRoughWallFunctionFvPatchScalarField Description - Boundary condition for turbulent (kinematic) viscosity when using wall + Boundary condition for turbulent (dynamic) viscosity when using wall functions for rough walls. Manipulates the E parameter to account for roughness effects, based on @@ -34,15 +34,32 @@ Description - roughness height = sand-grain roughness (0 for smooth walls) - roughness constant = 0.5-1.0 (0.5 default) +Usage + \table + Property | Description | Required | Default value + Ks | sand-grain roughness height | yes | + Cs | roughness constant | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + + { + type mutkRoughWallFunction; + Ks uniform 0; + Cs uniform 0.5; + } + \endverbatim + SourceFiles - mutRoughWallFunctionFvPatchScalarField.C + mutkRoughWallFunctionFvPatchScalarField.C \*---------------------------------------------------------------------------*/ #ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H #define compressibleMutRoughWallFunctionFvPatchScalarField_H -#include "mutWallFunctionFvPatchScalarField.H" +#include "mutkWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,12 +71,12 @@ namespace RASModels { /*---------------------------------------------------------------------------*\ - Class mutRoughWallFunctionFvPatchScalarField Declaration + Class mutkRoughWallFunctionFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class mutRoughWallFunctionFvPatchScalarField +class mutkRoughWallFunctionFvPatchScalarField : - public mutWallFunctionFvPatchScalarField + public mutkWallFunctionFvPatchScalarField { protected: @@ -72,7 +89,7 @@ protected: scalarField Cs_; - // Private member functions + // Protected Member Functions //- Compute the roughness function virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const; @@ -84,20 +101,20 @@ protected: public: //- Runtime type information - TypeName("mutRoughWallFunction"); + TypeName("mutkRoughWallFunction"); // Constructors //- Construct from patch and internal field - mutRoughWallFunctionFvPatchScalarField + mutkRoughWallFunctionFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - mutRoughWallFunctionFvPatchScalarField + mutkRoughWallFunctionFvPatchScalarField ( const fvPatch&, const DimensionedField&, @@ -105,20 +122,20 @@ public: ); //- Construct by mapping given - // mutRoughWallFunctionFvPatchScalarField + // mutkRoughWallFunctionFvPatchScalarField // onto a new patch - mutRoughWallFunctionFvPatchScalarField + mutkRoughWallFunctionFvPatchScalarField ( - const mutRoughWallFunctionFvPatchScalarField&, + const mutkRoughWallFunctionFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - mutRoughWallFunctionFvPatchScalarField + mutkRoughWallFunctionFvPatchScalarField ( - const mutRoughWallFunctionFvPatchScalarField& + const mutkRoughWallFunctionFvPatchScalarField& ); //- Construct and return a clone @@ -126,14 +143,14 @@ public: { return tmp ( - new mutRoughWallFunctionFvPatchScalarField(*this) + new mutkRoughWallFunctionFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - mutRoughWallFunctionFvPatchScalarField + mutkRoughWallFunctionFvPatchScalarField ( - const mutRoughWallFunctionFvPatchScalarField&, + const mutkRoughWallFunctionFvPatchScalarField&, const DimensionedField& ); @@ -145,20 +162,32 @@ public: { return tmp ( - new mutRoughWallFunctionFvPatchScalarField(*this, iF) + new mutkRoughWallFunctionFvPatchScalarField(*this, iF) ); } // Member functions + // Acces functions + + // Return Ks + scalarField& Ks() + { + return Ks_; + } + + // Return Cs + scalarField& Cs() + { + return Cs_; + } + + // Mapping functions //- Map (and resize as needed) from self given a mapping object - virtual void autoMap - ( - const fvPatchFieldMapper& - ); + virtual void autoMap(const fvPatchFieldMapper&); //- Reverse map the given fvPatchField onto this fvPatchField virtual void rmap 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 7505476c0..378ff0ec3 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C @@ -40,63 +40,37 @@ namespace RASModels // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void mutkWallFunctionFvPatchScalarField::checkType() -{ - if (!patch().isWall()) - { - FatalErrorIn("mutkWallFunctionFvPatchScalarField::checkType()") - << "Invalid wall function specification" << nl - << " Patch type for patch " << patch().name() - << " must be wall" << nl - << " Current patch type is " << patch().type() << nl << endl - << abort(FatalError); - } -} - - -scalar mutkWallFunctionFvPatchScalarField::calcYPlusLam -( - const scalar kappa, - const scalar E -) const -{ - scalar ypl = 11.0; - - for (int i=0; i<10; i++) - { - ypl = log(E*ypl)/kappa; - } - - return ypl; -} - - tmp mutkWallFunctionFvPatchScalarField::calcMut() const { - const label patchi = patch().index(); + const label patchI = patch().index(); + const turbulenceModel& turbModel = db().lookupObject("turbulenceModel"); - const scalarField& y = turbModel.y()[patchi]; - const scalarField& rhow = turbModel.rho().boundaryField()[patchi]; + + const scalarField& y = turbModel.y()[patchI]; + const scalarField& rhow = turbModel.rho().boundaryField()[patchI]; const tmp tk = turbModel.k(); const volScalarField& k = tk(); - const scalarField& muw = turbModel.mu().boundaryField()[patchi]; + const scalarField& muw = turbModel.mu().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); tmp tmutw(new scalarField(patch().size(), 0.0)); scalarField& mutw = tmutw(); + // Get face cells + const unallocLabelList& fc = patch().faceCells(); + forAll(mutw, faceI) { - label faceCellI = patch().faceCells()[faceI]; + const label faceCellI = fc[faceI]; - scalar yPlus = + const scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/(muw[faceI]/rhow[faceI]); if (yPlus > yPlusLam_) { - mutw[faceI] = muw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1); + mutw[faceI] = muw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1.0); } } @@ -104,14 +78,6 @@ tmp mutkWallFunctionFvPatchScalarField::calcMut() const } -void mutkWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const -{ - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField @@ -120,11 +86,18 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF), - Cmu_(0.09), - kappa_(0.41), - E_(9.8), - yPlusLam_(calcYPlusLam(kappa_, E_)) + mutWallFunctionFvPatchScalarField(p, iF) +{} + + +mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + mutWallFunctionFvPatchScalarField(p, iF, dict) {} @@ -136,26 +109,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper), - Cmu_(ptf.Cmu_), - kappa_(ptf.kappa_), - E_(ptf.E_), - yPlusLam_(ptf.yPlusLam_) -{} - - -mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF, dict), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)), - yPlusLam_(calcYPlusLam(kappa_, E_)) + mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) {} @@ -164,11 +118,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField const mutkWallFunctionFvPatchScalarField& wfpsf ) : - fixedValueFvPatchScalarField(wfpsf), - Cmu_(wfpsf.Cmu_), - kappa_(wfpsf.kappa_), - E_(wfpsf.E_), - yPlusLam_(wfpsf.yPlusLam_) + mutWallFunctionFvPatchScalarField(wfpsf) {} @@ -178,55 +128,30 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(wfpsf, iF), - Cmu_(wfpsf.Cmu_), - kappa_(wfpsf.kappa_), - E_(wfpsf.E_), - yPlusLam_(wfpsf.yPlusLam_) + mutWallFunctionFvPatchScalarField(wfpsf, iF) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void mutkWallFunctionFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - operator==(calcMut()); - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - tmp mutkWallFunctionFvPatchScalarField::yPlus() const { - const label patchi = patch().index(); + const label patchI = patch().index(); const turbulenceModel& turbModel = db().lookupObject("turbulenceModel"); - const scalarField& y = turbModel.y()[patchi]; + const scalarField& y = turbModel.y()[patchI]; const tmp tk = turbModel.k(); const volScalarField& k = tk(); - const scalarField kwc(k.boundaryField()[patchi].patchInternalField()); - const scalarField& muw = turbModel.mu().boundaryField()[patchi]; - const scalarField& rhow = turbModel.rho().boundaryField()[patchi]; + const scalarField kwc(k.boundaryField()[patchI].patchInternalField()); + const scalarField& muw = turbModel.mu().boundaryField()[patchI]; + const scalarField& rhow = turbModel.rho().boundaryField()[patchI]; return pow025(Cmu_)*y*sqrt(kwc)/(muw/rhow); } -void mutkWallFunctionFvPatchScalarField::write(Ostream& os) const -{ - fvPatchField::write(os); - writeLocalEntries(os); - writeEntry("value", os); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField(fvPatchScalarField, mutkWallFunctionFvPatchScalarField); diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H index 765d0b7f6..91a219dd2 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H @@ -25,10 +25,22 @@ Class Foam::compressible::RASModels::mutkWallFunctionFvPatchScalarField Description - Boundary condition for turbulent (kinematic) viscosity when using wall + Boundary condition for turbulent (dynamic) viscosity when using wall functions, based on turbulence kinetic energy. - replicates OpenFOAM v1.5 (and earlier) behaviour +Usage + Example of the boundary condition specification: + \verbatim + + { + type mutkWallFunction; + } + \endverbatim + +See also + Foam::mutWallFunctionFvPatchScalarField + SourceFiles mutkWallFunctionFvPatchScalarField.C @@ -37,7 +49,7 @@ SourceFiles #ifndef compressibleMutkWallFunctionFvPatchScalarField_H #define compressibleMutkWallFunctionFvPatchScalarField_H -#include "fixedValueFvPatchFields.H" +#include "mutWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,39 +66,15 @@ namespace RASModels class mutkWallFunctionFvPatchScalarField : - public fixedValueFvPatchScalarField + public mutWallFunctionFvPatchScalarField { protected: - // Protected data - - //- Cmu coefficient - scalar Cmu_; - - //- Von Karman constant - scalar kappa_; - - //- E coefficient - scalar E_; - - //- Y+ at the edge of the laminar sublayer - scalar yPlusLam_; - - - // Protected member functions - - //- Check the type of the patch - virtual void checkType(); - - //- Calculate the Y+ at the edge of the laminar sublayer - virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const; + // Protected Member Functions //- Calculate the turbulence viscosity virtual tmp calcMut() const; - //- Write local wall function variables - virtual void writeLocalEntries(Ostream&) const; - public: @@ -159,19 +147,8 @@ public: // Member functions - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // I-O - - //- Write - virtual void write(Ostream&) const; + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; }; diff --git a/src/turbulenceModels/incompressible/RAS/Make/files b/src/turbulenceModels/incompressible/RAS/Make/files index 9c374d144..45e6160f1 100644 --- a/src/turbulenceModels/incompressible/RAS/Make/files +++ b/src/turbulenceModels/incompressible/RAS/Make/files @@ -25,13 +25,15 @@ coupledKOmegaSST/coupledKOmegaSST.C wallFunctions = derivedFvPatchFields/wallFunctions nutWallFunctions = $(wallFunctions)/nutWallFunctions -$(nutWallFunctions)/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutWallFunction/nutWallFunctionFvPatchScalarField.C -$(nutWallFunctions)/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C -$(nutWallFunctions)/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C -$(nutWallFunctions)/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutCWTWallFunction/nutCWTWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutMEWTWallFunction/nutMEWTWallFunctionFvPatchScalarField.C diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C index 5f4366ccb..70facfd82 100644 --- a/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C +++ b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C @@ -26,7 +26,7 @@ License #include "backwardsCompatibilityWallFunctions.H" #include "calculatedFvPatchField.H" -#include "nutWallFunctionFvPatchScalarField.H" +#include "nutkWallFunctionFvPatchScalarField.H" #include "nutLowReWallFunctionFvPatchScalarField.H" #include "epsilonWallFunctionFvPatchScalarField.H" #include "kqRWallFunctionFvPatchField.H" @@ -77,7 +77,7 @@ tmp autoCreateNut if (bm[patchI].isWall()) { nutBoundaryTypes[patchI] = - RASModels::nutWallFunctionFvPatchScalarField::typeName; + RASModels::nutkWallFunctionFvPatchScalarField::typeName; } else { diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutCWTWallFunction/nutCWTWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutCWTWallFunction/nutCWTWallFunctionFvPatchScalarField.C index 7f05f0980..b82a6acdb 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutCWTWallFunction/nutCWTWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutCWTWallFunction/nutCWTWallFunctionFvPatchScalarField.C @@ -40,48 +40,19 @@ namespace RASModels // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void nutCWTWallFunctionFvPatchScalarField::checkType() -{ - if (!patch().isWall()) - { - FatalErrorIn("nutCWTWallFunctionFvPatchScalarField::checkType()") - << "Invalid wall function specification" << nl - << " Patch type for patch " << patch().name() - << " must be wall" << nl - << " Current patch type is " << patch().type() << nl << endl - << abort(FatalError); - } -} - - -scalar nutCWTWallFunctionFvPatchScalarField::calcYPlusLam -( - const scalar kappa, - const scalar E -) const -{ - scalar ypl = 11.0; - - for (int i = 0; i < 10; i++) - { - ypl = log(E*ypl)/kappa; - } - - return ypl; -} - - tmp nutCWTWallFunctionFvPatchScalarField::calcNut() const { const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); - const scalar Cmu25 = pow(Cmu_, 0.25); + const scalarField& y = turbModel.y()[patchI]; + const tmp tk = turbModel.k(); + const volScalarField& k = tk(); + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; + + const scalar Cmu25 = pow025(Cmu_); // Get normals const vectorField n = patch().nf(); @@ -130,8 +101,15 @@ tmp nutCWTWallFunctionFvPatchScalarField::calcNut() const } else { - Info<< "Field pressureGradient not found. Neglecting pressure gradient " + InfoIn + ( + "tmp" + "nutCWTWallFunctionFvPatchScalarField::calcNut() const" + ) << "Field pressureGradient not found. Neglecting pressure gradient " << "effects for wall functions at patch: " << patch().name() + << nl + << "If you would like to include pressure gradient effects, set up" + << " pressureGradient function object." << endl; } @@ -164,8 +142,15 @@ tmp nutCWTWallFunctionFvPatchScalarField::calcNut() const } else { - Info<< "Field velocityConvection not found. Neglecting convection " + InfoIn + ( + "tmp" + "nutCWTWallFunctionFvPatchScalarField::calcNut() const" + ) << "Field velocityConvection not found. Neglecting convection " << "effects for wall functions at patch: " << patch().name() + << nl + << "If you would like to include convection effects, set up" + << " velocityConvection function object." << endl; } @@ -206,12 +191,11 @@ tmp nutCWTWallFunctionFvPatchScalarField::calcNut() const void nutCWTWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { + nutkWallFunctionFvPatchScalarField::writeLocalEntries(os); + writeEntryIfDifferent(os, "U", "U", UName_); writeEntryIfDifferent(os, "p", "p", pName_); writeEntryIfDifferent(os, "nut", "nut", nutName_); - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; } @@ -223,17 +207,11 @@ nutCWTWallFunctionFvPatchScalarField::nutCWTWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF), + nutkWallFunctionFvPatchScalarField(p, iF), UName_("U"), pName_("p"), - nutName_("nut"), - Cmu_(0.09), - kappa_(0.41), - E_(9.8), - yPlusLam_(calcYPlusLam(kappa_, E_)) -{ - checkType(); -} + nutName_("nut") +{} nutCWTWallFunctionFvPatchScalarField::nutCWTWallFunctionFvPatchScalarField @@ -243,17 +221,11 @@ nutCWTWallFunctionFvPatchScalarField::nutCWTWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict), + nutkWallFunctionFvPatchScalarField(p, iF, dict), UName_(dict.lookupOrDefault("U", "U")), pName_(dict.lookupOrDefault("p", "p")), - nutName_(dict.lookupOrDefault("nut", "nut")), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)), - yPlusLam_(calcYPlusLam(kappa_, E_)) -{ - checkType(); -} + nutName_(dict.lookupOrDefault("nut", "nut")) +{} nutCWTWallFunctionFvPatchScalarField::nutCWTWallFunctionFvPatchScalarField @@ -264,17 +236,11 @@ nutCWTWallFunctionFvPatchScalarField::nutCWTWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper), + nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), UName_(ptf.UName_), pName_(ptf.pName_), - nutName_(ptf.nutName_), - Cmu_(ptf.Cmu_), - kappa_(ptf.kappa_), - E_(ptf.E_), - yPlusLam_(ptf.yPlusLam_) -{ - checkType(); -} + nutName_(ptf.nutName_) +{} nutCWTWallFunctionFvPatchScalarField::nutCWTWallFunctionFvPatchScalarField @@ -282,17 +248,11 @@ nutCWTWallFunctionFvPatchScalarField::nutCWTWallFunctionFvPatchScalarField const nutCWTWallFunctionFvPatchScalarField& wfpsf ) : - fixedValueFvPatchScalarField(wfpsf), + nutkWallFunctionFvPatchScalarField(wfpsf), UName_(wfpsf.UName_), pName_(wfpsf.pName_), - nutName_(wfpsf.nutName_), - Cmu_(wfpsf.Cmu_), - kappa_(wfpsf.kappa_), - E_(wfpsf.E_), - yPlusLam_(wfpsf.yPlusLam_) -{ - checkType(); -} + nutName_(wfpsf.nutName_) +{} nutCWTWallFunctionFvPatchScalarField::nutCWTWallFunctionFvPatchScalarField @@ -301,51 +261,11 @@ nutCWTWallFunctionFvPatchScalarField::nutCWTWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(wfpsf, iF), + nutkWallFunctionFvPatchScalarField(wfpsf, iF), UName_(wfpsf.UName_), pName_(wfpsf.pName_), - nutName_(wfpsf.nutName_), - Cmu_(wfpsf.Cmu_), - kappa_(wfpsf.kappa_), - E_(wfpsf.E_), - yPlusLam_(wfpsf.yPlusLam_) -{ - checkType(); -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void nutCWTWallFunctionFvPatchScalarField::updateCoeffs() -{ - operator==(calcNut()); - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - -tmp nutCWTWallFunctionFvPatchScalarField::yPlus() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField kwc = k.boundaryField()[patchI].patchInternalField(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - - return pow(Cmu_, 0.25)*y*sqrt(kwc)/nuw; -} - - -void nutCWTWallFunctionFvPatchScalarField::write(Ostream& os) const -{ - fvPatchField::write(os); - writeLocalEntries(os); - writeEntry("value", os); -} + nutName_(wfpsf.nutName_) +{} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutCWTWallFunction/nutCWTWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutCWTWallFunction/nutCWTWallFunctionFvPatchScalarField.H index b9a5cceb0..26083fc85 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutCWTWallFunction/nutCWTWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutCWTWallFunction/nutCWTWallFunctionFvPatchScalarField.H @@ -41,6 +41,18 @@ Description DOI = {10.1007/s10494-006-9067-x} } +Usage + Example of the boundary condition specification: + \verbatim + + { + type nutCWTWallFunction; + } + \endverbatim + +See also + Foam::nutkWallFunctionFvPatchScalarField + SourceFiles nutCWTWallFunctionFvPatchScalarField.C @@ -52,7 +64,7 @@ Author #ifndef nutCWTWallFunctionFvPatchScalarField_H #define nutCWTWallFunctionFvPatchScalarField_H -#include "fixedValueFvPatchFields.H" +#include "nutkWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -69,11 +81,9 @@ namespace RASModels class nutCWTWallFunctionFvPatchScalarField : - public fixedValueFvPatchScalarField + public nutkWallFunctionFvPatchScalarField { -protected: - - // Protected data + // Private Data Members //- Name of velocity field word UName_; @@ -84,29 +94,10 @@ protected: //- Name of eddy viscosity field word nutName_; - //- Name of omega field - word omegaName_; - //- Cmu coefficient - scalar Cmu_; +protected: - //- Von Karman constant - scalar kappa_; - - //- E coefficient - scalar E_; - - //- Y+ at the edge of the laminar sublayer - scalar yPlusLam_; - - - // Protected member functions - - //- Check the type of the patch - virtual void checkType(); - - //- Calculate the Y+ at the edge of the laminar sublayer - virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const; + // Protected Member Functions //- Calculate the turbulence viscosity virtual tmp calcNut() const; @@ -182,23 +173,6 @@ public: new nutCWTWallFunctionFvPatchScalarField(*this, iF) ); } - - - // Member functions - - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // I-O - - //- Write - virtual void write(Ostream&) const; }; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C index 3aeb20788..680e854c0 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C @@ -100,6 +100,22 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp nutLowReWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchI = patch().index(); + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + + return y*sqrt(nuw*mag(Uw.snGrad()))/nuw; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField(fvPatchScalarField, nutLowReWallFunctionFvPatchScalarField); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H index 8c8bc8add..7f1e5a97b 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H @@ -30,6 +30,18 @@ Description Sets nut to zero, and provides an access function to calculate y+. +Usage + Example of the boundary condition specification: + \verbatim + + { + type nutLowReWallFunction; + } + \endverbatim + +See also + Foam::nutWallFunctionFvPatchScalarField + SourceFiles nutLowReWallFunctionFvPatchScalarField.C @@ -59,7 +71,7 @@ class nutLowReWallFunctionFvPatchScalarField { protected: - // Protected member functions + // Protected Member Functions //- Calculate the turbulence viscosity virtual tmp calcNut() const; @@ -132,6 +144,12 @@ public: new nutLowReWallFunctionFvPatchScalarField(*this, iF) ); } + + + // Member functions + + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; }; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMEWTWallFunction/nutMEWTWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMEWTWallFunction/nutMEWTWallFunctionFvPatchScalarField.C index 621421e91..f4f053d1c 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMEWTWallFunction/nutMEWTWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMEWTWallFunction/nutMEWTWallFunctionFvPatchScalarField.C @@ -51,48 +51,19 @@ namespace RASModels // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void nutMEWTWallFunctionFvPatchScalarField::checkType() -{ - if (!patch().isWall()) - { - FatalErrorIn("nutMEWTWallFunctionFvPatchScalarField::checkType()") - << "Invalid wall function specification" << nl - << " Patch type for patch " << patch().name() - << " must be wall" << nl - << " Current patch type is " << patch().type() << nl << endl - << abort(FatalError); - } -} - - -scalar nutMEWTWallFunctionFvPatchScalarField::calcYPlusLam -( - const scalar kappa, - const scalar E -) const -{ - scalar ypl = 11.0; - - for (int i = 0; i < 10; i++) - { - ypl = log(E*ypl)/kappa; - } - - return ypl; -} - - tmp nutMEWTWallFunctionFvPatchScalarField::calcNut() const { const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); - const scalar Cmu25 = pow(Cmu_, 0.25); + const scalarField& y = turbModel.y()[patchI]; + const tmp tk = turbModel.k(); + const volScalarField& k = tk(); + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; + + const scalar Cmu25 = pow025(Cmu_); // Get normals const vectorField n = patch().nf(); @@ -141,8 +112,15 @@ tmp nutMEWTWallFunctionFvPatchScalarField::calcNut() const } else { - Info<< "Field pressureGradient not found. Neglecting pressure gradient " + InfoIn + ( + "tmp" + "nutCWTWallFunctionFvPatchScalarField::calcNut() const" + ) << "Field pressureGradient not found. Neglecting pressure gradient " << "effects for wall functions at patch: " << patch().name() + << nl + << "If you would like to include pressure gradient effects, set up" + << " pressureGradient function object." << endl; } @@ -175,8 +153,15 @@ tmp nutMEWTWallFunctionFvPatchScalarField::calcNut() const } else { - Info<< "Field velocityConvection not found. Neglecting convection " + InfoIn + ( + "tmp" + "nutCWTWallFunctionFvPatchScalarField::calcNut() const" + ) << "Field velocityConvection not found. Neglecting convection " << "effects for wall functions at patch: " << patch().name() + << nl + << "If you would like to include convection effects, set up" + << " velocityConvection function object." << endl; } @@ -254,12 +239,11 @@ tmp nutMEWTWallFunctionFvPatchScalarField::calcNut() const void nutMEWTWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { + nutkWallFunctionFvPatchScalarField::writeLocalEntries(os); + writeEntryIfDifferent(os, "U", "U", UName_); writeEntryIfDifferent(os, "p", "p", pName_); writeEntryIfDifferent(os, "nut", "nut", nutName_); - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; } @@ -271,17 +255,11 @@ nutMEWTWallFunctionFvPatchScalarField::nutMEWTWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF), + nutkWallFunctionFvPatchScalarField(p, iF), UName_("U"), pName_("p"), - nutName_("nut"), - Cmu_(0.09), - kappa_(0.41), - E_(9.8), - yPlusLam_(calcYPlusLam(kappa_, E_)) -{ - checkType(); -} + nutName_("nut") +{} nutMEWTWallFunctionFvPatchScalarField::nutMEWTWallFunctionFvPatchScalarField @@ -291,17 +269,11 @@ nutMEWTWallFunctionFvPatchScalarField::nutMEWTWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict), + nutkWallFunctionFvPatchScalarField(p, iF, dict), UName_(dict.lookupOrDefault("U", "U")), pName_(dict.lookupOrDefault("p", "p")), - nutName_(dict.lookupOrDefault("nut", "nut")), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)), - yPlusLam_(calcYPlusLam(kappa_, E_)) -{ - checkType(); -} + nutName_(dict.lookupOrDefault("nut", "nut")) +{} nutMEWTWallFunctionFvPatchScalarField::nutMEWTWallFunctionFvPatchScalarField @@ -312,17 +284,11 @@ nutMEWTWallFunctionFvPatchScalarField::nutMEWTWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper), + nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), UName_(ptf.UName_), pName_(ptf.pName_), - nutName_(ptf.nutName_), - Cmu_(ptf.Cmu_), - kappa_(ptf.kappa_), - E_(ptf.E_), - yPlusLam_(ptf.yPlusLam_) -{ - checkType(); -} + nutName_(ptf.nutName_) +{} nutMEWTWallFunctionFvPatchScalarField::nutMEWTWallFunctionFvPatchScalarField @@ -330,17 +296,11 @@ nutMEWTWallFunctionFvPatchScalarField::nutMEWTWallFunctionFvPatchScalarField const nutMEWTWallFunctionFvPatchScalarField& wfpsf ) : - fixedValueFvPatchScalarField(wfpsf), + nutkWallFunctionFvPatchScalarField(wfpsf), UName_(wfpsf.UName_), pName_(wfpsf.pName_), - nutName_(wfpsf.nutName_), - Cmu_(wfpsf.Cmu_), - kappa_(wfpsf.kappa_), - E_(wfpsf.E_), - yPlusLam_(wfpsf.yPlusLam_) -{ - checkType(); -} + nutName_(wfpsf.nutName_) +{} nutMEWTWallFunctionFvPatchScalarField::nutMEWTWallFunctionFvPatchScalarField @@ -349,51 +309,11 @@ nutMEWTWallFunctionFvPatchScalarField::nutMEWTWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(wfpsf, iF), + nutkWallFunctionFvPatchScalarField(wfpsf, iF), UName_(wfpsf.UName_), pName_(wfpsf.pName_), - nutName_(wfpsf.nutName_), - Cmu_(wfpsf.Cmu_), - kappa_(wfpsf.kappa_), - E_(wfpsf.E_), - yPlusLam_(wfpsf.yPlusLam_) -{ - checkType(); -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void nutMEWTWallFunctionFvPatchScalarField::updateCoeffs() -{ - operator==(calcNut()); - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - -tmp nutMEWTWallFunctionFvPatchScalarField::yPlus() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField kwc = k.boundaryField()[patchI].patchInternalField(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - - return pow(Cmu_, 0.25)*y*sqrt(kwc)/nuw; -} - - -void nutMEWTWallFunctionFvPatchScalarField::write(Ostream& os) const -{ - fvPatchField::write(os); - writeLocalEntries(os); - writeEntry("value", os); -} + nutName_(wfpsf.nutName_) +{} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMEWTWallFunction/nutMEWTWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMEWTWallFunction/nutMEWTWallFunctionFvPatchScalarField.H index e267d56f3..0fa6370f6 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMEWTWallFunction/nutMEWTWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutMEWTWallFunction/nutMEWTWallFunctionFvPatchScalarField.H @@ -39,6 +39,18 @@ Description year = {2017}, } +Usage + Example of the boundary condition specification: + \verbatim + + { + type nutCWTWallFunction; + } + \endverbatim + +See also + Foam::nutkWallFunctionFvPatchScalarField + SourceFiles nutMEWTWallFunctionFvPatchScalarField.C @@ -50,7 +62,7 @@ Author #ifndef nutMEWTWallFunctionFvPatchScalarField_H #define nutMEWTWallFunctionFvPatchScalarField_H -#include "fixedValueFvPatchFields.H" +#include "nutkWallFunctionFvPatchScalarField.H" #include "tolerancesSwitch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -68,19 +80,13 @@ namespace RASModels class nutMEWTWallFunctionFvPatchScalarField : - public fixedValueFvPatchScalarField + public nutkWallFunctionFvPatchScalarField { + // Private Data Members - // Private static data member - - //- Tolerance for the A dimensionless parameter + //- Static tolerance for the A dimensionless parameter static const debug::tolerancesSwitch dimlessAFactorTol_; - -protected: - - // Protected data - //- Name of velocity field word UName_; @@ -90,29 +96,10 @@ protected: //- Name of eddy viscosity field word nutName_; - //- Name of omega field - word omegaName_; - //- Cmu coefficient - scalar Cmu_; +protected: - //- Von Karman constant - scalar kappa_; - - //- E coefficient - scalar E_; - - //- Y+ at the edge of the laminar sublayer - scalar yPlusLam_; - - - // Protected member functions - - //- Check the type of the patch - virtual void checkType(); - - //- Calculate the Y+ at the edge of the laminar sublayer - virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const; + // Protected Member Functions //- Calculate the turbulence viscosity virtual tmp calcNut() const; @@ -144,8 +131,7 @@ public: const dictionary& ); - //- Construct by mapping given - // nutMEWTWallFunctionFvPatchScalarField + //- Construct by mapping given nutMEWTWallFunctionFvPatchScalarField // onto a new patch nutMEWTWallFunctionFvPatchScalarField ( @@ -188,23 +174,6 @@ public: new nutMEWTWallFunctionFvPatchScalarField(*this, iF) ); } - - - // Member functions - - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // I-O - - //- Write - virtual void write(Ostream&) const; }; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C index 412fc7790..b904d8993 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.C @@ -38,165 +38,6 @@ namespace incompressible namespace RASModels { -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -tmp -nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcNut() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - - // The flow velocity at the adjacent cell centre - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - - tmp tyPlus = calcYPlus(magUp); - scalarField& yPlus = tyPlus(); - - tmp tnutw(new scalarField(patch().size(), 0.0)); - scalarField& nutw = tnutw(); - - forAll(yPlus, facei) - { - if (yPlus[facei] > yPlusLam_) - { - const scalar Re = magUp[facei]*y[facei]/nuw[facei]; - nutw[facei] = nuw[facei]*(sqr(yPlus[facei])/Re - 1); - } - } - - return tnutw; -} - - -tmp -nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::calcYPlus -( - const scalarField& magUp -) const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - - tmp tyPlus(new scalarField(patch().size(), 0.0)); - scalarField& yPlus = tyPlus(); - - if (roughnessHeight_ > 0.0) - { - // Rough Walls - const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_; - static const scalar c_2 = 2.25/(90 - 2.25); - static const scalar c_3 = 2.0*atan(1.0)/log(90/2.25); - static const scalar c_4 = c_3*log(2.25); - - //if (KsPlusBasedOnYPlus_) - { - // If KsPlus is based on YPlus the extra term added to the law - // of the wall will depend on yPlus - forAll(yPlus, facei) - { - const scalar magUpara = magUp[facei]; - const scalar Re = magUpara*y[facei]/nuw[facei]; - const scalar kappaRe = kappa_*Re; - - scalar yp = yPlusLam_; - const scalar ryPlusLam = 1.0/yp; - - int iter = 0; - scalar yPlusLast = 0.0; - scalar dKsPlusdYPlus = roughnessHeight_/y[facei]; - - // Enforce the roughnessHeight to be less than the distance to - // the first cell centre - if (dKsPlusdYPlus > 1) - { - dKsPlusdYPlus = 1; - } - - // Additional tuning parameter (fudge factor) - nominally = 1 - dKsPlusdYPlus *= roughnessFudgeFactor_; - - do - { - yPlusLast = yp; - - // The non-dimensional roughness height - scalar KsPlus = yp*dKsPlusdYPlus; - - // The extra term in the law-of-the-wall - scalar G = 0.0; - - scalar yPlusGPrime = 0.0; - - if (KsPlus >= 90) - { - const scalar t_1 = 1 + roughnessConstant_*KsPlus; - G = log(t_1); - yPlusGPrime = roughnessConstant_*KsPlus/t_1; - } - else if (KsPlus > 2.25) - { - const scalar t_1 = c_1*KsPlus - c_2; - const scalar t_2 = c_3*log(KsPlus) - c_4; - const scalar sint_2 = sin(t_2); - const scalar logt_1 = log(t_1); - G = logt_1*sint_2; - yPlusGPrime = - (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); - } - - scalar denom = 1.0 + log(E_*yp) - G - yPlusGPrime; - if (mag(denom) > VSMALL) - { - yp = (kappaRe + yp*(1 - yPlusGPrime))/denom; - } - } while - ( - mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 - && ++iter < 10 - && yp > VSMALL - ); - - yPlus[facei] = max(0.0, yp); - } - } - } - else - { - // Smooth Walls - forAll(yPlus, facei) - { - const scalar magUpara = magUp[facei]; - const scalar Re = magUpara*y[facei]/nuw[facei]; - const scalar kappaRe = kappa_*Re; - - scalar yp = yPlusLam_; - const scalar ryPlusLam = 1.0/yp; - - int iter = 0; - scalar yPlusLast = 0.0; - - do - { - yPlusLast = yp; - yp = (kappaRe + yp)/(1.0 + log(E_*yp)); - - } while(mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10); - - yPlus[facei] = max(0.0, yp); - } - } - - return tyPlus; -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField:: @@ -206,10 +47,7 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const DimensionedField& iF ) : - nutWallFunctionFvPatchScalarField(p, iF), - roughnessHeight_(pTraits::zero), - roughnessConstant_(pTraits::zero), - roughnessFudgeFactor_(pTraits::zero) + nutURoughWallFunctionFvPatchScalarField(p, iF) {} @@ -222,10 +60,7 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper), - roughnessHeight_(ptf.roughnessHeight_), - roughnessConstant_(ptf.roughnessConstant_), - roughnessFudgeFactor_(ptf.roughnessFudgeFactor_) + nutURoughWallFunctionFvPatchScalarField(ptf, p, iF, mapper) {} @@ -237,10 +72,7 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const dictionary& dict ) : - nutWallFunctionFvPatchScalarField(p, iF, dict), - roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), - roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), - roughnessFudgeFactor_(readScalar(dict.lookup("roughnessFudgeFactor"))) + nutURoughWallFunctionFvPatchScalarField(p, iF, dict) {} @@ -250,10 +82,7 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField& rwfpsf ) : - nutWallFunctionFvPatchScalarField(rwfpsf), - roughnessHeight_(rwfpsf.roughnessHeight_), - roughnessConstant_(rwfpsf.roughnessConstant_), - roughnessFudgeFactor_(rwfpsf.roughnessFudgeFactor_) + nutURoughWallFunctionFvPatchScalarField(rwfpsf) {} @@ -264,45 +93,10 @@ nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField const DimensionedField& iF ) : - nutWallFunctionFvPatchScalarField(rwfpsf, iF), - roughnessHeight_(rwfpsf.roughnessHeight_), - roughnessConstant_(rwfpsf.roughnessConstant_), - roughnessFudgeFactor_(rwfpsf.roughnessFudgeFactor_) + nutURoughWallFunctionFvPatchScalarField(rwfpsf, iF) {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp -nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::yPlus() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - - return calcYPlus(magUp); -} - - -void nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchField::write(os); - writeLocalEntries(os); - os.writeKeyword("roughnessHeight") - << roughnessHeight_ << token::END_STATEMENT << nl; - os.writeKeyword("roughnessConstant") - << roughnessConstant_ << token::END_STATEMENT << nl; - os.writeKeyword("roughnessFudgeFactor") - << roughnessFudgeFactor_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H index a683c20fc..f21bda06b 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardRoughWallFunction/nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H @@ -26,7 +26,9 @@ Class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField Description - Wall function boundary condition for rough walls + This boundary condition is the same as nutURoughWallFunction. We will simply + derive from nutURoughWallFunctionFvPatchScalarField to enable backward + compatibility. SourceFiles nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -36,7 +38,7 @@ SourceFiles #ifndef nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H #define nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H -#include "nutWallFunctionFvPatchScalarField.H" +#include "nutURoughWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,31 +55,8 @@ Class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField Declaration class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField : - public nutWallFunctionFvPatchScalarField + public nutURoughWallFunctionFvPatchScalarField { - // Private data - - // Roughness model parameters - - //- Height - scalar roughnessHeight_; - - //- Constant - scalar roughnessConstant_; - - //- Scale factor - scalar roughnessFudgeFactor_; - - - // Protected member functions - - //- Calculate yPLus - virtual tmp calcYPlus(const scalarField& magUp) const; - - //- Calculate the turbulence viscosity - virtual tmp calcNut() const; - - public: //- Runtime type information @@ -152,63 +131,6 @@ public: ) ); } - - - // Member functions - - // Access - - //- Return the roughness height - const scalar& roughnessHeight() const - { - return roughnessHeight_; - } - - //- Return reference to the roughness height to allow adjustment - scalar& roughnessHeight() - { - return roughnessHeight_; - } - - - //- Return the roughness constant scale - const scalar& roughnessConstant() const - { - return roughnessConstant_; - } - - //- Return reference to the roughness constant to allow adjustment - scalar& roughnessConstant() - { - return roughnessConstant_; - } - - //- Return the roughness scale factor - const scalar& roughnessFudgeFactor() const - { - return roughnessFudgeFactor_; - } - - //- Return reference to the roughness scale factor to allow - // adjustment - scalar& roughnessFudgeFactor() - { - return roughnessFudgeFactor_; - } - - - // I-O - - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; - - - // I-O - - //- Write - virtual void write(Ostream& os) const; }; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C index d7b79839c..0dd1c7991 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -38,76 +38,6 @@ namespace incompressible namespace RASModels { -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -tmp -nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcNut() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - - tmp tyPlus = calcYPlus(magUp); - scalarField& yPlus = tyPlus(); - - tmp tnutw(new scalarField(patch().size(), 0.0)); - scalarField& nutw = tnutw(); - - forAll(yPlus, facei) - { - if (yPlus[facei] > yPlusLam_) - { - nutw[facei] = - nuw[facei]*(yPlus[facei]*kappa_/log(E_*yPlus[facei]) - 1.0); - } - } - - return tnutw; -} - - -tmp -nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::calcYPlus -( - const scalarField& magUp -) const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - - tmp tyPlus(new scalarField(patch().size(), 0.0)); - scalarField& yPlus = tyPlus(); - - forAll(yPlus, facei) - { - scalar kappaRe = kappa_*magUp[facei]*y[facei]/nuw[facei]; - - scalar yp = yPlusLam_; - scalar ryPlusLam = 1.0/yp; - - int iter = 0; - scalar yPlusLast = 0.0; - - do - { - yPlusLast = yp; - yp = (kappaRe + yp)/(1.0 + log(E_*yp)); - - } while(mag(ryPlusLam*(yp - yPlusLast)) > 0.01 && ++iter < 10 ); - - yPlus[facei] = max(0.0, yp); - } - - return tyPlus; -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // nutSpalartAllmarasStandardWallFunctionFvPatchScalarField:: @@ -117,7 +47,7 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const DimensionedField& iF ) : - nutWallFunctionFvPatchScalarField(p, iF) + nutUWallFunctionFvPatchScalarField(p, iF) {} @@ -130,7 +60,7 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) + nutUWallFunctionFvPatchScalarField(ptf, p, iF, mapper) {} @@ -142,7 +72,7 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const dictionary& dict ) : - nutWallFunctionFvPatchScalarField(p, iF, dict) + nutUWallFunctionFvPatchScalarField(p, iF, dict) {} @@ -152,7 +82,7 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const nutSpalartAllmarasStandardWallFunctionFvPatchScalarField& sawfpsf ) : - nutWallFunctionFvPatchScalarField(sawfpsf) + nutUWallFunctionFvPatchScalarField(sawfpsf) {} @@ -163,35 +93,10 @@ nutSpalartAllmarasStandardWallFunctionFvPatchScalarField const DimensionedField& iF ) : - nutWallFunctionFvPatchScalarField(sawfpsf, iF) + nutUWallFunctionFvPatchScalarField(sawfpsf, iF) {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp -nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::yPlus() const -{ - const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - - return calcYPlus(magUp); -} - - -void nutSpalartAllmarasStandardWallFunctionFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchField::write(os); - writeLocalEntries(os); - writeEntry("value", os); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H index 9084f3e23..dc4caca96 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasStandardWallFunction/nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.H @@ -26,7 +26,9 @@ Class nutSpalartAllmarasStandardWallFunctionFvPatchScalarField Description - Wall function boundary condition for walls + This boundary condition is the same as nutUWallFunction. We will simply + derive from nutUWallFunctionFvPatchScalarField to enable backward + compatibility. SourceFiles nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C @@ -36,7 +38,7 @@ SourceFiles #ifndef nutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H #define nutSpalartAllmarasStandardWallFunctionFvPatchScalarField_H -#include "nutWallFunctionFvPatchScalarField.H" +#include "nutUWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,19 +55,8 @@ namespace RASModels class nutSpalartAllmarasStandardWallFunctionFvPatchScalarField : - public nutWallFunctionFvPatchScalarField + public nutUWallFunctionFvPatchScalarField { -protected: - - // Protected member functions - - //- Calculate yPLus - virtual tmp calcYPlus(const scalarField& magUp) const; - - //- Calculate the turbulence viscosity - virtual tmp calcNut() const; - - public: //- Runtime type information @@ -140,20 +131,6 @@ public: ) ); } - - - // Member functions - - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; - - - // I-O - - //- Write - virtual void write(Ostream& os) const; }; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C index dc9185bec..9fcdbc8a5 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.C @@ -45,14 +45,16 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField::calcNut() const { const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; const scalarField magGradU = mag(Uw.snGrad()); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; return max ( - scalar(0), + 0.0, sqr(calcUTau(magGradU))/(magGradU + ROOTVSMALL) - nuw ); } @@ -63,51 +65,56 @@ tmp nutSpalartAllmarasWallFunctionFvPatchScalarField::calcUTau const scalarField& magGradU ) const { - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patch().index()]; + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; const fvPatchVectorField& Uw = - rasModel.U().boundaryField()[patch().index()]; + turbModel.U().boundaryField()[patchI]; const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const scalarField& nuw = rasModel.nu().boundaryField()[patch().index()]; + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; const scalarField& nutw = *this; tmp tuTau(new scalarField(patch().size(), 0.0)); scalarField& uTau = tuTau(); - forAll(uTau, facei) + forAll(uTau, faceI) { - scalar magUpara = magUp[facei]; + const scalar& magUpara = magUp[faceI]; - scalar ut = sqrt((nutw[facei] + nuw[facei])*magGradU[facei]); + scalar ut = sqrt((nutw[faceI] + nuw[faceI])*magGradU[faceI]); if (ut > VSMALL) { - int iter = 0; + label iter = 0; scalar err = GREAT; do { - scalar kUu = min(kappa_*magUpara/ut, 50); - scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); + const scalar kUu = min(kappa_*magUpara/ut, 50); + const scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); - scalar f = - - ut*y[facei]/nuw[facei] + const scalar f = + - ut*y[faceI]/nuw[faceI] + magUpara/ut + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); - scalar df = - y[facei]/nuw[facei] + const scalar df = + y[faceI]/nuw[faceI] + magUpara/sqr(ut) + 1/E_*kUu*fkUu/ut; - scalar uTauNew = ut + f/df; + const scalar uTauNew = ut + f/df; err = mag((ut - uTauNew)/ut); ut = uTauNew; } while (ut > VSMALL && err > 0.01 && ++iter < 10); - uTau[facei] = max(0.0, ut); + + uTau[faceI] = max(0.0, ut); } } @@ -128,6 +135,18 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField {} +nutSpalartAllmarasWallFunctionFvPatchScalarField:: +nutSpalartAllmarasWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict) +{} + + nutSpalartAllmarasWallFunctionFvPatchScalarField:: nutSpalartAllmarasWallFunctionFvPatchScalarField ( @@ -141,18 +160,6 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField {} -nutSpalartAllmarasWallFunctionFvPatchScalarField:: -nutSpalartAllmarasWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - nutWallFunctionFvPatchScalarField(p, iF, dict) -{} - - nutSpalartAllmarasWallFunctionFvPatchScalarField:: nutSpalartAllmarasWallFunctionFvPatchScalarField ( @@ -181,26 +188,17 @@ nutSpalartAllmarasWallFunctionFvPatchScalarField::yPlus() const { const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; return y*calcUTau(mag(Uw.snGrad()))/nuw; } -void nutSpalartAllmarasWallFunctionFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchField::write(os); - writeLocalEntries(os); - writeEntry("value", os); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H index b0b224a32..b88993ca7 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutSpalartAllmarasWallFunction/nutSpalartAllmarasWallFunctionFvPatchScalarField.H @@ -141,12 +141,6 @@ public: //- Calculate and return the yPlus at the boundary virtual tmp yPlus() const; - - - // I-O - - //- Write - virtual void write(Ostream& os) const; }; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C new file mode 100644 index 000000000..15af4c0b5 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,308 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "nutURoughWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp nutURoughWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; + + // The flow velocity at the adjacent cell centre + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + + tmp tyPlus = calcYPlus(magUp); + const scalarField& yPlus = tyPlus(); + + tmp tnutw(new scalarField(patch().size(), 0.0)); + scalarField& nutw = tnutw(); + + forAll(yPlus, faceI) + { + if (yPlus[faceI] > yPlusLam_) + { + const scalar Re = magUp[faceI]*y[faceI]/nuw[faceI] + ROOTVSMALL; + nutw[faceI] = nuw[faceI]*(sqr(yPlus[faceI])/Re - 1); + } + } + + return tnutw; +} + + +tmp nutURoughWallFunctionFvPatchScalarField::calcYPlus +( + const scalarField& magUp +) const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; + + tmp tyPlus(new scalarField(patch().size(), 0.0)); + scalarField& yPlus = tyPlus(); + + if (roughnessHeight_ > 0.0) + { + // Rough Walls + const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_; + static const scalar c_2 = 2.25/(90 - 2.25); + static const scalar c_3 = 2.0*atan(1.0)/log(90/2.25); + static const scalar c_4 = c_3*log(2.25); + + //if (KsPlusBasedOnYPlus_) + { + // If KsPlus is based on YPlus the extra term added to the law + // of the wall will depend on yPlus + forAll(yPlus, faceI) + { + const scalar magUpara = magUp[faceI]; + const scalar Re = magUpara*y[faceI]/nuw[faceI]; + const scalar kappaRe = kappa_*Re; + + scalar yp = yPlusLam_; + const scalar ryPlusLam = 1.0/yp; + + label iter = 0; + scalar yPlusLast = 0.0; + scalar dKsPlusdYPlus = roughnessHeight_/y[faceI]; + + // Additional tuning parameter - nominally = 1 + dKsPlusdYPlus *= roughnessFactor_; + + do + { + yPlusLast = yp; + + // The non-dimensional roughness height + scalar KsPlus = yp*dKsPlusdYPlus; + + // The extra term in the law-of-the-wall + scalar G = 0.0; + + scalar yPlusGPrime = 0.0; + + if (KsPlus >= 90) + { + const scalar t_1 = 1 + roughnessConstant_*KsPlus; + G = log(t_1); + yPlusGPrime = roughnessConstant_*KsPlus/t_1; + } + else if (KsPlus > 2.25) + { + const scalar t_1 = c_1*KsPlus - c_2; + const scalar t_2 = c_3*log(KsPlus) - c_4; + const scalar sint_2 = sin(t_2); + const scalar logt_1 = log(t_1); + G = logt_1*sint_2; + yPlusGPrime = + (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); + } + + scalar denom = 1.0 + log(E_*yp) - G - yPlusGPrime; + if (mag(denom) > VSMALL) + { + yp = (kappaRe + yp*(1 - yPlusGPrime))/denom; + } + } while + ( + mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 + && ++iter < 10 + && yp > VSMALL + ); + + yPlus[faceI] = max(0.0, yp); + } + } + } + else + { + // Smooth Walls + forAll(yPlus, faceI) + { + const scalar magUpara = magUp[faceI]; + const scalar Re = magUpara*y[faceI]/nuw[faceI]; + const scalar kappaRe = kappa_*Re; + + scalar yp = yPlusLam_; + const scalar ryPlusLam = 1.0/yp; + + label iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yp; + yp = (kappaRe + yp)/(1.0 + log(E_*yp)); + + } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10); + + yPlus[faceI] = max(0.0, yp); + } + } + + return tyPlus; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + nutWallFunctionFvPatchScalarField(p, iF), + roughnessHeight_(0.0), + roughnessConstant_(0.0), + roughnessFactor_(0.0) +{} + + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const nutURoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + roughnessHeight_(ptf.roughnessHeight_), + roughnessConstant_(ptf.roughnessConstant_), + roughnessFactor_(ptf.roughnessFactor_) +{} + + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict), + roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), + roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), + roughnessFactor_(readScalar(dict.lookup("roughnessFactor"))) +{} + + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const nutURoughWallFunctionFvPatchScalarField& rwfpsf +) +: + nutWallFunctionFvPatchScalarField(rwfpsf), + roughnessHeight_(rwfpsf.roughnessHeight_), + roughnessConstant_(rwfpsf.roughnessConstant_), + roughnessFactor_(rwfpsf.roughnessFactor_) +{} + + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const nutURoughWallFunctionFvPatchScalarField& rwfpsf, + const DimensionedField& iF +) +: + nutWallFunctionFvPatchScalarField(rwfpsf, iF), + roughnessHeight_(rwfpsf.roughnessHeight_), + roughnessConstant_(rwfpsf.roughnessConstant_), + roughnessFactor_(rwfpsf.roughnessFactor_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp nutURoughWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + tmp magUp = mag(Uw.patchInternalField() - Uw); + + return calcYPlus(magUp()); +} + + +void nutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField::write(os); + writeLocalEntries(os); + os.writeKeyword("roughnessHeight") + << roughnessHeight_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessConstant") + << roughnessConstant_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessFactor") + << roughnessFactor_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutURoughWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H new file mode 100644 index 000000000..8e505f83c --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,238 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + Foam::incompressible::RASModels::nutURoughWallFunctionFvPatchScalarField + +Description + This boundary condition provides a turbulent kinematic viscosity condition + when using wall functions for rough walls, based on velocity. + +Usage + \table + Property | Description | Required | Default value + roughnessHeight | roughness height | yes | + roughnessConstant | roughness constanr | yes | + roughnessFactor | scaling factor | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + + { + type nutURoughWallFunction; + roughnessHeight 1e-5; + roughnessConstant 0.5; + roughnessFactor 1; + } + \endverbatim + +See also + Foam::nutWallFunctionFvPatchScalarField + +SourceFiles + nutURoughWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutURoughWallFunctionFvPatchScalarField_H +#define nutURoughWallFunctionFvPatchScalarField_H + +#include "nutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class nutURoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutURoughWallFunctionFvPatchScalarField +: + public nutWallFunctionFvPatchScalarField +{ + // Private data + + // Roughness model parameters + + //- Height + scalar roughnessHeight_; + + //- Constant + scalar roughnessConstant_; + + //- Scale factor + scalar roughnessFactor_; + + + // Protected Member Functions + + //- Calculate yPLus + virtual tmp calcYPlus(const scalarField& magUp) const; + + //- Calculate the turbulence viscosity + virtual tmp calcNut() const; + + +public: + + //- Runtime type information + TypeName("nutURoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutURoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + nutURoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // nutURoughWallFunctionFvPatchScalarField + // onto a new patch + nutURoughWallFunctionFvPatchScalarField + ( + const nutURoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutURoughWallFunctionFvPatchScalarField + ( + const nutURoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new nutURoughWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutURoughWallFunctionFvPatchScalarField + ( + const nutURoughWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new nutURoughWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the roughness height + scalar roughnessHeight() const + { + return roughnessHeight_; + } + + //- Return reference to the roughness height to allow adjustment + scalar& roughnessHeight() + { + return roughnessHeight_; + } + + + //- Return the roughness constant scale + scalar roughnessConstant() const + { + return roughnessConstant_; + } + + //- Return reference to the roughness constant to allow adjustment + scalar& roughnessConstant() + { + return roughnessConstant_; + } + + //- Return the roughness scale factor + scalar roughnessFactor() const + { + return roughnessFactor_; + } + + //- Return reference to the roughness scale factor to allow + // adjustment + scalar& roughnessFactor() + { + return roughnessFactor_; + } + + + // Evaluation functions + + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; + + + // I-O + + //- Write + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C new file mode 100644 index 000000000..8654a3117 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -0,0 +1,192 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "nutUWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp nutUWallFunctionFvPatchScalarField::calcYPlus +( + const scalarField& magUp +) const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const scalarField& y = turbModel.y()[patchI]; + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; + + tmp tyPlus(new scalarField(patch().size(), 0.0)); + scalarField& yPlus = tyPlus(); + + forAll(yPlus, faceI) + { + const scalar kappaRe = kappa_*magUp[faceI]*y[faceI]/nuw[faceI]; + + scalar yp = yPlusLam_; + const scalar ryPlusLam = 1.0/yp; + + label iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yp; + yp = (kappaRe + yp)/(1.0 + log(E_*yp)); + + } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.01 && ++iter < 10); + + yPlus[faceI] = max(0.0, yp); + } + + return tyPlus; +} + + +tmp nutUWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchI = patch().index(); + + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; + + tmp tyPlus = calcYPlus(magUp); + scalarField& yPlus = tyPlus(); + + tmp tnutw(new scalarField(patch().size(), 0.0)); + scalarField& nutw = tnutw(); + + forAll(yPlus, faceI) + { + if (yPlus[faceI] > yPlusLam_) + { + nutw[faceI] = + nuw[faceI]*(yPlus[faceI]*kappa_/log(E_*yPlus[faceI]) - 1.0); + } + } + + return tnutw; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + nutWallFunctionFvPatchScalarField(p, iF) +{} + + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict) +{} + + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const nutUWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const nutUWallFunctionFvPatchScalarField& wfpsf +) +: + nutWallFunctionFvPatchScalarField(wfpsf) +{} + + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const nutUWallFunctionFvPatchScalarField& wfpsf, + const DimensionedField& iF +) +: + nutWallFunctionFvPatchScalarField(wfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp nutUWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchI = patch().index(); + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + + return calcYPlus(magUp); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, nutUWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H new file mode 100644 index 000000000..d69229977 --- /dev/null +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H @@ -0,0 +1,168 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.1 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + foam-extend is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with foam-extend. If not, see . + +Class + Foam::incompressible::RASModels::nutkWallFunctionFvPatchScalarField + +Description + Boundary condition for turbulent (kinematic) viscosity when using wall + functions, based on velocity. + - replicates OpenFOAM v1.5 (and earlier) behaviour + +Usage + Example of the boundary condition specification: + \verbatim + + { + type nutUWallFunction; + } + \endverbatim + +See also + Foam::nutWallFunctionFvPatchScalarField + +SourceFiles + nutUWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutUWallFunctionFvPatchScalarField_H +#define nutUWallFunctionFvPatchScalarField_H + +#include "nutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class nutUWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutUWallFunctionFvPatchScalarField +: + public nutWallFunctionFvPatchScalarField +{ +protected: + + // Protected Member Functions + + //- Calculate yPLus. Helper function + tmp calcYPlus(const scalarField& magUp) const; + + //- Calculate the turbulence viscosity + virtual tmp calcNut() const; + + +public: + + //- Runtime type information + TypeName("nutUWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutUWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + nutUWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // nutUWallFunctionFvPatchScalarField + // onto a new patch + nutUWallFunctionFvPatchScalarField + ( + const nutUWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutUWallFunctionFvPatchScalarField + ( + const nutUWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new nutUWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutUWallFunctionFvPatchScalarField + ( + const nutUWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new nutUWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C index 3e9df999e..77e996220 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -38,13 +38,15 @@ namespace incompressible namespace RASModels { +defineTypeNameAndDebug(nutWallFunctionFvPatchScalarField, 0); + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void nutWallFunctionFvPatchScalarField::checkType() { if (!patch().isWall()) { - FatalErrorIn("nutWallFunctionFvPatchScalarField::checkType()") + FatalErrorIn(this->type() + "FvPatchScalarField::checkType()") << "Invalid wall function specification" << nl << " Patch type for patch " << patch().name() << " must be wall" << nl @@ -62,7 +64,7 @@ scalar nutWallFunctionFvPatchScalarField::calcYPlusLam { scalar ypl = 11.0; - for (int i=0; i<10; i++) + for (label i = 0; i < 10; ++i) { ypl = log(E*ypl)/kappa; } @@ -71,37 +73,6 @@ scalar nutWallFunctionFvPatchScalarField::calcYPlusLam } -tmp nutWallFunctionFvPatchScalarField::calcNut() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - - const scalar Cmu25 = pow(Cmu_, 0.25); - - tmp tnutw(new scalarField(patch().size(), 0.0)); - scalarField& nutw = tnutw(); - - forAll(nutw, faceI) - { - label faceCellI = patch().faceCells()[faceI]; - - scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/nuw[faceI]; - - if (yPlus > yPlusLam_) - { - nutw[faceI] = nuw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1.0); - } - } - - return tnutw; -} - - void nutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; @@ -198,28 +169,17 @@ nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField void nutWallFunctionFvPatchScalarField::updateCoeffs() { + if (updated()) + { + return; + } + operator==(calcNut()); fixedValueFvPatchScalarField::updateCoeffs(); } -tmp nutWallFunctionFvPatchScalarField::yPlus() const -{ - const label patchI = patch().index(); - - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField kwc = k.boundaryField()[patchI].patchInternalField(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - - return pow(Cmu_, 0.25)*y*sqrt(kwc)/nuw; -} - - void nutWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); @@ -228,10 +188,6 @@ void nutWallFunctionFvPatchScalarField::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, nutWallFunctionFvPatchScalarField); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace RASModels diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H index 489a9bc20..8ad80f671 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H @@ -25,10 +25,37 @@ Class Foam::incompressible::RASModels::nutWallFunctionFvPatchScalarField Description - Boundary condition for turbulent (kinematic) viscosity when using wall - functions + Abstract base class for boundary condition for turbulent (kinematic) + viscosity when using wall functions - replicates OpenFOAM v1.5 (and earlier) behaviour +Usage + \table + Property | Description | Required | Default value + Cmu | Cmu coefficient | no | 0.09 + kappa | Von Karman constant | no | 0.41 + E | E coefficient | no | 9.8 + \endtable + + Examples of the boundary condition specification: + \verbatim + + { + type nutWallFunction; + value uniform 0.0; + } + \endverbatim + + Reference for the default model coefficients: + \verbatim + H. Versteeg, W. Malalasekera + An Introduction to Computational Fluid Dynamics: The Finite Volume + Method, subsection "3.5.2 k-epsilon model" + \endverbatim + +See also + Foam::fixedValueFvPatchField + SourceFiles nutWallFunctionFvPatchScalarField.C @@ -73,7 +100,7 @@ protected: scalar yPlusLam_; - // Protected member functions + // Protected Member Functions //- Check the type of the patch virtual void checkType(); @@ -82,7 +109,7 @@ protected: virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const; //- Calculate the turbulence viscosity - virtual tmp calcNut() const; + virtual tmp calcNut() const = 0; //- Write local wall function variables virtual void writeLocalEntries(Ostream&) const; @@ -128,15 +155,6 @@ public: const nutWallFunctionFvPatchScalarField& ); - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new nutWallFunctionFvPatchScalarField(*this) - ); - } - //- Construct as copy setting internal field reference nutWallFunctionFvPatchScalarField ( @@ -144,25 +162,13 @@ public: const DimensionedField& ); - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new nutWallFunctionFvPatchScalarField(*this, iF) - ); - } - // Member functions // Evaluation functions //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; + virtual tmp yPlus() const = 0; //- Update the coefficients associated with the patch field virtual void updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C similarity index 67% rename from src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C rename to src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C index 59bf970d6..9c2d61484 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "nutRoughWallFunctionFvPatchScalarField.H" +#include "nutkRoughWallFunctionFvPatchScalarField.H" #include "RASModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" @@ -40,7 +40,7 @@ namespace RASModels // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -scalar nutRoughWallFunctionFvPatchScalarField::fnRough +scalar nutkRoughWallFunctionFvPatchScalarField::fnRough ( const scalar KsPlus, const scalar Cs @@ -63,28 +63,32 @@ scalar nutRoughWallFunctionFvPatchScalarField::fnRough } -tmp nutRoughWallFunctionFvPatchScalarField::calcNut() const +tmp nutkRoughWallFunctionFvPatchScalarField::calcNut() const { const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const tmp tk = rasModel.k(); - const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const turbulenceModel& turbModel = + db().lookupObject("turbulenceModel"); - const scalar Cmu25 = pow(Cmu_, 0.25); + const scalarField& y = turbModel.y()[patchI]; + const tmp tk = turbModel.k(); + const volScalarField& k = tk(); + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; + + const scalar Cmu25 = pow025(Cmu_); tmp tnutw(new scalarField(*this)); scalarField& nutw = tnutw(); + const unallocLabelList& fc = patch().faceCells(); + forAll(nutw, faceI) { - label faceCellI = patch().faceCells()[faceI]; + const label faceCellI = fc[faceI]; - scalar uStar = Cmu25*sqrt(k[faceCellI]); - scalar yPlus = uStar*y[faceI]/nuw[faceI]; - scalar KsPlus = uStar*Ks_[faceI]/nuw[faceI]; + const scalar uStar = Cmu25*sqrt(k[faceCellI]); + const scalar yPlus = uStar*y[faceI]/nuw[faceI]; + const scalar KsPlus = uStar*Ks_[faceI]/nuw[faceI]; scalar Edash = E_; @@ -105,7 +109,7 @@ tmp nutRoughWallFunctionFvPatchScalarField::calcNut() const min ( nuw[faceI] - *(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1), + *(yPlus*kappa_/log(max(Edash*yPlus, 1 + 1e-4)) - 1.0), 2*limitingNutw ), 0.5*limitingNutw ); @@ -127,63 +131,63 @@ tmp nutRoughWallFunctionFvPatchScalarField::calcNut() const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF ) : - nutWallFunctionFvPatchScalarField(p, iF), + nutkWallFunctionFvPatchScalarField(p, iF), Ks_(p.size(), 0.0), Cs_(p.size(), 0.0) {} -nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField ( - const nutRoughWallFunctionFvPatchScalarField& ptf, + const nutkRoughWallFunctionFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper ) : - nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), Ks_(ptf.Ks_, mapper), Cs_(ptf.Cs_, mapper) {} -nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : - nutWallFunctionFvPatchScalarField(p, iF, dict), + nutkWallFunctionFvPatchScalarField(p, iF, dict), Ks_("Ks", dict, p.size()), Cs_("Cs", dict, p.size()) {} -nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField ( - const nutRoughWallFunctionFvPatchScalarField& rwfpsf + const nutkRoughWallFunctionFvPatchScalarField& rwfpsf ) : - nutWallFunctionFvPatchScalarField(rwfpsf), + nutkWallFunctionFvPatchScalarField(rwfpsf), Ks_(rwfpsf.Ks_), Cs_(rwfpsf.Cs_) {} -nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField ( - const nutRoughWallFunctionFvPatchScalarField& rwfpsf, + const nutkRoughWallFunctionFvPatchScalarField& rwfpsf, const DimensionedField& iF ) : - nutWallFunctionFvPatchScalarField(rwfpsf, iF), + nutkWallFunctionFvPatchScalarField(rwfpsf, iF), Ks_(rwfpsf.Ks_), Cs_(rwfpsf.Cs_) {} @@ -191,34 +195,34 @@ nutRoughWallFunctionFvPatchScalarField::nutRoughWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void nutRoughWallFunctionFvPatchScalarField::autoMap +void nutkRoughWallFunctionFvPatchScalarField::autoMap ( const fvPatchFieldMapper& m ) { - nutWallFunctionFvPatchScalarField::autoMap(m); + nutkWallFunctionFvPatchScalarField::autoMap(m); Ks_.autoMap(m); Cs_.autoMap(m); } -void nutRoughWallFunctionFvPatchScalarField::rmap +void nutkRoughWallFunctionFvPatchScalarField::rmap ( const fvPatchScalarField& ptf, const labelList& addr ) { - nutWallFunctionFvPatchScalarField::rmap(ptf, addr); + nutkWallFunctionFvPatchScalarField::rmap(ptf, addr); - const nutRoughWallFunctionFvPatchScalarField& nrwfpsf = - refCast(ptf); + const nutkRoughWallFunctionFvPatchScalarField& nrwfpsf = + refCast(ptf); Ks_.rmap(nrwfpsf.Ks_, addr); Cs_.rmap(nrwfpsf.Cs_, addr); } -void nutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const +void nutkRoughWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); writeLocalEntries(os); @@ -230,7 +234,11 @@ void nutRoughWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, nutRoughWallFunctionFvPatchScalarField); +makePatchTypeField +( + fvPatchScalarField, + nutkRoughWallFunctionFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H similarity index 70% rename from src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H rename to src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H index a42832e56..8ed37d45f 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with foam-extend. If not, see . Class - Foam::incompressible::RASModels::nutRoughWallFunctionFvPatchScalarField + Foam::incompressible::RASModels::nutkRoughWallFunctionFvPatchScalarField Description Boundary condition for turbulent (kinematic) viscosity when using wall @@ -34,15 +34,32 @@ Description - roughness height = sand-grain roughness (0 for smooth walls) - roughness constant = 0.5-1.0 (0.5 default) +Usage + \table + Property | Description | Required | Default value + Ks | sand-grain roughness height | yes | + Cs | roughness constant | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + + { + type nutkRoughWallFunction; + Ks uniform 0; + Cs uniform 0.5; + } + \endverbatim + SourceFiles - nutRoughWallFunctionFvPatchScalarField.C + nutkRoughWallFunctionFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef nutRoughWallFunctionFvPatchScalarField_H -#define nutRoughWallFunctionFvPatchScalarField_H +#ifndef nutkRoughWallFunctionFvPatchScalarField_H +#define nutkRoughWallFunctionFvPatchScalarField_H -#include "nutWallFunctionFvPatchScalarField.H" +#include "nutkWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,12 +71,12 @@ namespace RASModels { /*---------------------------------------------------------------------------*\ - Class nutRoughWallFunctionFvPatchScalarField Declaration + Class nutkRoughWallFunctionFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class nutRoughWallFunctionFvPatchScalarField +class nutkRoughWallFunctionFvPatchScalarField : - public nutWallFunctionFvPatchScalarField + public nutkWallFunctionFvPatchScalarField { protected: @@ -72,7 +89,7 @@ protected: scalarField Cs_; - // Protected member functions + // Protected Member Functions //- Compute the roughness function virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const; @@ -84,20 +101,20 @@ protected: public: //- Runtime type information - TypeName("nutRoughWallFunction"); + TypeName("nutkRoughWallFunction"); // Constructors //- Construct from patch and internal field - nutRoughWallFunctionFvPatchScalarField + nutkRoughWallFunctionFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - nutRoughWallFunctionFvPatchScalarField + nutkRoughWallFunctionFvPatchScalarField ( const fvPatch&, const DimensionedField&, @@ -105,20 +122,20 @@ public: ); //- Construct by mapping given - // nutRoughWallFunctionFvPatchScalarField + // nutkRoughWallFunctionFvPatchScalarField // onto a new patch - nutRoughWallFunctionFvPatchScalarField + nutkRoughWallFunctionFvPatchScalarField ( - const nutRoughWallFunctionFvPatchScalarField&, + const nutkRoughWallFunctionFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - nutRoughWallFunctionFvPatchScalarField + nutkRoughWallFunctionFvPatchScalarField ( - const nutRoughWallFunctionFvPatchScalarField& + const nutkRoughWallFunctionFvPatchScalarField& ); //- Construct and return a clone @@ -126,14 +143,14 @@ public: { return tmp ( - new nutRoughWallFunctionFvPatchScalarField(*this) + new nutkRoughWallFunctionFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - nutRoughWallFunctionFvPatchScalarField + nutkRoughWallFunctionFvPatchScalarField ( - const nutRoughWallFunctionFvPatchScalarField&, + const nutkRoughWallFunctionFvPatchScalarField&, const DimensionedField& ); @@ -145,13 +162,28 @@ public: { return tmp ( - new nutRoughWallFunctionFvPatchScalarField(*this, iF) + new nutkRoughWallFunctionFvPatchScalarField(*this, iF) ); } // Member functions + // Acces functions + + // Return Ks + scalarField& Ks() + { + return Ks_; + } + + // Return Cs + scalarField& Cs() + { + return Cs_; + } + + // Mapping functions //- Map (and resize as needed) from self given a mapping object 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 9eb64d6c5..6521fcde9 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -40,58 +40,31 @@ namespace RASModels // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void nutkWallFunctionFvPatchScalarField::checkType() -{ - if (!patch().isWall()) - { - FatalErrorIn("nutkWallFunctionFvPatchScalarField::checkType()") - << "Invalid wall function specification" << nl - << " Patch type for patch " << patch().name() - << " must be wall" << nl - << " Current patch type is " << patch().type() << nl << endl - << abort(FatalError); - } -} - - -scalar nutkWallFunctionFvPatchScalarField::calcYPlusLam -( - const scalar kappa, - const scalar E -) const -{ - scalar ypl = 11.0; - - for (int i = 0; i < 10; i++) - { - ypl = log(E*ypl)/kappa; - } - - return ypl; -} - - tmp nutkWallFunctionFvPatchScalarField::calcNut() const { - const label patchi = patch().index(); + const label patchI = patch().index(); const turbulenceModel& turbModel = db().lookupObject("turbulenceModel"); - const scalarField& y = turbModel.y()[patchi]; + + const scalarField& y = turbModel.y()[patchI]; const tmp tk = turbModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = turbModel.nu().boundaryField()[patchi]; + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); tmp tnutw(new scalarField(patch().size(), 0.0)); scalarField& nutw = tnutw(); + // Get face cells + const unallocLabelList& fc = patch().faceCells(); + forAll(nutw, faceI) { - label faceCellI = patch().faceCells()[faceI]; + const label faceCellI = fc[faceI]; - scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/nuw[faceI]; + const scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/nuw[faceI]; if (yPlus > yPlusLam_) { @@ -103,14 +76,6 @@ tmp nutkWallFunctionFvPatchScalarField::calcNut() const } -void nutkWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const -{ - os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; - os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; - os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField @@ -119,14 +84,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF), - Cmu_(0.09), - kappa_(0.41), - E_(9.8), - yPlusLam_(calcYPlusLam(kappa_, E_)) -{ - checkType(); -} + nutWallFunctionFvPatchScalarField(p, iF) +{} nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField @@ -136,14 +95,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict), - Cmu_(dict.lookupOrDefault("Cmu", 0.09)), - kappa_(dict.lookupOrDefault("kappa", 0.41)), - E_(dict.lookupOrDefault("E", 9.8)), - yPlusLam_(calcYPlusLam(kappa_, E_)) -{ - checkType(); -} + nutWallFunctionFvPatchScalarField(p, iF, dict) +{} nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField @@ -154,14 +107,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper), - Cmu_(ptf.Cmu_), - kappa_(ptf.kappa_), - E_(ptf.E_), - yPlusLam_(ptf.yPlusLam_) -{ - checkType(); -} + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField @@ -169,14 +116,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField const nutkWallFunctionFvPatchScalarField& wfpsf ) : - fixedValueFvPatchScalarField(wfpsf), - Cmu_(wfpsf.Cmu_), - kappa_(wfpsf.kappa_), - E_(wfpsf.E_), - yPlusLam_(wfpsf.yPlusLam_) -{ - checkType(); -} + nutWallFunctionFvPatchScalarField(wfpsf) +{} nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField @@ -185,56 +126,29 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(wfpsf, iF), - Cmu_(wfpsf.Cmu_), - kappa_(wfpsf.kappa_), - E_(wfpsf.E_), - yPlusLam_(wfpsf.yPlusLam_) -{ - checkType(); -} + nutWallFunctionFvPatchScalarField(wfpsf, iF) +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void nutkWallFunctionFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - operator==(calcNut()); - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - tmp nutkWallFunctionFvPatchScalarField::yPlus() const { - const label patchi = patch().index(); + const label patchI = patch().index(); const turbulenceModel& turbModel = db().lookupObject("turbulenceModel"); - const scalarField& y = turbModel.y()[patchi]; + const scalarField& y = turbModel.y()[patchI]; const tmp tk = turbModel.k(); const volScalarField& k = tk(); - const scalarField kwc = k.boundaryField()[patchi].patchInternalField(); - const scalarField& nuw = turbModel.nu().boundaryField()[patchi]; + const scalarField kwc = k.boundaryField()[patchI].patchInternalField(); + const scalarField& nuw = turbModel.nu().boundaryField()[patchI]; return pow025(Cmu_)*y*sqrt(kwc)/nuw; } -void nutkWallFunctionFvPatchScalarField::write(Ostream& os) const -{ - fvPatchField::write(os); - writeLocalEntries(os); - writeEntry("value", os); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField(fvPatchScalarField, nutkWallFunctionFvPatchScalarField); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H index 0605f20fd..d8513d11c 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H @@ -29,6 +29,18 @@ Description functions, based on turbulence kinetic energy. - replicates OpenFOAM v1.5 (and earlier) behaviour +Usage + Example of the boundary condition specification: + \verbatim + + { + type nutkWallFunction; + } + \endverbatim + +See also + Foam::nutWallFunctionFvPatchScalarField + SourceFiles nutkWallFunctionFvPatchScalarField.C @@ -37,7 +49,7 @@ SourceFiles #ifndef nutkWallFunctionFvPatchScalarField_H #define nutkWallFunctionFvPatchScalarField_H -#include "fixedValueFvPatchFields.H" +#include "nutWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,39 +66,15 @@ namespace RASModels class nutkWallFunctionFvPatchScalarField : - public fixedValueFvPatchScalarField + public nutWallFunctionFvPatchScalarField { protected: - // Protected data - - //- Cmu coefficient - scalar Cmu_; - - //- Von Karman constant - scalar kappa_; - - //- E coefficient - scalar E_; - - //- Y+ at the edge of the laminar sublayer - scalar yPlusLam_; - - - // Protected member functions - - //- Check the type of the patch - virtual void checkType(); - - //- Calculate the Y+ at the edge of the laminar sublayer - virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const; + // Protected Member Functions //- Calculate the turbulence viscosity virtual tmp calcNut() const; - //- Write local wall function variables - virtual void writeLocalEntries(Ostream&) const; - public: @@ -159,19 +147,8 @@ public: // Member functions - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp yPlus() const; - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // I-O - - //- Write - virtual void write(Ostream&) const; + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; }; diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/mut b/tutorials/combustion/dieselFoam/aachenBomb/0/mut index a442f9a7e..570078e6c 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/mut +++ b/tutorials/combustion/dieselFoam/aachenBomb/0/mut @@ -23,7 +23,7 @@ boundaryField { walls { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } } diff --git a/tutorials/combustion/engineFoam/kivaTest/-180/mut b/tutorials/combustion/engineFoam/kivaTest/-180/mut index bb9883aff..9e5a89e1a 100644 --- a/tutorials/combustion/engineFoam/kivaTest/-180/mut +++ b/tutorials/combustion/engineFoam/kivaTest/-180/mut @@ -23,7 +23,7 @@ boundaryField { piston { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -31,7 +31,7 @@ boundaryField } liner { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -39,7 +39,7 @@ boundaryField } cylinderHead { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/dbnsTurbFoam/naca0012/0/mut b/tutorials/compressible/dbnsTurbFoam/naca0012/0/mut index 4dc547c23..3f937359a 100644 --- a/tutorials/compressible/dbnsTurbFoam/naca0012/0/mut +++ b/tutorials/compressible/dbnsTurbFoam/naca0012/0/mut @@ -23,7 +23,7 @@ boundaryField { wall { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/rhoPimpleFoam/angledDuct/0/mut b/tutorials/compressible/rhoPimpleFoam/angledDuct/0/mut index a15d25384..01eaa6724 100644 --- a/tutorials/compressible/rhoPimpleFoam/angledDuct/0/mut +++ b/tutorials/compressible/rhoPimpleFoam/angledDuct/0/mut @@ -23,22 +23,22 @@ boundaryField { front { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } back { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } wall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } porosityWall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } inlet diff --git a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/mut b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/mut index 1bd82d2fe..a8a47e3d9 100644 --- a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/mut +++ b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/mut @@ -23,7 +23,7 @@ boundaryField { movingWall { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -31,7 +31,7 @@ boundaryField } fixedWalls { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/0/mut b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/0/mut index c16b7fbe9..230906aeb 100644 --- a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/0/mut +++ b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/0/mut @@ -23,13 +23,13 @@ boundaryField { rotor { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } stator { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/0/mut b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/0/mut index a3d6db9b7..248aef0d1 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/0/mut +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/0/mut @@ -23,25 +23,25 @@ boundaryField { front { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } back { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } wall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } porosityWall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/mut b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/mut index a3d6db9b7..248aef0d1 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/mut +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/mut @@ -23,25 +23,25 @@ boundaryField { front { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } back { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } wall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } porosityWall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } diff --git a/tutorials/compressible/sonicFoam/ras/prism/0/mut b/tutorials/compressible/sonicFoam/ras/prism/0/mut index 8b51a979d..d784f961f 100644 --- a/tutorials/compressible/sonicFoam/ras/prism/0/mut +++ b/tutorials/compressible/sonicFoam/ras/prism/0/mut @@ -43,7 +43,7 @@ boundaryField } prismWall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } defaultFaces diff --git a/tutorials/compressible/steadyCompressibleMRFFoam/bentRotorStator/0/mut b/tutorials/compressible/steadyCompressibleMRFFoam/bentRotorStator/0/mut index 57f46645d..49cfcf9ce 100644 --- a/tutorials/compressible/steadyCompressibleMRFFoam/bentRotorStator/0/mut +++ b/tutorials/compressible/steadyCompressibleMRFFoam/bentRotorStator/0/mut @@ -33,7 +33,7 @@ boundaryField } bladeRotor { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -41,7 +41,7 @@ boundaryField } shaftRotor { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -49,7 +49,7 @@ boundaryField } shroudRotor { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -57,7 +57,7 @@ boundaryField } bladeStator { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -65,7 +65,7 @@ boundaryField } shaftStator { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -73,7 +73,7 @@ boundaryField } shroudStator { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/steadyCompressibleMRFFoam/simpleRotorStator/0/mut b/tutorials/compressible/steadyCompressibleMRFFoam/simpleRotorStator/0/mut index 57f46645d..49cfcf9ce 100644 --- a/tutorials/compressible/steadyCompressibleMRFFoam/simpleRotorStator/0/mut +++ b/tutorials/compressible/steadyCompressibleMRFFoam/simpleRotorStator/0/mut @@ -33,7 +33,7 @@ boundaryField } bladeRotor { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -41,7 +41,7 @@ boundaryField } shaftRotor { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -49,7 +49,7 @@ boundaryField } shroudRotor { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -57,7 +57,7 @@ boundaryField } bladeStator { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -65,7 +65,7 @@ boundaryField } shaftStator { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -73,7 +73,7 @@ boundaryField } shroudStator { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/steadyCompressibleSRFFoam/bentBlade/0/mut b/tutorials/compressible/steadyCompressibleSRFFoam/bentBlade/0/mut index f83ad3f8b..eb61a7e11 100644 --- a/tutorials/compressible/steadyCompressibleSRFFoam/bentBlade/0/mut +++ b/tutorials/compressible/steadyCompressibleSRFFoam/bentBlade/0/mut @@ -33,7 +33,7 @@ boundaryField } blade { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -41,7 +41,7 @@ boundaryField } shaft { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -49,7 +49,7 @@ boundaryField } shroud { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/steadyCompressibleSRFFoam/simpleBlade/0/mut b/tutorials/compressible/steadyCompressibleSRFFoam/simpleBlade/0/mut index f83ad3f8b..eb61a7e11 100644 --- a/tutorials/compressible/steadyCompressibleSRFFoam/simpleBlade/0/mut +++ b/tutorials/compressible/steadyCompressibleSRFFoam/simpleBlade/0/mut @@ -33,7 +33,7 @@ boundaryField } blade { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -41,7 +41,7 @@ boundaryField } shaft { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -49,7 +49,7 @@ boundaryField } shroud { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineGgiJump/0/mut b/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineGgiJump/0/mut index 619577c60..d2561e1e8 100644 --- a/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineGgiJump/0/mut +++ b/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineGgiJump/0/mut @@ -38,7 +38,7 @@ boundaryField } GVBLADE { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -46,7 +46,7 @@ boundaryField } GVHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -54,7 +54,7 @@ boundaryField } GVSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -82,7 +82,7 @@ boundaryField } RUBLADE { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -90,7 +90,7 @@ boundaryField } RUHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -98,7 +98,7 @@ boundaryField } RUSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -126,7 +126,7 @@ boundaryField } DTHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -134,7 +134,7 @@ boundaryField } DTSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineGgiJump/save/mut b/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineGgiJump/save/mut index 619577c60..d2561e1e8 100644 --- a/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineGgiJump/save/mut +++ b/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineGgiJump/save/mut @@ -38,7 +38,7 @@ boundaryField } GVBLADE { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -46,7 +46,7 @@ boundaryField } GVHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -54,7 +54,7 @@ boundaryField } GVSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -82,7 +82,7 @@ boundaryField } RUBLADE { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -90,7 +90,7 @@ boundaryField } RUHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -98,7 +98,7 @@ boundaryField } RUSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -126,7 +126,7 @@ boundaryField } DTHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -134,7 +134,7 @@ boundaryField } DTSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineMixingPlane/0/mut b/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineMixingPlane/0/mut index 98af9fa76..51246c0be 100644 --- a/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineMixingPlane/0/mut +++ b/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineMixingPlane/0/mut @@ -38,7 +38,7 @@ boundaryField } GVBLADE { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -46,7 +46,7 @@ boundaryField } GVHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -54,7 +54,7 @@ boundaryField } GVSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -82,7 +82,7 @@ boundaryField } RUBLADE { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -90,7 +90,7 @@ boundaryField } RUHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -98,7 +98,7 @@ boundaryField } RUSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -126,7 +126,7 @@ boundaryField } DTHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -134,7 +134,7 @@ boundaryField } DTSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineMixingPlane/save/mut b/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineMixingPlane/save/mut index 98af9fa76..51246c0be 100644 --- a/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineMixingPlane/save/mut +++ b/tutorials/compressible/steadyUniversalMRFFoam/axialTurbineMixingPlane/save/mut @@ -38,7 +38,7 @@ boundaryField } GVBLADE { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -46,7 +46,7 @@ boundaryField } GVHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -54,7 +54,7 @@ boundaryField } GVSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -82,7 +82,7 @@ boundaryField } RUBLADE { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -90,7 +90,7 @@ boundaryField } RUHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -98,7 +98,7 @@ boundaryField } RUSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -126,7 +126,7 @@ boundaryField } DTHUB { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -134,7 +134,7 @@ boundaryField } DTSHROUD { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/coupled/conjugateHeatFoam/conjugateCavity/0/nut b/tutorials/coupled/conjugateHeatFoam/conjugateCavity/0/nut index 026ef64c3..502a37cc4 100644 --- a/tutorials/coupled/conjugateHeatFoam/conjugateCavity/0/nut +++ b/tutorials/coupled/conjugateHeatFoam/conjugateCavity/0/nut @@ -127,7 +127,7 @@ boundaryField { movingWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -135,7 +135,7 @@ boundaryField } left { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -143,7 +143,7 @@ boundaryField } right { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -151,7 +151,7 @@ boundaryField } bottom { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/coupled/conjugateHeatSimpleFoam/conjugateCavity/0/nut b/tutorials/coupled/conjugateHeatSimpleFoam/conjugateCavity/0/nut index 026ef64c3..502a37cc4 100644 --- a/tutorials/coupled/conjugateHeatSimpleFoam/conjugateCavity/0/nut +++ b/tutorials/coupled/conjugateHeatSimpleFoam/conjugateCavity/0/nut @@ -127,7 +127,7 @@ boundaryField { movingWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -135,7 +135,7 @@ boundaryField } left { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -143,7 +143,7 @@ boundaryField } right { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -151,7 +151,7 @@ boundaryField } bottom { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/nut b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/nut index 815a449e8..52a638866 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/nut +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/nut @@ -23,17 +23,17 @@ boundaryField { floor { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } ceiling { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } fixedWalls { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } } diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/nut b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/nut index 815a449e8..52a638866 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/nut +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/nut @@ -23,17 +23,17 @@ boundaryField { floor { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } ceiling { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } fixedWalls { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } } diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut index 669ad53fc..065942800 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/0/nut @@ -23,25 +23,25 @@ boundaryField { ground { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } igloo_region0 { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } twoFridgeFreezers_seal_0 { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } twoFridgeFreezers_herring_1 { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } } diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/mut b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/mut index 710ae1512..0914bfb79 100644 --- a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/mut +++ b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/mut @@ -23,17 +23,17 @@ boundaryField { floor { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } ceiling { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } fixedWalls { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } } diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut index 5383ca7ba..3881f5cef 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut @@ -23,7 +23,7 @@ boundaryField { box { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -31,7 +31,7 @@ boundaryField } floor { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -39,7 +39,7 @@ boundaryField } ceiling { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -47,7 +47,7 @@ boundaryField } fixedWalls { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOMSpecularCeiling/0/mut b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOMSpecularCeiling/0/mut index 5383ca7ba..3881f5cef 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOMSpecularCeiling/0/mut +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOMSpecularCeiling/0/mut @@ -23,7 +23,7 @@ boundaryField { box { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -31,7 +31,7 @@ boundaryField } floor { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -39,7 +39,7 @@ boundaryField } ceiling { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -47,7 +47,7 @@ boundaryField } fixedWalls { - type mutWallFunction; + type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/immersedBoundary/pitzDailyBodyFitted/constant/polyMesh/boundary b/tutorials/immersedBoundary/pitzDailyBodyFitted/constant/polyMesh/boundary new file mode 100644 index 000000000..e401dca6e --- /dev/null +++ b/tutorials/immersedBoundary/pitzDailyBodyFitted/constant/polyMesh/boundary @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | foam-extend: Open Source CFD | +| \\ / O peration | Version: 4.1 | +| \\ / A nd | Web: http://www.foam-extend.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +5 +( + inlet + { + type patch; + nFaces 30; + startFace 24170; + } + outlet + { + type patch; + nFaces 57; + startFace 24200; + } + upperWall + { + type wall; + nFaces 223; + startFace 24257; + } + lowerWall + { + type wall; + nFaces 250; + startFace 24480; + } + frontAndBack + { + type empty; + nFaces 24450; + startFace 24730; + } +) + + +// ************************************************************************* // diff --git a/tutorials/immersedBoundary/pitzDailyTurbulent/0_org/nut b/tutorials/immersedBoundary/pitzDailyTurbulent/0_org/nut index 8a7a4e6ad..2e6d6d95c 100644 --- a/tutorials/immersedBoundary/pitzDailyTurbulent/0_org/nut +++ b/tutorials/immersedBoundary/pitzDailyTurbulent/0_org/nut @@ -23,7 +23,7 @@ boundaryField { pitzDailyIB { - type nutWallFunction; + type nutkWallFunction; patchType immersedBoundary; value uniform 0; } diff --git a/tutorials/incompressible/MRFSimpleFoam/axialTurbine_ggi/0_orig/nut b/tutorials/incompressible/MRFSimpleFoam/axialTurbine_ggi/0_orig/nut index 01fc587ee..c89d2d281 100644 --- a/tutorials/incompressible/MRFSimpleFoam/axialTurbine_ggi/0_orig/nut +++ b/tutorials/incompressible/MRFSimpleFoam/axialTurbine_ggi/0_orig/nut @@ -38,7 +38,7 @@ boundaryField } GVBLADE { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -46,7 +46,7 @@ boundaryField } GVHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -54,7 +54,7 @@ boundaryField } GVSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -82,7 +82,7 @@ boundaryField } RUBLADE { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -90,7 +90,7 @@ boundaryField } RUHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -98,7 +98,7 @@ boundaryField } RUSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -126,7 +126,7 @@ boundaryField } DTHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -134,7 +134,7 @@ boundaryField } DTSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/MRFSimpleFoam/axialTurbine_mixingPlane/0_orig/nut b/tutorials/incompressible/MRFSimpleFoam/axialTurbine_mixingPlane/0_orig/nut index 8df1e34ad..f177e3e74 100644 --- a/tutorials/incompressible/MRFSimpleFoam/axialTurbine_mixingPlane/0_orig/nut +++ b/tutorials/incompressible/MRFSimpleFoam/axialTurbine_mixingPlane/0_orig/nut @@ -38,7 +38,7 @@ boundaryField } GVBLADE { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -46,7 +46,7 @@ boundaryField } GVHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -54,7 +54,7 @@ boundaryField } GVSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -82,7 +82,7 @@ boundaryField } RUBLADE { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -90,7 +90,7 @@ boundaryField } RUHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -98,7 +98,7 @@ boundaryField } RUSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -126,7 +126,7 @@ boundaryField } DTHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -134,7 +134,7 @@ boundaryField } DTSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/boundaryFoam/boundaryTwoWallsFlowSolution/0/nut b/tutorials/incompressible/boundaryFoam/boundaryTwoWallsFlowSolution/0/nut index aa4096e46..31b52b731 100644 --- a/tutorials/incompressible/boundaryFoam/boundaryTwoWallsFlowSolution/0/nut +++ b/tutorials/incompressible/boundaryFoam/boundaryTwoWallsFlowSolution/0/nut @@ -23,7 +23,7 @@ boundaryField { lowerWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -31,7 +31,7 @@ boundaryField } upperWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/0/nut b/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/0/nut index 78aae8c63..74bd7dc27 100644 --- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/0/nut +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/0/nut @@ -23,7 +23,7 @@ boundaryField { lowerWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -31,7 +31,7 @@ boundaryField } upperWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/0/nut b/tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/0/nut index 6391dc19a..28c1e9efa 100644 --- a/tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/0/nut +++ b/tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/0/nut @@ -33,7 +33,7 @@ boundaryField } upperWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -41,7 +41,7 @@ boundaryField } lowerWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/save/nut b/tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/save/nut index 6391dc19a..28c1e9efa 100644 --- a/tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/save/nut +++ b/tutorials/incompressible/pUCoupledFoam/backwardFacingStepTurbulent/save/nut @@ -33,7 +33,7 @@ boundaryField } upperWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -41,7 +41,7 @@ boundaryField } lowerWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/pimpleDyMFoam/axialTurbine/0_orig/nut b/tutorials/incompressible/pimpleDyMFoam/axialTurbine/0_orig/nut index 4e18be124..e5aca3fab 100644 --- a/tutorials/incompressible/pimpleDyMFoam/axialTurbine/0_orig/nut +++ b/tutorials/incompressible/pimpleDyMFoam/axialTurbine/0_orig/nut @@ -43,7 +43,7 @@ boundaryField } GVBLADE { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -51,7 +51,7 @@ boundaryField } GVHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -59,7 +59,7 @@ boundaryField } GVSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -87,7 +87,7 @@ boundaryField } RUBLADE { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -95,7 +95,7 @@ boundaryField } RUHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -103,7 +103,7 @@ boundaryField } RUSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -131,7 +131,7 @@ boundaryField } DTHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -139,7 +139,7 @@ boundaryField } DTSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon b/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon index c84955ab0..41d40744f 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/epsilon @@ -42,8 +42,7 @@ boundaryField defaultFaces { - type epsilonWallFunction; - value uniform 0; + type empty; } } diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/k b/tutorials/incompressible/pimpleFoam/t-junction/0/k index a2c7d4cbf..dae6c0334 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/k +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/k @@ -42,8 +42,7 @@ boundaryField defaultFaces { - type kqRWallFunction; - value uniform 0; + type empty; } } diff --git a/tutorials/incompressible/pimpleFoam/t-junction/0/nut b/tutorials/incompressible/pimpleFoam/t-junction/0/nut index b5f08955c..3091704c9 100644 --- a/tutorials/incompressible/pimpleFoam/t-junction/0/nut +++ b/tutorials/incompressible/pimpleFoam/t-junction/0/nut @@ -41,8 +41,7 @@ boundaryField defaultFaces { - type nutWallFunction; - value uniform 0; + type empty; } } diff --git a/tutorials/incompressible/pisoFoam/ras/cavity/0/nut b/tutorials/incompressible/pisoFoam/ras/cavity/0/nut index a8c4ddf61..b16fc934c 100644 --- a/tutorials/incompressible/pisoFoam/ras/cavity/0/nut +++ b/tutorials/incompressible/pisoFoam/ras/cavity/0/nut @@ -23,12 +23,12 @@ boundaryField { movingWall { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } fixedWalls { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } frontAndBack diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/0/nut b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/0/nut index 08b54490a..345384267 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/0/nut +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/0/nut @@ -23,25 +23,25 @@ boundaryField { front { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } back { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } wall { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } porosityWall { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut index 08b54490a..345384267 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut @@ -23,25 +23,25 @@ boundaryField { front { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } back { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } wall { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } porosityWall { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } diff --git a/tutorials/incompressible/simpleFoam/motorBike/0/nut b/tutorials/incompressible/simpleFoam/motorBike/0/nut index 0cdaa83a1..fd1ad0a8b 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/0/nut +++ b/tutorials/incompressible/simpleFoam/motorBike/0/nut @@ -41,7 +41,7 @@ boundaryField lowerWall { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } @@ -53,7 +53,7 @@ boundaryField "motorBike_.*" { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } } diff --git a/tutorials/incompressible/simpleFoam/pitzDaily/0/nut b/tutorials/incompressible/simpleFoam/pitzDaily/0/nut index 6391dc19a..28c1e9efa 100644 --- a/tutorials/incompressible/simpleFoam/pitzDaily/0/nut +++ b/tutorials/incompressible/simpleFoam/pitzDaily/0/nut @@ -33,7 +33,7 @@ boundaryField } upperWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -41,7 +41,7 @@ boundaryField } lowerWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/simpleFoam/pitzDaily3Blocks/0/nut b/tutorials/incompressible/simpleFoam/pitzDaily3Blocks/0/nut index 4c51b481e..ab8fa0a8a 100644 --- a/tutorials/incompressible/simpleFoam/pitzDaily3Blocks/0/nut +++ b/tutorials/incompressible/simpleFoam/pitzDaily3Blocks/0/nut @@ -33,7 +33,7 @@ boundaryField } upperWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -41,7 +41,7 @@ boundaryField } lowerWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -49,7 +49,7 @@ boundaryField } lowerWallInterface { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -57,7 +57,7 @@ boundaryField } lowerWallInlet { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/simpleSRFFoam/axialTurbine/0_orig/nut b/tutorials/incompressible/simpleSRFFoam/axialTurbine/0_orig/nut index ee99c13cf..6ed4da72c 100644 --- a/tutorials/incompressible/simpleSRFFoam/axialTurbine/0_orig/nut +++ b/tutorials/incompressible/simpleSRFFoam/axialTurbine/0_orig/nut @@ -43,7 +43,7 @@ boundaryField } RUBLADE { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -51,7 +51,7 @@ boundaryField } RUHUB { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -59,7 +59,7 @@ boundaryField } RUSHROUD { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/0/nut b/tutorials/incompressible/simpleSRFFoam/mixer/0/nut index ad7ebe801..e35ce6a51 100644 --- a/tutorials/incompressible/simpleSRFFoam/mixer/0/nut +++ b/tutorials/incompressible/simpleSRFFoam/mixer/0/nut @@ -33,7 +33,7 @@ boundaryField } innerWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; @@ -41,7 +41,7 @@ boundaryField } outerWall { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/mut b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/mut index f7971713c..24a7618df 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/mut +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/mut @@ -23,17 +23,17 @@ boundaryField { top { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } bottom { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } walls { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } symmetry diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/mut b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/mut index 577f9b6f5..2a96ed33a 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/mut +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/mut @@ -23,7 +23,7 @@ boundaryField { walls { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } inlet diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/mut b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/mut index 577f9b6f5..2a96ed33a 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/mut +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/mut @@ -23,7 +23,7 @@ boundaryField { walls { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } inlet diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/mut b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/mut index f7971713c..24a7618df 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/mut +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/mut @@ -23,17 +23,17 @@ boundaryField { top { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } bottom { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } walls { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } symmetry diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/0/nut b/tutorials/multiphase/cavitatingFoam/ras/throttle/0/nut index 778da44b3..a49b13877 100644 --- a/tutorials/multiphase/cavitatingFoam/ras/throttle/0/nut +++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/0/nut @@ -35,7 +35,7 @@ boundaryField walls { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/mut b/tutorials/multiphase/interFoam/ras/damBreak/0/mut index ca860aba0..d616c53f1 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/0/mut +++ b/tutorials/multiphase/interFoam/ras/damBreak/0/mut @@ -23,19 +23,19 @@ boundaryField { leftWall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } rightWall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } lowerWall { - type mutWallFunction; + type mutkWallFunction; value uniform 0; } diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/nut b/tutorials/multiphase/interFoam/ras/damBreak/0/nut index 0f25a9450..3264291d2 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/0/nut +++ b/tutorials/multiphase/interFoam/ras/damBreak/0/nut @@ -23,17 +23,17 @@ boundaryField { leftWall { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } rightWall { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } lowerWall { - type nutWallFunction; + type nutkWallFunction; value uniform 0; } atmosphere diff --git a/tutorials/overset/parallelTests/NACA4412-ThreeLayerOverlapFringeAssemby-100Processors/0/nut b/tutorials/overset/parallelTests/NACA4412-ThreeLayerOverlapFringeAssemby-100Processors/0/nut index 1f27a01b8..50811916a 100644 --- a/tutorials/overset/parallelTests/NACA4412-ThreeLayerOverlapFringeAssemby-100Processors/0/nut +++ b/tutorials/overset/parallelTests/NACA4412-ThreeLayerOverlapFringeAssemby-100Processors/0/nut @@ -61,7 +61,7 @@ boundaryField airfoil { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; diff --git a/tutorials/overset/parallelTests/NACA4412-ThreeLayerOverlapFringeAssemby-100Processors/save/nut b/tutorials/overset/parallelTests/NACA4412-ThreeLayerOverlapFringeAssemby-100Processors/save/nut index 1f27a01b8..50811916a 100644 --- a/tutorials/overset/parallelTests/NACA4412-ThreeLayerOverlapFringeAssemby-100Processors/save/nut +++ b/tutorials/overset/parallelTests/NACA4412-ThreeLayerOverlapFringeAssemby-100Processors/save/nut @@ -61,7 +61,7 @@ boundaryField airfoil { - type nutWallFunction; + type nutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8;