mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: avoid ambiguous construct from tmp - turbulenceModels/incompressible/RAS
This commit is contained in:
@ -300,7 +300,7 @@ void LRR::correct()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_));
|
volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_)));
|
||||||
volScalarField G("RASModel::G", 0.5*mag(tr(P)));
|
volScalarField G("RASModel::G", 0.5*mag(tr(P)));
|
||||||
|
|
||||||
// Update epsilon and G at the wall
|
// Update epsilon and G at the wall
|
||||||
@ -403,7 +403,7 @@ void LRR::correct()
|
|||||||
|
|
||||||
const scalarField& nutw = nut_.boundaryField()[patchi];
|
const scalarField& nutw = nut_.boundaryField()[patchi];
|
||||||
|
|
||||||
vectorField snGradU = U_.boundaryField()[patchi].snGrad();
|
const vectorField snGradU(U_.boundaryField()[patchi].snGrad());
|
||||||
|
|
||||||
const vectorField& faceAreas
|
const vectorField& faceAreas
|
||||||
= mesh_.Sf().boundaryField()[patchi];
|
= mesh_.Sf().boundaryField()[patchi];
|
||||||
|
|||||||
@ -242,12 +242,12 @@ void LamBremhorstKE::correct()
|
|||||||
// Calculate parameters and coefficients for low-Reynolds number model
|
// Calculate parameters and coefficients for low-Reynolds number model
|
||||||
|
|
||||||
Rt_ = sqr(k_)/(nu()*epsilon_);
|
Rt_ = sqr(k_)/(nu()*epsilon_);
|
||||||
volScalarField Ry = sqrt(k_)*y_/nu();
|
tmp<volScalarField> Ry = sqrt(k_)*y_/nu();
|
||||||
|
|
||||||
fMu_ = sqr(scalar(1) - exp(-0.0165*Ry))*(scalar(1) + 20.5/(Rt_ + SMALL));
|
fMu_ = sqr(scalar(1) - exp(-0.0165*Ry))*(scalar(1) + 20.5/(Rt_ + SMALL));
|
||||||
|
|
||||||
volScalarField f1 = scalar(1) + pow(0.05/(fMu_ + SMALL), 3);
|
tmp<volScalarField> f1 = scalar(1) + pow(0.05/(fMu_ + SMALL), 3);
|
||||||
volScalarField f2 = scalar(1) - exp(-sqr(Rt_));
|
tmp<volScalarField> f2 = scalar(1) - exp(-sqr(Rt_));
|
||||||
|
|
||||||
|
|
||||||
// Dissipation equation
|
// Dissipation equation
|
||||||
|
|||||||
@ -342,7 +342,7 @@ void LaunderGibsonRSTM::correct()
|
|||||||
yr_.correct();
|
yr_.correct();
|
||||||
}
|
}
|
||||||
|
|
||||||
volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_));
|
volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_)));
|
||||||
volScalarField G("RASModel::G", 0.5*mag(tr(P)));
|
volScalarField G("RASModel::G", 0.5*mag(tr(P)));
|
||||||
|
|
||||||
// Update epsilon and G at the wall
|
// Update epsilon and G at the wall
|
||||||
@ -388,7 +388,10 @@ void LaunderGibsonRSTM::correct()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
volSymmTensorField reflect = C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P);
|
const volSymmTensorField reflect
|
||||||
|
(
|
||||||
|
C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P)
|
||||||
|
);
|
||||||
|
|
||||||
tmp<fvSymmTensorMatrix> REqn
|
tmp<fvSymmTensorMatrix> REqn
|
||||||
(
|
(
|
||||||
@ -451,7 +454,7 @@ void LaunderGibsonRSTM::correct()
|
|||||||
|
|
||||||
const scalarField& nutw = nut_.boundaryField()[patchi];
|
const scalarField& nutw = nut_.boundaryField()[patchi];
|
||||||
|
|
||||||
vectorField snGradU = U_.boundaryField()[patchi].snGrad();
|
const vectorField snGradU(U_.boundaryField()[patchi].snGrad());
|
||||||
|
|
||||||
const vectorField& faceAreas
|
const vectorField& faceAreas
|
||||||
= mesh_.Sf().boundaryField()[patchi];
|
= mesh_.Sf().boundaryField()[patchi];
|
||||||
|
|||||||
@ -237,12 +237,12 @@ void LaunderSharmaKE::correct()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
volScalarField S2 = 2*magSqr(symm(fvc::grad(U_)));
|
tmp<volScalarField> S2 = 2*magSqr(symm(fvc::grad(U_)));
|
||||||
|
|
||||||
volScalarField G("RASModel::G", nut_*S2);
|
volScalarField G("RASModel::G", nut_*S2);
|
||||||
|
|
||||||
volScalarField E = 2.0*nu()*nut_*fvc::magSqrGradGrad(U_);
|
const volScalarField E(2.0*nu()*nut_*fvc::magSqrGradGrad(U_));
|
||||||
volScalarField D = 2.0*nu()*magSqr(fvc::grad(sqrt(k_)));
|
const volScalarField D(2.0*nu()*magSqr(fvc::grad(sqrt(k_))));
|
||||||
|
|
||||||
|
|
||||||
// Dissipation rate equation
|
// Dissipation rate equation
|
||||||
|
|||||||
@ -335,7 +335,7 @@ void LienCubicKE::correct()
|
|||||||
gradU_ = fvc::grad(U_);
|
gradU_ = fvc::grad(U_);
|
||||||
|
|
||||||
// generation term
|
// generation term
|
||||||
volScalarField S2 = symm(gradU_) && gradU_;
|
tmp<volScalarField> S2 = symm(gradU_) && gradU_;
|
||||||
|
|
||||||
volScalarField G
|
volScalarField G
|
||||||
(
|
(
|
||||||
|
|||||||
@ -409,19 +409,25 @@ void LienCubicKELowRe::correct()
|
|||||||
gradU_ = fvc::grad(U_);
|
gradU_ = fvc::grad(U_);
|
||||||
|
|
||||||
// generation term
|
// generation term
|
||||||
volScalarField S2 = symm(gradU_) && gradU_;
|
tmp<volScalarField> S2 = symm(gradU_) && gradU_;
|
||||||
|
|
||||||
yStar_ = sqrt(k_)*y_/nu() + SMALL;
|
yStar_ = sqrt(k_)*y_/nu() + SMALL;
|
||||||
volScalarField Rt = sqr(k_)/(nu()*epsilon_);
|
tmp<volScalarField> Rt = sqr(k_)/(nu()*epsilon_);
|
||||||
|
|
||||||
volScalarField fMu =
|
const volScalarField fMu
|
||||||
|
(
|
||||||
(scalar(1) - exp(-Am_*yStar_))
|
(scalar(1) - exp(-Am_*yStar_))
|
||||||
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL);
|
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL)
|
||||||
|
);
|
||||||
|
const volScalarField f2
|
||||||
|
(
|
||||||
|
scalar(1) - 0.3*exp(-sqr(Rt))
|
||||||
|
);
|
||||||
|
|
||||||
volScalarField f2 = scalar(1) - 0.3*exp(-sqr(Rt));
|
volScalarField G
|
||||||
|
(
|
||||||
volScalarField G =
|
Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_)
|
||||||
Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_);
|
);
|
||||||
|
|
||||||
// Dissipation equation
|
// Dissipation equation
|
||||||
tmp<fvScalarMatrix> epsEqn
|
tmp<fvScalarMatrix> epsEqn
|
||||||
|
|||||||
@ -197,7 +197,7 @@ LienLeschzinerLowRe::LienLeschzinerLowRe
|
|||||||
|
|
||||||
tmp<volSymmTensorField> LienLeschzinerLowRe::R() const
|
tmp<volSymmTensorField> LienLeschzinerLowRe::R() const
|
||||||
{
|
{
|
||||||
volTensorField gradU = fvc::grad(U_);
|
tmp<volTensorField> gradU = fvc::grad(U_);
|
||||||
|
|
||||||
return tmp<volSymmTensorField>
|
return tmp<volSymmTensorField>
|
||||||
(
|
(
|
||||||
@ -288,19 +288,21 @@ void LienLeschzinerLowRe::correct()
|
|||||||
|
|
||||||
scalar Cmu75 = pow(Cmu_.value(), 0.75);
|
scalar Cmu75 = pow(Cmu_.value(), 0.75);
|
||||||
|
|
||||||
volTensorField gradU = fvc::grad(U_);
|
const volTensorField gradU(fvc::grad(U_));
|
||||||
|
|
||||||
// generation term
|
// generation term
|
||||||
volScalarField S2 = symm(gradU) && gradU;
|
tmp<volScalarField> S2 = symm(gradU) && gradU;
|
||||||
|
|
||||||
yStar_ = sqrt(k_)*y_/nu() + SMALL;
|
yStar_ = sqrt(k_)*y_/nu() + SMALL;
|
||||||
volScalarField Rt = sqr(k_)/(nu()*epsilon_);
|
tmp<volScalarField> Rt = sqr(k_)/(nu()*epsilon_);
|
||||||
|
|
||||||
volScalarField fMu =
|
volScalarField fMu
|
||||||
|
(
|
||||||
(scalar(1) - exp(-Am_*yStar_))
|
(scalar(1) - exp(-Am_*yStar_))
|
||||||
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL);
|
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL)
|
||||||
|
);
|
||||||
|
|
||||||
volScalarField f2 = scalar(1) - 0.3*exp(-sqr(Rt));
|
const volScalarField f2(scalar(1) - 0.3*exp(-sqr(Rt)));
|
||||||
|
|
||||||
volScalarField G("RASModel::G", Cmu_*fMu*sqr(k_)/epsilon_*S2);
|
volScalarField G("RASModel::G", Cmu_*fMu*sqr(k_)/epsilon_*S2);
|
||||||
|
|
||||||
|
|||||||
@ -237,8 +237,6 @@ NonlinearKEShih::NonlinearKEShih
|
|||||||
|
|
||||||
tmp<volSymmTensorField> NonlinearKEShih::R() const
|
tmp<volSymmTensorField> NonlinearKEShih::R() const
|
||||||
{
|
{
|
||||||
volTensorField gradU_ = fvc::grad(U_);
|
|
||||||
|
|
||||||
return tmp<volSymmTensorField>
|
return tmp<volSymmTensorField>
|
||||||
(
|
(
|
||||||
new volSymmTensorField
|
new volSymmTensorField
|
||||||
@ -251,7 +249,7 @@ tmp<volSymmTensorField> NonlinearKEShih::R() const
|
|||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU_) + nonlinearStress_,
|
((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)) + nonlinearStress_,
|
||||||
k_.boundaryField().types()
|
k_.boundaryField().types()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -328,7 +326,7 @@ void NonlinearKEShih::correct()
|
|||||||
gradU_ = fvc::grad(U_);
|
gradU_ = fvc::grad(U_);
|
||||||
|
|
||||||
// generation term
|
// generation term
|
||||||
volScalarField S2 = symm(gradU_) && gradU_;
|
tmp<volScalarField> S2 = symm(gradU_) && gradU_;
|
||||||
|
|
||||||
volScalarField G
|
volScalarField G
|
||||||
(
|
(
|
||||||
|
|||||||
@ -250,13 +250,14 @@ void RNGkEpsilon::correct()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
volScalarField S2 = 2*magSqr(symm(fvc::grad(U_)));
|
const volScalarField S2(2*magSqr(symm(fvc::grad(U_))));
|
||||||
|
|
||||||
volScalarField G("RASModel::G", nut_*S2);
|
volScalarField G("RASModel::G", nut_*S2);
|
||||||
|
|
||||||
volScalarField eta = sqrt(S2)*k_/epsilon_;
|
const volScalarField eta(sqrt(S2)*k_/epsilon_);
|
||||||
volScalarField R =
|
volScalarField R
|
||||||
((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta)));
|
(
|
||||||
|
((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta)))
|
||||||
|
);
|
||||||
|
|
||||||
// Update epsilon and G at the wall
|
// Update epsilon and G at the wall
|
||||||
epsilon_.boundaryField().updateCoeffs();
|
epsilon_.boundaryField().updateCoeffs();
|
||||||
|
|||||||
@ -50,7 +50,7 @@ tmp<volScalarField> SpalartAllmaras::chi() const
|
|||||||
|
|
||||||
tmp<volScalarField> SpalartAllmaras::fv1(const volScalarField& chi) const
|
tmp<volScalarField> SpalartAllmaras::fv1(const volScalarField& chi) const
|
||||||
{
|
{
|
||||||
volScalarField chi3 = pow3(chi);
|
const volScalarField chi3(pow3(chi));
|
||||||
return chi3/(chi3 + pow3(Cv1_));
|
return chi3/(chi3 + pow3(Cv1_));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ tmp<volScalarField> SpalartAllmaras::fv3
|
|||||||
const volScalarField& fv1
|
const volScalarField& fv1
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
volScalarField chiByCv2 = (1/Cv2_)*chi;
|
const volScalarField chiByCv2((1/Cv2_)*chi);
|
||||||
|
|
||||||
return
|
return
|
||||||
(scalar(1) + chi*fv1)
|
(scalar(1) + chi*fv1)
|
||||||
@ -83,18 +83,25 @@ tmp<volScalarField> SpalartAllmaras::fv3
|
|||||||
|
|
||||||
tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const
|
tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const
|
||||||
{
|
{
|
||||||
volScalarField r = min
|
volScalarField r
|
||||||
(
|
(
|
||||||
nuTilda_
|
min
|
||||||
/(
|
(
|
||||||
max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL))
|
nuTilda_
|
||||||
*sqr(kappa_*d_)
|
/(
|
||||||
),
|
max
|
||||||
scalar(10.0)
|
(
|
||||||
|
Stilda,
|
||||||
|
dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)
|
||||||
|
)
|
||||||
|
*sqr(kappa_*d_)
|
||||||
|
),
|
||||||
|
scalar(10.0)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
r.boundaryField() == 0.0;
|
r.boundaryField() == 0.0;
|
||||||
|
|
||||||
volScalarField g = r + Cw2_*(pow6(r) - r);
|
const volScalarField g(r + Cw2_*(pow6(r) - r));
|
||||||
|
|
||||||
return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0);
|
return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0);
|
||||||
}
|
}
|
||||||
@ -320,7 +327,7 @@ tmp<volSymmTensorField> SpalartAllmaras::devReff() const
|
|||||||
|
|
||||||
tmp<fvVectorMatrix> SpalartAllmaras::divDevReff(volVectorField& U) const
|
tmp<fvVectorMatrix> SpalartAllmaras::divDevReff(volVectorField& U) const
|
||||||
{
|
{
|
||||||
volScalarField nuEff_ = nuEff();
|
const volScalarField nuEff_(nuEff());
|
||||||
|
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
@ -368,12 +375,14 @@ void SpalartAllmaras::correct()
|
|||||||
d_.correct();
|
d_.correct();
|
||||||
}
|
}
|
||||||
|
|
||||||
volScalarField chi = this->chi();
|
const volScalarField chi(this->chi());
|
||||||
volScalarField fv1 = this->fv1(chi);
|
const volScalarField fv1(this->fv1(chi));
|
||||||
|
|
||||||
volScalarField Stilda =
|
const volScalarField Stilda
|
||||||
|
(
|
||||||
fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_)))
|
fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_)))
|
||||||
+ fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_);
|
+ fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_)
|
||||||
|
);
|
||||||
|
|
||||||
tmp<fvScalarMatrix> nuTildaEqn
|
tmp<fvScalarMatrix> nuTildaEqn
|
||||||
(
|
(
|
||||||
|
|||||||
@ -130,7 +130,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
|
|||||||
void atmBoundaryLayerInletEpsilonFvPatchScalarField::updateCoeffs()
|
void atmBoundaryLayerInletEpsilonFvPatchScalarField::updateCoeffs()
|
||||||
{
|
{
|
||||||
const vectorField& c = patch().Cf();
|
const vectorField& c = patch().Cf();
|
||||||
scalarField coord = (c & z_);
|
tmp<scalarField> coord = (c & z_);
|
||||||
scalarField::operator=(pow3(Ustar_)/(kappa_*(coord - zGround_ + z0_)));
|
scalarField::operator=(pow3(Ustar_)/(kappa_*(coord - zGround_ + z0_)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -145,12 +145,12 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
|
|||||||
void atmBoundaryLayerInletVelocityFvPatchVectorField::updateCoeffs()
|
void atmBoundaryLayerInletVelocityFvPatchVectorField::updateCoeffs()
|
||||||
{
|
{
|
||||||
const vectorField& c = patch().Cf();
|
const vectorField& c = patch().Cf();
|
||||||
scalarField coord = (c & z_);
|
const scalarField coord(c & z_);
|
||||||
scalarField Un(coord.size());
|
scalarField Un(coord.size());
|
||||||
|
|
||||||
forAll(coord, i)
|
forAll(coord, i)
|
||||||
{
|
{
|
||||||
if((coord[i] - zGround_) < Href_)
|
if ((coord[i] - zGround_) < Href_)
|
||||||
{
|
{
|
||||||
Un[i] = (Ustar_/kappa_)*log((coord[i] - zGround_ + z0_)/z0_);
|
Un[i] = (Ustar_/kappa_)*log((coord[i] - zGround_ + z0_)/z0_);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,23 +112,23 @@ void fixedShearStressFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
|
|
||||||
const vectorField Ui = Uw.patchInternalField();
|
const vectorField Ui(Uw.patchInternalField());
|
||||||
|
|
||||||
vector tauHat = tau0_/(mag(tau0_) + ROOTVSMALL);
|
vector tauHat = tau0_/(mag(tau0_) + ROOTVSMALL);
|
||||||
|
|
||||||
const scalarField& ry = patch().deltaCoeffs();
|
const scalarField& ry = patch().deltaCoeffs();
|
||||||
|
|
||||||
scalarField nuEffw = rasModel.nuEff()().boundaryField()[patchI];
|
tmp<scalarField> nuEffw = rasModel.nuEff()().boundaryField()[patchI];
|
||||||
|
|
||||||
vectorField UwUpdated =
|
tmp<vectorField> UwUpdated =
|
||||||
tauHat*(tauHat & (tau0_*(1.0/(ry*nuEffw)) + Ui));
|
tauHat*(tauHat & (tau0_*(1.0/(ry*nuEffw)) + Ui));
|
||||||
|
|
||||||
operator==(UwUpdated);
|
operator==(UwUpdated);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
vectorField nHat = this->patch().nf();
|
tmp<vectorField> nHat = this->patch().nf();
|
||||||
volSymmTensorField Reff = rasModel.devReff();
|
volSymmTensorField Reff(rasModel.devReff());
|
||||||
Info << "tau : " << (nHat & Reff.boundaryField()[patchI])() << endl;
|
Info << "tau : " << (nHat & Reff.boundaryField()[patchI])() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -207,7 +207,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
|
|
||||||
const scalarField magGradUw = mag(Uw.snGrad());
|
const scalarField magGradUw(mag(Uw.snGrad()));
|
||||||
|
|
||||||
// Set epsilon and G
|
// Set epsilon and G
|
||||||
forAll(nutw, faceI)
|
forAll(nutw, faceI)
|
||||||
|
|||||||
@ -50,7 +50,7 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcNut() const
|
|||||||
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
|
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
|
||||||
|
|
||||||
// The flow velocity at the adjacent cell centre
|
// The flow velocity at the adjacent cell centre
|
||||||
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
|
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||||
|
|
||||||
tmp<scalarField> tyPlus = calcYPlus(magUp);
|
tmp<scalarField> tyPlus = calcYPlus(magUp);
|
||||||
scalarField& yPlus = tyPlus();
|
scalarField& yPlus = tyPlus();
|
||||||
@ -272,9 +272,9 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::yPlus() const
|
|||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
|
tmp<scalarField> magUp = mag(Uw.patchInternalField() - Uw);
|
||||||
|
|
||||||
return calcYPlus(magUp);
|
return calcYPlus(magUp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const
|
|||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
const scalarField magGradU = mag(Uw.snGrad());
|
const scalarField magGradU(mag(Uw.snGrad()));
|
||||||
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
|
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
|
||||||
|
|
||||||
return max
|
return max
|
||||||
@ -67,7 +67,7 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcUTau
|
|||||||
|
|
||||||
const fvPatchVectorField& Uw =
|
const fvPatchVectorField& Uw =
|
||||||
rasModel.U().boundaryField()[patch().index()];
|
rasModel.U().boundaryField()[patch().index()];
|
||||||
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
|
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;
|
const scalarField& nutw = *this;
|
||||||
|
|||||||
@ -47,8 +47,8 @@ tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::calcNut() const
|
|||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
const scalarField& y = rasModel.y()[patchI];
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
|
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||||
const scalarField magGradU = mag(Uw.snGrad());
|
const scalarField magGradU(mag(Uw.snGrad()));
|
||||||
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
|
const scalarField& nuw = rasModel.nu().boundaryField()[patchI];
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -181,9 +181,9 @@ tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const
|
|||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
const scalarField& y = rasModel.y()[patchI];
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
|
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;
|
const scalarField Rey(magUp*y/nuw);
|
||||||
|
|
||||||
return Rey/(calcUPlus(Rey) + ROOTVSMALL);
|
return Rey/(calcUPlus(Rey) + ROOTVSMALL);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,7 +46,7 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcNut() const
|
|||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
|
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);
|
tmp<scalarField> tyPlus = calcYPlus(magUp);
|
||||||
@ -167,7 +167,7 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::yPlus() const
|
|||||||
const label patchI = patch().index();
|
const label patchI = patch().index();
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
const scalarField magUp = mag(Uw.patchInternalField() - Uw);
|
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||||
|
|
||||||
return calcYPlus(magUp);
|
return calcYPlus(magUp);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -219,7 +219,7 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const
|
|||||||
|
|
||||||
const tmp<volScalarField> tk = rasModel.k();
|
const tmp<volScalarField> tk = rasModel.k();
|
||||||
const volScalarField& k = tk();
|
const volScalarField& k = tk();
|
||||||
const scalarField kwc = k.boundaryField()[patchI].patchInternalField();
|
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;
|
return pow025(Cmu_)*y*sqrt(kwc)/nuw;
|
||||||
|
|||||||
@ -212,7 +212,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
|
|
||||||
const scalarField magGradUw = mag(Uw.snGrad());
|
const scalarField magGradUw(mag(Uw.snGrad()));
|
||||||
|
|
||||||
// Set omega and G
|
// Set omega and G
|
||||||
forAll(nutw, faceI)
|
forAll(nutw, faceI)
|
||||||
|
|||||||
@ -67,7 +67,10 @@ Description
|
|||||||
const scalarField& nuw = nu().boundaryField()[patchi];
|
const scalarField& nuw = nu().boundaryField()[patchi];
|
||||||
const scalarField& nutw = nut_.boundaryField()[patchi];
|
const scalarField& nutw = nut_.boundaryField()[patchi];
|
||||||
|
|
||||||
scalarField magFaceGradU = mag(U_.boundaryField()[patchi].snGrad());
|
const scalarField magFaceGradU
|
||||||
|
(
|
||||||
|
mag(U_.boundaryField()[patchi].snGrad())
|
||||||
|
);
|
||||||
|
|
||||||
forAll(curPatch, facei)
|
forAll(curPatch, facei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,13 +46,13 @@ addToRunTimeSelectionTable(RASModel, kOmegaSST, dictionary);
|
|||||||
|
|
||||||
tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const
|
tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const
|
||||||
{
|
{
|
||||||
volScalarField CDkOmegaPlus = max
|
tmp<volScalarField> CDkOmegaPlus = max
|
||||||
(
|
(
|
||||||
CDkOmega,
|
CDkOmega,
|
||||||
dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10)
|
dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10)
|
||||||
);
|
);
|
||||||
|
|
||||||
volScalarField arg1 = min
|
tmp<volScalarField> arg1 = min
|
||||||
(
|
(
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
@ -71,7 +71,7 @@ tmp<volScalarField> kOmegaSST::F1(const volScalarField& CDkOmega) const
|
|||||||
|
|
||||||
tmp<volScalarField> kOmegaSST::F2() const
|
tmp<volScalarField> kOmegaSST::F2() const
|
||||||
{
|
{
|
||||||
volScalarField arg2 = min
|
tmp<volScalarField> arg2 = min
|
||||||
(
|
(
|
||||||
max
|
max
|
||||||
(
|
(
|
||||||
@ -347,16 +347,18 @@ void kOmegaSST::correct()
|
|||||||
y_.correct();
|
y_.correct();
|
||||||
}
|
}
|
||||||
|
|
||||||
volScalarField S2 = magSqr(symm(fvc::grad(U_)));
|
const volScalarField S2(magSqr(symm(fvc::grad(U_))));
|
||||||
volScalarField G("RASModel::G", nut_*2*S2);
|
volScalarField G("RASModel::G", nut_*2*S2);
|
||||||
|
|
||||||
// Update omega and G at the wall
|
// Update omega and G at the wall
|
||||||
omega_.boundaryField().updateCoeffs();
|
omega_.boundaryField().updateCoeffs();
|
||||||
|
|
||||||
volScalarField CDkOmega =
|
const volScalarField CDkOmega
|
||||||
(2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_;
|
(
|
||||||
|
(2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_
|
||||||
|
);
|
||||||
|
|
||||||
volScalarField F1 = this->F1(CDkOmega);
|
const volScalarField F1(this->F1(CDkOmega));
|
||||||
|
|
||||||
// Turbulent frequency equation
|
// Turbulent frequency equation
|
||||||
tmp<fvScalarMatrix> omegaEqn
|
tmp<fvScalarMatrix> omegaEqn
|
||||||
|
|||||||
@ -46,7 +46,7 @@ addToRunTimeSelectionTable(RASModel, qZeta, dictionary);
|
|||||||
|
|
||||||
tmp<volScalarField> qZeta::fMu() const
|
tmp<volScalarField> qZeta::fMu() const
|
||||||
{
|
{
|
||||||
volScalarField Rt = q_*k_/(2.0*nu()*zeta_);
|
const volScalarField Rt(q_*k_/(2.0*nu()*zeta_));
|
||||||
|
|
||||||
if (anisotropic_)
|
if (anisotropic_)
|
||||||
{
|
{
|
||||||
@ -63,7 +63,7 @@ tmp<volScalarField> qZeta::fMu() const
|
|||||||
|
|
||||||
tmp<volScalarField> qZeta::f2() const
|
tmp<volScalarField> qZeta::f2() const
|
||||||
{
|
{
|
||||||
volScalarField Rt = q_*k_/(2.0*nu()*zeta_);
|
tmp<volScalarField> Rt = q_*k_/(2.0*nu()*zeta_);
|
||||||
return scalar(1) - 0.3*exp(-sqr(Rt));
|
return scalar(1) - 0.3*exp(-sqr(Rt));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,10 +293,10 @@ void qZeta::correct()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
volScalarField S2 = 2*magSqr(symm(fvc::grad(U_)));
|
tmp<volScalarField> S2 = 2*magSqr(symm(fvc::grad(U_)));
|
||||||
|
|
||||||
volScalarField G("RASModel::G", nut_/(2.0*q_)*S2);
|
volScalarField G("RASModel::G", nut_/(2.0*q_)*S2);
|
||||||
volScalarField E = nu()*nut_/q_*fvc::magSqrGradGrad(U_);
|
const volScalarField E(nu()*nut_/q_*fvc::magSqrGradGrad(U_));
|
||||||
|
|
||||||
|
|
||||||
// Zeta equation
|
// Zeta equation
|
||||||
|
|||||||
@ -54,19 +54,23 @@ tmp<volScalarField> realizableKE::rCmu
|
|||||||
tmp<volSymmTensorField> tS = dev(symm(gradU));
|
tmp<volSymmTensorField> tS = dev(symm(gradU));
|
||||||
const volSymmTensorField& S = tS();
|
const volSymmTensorField& S = tS();
|
||||||
|
|
||||||
volScalarField W =
|
tmp<volScalarField> W
|
||||||
|
(
|
||||||
(2*sqrt(2.0))*((S&S)&&S)
|
(2*sqrt(2.0))*((S&S)&&S)
|
||||||
/(
|
/(
|
||||||
magS*S2
|
magS*S2
|
||||||
+ dimensionedScalar("small", dimensionSet(0, 0, -3, 0, 0), SMALL)
|
+ dimensionedScalar("small", dimensionSet(0, 0, -3, 0, 0), SMALL)
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
|
||||||
tS.clear();
|
tS.clear();
|
||||||
|
|
||||||
volScalarField phis =
|
tmp<volScalarField> phis
|
||||||
(1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1)));
|
(
|
||||||
volScalarField As = sqrt(6.0)*cos(phis);
|
(1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1)))
|
||||||
volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU)));
|
);
|
||||||
|
tmp<volScalarField> As = sqrt(6.0)*cos(phis);
|
||||||
|
tmp<volScalarField> Us = sqrt(S2/2.0 + magSqr(skew(gradU)));
|
||||||
|
|
||||||
return 1.0/(A0_ + As*Us*k_/epsilon_);
|
return 1.0/(A0_ + As*Us*k_/epsilon_);
|
||||||
}
|
}
|
||||||
@ -77,8 +81,8 @@ tmp<volScalarField> realizableKE::rCmu
|
|||||||
const volTensorField& gradU
|
const volTensorField& gradU
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
volScalarField S2 = 2*magSqr(dev(symm(gradU)));
|
const volScalarField S2(2*magSqr(dev(symm(gradU))));
|
||||||
volScalarField magS = sqrt(S2);
|
tmp<volScalarField> magS = sqrt(S2);
|
||||||
return rCmu(gradU, S2, magS);
|
return rCmu(gradU, S2, magS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,12 +274,12 @@ void realizableKE::correct()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
volTensorField gradU = fvc::grad(U_);
|
const volTensorField gradU(fvc::grad(U_));
|
||||||
volScalarField S2 = 2*magSqr(dev(symm(gradU)));
|
const volScalarField S2(2*magSqr(dev(symm(gradU))));
|
||||||
volScalarField magS = sqrt(S2);
|
const volScalarField magS(sqrt(S2));
|
||||||
|
|
||||||
volScalarField eta = magS*k_/epsilon_;
|
const volScalarField eta(magS*k_/epsilon_);
|
||||||
volScalarField C1 = max(eta/(scalar(5) + eta), scalar(0.43));
|
tmp<volScalarField> C1 = max(eta/(scalar(5) + eta), scalar(0.43));
|
||||||
|
|
||||||
volScalarField G("RASModel::G", nut_*S2);
|
volScalarField G("RASModel::G", nut_*S2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user