diff --git a/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H b/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H index 8844f21e6e..3534caebd0 100644 --- a/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H +++ b/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H @@ -1,7 +1,7 @@ { // Evaluate near-wall behaviour - scalar nu = turbulence->nu().boundaryField()[patchId][faceId]; + scalar nu = turbulence->nu()().boundaryField()[patchId][faceId]; scalar nut = turbulence->nut()().boundaryField()[patchId][faceId]; symmTensor R = turbulence->devReff()().boundaryField()[patchId][faceId]; scalar epsilon = turbulence->epsilon()()[cellId]; @@ -31,4 +31,4 @@ << ", y+ = " << yPlus << ", u+ = " << uPlus << ", k+ = " << kPlus << ", epsilon+ = " << epsilonPlus << endl; -} \ No newline at end of file +} diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C index 2259aa0154..74226acee0 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C +++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C @@ -104,6 +104,8 @@ int main(int argc, char *argv[]) const fvPatchList& patches = mesh.boundary(); + const volScalarField nuLam(sgsModel->nu()); + forAll(patches, patchi) { const fvPatch& currPatch = patches[patchi]; @@ -117,7 +119,7 @@ int main(int argc, char *argv[]) nuEff.boundaryField()[patchi] *mag(U.boundaryField()[patchi].snGrad()) ) - /sgsModel->nu().boundaryField()[patchi]; + /nuLam.boundaryField()[patchi]; const scalarField& Yp = yPlus.boundaryField()[patchi]; Info<< "Patch " << patchi diff --git a/src/turbulenceModels/incompressible/LES/laminar/laminar.C b/src/turbulenceModels/incompressible/LES/laminar/laminar.C index 767dfeae22..d654fddc71 100644 --- a/src/turbulenceModels/incompressible/LES/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/LES/laminar/laminar.C @@ -98,7 +98,7 @@ tmp laminar::nuSgs() const IOobject::NO_WRITE ), mesh_, - dimensionedScalar("nuSgs", nu().dimensions(), 0.0) + dimensionedScalar("nuSgs", nu()().dimensions(), 0.0) ) ); } diff --git a/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C index f6c77ad983..d27b71cbbd 100644 --- a/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C +++ b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.C @@ -51,7 +51,8 @@ void vanDriestDelta::calcDelta() const LESModel& lesModel = mesh_.lookupObject("LESProperties"); const volVectorField& U = lesModel.U(); - const volScalarField& nu = lesModel.nu(); + const tmp tnu = lesModel.nu(); + const volScalarField& nu = tnu(); tmp nuSgs = lesModel.nuSgs(); volScalarField ystar diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C index 2b93114c49..556fbcc481 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C @@ -182,7 +182,7 @@ tmp RASModel::yPlus(const label patchNo, const scalar Cmu) const Yp = pow025(Cmu) *y_[patchNo] *sqrt(k()().boundaryField()[patchNo].patchInternalField()) - /nu().boundaryField()[patchNo]; + /nu()().boundaryField()[patchNo]; } else { diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 8362785332..a7e31ff80b 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -199,7 +199,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() const tmp tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const tmp tnu = rasModel.nu(); + const scalarField& nuw = tnu().boundaryField()[patchI]; const tmp tnut = rasModel.nut(); const volScalarField& nut = tnut(); 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 bce7283abc..a33441d83f 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C @@ -207,7 +207,7 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() const RASModel& rasModel = db().lookupObject("RASProperties"); const scalar Cmu25 = pow(Cmu_, 0.25); const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; const tmp tk = rasModel.k(); const volScalarField& k = tk(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index df297ab9ce..29f0fc0bbe 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -47,7 +47,7 @@ tmp nutURoughWallFunctionFvPatchScalarField::calcNut() const 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 scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; // The flow velocity at the adjacent cell centre const scalarField magUp(mag(Uw.patchInternalField() - Uw)); @@ -80,7 +80,7 @@ tmp nutURoughWallFunctionFvPatchScalarField::calcYPlus const RASModel& rasModel = db().lookupObject("RASProperties"); const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; tmp tyPlus(new scalarField(patch().size(), 0.0)); scalarField& yPlus = tyPlus(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index 37a0d4b277..f236357c6a 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -47,7 +47,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; const scalarField magGradU(mag(Uw.snGrad())); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; return max ( @@ -69,7 +69,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau rasModel.U().boundaryField()[patch().index()]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); - const scalarField& nuw = rasModel.nu().boundaryField()[patch().index()]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patch().index()]; const scalarField& nutw = *this; tmp tuTau(new scalarField(patch().size(), 0.0)); @@ -181,7 +181,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::yPlus() const 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 scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; return y*calcUTau(mag(Uw.snGrad()))/nuw; } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C index 9c4e390d9d..7d4a9ede5d 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C @@ -49,7 +49,7 @@ tmp nutUTabulatedWallFunctionFvPatchScalarField::calcNut() const const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); const scalarField magGradU(mag(Uw.snGrad())); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; return max @@ -182,7 +182,7 @@ tmp nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; const scalarField Rey(magUp*y/nuw); return Rey/(calcUPlus(Rey) + ROOTVSMALL); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C index df736990b8..572fba9c68 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -47,7 +47,7 @@ tmp nutUWallFunctionFvPatchScalarField::calcNut() const 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]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; tmp tyPlus = calcYPlus(magUp); scalarField& yPlus = tyPlus(); @@ -77,7 +77,7 @@ tmp nutUWallFunctionFvPatchScalarField::calcYPlus const RASModel& rasModel = db().lookupObject("RASProperties"); const scalarField& y = rasModel.y()[patchI]; - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; tmp tyPlus(new scalarField(patch().size(), 0.0)); scalarField& yPlus = tyPlus(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C index c3fc9fac61..27c1008300 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -71,7 +71,7 @@ tmp nutkRoughWallFunctionFvPatchScalarField::calcNut() const const scalarField& y = rasModel.y()[patchI]; const tmp tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); 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 cc9dd91761..8b4949ba68 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -80,7 +80,7 @@ tmp nutkWallFunctionFvPatchScalarField::calcNut() const const scalarField& y = rasModel.y()[patchI]; const tmp tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); @@ -220,7 +220,7 @@ tmp nutkWallFunctionFvPatchScalarField::yPlus() const const tmp tk = rasModel.k(); const volScalarField& k = tk(); tmp kwc = k.boundaryField()[patchI].patchInternalField(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const scalarField& nuw = rasModel.nu()().boundaryField()[patchI]; return pow025(Cmu_)*y*sqrt(kwc)/nuw; } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 4bcac12985..c715658615 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -204,7 +204,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() const tmp tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; + const tmp tnu = rasModel.nu(); + const scalarField& nuw = tnu().boundaryField()[patchI]; const tmp tnut = rasModel.nut(); const volScalarField& nut = tnut(); diff --git a/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H b/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H index eb49fe0fde..71746b4ebf 100644 --- a/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H +++ b/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H @@ -54,6 +54,8 @@ Description } } + const volScalarField nuLam(this->nu()); + //- Accumulate the wall face contributions to epsilon and G // Increment cellBoundaryFaceCount for each face for averaging forAll(patches, patchi) @@ -64,7 +66,7 @@ Description { #include "checkPatchFieldTypes.H" - const scalarField& nuw = nu().boundaryField()[patchi]; + const scalarField& nuw = nuLam.boundaryField()[patchi]; const scalarField& nutw = nut_.boundaryField()[patchi]; const scalarField magFaceGradU diff --git a/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H b/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H index 67b28ab3fb..de3f3833a6 100644 --- a/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H +++ b/src/turbulenceModels/incompressible/RAS/include/wallNonlinearViscosityI.H @@ -34,13 +34,15 @@ Description const scalar yPlusLam = this->yPlusLam(kappa_.value(), E_.value()); + const volScalarField nuLam(this->nu()); + forAll(patches, patchi) { const fvPatch& curPatch = patches[patchi]; if (isA(curPatch)) { - const scalarField& nuw = nu().boundaryField()[patchi]; + const scalarField& nuw = nuLam.boundaryField()[patchi]; scalarField& nutw = nut_.boundaryField()[patchi]; forAll(curPatch, facei) diff --git a/src/turbulenceModels/incompressible/RAS/laminar/laminar.C b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C index 9a7a2a3e0f..e73b32046f 100644 --- a/src/turbulenceModels/incompressible/RAS/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C @@ -72,7 +72,7 @@ tmp laminar::nut() const IOobject::NO_WRITE ), mesh_, - dimensionedScalar("nut", nu().dimensions(), 0.0) + dimensionedScalar("nut", nu()().dimensions(), 0.0) ) ); } diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C index 7ab42b7fb8..99d48b23da 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C @@ -92,7 +92,7 @@ tmp laminar::nut() const IOobject::NO_WRITE ), mesh_, - dimensionedScalar("nut", nu().dimensions(), 0.0) + dimensionedScalar("nut", nu()().dimensions(), 0.0) ) ); }