diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C index 2d372fca7e..3819066c88 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C @@ -138,9 +138,9 @@ void convectiveHeatTransferFvPatchScalarField::updateCoeffs() scalarField& htc = *this; forAll(htc, facei) { - label faceCelli = patch().faceCells()[facei]; + label celli = patch().faceCells()[facei]; - scalar Re = rhow[facei]*mag(Uc[faceCelli] - Uw[facei])*L_/muw[facei]; + scalar Re = rhow[facei]*mag(Uc[celli] - Uw[facei])*L_/muw[facei]; if (Re < 5.0E+05) { diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 2ebd97528d..3840262bd2 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -239,9 +239,9 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() // Populate boundary values forAll(alphatw, facei) { - label faceCelli = patch().faceCells()[facei]; + label celli = patch().faceCells()[facei]; - scalar uTau = Cmu25*sqrt(k[faceCelli]); + scalar uTau = Cmu25*sqrt(k[celli]); scalar yPlus = uTau*y[facei]/(muw[facei]/rhow[facei]); diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index eece304601..8677d5f864 100644 --- a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -236,10 +236,10 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() scalarField& alphatw = *this; forAll(alphatw, facei) { - label faceCelli = patch().faceCells()[facei]; + label celli = patch().faceCells()[facei]; // y+ - scalar yPlus = Cmu25*sqrt(k[faceCelli])*y[facei]/nuw[facei]; + scalar yPlus = Cmu25*sqrt(k[celli])*y[facei]/nuw[facei]; // Molecular-to-turbulent Prandtl number ratio scalar Prat = Pr/Prt_; diff --git a/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C b/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C index fc9ae3734e..121364d9a1 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/LRR/LRR.C @@ -327,10 +327,10 @@ void LRR::correct() { forAll(curPatch, facei) { - label faceCelli = curPatch.faceCells()[facei]; - P[faceCelli] *= min + label celli = curPatch.faceCells()[facei]; + P[celli] *= min ( - G[faceCelli]/(0.5*mag(tr(P[faceCelli])) + SMALL), + G[celli]/(0.5*mag(tr(P[celli])) + SMALL), 1.0 ); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C b/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C index ffde2cf1dc..796822b9ee 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/SSG/SSG.C @@ -337,10 +337,10 @@ void SSG::correct() { forAll(curPatch, facei) { - label faceCelli = curPatch.faceCells()[facei]; - P[faceCelli] *= min + label celli = curPatch.faceCells()[facei]; + P[celli] *= min ( - G[faceCelli]/(0.5*mag(tr(P[faceCelli])) + SMALL), + G[celli]/(0.5*mag(tr(P[celli])) + SMALL), 1.0 ); } diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C index ca7f10a123..862f7e647b 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C @@ -204,18 +204,18 @@ void fWallFunctionFvPatchScalarField::updateCoeffs() // Set f wall values forAll(f, facei) { - label faceCelli = patch().faceCells()[facei]; + label celli = patch().faceCells()[facei]; - scalar uTau = Cmu25*sqrt(k[faceCelli]); + scalar uTau = Cmu25*sqrt(k[celli]); scalar yPlus = uTau*y[facei]/nuw[facei]; if (yPlus > yPlusLam_) { scalar N = 6.0; - scalar v2c = v2[faceCelli]; - scalar epsc = epsilon[faceCelli]; - scalar kc = k[faceCelli]; + scalar v2c = v2[celli]; + scalar epsc = epsilon[celli]; + scalar kc = k[celli]; f[facei] = N*v2c*epsc/(sqr(kc) + ROOTVSMALL); f[facei] /= sqr(uTau) + ROOTVSMALL; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C index 9ec85dad32..03db4555a9 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C @@ -193,9 +193,9 @@ void kLowReWallFunctionFvPatchScalarField::updateCoeffs() // Set k wall values forAll(kw, facei) { - label faceCelli = patch().faceCells()[facei]; + label celli = patch().faceCells()[facei]; - scalar uTau = Cmu25*sqrt(k[faceCelli]); + scalar uTau = Cmu25*sqrt(k[celli]); scalar yPlus = uTau*y[facei]/nuw[facei]; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C index 86cb3b473c..04c5d76746 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,15 +33,12 @@ License namespace Foam { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -defineTypeNameAndDebug(nutWallFunctionFvPatchScalarField, 0); - + defineTypeNameAndDebug(nutWallFunctionFvPatchScalarField, 0); +} // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void nutWallFunctionFvPatchScalarField::checkType() +void Foam::nutWallFunctionFvPatchScalarField::checkType() { if (!isA(patch())) { @@ -55,7 +52,10 @@ void nutWallFunctionFvPatchScalarField::checkType() } -void nutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const +void Foam::nutWallFunctionFvPatchScalarField::writeLocalEntries +( + Ostream& os +) const { os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; @@ -65,7 +65,7 @@ void nutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF @@ -81,7 +81,7 @@ nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField } -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField ( const nutWallFunctionFvPatchScalarField& ptf, const fvPatch& p, @@ -99,7 +99,7 @@ nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField } -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -116,7 +116,7 @@ nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField } -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField ( const nutWallFunctionFvPatchScalarField& wfpsf ) @@ -131,7 +131,7 @@ nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField } -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField ( const nutWallFunctionFvPatchScalarField& wfpsf, const DimensionedField& iF @@ -149,7 +149,7 @@ nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -scalar nutWallFunctionFvPatchScalarField::yPlusLam +Foam::scalar Foam::nutWallFunctionFvPatchScalarField::yPlusLam ( const scalar kappa, const scalar E @@ -166,7 +166,13 @@ scalar nutWallFunctionFvPatchScalarField::yPlusLam } -void nutWallFunctionFvPatchScalarField::updateCoeffs() +Foam::scalar Foam::nutWallFunctionFvPatchScalarField::yPlusLam() const +{ + return yPlusLam_; +} + + +void Foam::nutWallFunctionFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -179,7 +185,7 @@ void nutWallFunctionFvPatchScalarField::updateCoeffs() } -void nutWallFunctionFvPatchScalarField::write(Ostream& os) const +void Foam::nutWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); writeLocalEntries(os); @@ -187,8 +193,4 @@ void nutWallFunctionFvPatchScalarField::write(Ostream& os) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H index 56b73e2241..a56fe62ae1 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H @@ -164,6 +164,9 @@ public: //- Calculate the Y+ at the edge of the laminar sublayer static scalar yPlusLam(const scalar kappa, const scalar E); + //- Return the Y+ at the edge of the laminar sublayer + scalar yPlusLam() const; + //- Calculate and return the yPlus at the boundary virtual tmp yPlus() const = 0; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C index 5762610fe9..668a07a2c0 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C @@ -61,9 +61,9 @@ tmp nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const forAll(nutw, facei) { - label faceCelli = patch().faceCells()[facei]; + label celli = patch().faceCells()[facei]; - scalar uStar = Cmu25*sqrt(k[faceCelli]); + scalar uStar = Cmu25*sqrt(k[celli]); scalar yPlus = uStar*y[facei]/nuw[facei]; scalar Edash = (y[facei] + z0_[facei])/z0_[facei]; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C index b1ac17bd57..fba57e6b3c 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -84,9 +84,9 @@ tmp nutkRoughWallFunctionFvPatchScalarField::calcNut() const forAll(nutw, facei) { - label faceCelli = patch().faceCells()[facei]; + label celli = patch().faceCells()[facei]; - scalar uStar = Cmu25*sqrt(k[faceCelli]); + scalar uStar = Cmu25*sqrt(k[celli]); scalar yPlus = uStar*y[facei]/nuw[facei]; scalar KsPlus = uStar*Ks_[facei]/nuw[facei]; diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C index 08aea98d49..c88e12919e 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -63,9 +63,9 @@ tmp nutkWallFunctionFvPatchScalarField::calcNut() const forAll(nutw, facei) { - label faceCelli = patch().faceCells()[facei]; + label celli = patch().faceCells()[facei]; - scalar yPlus = Cmu25*y[facei]*sqrt(k[faceCelli])/nuw[facei]; + scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei]; if (yPlus > yPlusLam_) { diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C index 1d938c851a..e3704f287c 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C @@ -196,9 +196,9 @@ void v2WallFunctionFvPatchScalarField::updateCoeffs() // Set v2 wall values forAll(v2, facei) { - label faceCelli = patch().faceCells()[facei]; + label celli = patch().faceCells()[facei]; - scalar uTau = Cmu25*sqrt(k[faceCelli]); + scalar uTau = Cmu25*sqrt(k[celli]); scalar yPlus = uTau*y[facei]/nuw[facei];