mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TurbulenceModels::derivedFvPatchFields: standardized the cell index of the 'faceCell'
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
||||
@ -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]);
|
||||
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -327,10 +327,10 @@ void LRR<BasicTurbulenceModel>::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
|
||||
);
|
||||
}
|
||||
|
||||
@ -337,10 +337,10 @@ void SSG<BasicTurbulenceModel>::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
|
||||
);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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];
|
||||
|
||||
|
||||
@ -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<wallFvPatch>(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<scalar, volMesh>& 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<scalar, volMesh>& 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<scalar, volMesh>& 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<scalar>::write(os);
|
||||
writeLocalEntries(os);
|
||||
@ -187,8 +193,4 @@ void nutWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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<scalarField> yPlus() const = 0;
|
||||
|
||||
|
||||
@ -61,9 +61,9 @@ tmp<scalarField> 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];
|
||||
|
||||
@ -84,9 +84,9 @@ tmp<scalarField> 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];
|
||||
|
||||
|
||||
@ -63,9 +63,9 @@ tmp<scalarField> 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_)
|
||||
{
|
||||
|
||||
@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user