mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
omegaWallFunction: Change blending from geometric mean to wall distance Reynolds number based
Replaced the ad hoc geometric mean blending with the more physical wall distance Reynolds number blending function. Additionally the part of the production term active for y+ < 11.6 has been reinstated.
This commit is contained in:
@ -281,30 +281,6 @@ epsilonWallFunctionFvPatchScalarField
|
||||
}
|
||||
|
||||
|
||||
Foam::epsilonWallFunctionFvPatchScalarField::
|
||||
epsilonWallFunctionFvPatchScalarField
|
||||
(
|
||||
const epsilonWallFunctionFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
|
||||
Cmu_(ptf.Cmu_),
|
||||
kappa_(ptf.kappa_),
|
||||
E_(ptf.E_),
|
||||
yPlusLam_(ptf.yPlusLam_),
|
||||
G_(),
|
||||
epsilon_(),
|
||||
initialised_(false),
|
||||
master_(-1),
|
||||
cornerWeights_()
|
||||
{
|
||||
checkType();
|
||||
}
|
||||
|
||||
|
||||
Foam::epsilonWallFunctionFvPatchScalarField::
|
||||
epsilonWallFunctionFvPatchScalarField
|
||||
(
|
||||
@ -331,6 +307,30 @@ epsilonWallFunctionFvPatchScalarField
|
||||
}
|
||||
|
||||
|
||||
Foam::epsilonWallFunctionFvPatchScalarField::
|
||||
epsilonWallFunctionFvPatchScalarField
|
||||
(
|
||||
const epsilonWallFunctionFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
|
||||
Cmu_(ptf.Cmu_),
|
||||
kappa_(ptf.kappa_),
|
||||
E_(ptf.E_),
|
||||
yPlusLam_(ptf.yPlusLam_),
|
||||
G_(),
|
||||
epsilon_(),
|
||||
initialised_(false),
|
||||
master_(-1),
|
||||
cornerWeights_()
|
||||
{
|
||||
checkType();
|
||||
}
|
||||
|
||||
|
||||
Foam::epsilonWallFunctionFvPatchScalarField::
|
||||
epsilonWallFunctionFvPatchScalarField
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -219,6 +219,7 @@ void omegaWallFunctionFvPatchScalarField::calculate
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
|
||||
const scalar Cmu25 = pow025(Cmu_);
|
||||
const scalar Cmu5 = sqrt(Cmu_);
|
||||
|
||||
const tmp<volScalarField> tk = turbModel.k();
|
||||
const volScalarField& k = tk();
|
||||
@ -233,49 +234,65 @@ void omegaWallFunctionFvPatchScalarField::calculate
|
||||
|
||||
const scalarField magGradUw(mag(Uw.snGrad()));
|
||||
|
||||
const FieldType& G =
|
||||
db().lookupObject<FieldType>(turbModel.GName());
|
||||
|
||||
// Set omega and G
|
||||
forAll(nutw, facei)
|
||||
{
|
||||
const label celli = patch.faceCells()[facei];
|
||||
|
||||
const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei];
|
||||
|
||||
const scalar w = cornerWeights[facei];
|
||||
|
||||
const scalar omegaVis = 6*nuw[facei]/(beta1_*sqr(y[facei]));
|
||||
const scalar omegaLog = sqrt(k[celli])/(Cmu25*kappa_*y[facei]);
|
||||
|
||||
// Switching between the laminar sub-layer and the log-region rather
|
||||
// than blending has been found to provide more accurate results over a
|
||||
// range of near-wall y+.
|
||||
//
|
||||
// For backward-compatibility the blending method is provided as an
|
||||
// option
|
||||
const scalar Rey = y[facei]*sqrt(k[celli])/nuw[facei];
|
||||
const scalar yPlus = Cmu25*Rey;
|
||||
const scalar uPlus = (1/kappa_)*log(E_*yPlus);
|
||||
|
||||
if (blended_)
|
||||
{
|
||||
omega0[celli] += w*sqrt(sqr(omegaVis) + sqr(omegaLog));
|
||||
}
|
||||
const scalar lamFrac = exp(-Rey/11);
|
||||
const scalar turbFrac = 1 - lamFrac;
|
||||
|
||||
if (yPlus > yPlusLam_)
|
||||
{
|
||||
if (!blended_)
|
||||
{
|
||||
omega0[celli] += w*omegaLog;
|
||||
}
|
||||
const scalar uStar = sqrt
|
||||
(
|
||||
lamFrac*nuw[facei]*magGradUw[facei] + turbFrac*Cmu5*k[celli]
|
||||
);
|
||||
|
||||
const scalar omegaVis = 6*nuw[facei]/(beta1_*sqr(y[facei]));
|
||||
const scalar omegaLog = uStar/(Cmu5*kappa_*y[facei]);
|
||||
|
||||
omega0[celli] += w*(lamFrac*omegaVis + turbFrac*omegaLog);
|
||||
|
||||
G0[celli] +=
|
||||
w
|
||||
*(nutw[facei] + nuw[facei])
|
||||
*magGradUw[facei]
|
||||
*Cmu25*sqrt(k[celli])
|
||||
/(kappa_*y[facei]);
|
||||
*(
|
||||
lamFrac*G[celli]
|
||||
|
||||
+ turbFrac
|
||||
*sqr(uStar*magGradUw[facei]*y[facei]/uPlus)
|
||||
/(nuw[facei]*kappa_*yPlus)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!blended_)
|
||||
if (yPlus < yPlusLam_)
|
||||
{
|
||||
const scalar omegaVis = 6*nuw[facei]/(beta1_*sqr(y[facei]));
|
||||
|
||||
omega0[celli] += w*omegaVis;
|
||||
|
||||
G0[celli] += w*G[celli];
|
||||
}
|
||||
else
|
||||
{
|
||||
const scalar uStar = sqrt(Cmu5*k[celli]);
|
||||
const scalar omegaLog = uStar/(Cmu5*kappa_*y[facei]);
|
||||
|
||||
omega0[celli] += w*omegaLog;
|
||||
|
||||
G0[celli] +=
|
||||
w*
|
||||
sqr(uStar*magGradUw[facei]*y[facei]/uPlus)
|
||||
/(nuw[facei]*kappa_*yPlus);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -307,31 +324,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
||||
}
|
||||
|
||||
|
||||
omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
||||
(
|
||||
const omegaWallFunctionFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
|
||||
Cmu_(ptf.Cmu_),
|
||||
kappa_(ptf.kappa_),
|
||||
E_(ptf.E_),
|
||||
beta1_(ptf.beta1_),
|
||||
blended_(ptf.blended_),
|
||||
yPlusLam_(ptf.yPlusLam_),
|
||||
G_(),
|
||||
omega_(),
|
||||
initialised_(false),
|
||||
master_(-1),
|
||||
cornerWeights_()
|
||||
{
|
||||
checkType();
|
||||
}
|
||||
|
||||
|
||||
omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
@ -359,6 +351,31 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
||||
}
|
||||
|
||||
|
||||
omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
||||
(
|
||||
const omegaWallFunctionFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
|
||||
Cmu_(ptf.Cmu_),
|
||||
kappa_(ptf.kappa_),
|
||||
E_(ptf.E_),
|
||||
beta1_(ptf.beta1_),
|
||||
blended_(ptf.blended_),
|
||||
yPlusLam_(ptf.yPlusLam_),
|
||||
G_(),
|
||||
omega_(),
|
||||
initialised_(false),
|
||||
master_(-1),
|
||||
cornerWeights_()
|
||||
{
|
||||
checkType();
|
||||
}
|
||||
|
||||
|
||||
omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
||||
(
|
||||
const omegaWallFunctionFvPatchScalarField& owfpsf
|
||||
@ -465,8 +482,6 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
const scalarField& G0 = this->G();
|
||||
const scalarField& omega0 = this->omega();
|
||||
|
||||
typedef DimensionedField<scalar, volMesh> FieldType;
|
||||
|
||||
FieldType& G =
|
||||
const_cast<FieldType&>
|
||||
(
|
||||
@ -517,8 +532,6 @@ void omegaWallFunctionFvPatchScalarField::updateWeightedCoeffs
|
||||
const scalarField& G0 = this->G();
|
||||
const scalarField& omega0 = this->omega();
|
||||
|
||||
typedef DimensionedField<scalar, volMesh> FieldType;
|
||||
|
||||
FieldType& G =
|
||||
const_cast<FieldType&>
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -126,7 +126,7 @@ protected:
|
||||
//- beta1 coefficient
|
||||
scalar beta1_;
|
||||
|
||||
//- beta1 coefficient
|
||||
//- Blending switch (defaults to false)
|
||||
Switch blended_;
|
||||
|
||||
//- y+ at the edge of the laminar sublayer
|
||||
@ -194,6 +194,8 @@ protected:
|
||||
return master_;
|
||||
}
|
||||
|
||||
typedef DimensionedField<scalar, volMesh> FieldType;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user