Commit e81e392a authored by Mark Olesen's avatar Mark Olesen
Browse files

COMP: adjust code for nu() as tmp<volScalarField>

parent bf915ce8
{
// 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
}
......@@ -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
......
......@@ -98,7 +98,7 @@ tmp<volScalarField> laminar::nuSgs() const
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("nuSgs", nu().dimensions(), 0.0)
dimensionedScalar("nuSgs", nu()().dimensions(), 0.0)
)
);
}
......
......@@ -51,7 +51,8 @@ void vanDriestDelta::calcDelta()
const LESModel& lesModel = mesh_.lookupObject<LESModel>("LESProperties");
const volVectorField& U = lesModel.U();
const volScalarField& nu = lesModel.nu();
const tmp<volScalarField> tnu = lesModel.nu();
const volScalarField& nu = tnu();
tmp<volScalarField> nuSgs = lesModel.nuSgs();
volScalarField ystar
......
......@@ -182,7 +182,7 @@ tmp<scalarField> 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
{
......
......@@ -199,7 +199,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs()
const tmp<volScalarField> tk = rasModel.k();
const volScalarField& k = tk();
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
const tmp<volScalarField> tnu = rasModel.nu();
const scalarField& nuw = tnu().boundaryField()[patchI];
const tmp<volScalarField> tnut = rasModel.nut();
const volScalarField& nut = tnut();
......
......@@ -207,7 +207,7 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
const RASModel& rasModel = db().lookupObject<RASModel>("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<volScalarField> tk = rasModel.k();
const volScalarField& k = tk();
......
......@@ -47,7 +47,7 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcNut() const
const RASModel& rasModel = db().lookupObject<RASModel>("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<scalarField> nutURoughWallFunctionFvPatchScalarField::calcYPlus
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
const scalarField& nuw = rasModel.nu()().boundaryField()[patchI];
tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
scalarField& yPlus = tyPlus();
......
......@@ -47,7 +47,7 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const
const RASModel& rasModel = db().lookupObject<RASModel>("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<scalarField> 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<scalarField> tuTau(new scalarField(patch().size(), 0.0));
......@@ -181,7 +181,7 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::yPlus() const
const RASModel& rasModel = db().lookupObject<RASModel>("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;
}
......
......@@ -49,7 +49,7 @@ tmp<scalarField> 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<scalarField> 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);
......
......@@ -47,7 +47,7 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcNut() const
const RASModel& rasModel = db().lookupObject<RASModel>("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<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
......@@ -77,7 +77,7 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcYPlus
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
const scalarField& nuw = rasModel.nu()().boundaryField()[patchI];
tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
scalarField& yPlus = tyPlus();
......
......@@ -71,7 +71,7 @@ tmp<scalarField> nutkRoughWallFunctionFvPatchScalarField::calcNut() const
const scalarField& y = rasModel.y()[patchI];
const tmp<volScalarField> 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_);
......
......@@ -80,7 +80,7 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const
const scalarField& y = rasModel.y()[patchI];
const tmp<volScalarField> 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<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const
const tmp<volScalarField> tk = rasModel.k();
const volScalarField& k = tk();
tmp<scalarField> 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;
}
......
......@@ -204,7 +204,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
const tmp<volScalarField> tk = rasModel.k();
const volScalarField& k = tk();
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
const tmp<volScalarField> tnu = rasModel.nu();
const scalarField& nuw = tnu().boundaryField()[patchI];
const tmp<volScalarField> tnut = rasModel.nut();
const volScalarField& nut = tnut();
......
......@@ -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
......
......@@ -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<wallFvPatch>(curPatch))
{
const scalarField& nuw = nu().boundaryField()[patchi];
const scalarField& nuw = nuLam.boundaryField()[patchi];
scalarField& nutw = nut_.boundaryField()[patchi];
forAll(curPatch, facei)
......
......@@ -72,7 +72,7 @@ tmp<volScalarField> laminar::nut() const
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("nut", nu().dimensions(), 0.0)
dimensionedScalar("nut", nu()().dimensions(), 0.0)
)
);
}
......
......@@ -92,7 +92,7 @@ tmp<volScalarField> laminar::nut() const
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("nut", nu().dimensions(), 0.0)
dimensionedScalar("nut", nu()().dimensions(), 0.0)
)
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment