diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C index 59ab80e4fe712a1b226cb242309ff872178799fb..9bb31c8fa17fbb8e9dd16b4edbdf7698ebc4be62 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C @@ -106,11 +106,12 @@ void fixedShearStressFvPatchVectorField::updateCoeffs() return; } - const label patchI = patch().index(); + const label patchi = patch().index(); - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); + const turbulenceModel& turbModel = + db().lookupObject<turbulenceModel>("turbulenceModel"); - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; const vectorField Ui(Uw.patchInternalField()); @@ -118,9 +119,9 @@ void fixedShearStressFvPatchVectorField::updateCoeffs() const scalarField& ry = patch().deltaCoeffs(); - tmp<volScalarField> tnuEff = rasModel.nuEff(); + tmp<volScalarField> tnuEff = turbModel.nuEff(); const volScalarField& nuEff = tnuEff(); - const scalarField& nuEffw = nuEff.boundaryField()[patchI]; + const scalarField& nuEffw = nuEff.boundaryField()[patchi]; tmp<vectorField> UwUpdated = tauHat*(tauHat & (tau0_*(1.0/(ry*nuEffw)) + Ui)); @@ -130,8 +131,8 @@ void fixedShearStressFvPatchVectorField::updateCoeffs() if (debug) { tmp<vectorField> nHat = this->patch().nf(); - volSymmTensorField Reff(rasModel.devReff()); - Info << "tau : " << (nHat & Reff.boundaryField()[patchI])() << endl; + volSymmTensorField Reff(turbModel.devReff()); + Info << "tau : " << (nHat & Reff.boundaryField()[patchi])() << endl; } fixedValueFvPatchVectorField::updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C index 917c65ca5f0beab8a0a8d8e2ab6d310a8609091a..2700a816a9cccd15cea62bb193847ea254b57a50 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C @@ -201,21 +201,22 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() return; } - const label patchI = patch().index(); + const label patchi = patch().index(); // Retrieve turbulence properties from model - const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); + const turbulenceModel& turbModel = + db().lookupObject<turbulenceModel>("turbulenceModel"); const scalar Cmu25 = pow(Cmu_, 0.25); - const scalarField& y = rasModel.y()[patchI]; - const tmp<volScalarField> tnu = rasModel.nu(); + const scalarField& y = turbModel.y()[patchi]; + const tmp<volScalarField> tnu = turbModel.nu(); const volScalarField& nu = tnu(); - const scalarField& nuw = nu.boundaryField()[patchI]; - const tmp<volScalarField> tk = rasModel.k(); + const scalarField& nuw = nu.boundaryField()[patchi]; + const tmp<volScalarField> tk = turbModel.k(); const volScalarField& k = tk(); // Molecular Prandtl number const scalar - Pr(dimensionedScalar(rasModel.transport().lookup("Pr")).value()); + Pr(dimensionedScalar(turbModel.transport().lookup("Pr")).value()); // Populate boundary values scalarField& kappatw = *this; 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 065270eea67dc38ff766717190e4522bc9431104..c23aea5551d9c13e99025834358d851a1ba084de 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -39,6 +39,11 @@ namespace incompressible namespace RASModels { +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defineTypeNameAndDebug(nutWallFunctionFvPatchScalarField, 0); + + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void nutWallFunctionFvPatchScalarField::checkType() 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 eabc768d86238c46b3f296e62a2bb24f4b28aa19..afbd1548d15fb7e38b4c494a56b92feb12dff40c 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -41,20 +41,6 @@ namespace RASModels // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void nutkWallFunctionFvPatchScalarField::checkType() -{ - if (!isA<wallFvPatch>(patch())) - { - 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); - } -} - - tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const { const label patchi = patch().index(); @@ -89,14 +75,6 @@ tmp<scalarField> 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 @@ -105,14 +83,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField const DimensionedField<scalar, volMesh>& iF ) : - fixedValueFvPatchScalarField(p, iF), - Cmu_(0.09), - kappa_(0.41), - E_(9.8), - yPlusLam_(yPlusLam(kappa_, E_)) -{ - checkType(); -} + nutWallFunctionFvPatchScalarField(p, iF) +{} nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField @@ -123,14 +95,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 @@ -140,14 +106,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict), - Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), - kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), - E_(dict.lookupOrDefault<scalar>("E", 9.8)), - yPlusLam_(yPlusLam(kappa_, E_)) -{ - checkType(); -} + nutWallFunctionFvPatchScalarField(p, iF, dict) +{} nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField @@ -155,14 +115,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 @@ -171,48 +125,12 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField const DimensionedField<scalar, volMesh>& iF ) : - fixedValueFvPatchScalarField(wfpsf, iF), - Cmu_(wfpsf.Cmu_), - kappa_(wfpsf.kappa_), - E_(wfpsf.E_), - yPlusLam_(wfpsf.yPlusLam_) -{ - checkType(); -} + nutWallFunctionFvPatchScalarField(wfpsf, iF) +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -scalar nutkWallFunctionFvPatchScalarField::yPlusLam -( - const scalar kappa, - const scalar E -) -{ - scalar ypl = 11.0; - - for (int i=0; i<10; i++) - { - ypl = log(max(E*ypl, 1))/kappa; - } - - return ypl; -} - - -void nutkWallFunctionFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - operator==(calcNut()); - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const { const label patchi = patch().index(); @@ -232,14 +150,6 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const } -void nutkWallFunctionFvPatchScalarField::write(Ostream& os) const -{ - fvPatchField<scalar>::write(os); - writeLocalEntries(os); - writeEntry("value", os); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // makePatchTypeField 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 8b4b181c2077f3dadd280cb23b9438a8535c968c..d4ffd6167a03d7a4b1dc29b9097a115d59aafc60 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H @@ -37,7 +37,7 @@ SourceFiles #ifndef nutkWallFunctionFvPatchScalarField_H #define nutkWallFunctionFvPatchScalarField_H -#include "fixedValueFvPatchFields.H" +#include "nutWallFunctionFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,36 +54,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 turbulence viscosity virtual tmp<scalarField> calcNut() const; - //- Write local wall function variables - virtual void writeLocalEntries(Ostream&) const; - public: @@ -156,23 +135,8 @@ public: // Member functions - //- Calculate the Y+ at the edge of the laminar sublayer - static scalar yPlusLam(const scalar kappa, const scalar E); - - - // Evaluation functions - - //- Calculate and return the yPlus at the boundary - virtual tmp<scalarField> 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<scalarField> yPlus() const; };