Merge branch 'feature-wall-functions' into 'develop'

ENH: New wall-function blending approaches

See merge request Development/openfoam!350
This commit is contained in:
Andrew Heather
2020-06-10 10:24:25 +01:00
20 changed files with 1076 additions and 355 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2019 OpenFOAM Foundation Copyright (C) 2011-2019 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd. Copyright (C) 2017-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,9 +32,20 @@ License
#include "fvMatrix.H" #include "fvMatrix.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum
<
Foam::epsilonWallFunctionFvPatchScalarField::blendingType
>
Foam::epsilonWallFunctionFvPatchScalarField::blendingTypeNames
({
{ blendingType::STEPWISE , "stepwise" },
{ blendingType::MAX , "max" },
{ blendingType::BINOMIAL , "binomial" },
{ blendingType::EXPONENTIAL, "exponential" }
});
Foam::scalar Foam::epsilonWallFunctionFvPatchScalarField::tolerance_ = 1e-5; Foam::scalar Foam::epsilonWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
@ -106,17 +117,17 @@ void Foam::epsilonWallFunctionFvPatchScalarField::createAveragingWeights()
epsilonPatches.append(patchi); epsilonPatches.append(patchi);
const labelUList& faceCells = bf[patchi].patch().faceCells(); const labelUList& faceCells = bf[patchi].patch().faceCells();
forAll(faceCells, i) for (const auto& faceCell : faceCells)
{ {
weights[faceCells[i]]++; ++weights[faceCell];
} }
} }
} }
cornerWeights_.setSize(bf.size()); cornerWeights_.setSize(bf.size());
forAll(epsilonPatches, i)
for (const auto& patchi : epsilonPatches)
{ {
label patchi = epsilonPatches[i];
const fvPatchScalarField& wf = weights.boundaryField()[patchi]; const fvPatchScalarField& wf = weights.boundaryField()[patchi];
cornerWeights_[patchi] = 1.0/wf.patchInternalField(); cornerWeights_[patchi] = 1.0/wf.patchInternalField();
} }
@ -217,24 +228,71 @@ void Foam::epsilonWallFunctionFvPatchScalarField::calculate
const scalar w = cornerWeights[facei]; const scalar w = cornerWeights[facei];
// Default high-Re form scalar epsilonBlended = 0.0;
scalar epsilonc = w*Cmu75*pow(k[celli], 1.5)/(nutw.kappa()*y[facei]);
scalar Gc =
w
*(nutw[facei] + nuw[facei])
*magGradUw[facei]
*Cmu25*sqrt(k[celli])
/(nutw.kappa()*y[facei]);
if (lowReCorrection_ && yPlus < nutw.yPlusLam()) // Contribution from the viscous sublayer
const scalar epsilonVis = w*2.0*k[celli]*nuw[facei]/sqr(y[facei]);
// Contribution from the inertial sublayer
const scalar epsilonLog =
w*Cmu75*pow(k[celli], 1.5)/(nutw.kappa()*y[facei]);
switch (blending_)
{ {
epsilonc = w*2.0*k[celli]*nuw[facei]/sqr(y[facei]); case blendingType::STEPWISE:
Gc = 0; {
if (lowReCorrection_ && yPlus < nutw.yPlusLam())
{
epsilonBlended = epsilonVis;
}
else
{
epsilonBlended = epsilonLog;
}
break;
}
case blendingType::MAX:
{
// (PH:Eq. 27)
epsilonBlended = max(epsilonVis, epsilonLog);
break;
}
case blendingType::BINOMIAL:
{
// (ME:Eqs. 15-16)
epsilonBlended =
pow
(
pow(epsilonVis, n_) + pow(epsilonLog, n_),
1.0/n_
);
break;
}
case blendingType::EXPONENTIAL:
{
// (PH:p. 193)
const scalar Gamma = 0.001*pow4(yPlus)/(1.0 + yPlus);
const scalar invGamma = 1.0/(Gamma + ROOTVSMALL);
epsilonBlended =
epsilonVis*exp(-Gamma) + epsilonLog*exp(-invGamma);
break;
}
} }
epsilon0[celli] += epsilonc; epsilon0[celli] += epsilonBlended;
G0[celli] += Gc; if (!(lowReCorrection_ && yPlus < nutw.yPlusLam()))
{
G0[celli] +=
w
*(nutw[facei] + nuw[facei])
*magGradUw[facei]
*Cmu25*sqrt(k[celli])
/(nutw.kappa()*y[facei]);
}
} }
} }
@ -249,6 +307,8 @@ epsilonWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(p, iF), fixedValueFvPatchField<scalar>(p, iF),
blending_(blendingType::STEPWISE),
n_(2.0),
lowReCorrection_(false), lowReCorrection_(false),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
@ -268,6 +328,8 @@ epsilonWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
blending_(ptf.blending_),
n_(ptf.n_),
lowReCorrection_(ptf.lowReCorrection_), lowReCorrection_(ptf.lowReCorrection_),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
@ -286,6 +348,24 @@ epsilonWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(p, iF, dict), fixedValueFvPatchField<scalar>(p, iF, dict),
blending_
(
blendingTypeNames.getOrDefault
(
"blending",
dict,
blendingType::STEPWISE
)
),
n_
(
dict.getCheckOrDefault<scalar>
(
"n",
2.0,
scalarMinMax::ge(0)
)
),
lowReCorrection_(dict.getOrDefault("lowReCorrection", false)), lowReCorrection_(dict.getOrDefault("lowReCorrection", false)),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
@ -305,6 +385,8 @@ epsilonWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(ewfpsf), fixedValueFvPatchField<scalar>(ewfpsf),
blending_(ewfpsf.blending_),
n_(ewfpsf.n_),
lowReCorrection_(ewfpsf.lowReCorrection_), lowReCorrection_(ewfpsf.lowReCorrection_),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
@ -322,6 +404,8 @@ epsilonWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(ewfpsf, iF), fixedValueFvPatchField<scalar>(ewfpsf, iF),
blending_(ewfpsf.blending_),
n_(ewfpsf.n_),
lowReCorrection_(ewfpsf.lowReCorrection_), lowReCorrection_(ewfpsf.lowReCorrection_),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
@ -459,7 +543,7 @@ void Foam::epsilonWallFunctionFvPatchScalarField::updateWeightedCoeffs
{ {
const scalar w = weights[facei]; const scalar w = weights[facei];
if (tolerance_ < w) if (w > tolerance_)
{ {
const label celli = patch().faceCells()[facei]; const label celli = patch().faceCells()[facei];
@ -509,7 +593,7 @@ void Foam::epsilonWallFunctionFvPatchScalarField::manipulateMatrix
forAll(weights, facei) forAll(weights, facei)
{ {
// Only set the values if the weights are > tolerance // Only set the values if the weights are > tolerance
if (tolerance_ < weights[facei]) if (weights[facei] > tolerance_)
{ {
const label celli = faceCells[facei]; const label celli = faceCells[facei];
@ -538,6 +622,9 @@ void Foam::epsilonWallFunctionFvPatchScalarField::write
) const ) const
{ {
os.writeEntry("lowReCorrection", lowReCorrection_); os.writeEntry("lowReCorrection", lowReCorrection_);
os.writeKeyword("blending") << blendingTypeNames[blending_]
<< token::END_STATEMENT << nl;
os.writeEntry("n", n_);
fixedValueFvPatchField<scalar>::write(os); fixedValueFvPatchField<scalar>::write(os);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016, 2019 OpenFOAM Foundation Copyright (C) 2011-2016, 2019 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -31,52 +31,138 @@ Group
grpWallFunctions grpWallFunctions
Description Description
This boundary condition provides a wall constraint on turbulent kinetic This boundary condition provides a wall constraint on the turbulent kinetic
energy dissipation rate, i.e. \c epsilon, for low- and high-Reynolds number energy dissipation rate, i.e. \c epsilon, and the turbulent kinetic
turbulence models. energy production contribution, i.e. \c G, for low- and high-Reynolds
number turbulence models.
The condition can be applied to wall boundaries for which it Reference:
- calculates \c epsilon and \c G \verbatim
- specifies the near-wall \c epsilon value Binomial blending of the viscous and inertial sublayers (tag:ME):
Menter, F., & Esch, T. (2001).
Elements of industrial heat transfer prediction.
In Proceedings of the 16th Brazilian Congress of Mechanical
Engineering (COBEM), November 2001. vol. 20, p. 117-127.
where Exponential/Max blending of the viscous and inertial sublayers (tag:PH):
\vartable Popovac, M., & Hanjalić, K. (2007).
epsilon | turbulent kinetic energy dissipation rate field Compound wall treatment for RANS computation of complex
G | turbulent kinetic energy production field (divergence-free) turbulent flows and heat transfer.
\endvartable Flow, turbulence and combustion, 78(2), 177-202.
DOI:10.1007/s10494-006-9067-x
The low-Re correction is activated by setting the entry \endverbatim
\c lowReCorrection to 'on'; in this mode the model switches between
viscous and turbulent functions based on the viscous-to-turbulent
\c y+ value derived from the \c kappa and \c E.
When the \c lowReCorrection is inactive, the wall function operates
in high-Re mode.
Usage Usage
\table
Property | Description | Required | Default value
lowReCorrection | Low-Re correction active | no | off
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type epsilonWallFunction; type epsilonWallFunction;
// Optional entries // Optional entries (unmodifiable)
lowReCorrection false;
blending stepwise;
n 2.0;
// Optional (inherited) entries
...
} }
\endverbatim \endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: epsilonWallFunction | word | yes | -
lowReCorrection | Flag for low-Re correction | bool | no | false
blending | Viscous/inertial sublayer blending method <!--
--> | word | no | stepwise
n | Binomial blending exponent | scalar | no | 2.0
\endtable
The inherited entries are elaborated in:
- \link fixedValueFvPatchField.H \endlink
- \link nutWallFunctionFvPatchScalarField.H \endlink
Options for the \c blending entry:
\verbatim
stepwise | Stepwise switch (discontinuous)
max | Maximum value switch (discontinuous)
binomial | Binomial blending (smooth)
exponential | Exponential blending (smooth)
\endverbatim
wherein \c epsilon predictions for the viscous and inertial sublayers are
blended according to the following expressions:
- \c stepwise (default):
\f[
\epsilon = \epsilon_{vis} \qquad if \quad y^+ < y^+_{lam}
\f]
\f[
\epsilon = \epsilon_{log} \qquad if \quad y^+ >= y^+_{lam}
\f]
where
\vartable
\epsilon | \f$\epsilon\f$ at \f$y^+\f$
\epsilon_{vis} | \f$\epsilon\f$ computed by viscous subl. assumptions
\epsilon_{log} | \f$\epsilon\f$ computed by inertial subl. assumptions
y^+ | estimated wall-normal height of the cell centre in wall units
y^+_{lam} | estimated intersection of the viscous and inertial sublayers
\endvartable
- \c max (PH:Eq. 27):
\f[
\epsilon = max(\epsilon_{vis}, \epsilon_{log})
\f]
- \c binomial (ME:Eqs. 15-16):
\f[
\epsilon = ((\epsilon_{vis})^n + (\epsilon_{log})^n)^{1/n}
\f]
where
\vartable
n | Binomial blending exponent
\endvartable
- \c exponential (PH:Eq. 32):
\f[
\epsilon = \epsilon_{vis} \exp[-\Gamma] +\epsilon_{log} \exp[-1/\Gamma]
\f]
where (PH:p. 193)
\vartable
\Gamma_\epsilon | \f$\Gamma = 0.001 (y^+)^4 / (1.0 + y^+)\f$
\Gamma_G | \f$\Gamma = 0.01 (y^+)^4 / (1.0 + 5.0 y^+)\f$
\Gamma_\epsilon | Blending expression for \f$\epsilon\f$
\Gamma_G | Blending expression for \f$G\f$
\endvartable
\c G predictions for the viscous and inertial sublayers are blended
in a stepwise manner, and \c G below \f$y^+_{lam}\f$ (i.e. in the viscous
sublayer) is presumed to be zero.
Note Note
The coefficients \c Cmu, \c kappa, and \c E are obtained from - The coefficients \c Cmu, \c kappa, and \c E are obtained from
the specified \c nutWallFunction in order to ensure that each patch the specified \c nutWallFunction in order to ensure that each patch
possesses the same set of values for these coefficients. possesses the same set of values for these coefficients.
- \c lowReCorrection operates with only \c stepwise blending treatment to
ensure the backward compatibility.
- If \c lowReCorrection is \c on, \c stepwise blending treatment is fully
active.
- If \c lowReCorrection is \c off, only the inertial sublayer prediction
is used in the wall function, hence high-Re mode operation.
See also See also
Foam::fixedInternalValueFvPatchField - Foam::omegaWallFunctionFvPatchScalarField
SourceFiles SourceFiles
epsilonWallFunctionFvPatchScalarField.C epsilonWallFunctionFvPatchScalarField.C
@ -103,6 +189,33 @@ class epsilonWallFunctionFvPatchScalarField
: :
public fixedValueFvPatchField<scalar> public fixedValueFvPatchField<scalar>
{ {
private:
// Private Enumerations
//- Options for the blending treatment of viscous and inertial sublayers
enum blendingType
{
STEPWISE, //!< "Stepwise switch (discontinuous)"
MAX, //!< "Maximum value switch (discontinuous)"
BINOMIAL, //!< "Binomial blending (smooth)"
EXPONENTIAL //!< "Exponential blending (smooth)"
};
//- Names for blendingType
static const Enum<blendingType> blendingTypeNames;
// Private Data
//- Blending treatment (default = blendingType::STEPWISE)
const enum blendingType blending_;
//- Binomial blending exponent being used when
//- blendingType is blendingType::BINOMIAL (default = 2)
const scalar n_;
protected: protected:
// Protected Data // Protected Data
@ -110,8 +223,8 @@ protected:
//- Tolerance used in weighted calculations //- Tolerance used in weighted calculations
static scalar tolerance_; static scalar tolerance_;
//- Apply low-Re correction term; default = no //- Apply low-Re correction term (default = no)
bool lowReCorrection_; const bool lowReCorrection_;
//- Initialised flag //- Initialised flag
bool initialised_; bool initialised_;

View File

@ -72,7 +72,15 @@ Foam::kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(p, iF, dict), fixedValueFvPatchField<scalar>(p, iF, dict),
Ceps2_(dict.getOrDefault<scalar>("Ceps2", 1.9)), Ceps2_
(
dict.getCheckOrDefault<scalar>
(
"Ceps2",
1.9,
scalarMinMax::ge(SMALL)
)
),
Ck_(dict.getOrDefault<scalar>("Ck", -0.416)), Ck_(dict.getOrDefault<scalar>("Ck", -0.416)),
Bk_(dict.getOrDefault<scalar>("Bk", 8.366)), Bk_(dict.getOrDefault<scalar>("Bk", 8.366)),
C_(dict.getOrDefault<scalar>("C", 11.0)) C_(dict.getOrDefault<scalar>("C", 11.0))
@ -145,12 +153,10 @@ void Foam::kLowReWallFunctionFvPatchScalarField::updateCoeffs()
forAll(kw, facei) forAll(kw, facei)
{ {
const label celli = patch().faceCells()[facei]; const label celli = patch().faceCells()[facei];
const scalar uTau = Cmu25*sqrt(k[celli]); const scalar uTau = Cmu25*sqrt(k[celli]);
const scalar yPlus = uTau*y[facei]/nuw[facei]; const scalar yPlus = uTau*y[facei]/nuw[facei];
if (nutw.yPlusLam() < yPlus) if (yPlus > nutw.yPlusLam())
{ {
kw[facei] = Ck_/nutw.kappa()*log(yPlus) + Bk_; kw[facei] = Ck_/nutw.kappa()*log(yPlus) + Bk_;
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2012-2016, 2019 OpenFOAM Foundation Copyright (C) 2012-2016, 2019 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -31,39 +31,66 @@ Group
grpWallFunctions grpWallFunctions
Description Description
This boundary condition provides a wall constraint on turbulent kinetic This boundary condition provides a wall constraint on the turbulent kinetic
energy, i.e. \c k, for low- and high-Reynolds number turbulence models. energy, i.e. \c k, for low- and high-Reynolds number turbulence models.
The model operates in two modes, based on the computed viscous-to-turbulent
switch-over \c y+ value derived from \c kappa and \c E.
Usage Usage
\table
Property | Description | Required | Default value
Ceps2 | Model coefficient | no | 1.9
Ck | Model coefficient | no | -0.416
Bk | Model coefficient | no | 8.366
C | Model coefficient | no | 11.0
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type kLowReWallFunction; type kLowReWallFunction;
// Optional entries // Optional entries (unmodifiable)
Ceps2 1.9;
Ck -0.416;
Bk 8.366;
C 11.0;
// Optional (inherited) entries
...
} }
\endverbatim \endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: kLowReWallFunction | word | yes | -
Ceps2 | Model coefficient | scalar | no | 1.9
Ck | Model coefficient | scalar | no | -0.416
Bk | Model coefficient | scalar | no | 8.366
C | Model coefficient | scalar | no | 11.0
\endtable
The inherited entries are elaborated in:
- \link fixedValueFvPatchField.H \endlink
Viscous and inertial sublayer predictions for \c k are blended in
a stepwise manner:
\f[
k = k_{log} \qquad if \quad y^+ > y^+_{lam}
\f]
\f[
k = k_{vis} \qquad if \quad y^+ <= y^+_{lam}
\f]
where
\vartable
k_{vis} | k prediction in the viscous sublayer
k_{log} | k prediction in the inertial sublayer
y^+ | estimated wall-normal height of the cell centre in wall units
y^+_{lam} | estimated intersection of the viscous and inertial sublayers
\endvartable
Note Note
The coefficients \c Cmu, \c kappa, and \c E are obtained from The coefficients \c Cmu, \c kappa, and \c E are obtained from
the specified \c nutWallFunction in order to ensure that each patch the specified \c nutWallFunction in order to ensure that each patch
possesses the same set of values for these coefficients. possesses the same set of values for these coefficients.
See also See also
Foam::fixedValueFvPatchField - Foam::fixedValueFvPatchField
- Foam::kqRWallFunctionFvPatchScalarField
SourceFiles SourceFiles
kLowReWallFunctionFvPatchScalarField.C kLowReWallFunctionFvPatchScalarField.C
@ -129,7 +156,7 @@ public:
); );
//- Construct by mapping given kLowReWallFunctionFvPatchScalarField //- Construct by mapping given kLowReWallFunctionFvPatchScalarField
// onto a new patch //- onto a new patch
kLowReWallFunctionFvPatchScalarField kLowReWallFunctionFvPatchScalarField
( (
const kLowReWallFunctionFvPatchScalarField&, const kLowReWallFunctionFvPatchScalarField&,

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017, 2019 OpenFOAM Foundation Copyright (C) 2011-2017, 2019 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -40,13 +40,22 @@ Usage
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type kqRWallFunction; type kqRWallFunction;
// Optional (inherited) entries
...
} }
\endverbatim \endverbatim
See also where the entries mean:
Foam::zeroGradientFvPatchField \table
Property | Description | Type | Req'd | Dflt
type | Type name: kqRWallFunction | word | yes | -
\endtable
The inherited entries are elaborated in:
- \link zeroGradientFvPatchField.H \endlink
SourceFiles SourceFiles
kqRWallFunctionFvPatchField.C kqRWallFunctionFvPatchField.C

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016, 2019 OpenFOAM Foundation Copyright (C) 2011-2016, 2019 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,30 +32,30 @@ Group
Description Description
This boundary condition provides a wall constraint on the turbulent This boundary condition provides a wall constraint on the turbulent
kinematic viscosity, i.e. \c nut for use with low Reynolds number models. viscosity, i.e. \c nut for low Reynolds number models.
It sets \c nut to zero, and provides an access function to calculate \c y+. It sets \c nut to zero, and provides an access function to calculate \c y+.
Usage Usage
\table
Property | Description | Required | Default value
Cmu | Model coefficient | no | 0.09
kappa | Von Karman constant | no | 0.41
E | Model coefficient | no | 9.8
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type nutLowReWallFunction; type nutLowReWallFunction;
// Optional entries // Optional (inherited) entries
...
} }
\endverbatim \endverbatim
See also where the entries mean:
Foam::nutWallFunctionFvPatchScalarField \table
Property | Description | Type | Req'd | Dflt
type | Type name: nutLowReWallFunction | word | yes | -
\endtable
The inherited entries are elaborated in:
- \link nutWallFunctionFvPatchScalarField.H \endlink
SourceFiles SourceFiles
nutLowReWallFunctionFvPatchScalarField.C nutLowReWallFunctionFvPatchScalarField.C
@ -84,7 +84,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Calculate the turbulence viscosity //- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const; virtual tmp<scalarField> calcNut() const;

View File

@ -155,7 +155,7 @@ nutUBlendedWallFunctionFvPatchScalarField
) )
: :
nutWallFunctionFvPatchScalarField(p, iF, dict), nutWallFunctionFvPatchScalarField(p, iF, dict),
n_(dict.getOrDefault<scalar>("n", 4)) n_(dict.getOrDefault<scalar>("n", 4.0))
{} {}
@ -214,8 +214,8 @@ void Foam::nutUBlendedWallFunctionFvPatchScalarField::write
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
writeLocalEntries(os); writeLocalEntries(os);
writeEntry("value", os);
os.writeEntry("n", n_); os.writeEntry("n", n_);
writeEntry("value", os);
} }

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2019 OpenCFD Ltd. Copyright (C) 2016-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -31,8 +31,8 @@ Group
Description Description
This boundary condition provides a wall constraint on the turbulent This boundary condition provides a wall constraint on the turbulent
kinematic viscosity, i.e. \c nut, when using wall functions based on viscosity, i.e. \c nut, when using wall functions based on
a blending of laminar sub-layer and log region contributions. a blending of viscous and inertial sublayer contributions.
\f[ \f[
u_\tau = (u_{\tau,v}^n + u_{\tau,l}^n)^{1/n} u_\tau = (u_{\tau,v}^n + u_{\tau,l}^n)^{1/n}
@ -40,9 +40,9 @@ Description
where where
\vartable \vartable
u_\tau | friction velocity u_\tau | Friction velocity
u_{\tau,v} | friction velocity in the viscous region u_{\tau,v} | Friction velocity in the viscous sublayer
u_{\tau,l} | friction velocity in the log region u_{\tau,l} | Friction velocity in the inertial sublayer
\endvartable \endvartable
Reference: Reference:
@ -55,35 +55,43 @@ Description
\endverbatim \endverbatim
Usage Usage
\table
Property | Description | Required | Default value
Cmu | Model coefficient | no | 0.09
kappa | Von Karman constant | no | 0.41
E | Model coefficient | no | 9.8
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type nutUBlendedWallFunction; type nutUBlendedWallFunction;
// Optional entries // Optional entries
n 4.0;
// Optional (inherited) entries
...
} }
\endverbatim \endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: nutUBlendedWallFunction | word | yes | -
n | Blending factor | scalar | no | 4.0
\endtable
The inherited entries are elaborated in:
- \link nutWallFunctionFvPatchScalarField.H \endlink
Note Note
The full 'automatic wall treatment' description also requires use of the - The full 'automatic wall treatment' description also requires use of the
Foam::omegaWallFunction with the \c blended flag set to 'on' \link omegaWallFunctionFvPatchScalarField.H \endlink with the \c blending
option \c binomial or with the deprecated \c blended flag set to \c on.
- Suffers from non-exact restart since \c correctNut() (called through
\c turbulence->validate) returns a slightly different value every time
it is called.
See \link nutUSpaldingWallFunctionFvPatchScalarField.C \endlink.
Suffers from non-exact restart since correctNut() (called through See also
turbulence->validate) returns a slightly different value every time - Foam::nutWallFunctionFvPatchScalarField
it is called. See nutUSpaldingWallFunctionFvPatchScalarField.C - Foam::omegaWallFunctionFvPatchScalarField
SeeAlso
Foam::nutWallFunctionFvPatchScalarField
Foam::omegaWallFunctionFvPatchScalarField
SourceFiles SourceFiles
nutUBlendedWallFunctionFvPatchScalarField.C nutUBlendedWallFunctionFvPatchScalarField.C
@ -118,7 +126,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Calculate the turbulence viscosity //- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const; virtual tmp<scalarField> calcNut() const;
//- Calculate the friction velocity //- Calculate the friction velocity

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,46 +32,51 @@ Group
Description Description
This boundary condition provides a wall constraint on the turbulent This boundary condition provides a wall constraint on the turbulent
kinematic viscosity, i.e. \c nut, when using wall functions for rough walls, viscosity, i.e. \c nut, when using wall functions for rough walls,
based on velocity, \c U. based on velocity, \c U.
Usage Usage
\table
Property | Description | Required | Default value
roughnessHeight | Roughness height | yes |
roughnessConstant | Roughness constanr | yes |
roughnessFactor | Scaling factor | yes |
Cmu | Model coefficient | no | 0.09
kappa | Von Karman constant | no | 0.41
E | Model coefficient | no | 9.8
maxIter | Number of Newton-Raphson iterations | no | 10
tolerance | Convergence tolerance | no | 0.0001
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type nutURoughWallFunction; type nutURoughWallFunction;
roughnessHeight 1e-5; roughnessHeight 1e-5;
roughnessConstant 0.5; roughnessConstant 0.5;
roughnessFactor 1; roughnessFactor 1;
// Optional entries // Optional entries (unmodifiable)
maxIter 10;
tolerance 0.0001;
// Optional (inherited) entries
...
} }
\endverbatim \endverbatim
Note where the entries mean:
Suffers from non-exact restart since correctNut() (called through \table
turbulence->validate) returns a slightly different value every time Property | Description | Type | Req'd | Dflt
it is called. See nutUSpaldingWallFunctionFvPatchScalarField.C. type | Type name: nutURoughWallFunction | word | yes | -
Can be avoided by seeding the NR with e.g. the laminar viscosity roughnessHeight | Roughness height | scalar | yes | -
or tightening the convergence tolerance roughnessConstant | Roughness constant | scalar | yes | -
to e.g. 1e-7 and the max number of iterations to 100. roughnessFactor | Scaling factor | scalar | yes | -
maxIter | Number of Newton-Raphson iterations | label | no | 10
tolerance | Convergence tolerance | scalar | no | 0.0001
\endtable
See also The inherited entries are elaborated in:
Foam::nutWallFunctionFvPatchScalarField - \link nutWallFunctionFvPatchScalarField.H \endlink
Note
- Suffers from non-exact restart since \c correctNut() (called through
\c turbulence->validate) returns a slightly different value every time
it is called.
See \link nutUSpaldingWallFunctionFvPatchScalarField.C \endlink.
- Can be avoided by seeding the NR with e.g. the laminar viscosity
or tightening the convergence tolerance to e.g. 1e-7 and the max
number of iterations to 100.
SourceFiles SourceFiles
nutURoughWallFunctionFvPatchScalarField.C nutURoughWallFunctionFvPatchScalarField.C
@ -214,7 +219,6 @@ public:
return roughnessHeight_; return roughnessHeight_;
} }
//- Return the roughness constant scale //- Return the roughness constant scale
scalar roughnessConstant() const scalar roughnessConstant() const
{ {

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,7 +32,7 @@ Group
Description Description
This boundary condition provides a wall constraint on the turbulent This boundary condition provides a wall constraint on the turbulent
kinematic viscosity, i.e. \c nut, when using wall functions for rough walls, viscosity, i.e. \c nut, when using wall functions for rough walls,
based on velocity, \c U, using Spalding's law to give a continuous \c nut based on velocity, \c U, using Spalding's law to give a continuous \c nut
profile to the wall (y+ = 0) profile to the wall (y+ = 0)
@ -43,52 +43,54 @@ Description
where where
\vartable \vartable
y^+ | non-dimensional position y^+ | Non-dimensional position
u^+ | non-dimensional velocity u^+ | Non-dimensional velocity
\kappa | Von Karman constant \kappa | von Kármán constant
\endvartable \endvartable
Usage Usage
\table
Property | Description | Required | Default value
Cmu | Model coefficient | no | 0.09
kappa | Von Karman constant | no | 0.41
E | Model coefficient | no | 9.8
maxIter | Number of Newton-Raphson iterations | no | 10
tolerance | Convergence tolerance | no | 0.0001
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type nutUSpaldingWallFunction; type nutUSpaldingWallFunction;
// Optional entries // Optional entries (unmodifiable)
maxIter 10;
tolerance 0.0001;
// Optional (inherited) entries
...
} }
\endverbatim \endverbatim
See also where the entries mean:
Foam::nutWallFunctionFvPatchScalarField \table
Property | Description | Type | Req'd | Dflt
type | Type name: nutUBlendedWallFunction | word | yes | -
maxIter | Number of Newton-Raphson iterations | label | no | 10
tolerance | Convergence tolerance | scalar | no | 0.0001
\endtable
The inherited entries are elaborated in:
- \link nutWallFunctionFvPatchScalarField.H \endlink
Note Note
Suffers from non-exact restart since correctNut() (called through - Suffers from non-exact restart since \c correctNut() (called through
turbulence->validate) returns a slightly different value every time \c turbulence->validate) returns a slightly different value every time
it is called. This is since the seed for the Newton-Raphson iteration it is called. This is since the seed for the Newton-Raphson iteration
uses the current value of *this (= nut). uses the current value of \c *this (\c =nut ).
This can be avoided by overriding the tolerance. This also switches on - This can be avoided by overriding the tolerance. This also switches on
a pre-detection whether the current nut already satisfies the turbulence a pre-detection whether the current nut already satisfies the turbulence
conditions and if so does not change it at all. This means that the nut conditions and if so does not change it at all. This means that the nut
only changes if it 'has really changed'. This probably should be used with only changes if it 'has really changed'. This probably should be used with
a tight tolerance, e.g. a tight tolerance, to make sure to kick every iteration, e.g.
maxIter 100; maxIter 100;
tolerance 1e-7; tolerance 1e-7;
to make sure to kick every iteration.
SourceFiles SourceFiles
nutUSpaldingWallFunctionFvPatchScalarField.C nutUSpaldingWallFunctionFvPatchScalarField.C
@ -131,7 +133,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Calculate the turbulence viscosity //- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const; virtual tmp<scalarField> calcNut() const;
//- Calculate the friction velocity //- Calculate the friction velocity

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,41 +32,41 @@ Group
Description Description
This boundary condition provides a wall constraint on the turbulent This boundary condition provides a wall constraint on the turbulent
kinematic viscosity, i.e. \c nut, when using wall functions, based on viscosity, i.e. \c nut, when using wall functions, based on
velocity, i.e. \c U. velocity, i.e. \c U.
As input, the user specifies a look-up table of \c U+ as a function of As input, the user specifies a look-up table of \c U+ as a function of
near-wall Reynolds number. near-wall Reynolds number.
The table should be located in the $FOAM_CASE/constant directory. The table should be located in the \c $FOAM_CASE/constant directory.
Usage Usage
\table
Property | Description | Required | Default value
uPlusTable | U+ as a function of Re table name | yes |
Cmu | Model coefficient | no | 0.09
kappa | Von Karman constant | no | 0.41
E | Model coefficient | no | 9.8
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type nutTabulatedWallFunction; type nutTabulatedWallFunction;
uPlusTable myUPlusTable; uPlusTable myUPlusTable;
// Optional entries // Optional (inherited) entries
...
} }
\endverbatim \endverbatim
Note where the entries mean:
The tables are not registered since the same table object may be used for \table
more than one patch. Property | Description | Type | Req'd | Dflt
type | Type name: nutUTabulatedWallFunction | word | yes | -
uPlusTable | U+ as a function of Re table name | word | yes | -
\endtable
See also The inherited entries are elaborated in:
Foam::nutWallFunctionFvPatchScalarField - \link nutWallFunctionFvPatchScalarField.H \endlink
Note
- The tables are not registered since the same table object may be used for
more than one patch.
SourceFiles SourceFiles
nutUTabulatedWallFunctionFvPatchScalarField.C nutUTabulatedWallFunctionFvPatchScalarField.C
@ -105,7 +105,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Calculate the turbulence viscosity //- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const; virtual tmp<scalarField> calcNut() const;
//- Calculate wall u+ from table //- Calculate wall u+ from table

View File

@ -61,11 +61,14 @@ Foam::nutUWallFunctionFvPatchScalarField::calcNut() const
forAll(yPlus, facei) forAll(yPlus, facei)
{ {
if (yPlusLam_ < yPlus[facei]) // Viscous sublayer contribution
{ const scalar nutVis = 0.0;
nutw[facei] =
nuw[facei]*(yPlus[facei]*kappa_/log(E_*yPlus[facei]) - 1.0); // Inertial sublayer contribution
} const scalar nutLog =
nuw[facei]*(yPlus[facei]*kappa_/log(E_*yPlus[facei]) - 1.0);
nutw[facei] = blend(nutVis, nutLog, yPlus[facei]);
} }
return tnutw; return tnutw;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,35 +32,38 @@ Group
Description Description
This boundary condition provides a wall constraint on the turbulent This boundary condition provides a wall constraint on the turbulent
kinematic viscosity, i.e. \c nut, when using wall functions, based on viscosity, i.e. \c nut, when using wall functions, based on
velocity, \c U. velocity, \c U.
Usage Usage
\table
Property | Description | Required | Default value
Cmu | Model coefficient | no | 0.09
kappa | Von Karman constant | no | 0.41
E | Model coefficient | no | 9.8
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type nutUWallFunction; type nutUWallFunction;
// Optional entries // Optional (inherited) entries
...
} }
\endverbatim \endverbatim
See also where the entries mean:
Foam::nutWallFunctionFvPatchScalarField \table
Property | Description | Type | Req'd | Dflt
type | Type name: nutUWallFunction | word | yes | -
\endtable
The inherited entries are elaborated in:
- \link nutWallFunctionFvPatchScalarField.H \endlink
Note Note
Suffers from non-exact restart since correctNut() (called through - Suffers from non-exact restart since \c correctNut() (called through
turbulence->validate) returns a slightly different value every time \c turbulence->validate) returns a slightly different value every time
it is called. See nutUSpaldingWallFunctionFvPatchScalarField.C it is called.
See \link nutUSpaldingWallFunctionFvPatchScalarField.C \endlink.
- See \link nutWallFunctionFvPatchScalarField.H \endlink for the wall
function blending treatments.
SourceFiles SourceFiles
nutUWallFunctionFvPatchScalarField.C nutUWallFunctionFvPatchScalarField.C
@ -92,7 +95,7 @@ protected:
//- Calculate yPlus //- Calculate yPlus
virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const; virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const;
//- Calculate the turbulence viscosity //- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const; virtual tmp<scalarField> calcNut() const;

View File

@ -40,6 +40,21 @@ namespace Foam
defineTypeNameAndDebug(nutWallFunctionFvPatchScalarField, 0); defineTypeNameAndDebug(nutWallFunctionFvPatchScalarField, 0);
} }
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum
<
Foam::nutWallFunctionFvPatchScalarField::blendingType
>
Foam::nutWallFunctionFvPatchScalarField::blendingTypeNames
({
{ blendingType::STEPWISE , "stepwise" },
{ blendingType::MAX , "max" },
{ blendingType::BINOMIAL , "binomial" },
{ blendingType::EXPONENTIAL, "exponential" }
});
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::nutWallFunctionFvPatchScalarField::checkType() void Foam::nutWallFunctionFvPatchScalarField::checkType()
@ -77,6 +92,14 @@ void Foam::nutWallFunctionFvPatchScalarField::writeLocalEntries
Ostream& os Ostream& os
) const ) const
{ {
os.writeKeyword("blending") << blendingTypeNames[blending_]
<< token::END_STATEMENT << nl;
if (blending_ == blendingType::BINOMIAL)
{
os.writeEntry("n", n_);
}
if (UName_ != word::null) if (UName_ != word::null)
{ {
os.writeEntry("U", UName_); os.writeEntry("U", UName_);
@ -97,6 +120,8 @@ Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
blending_(blendingType::STEPWISE),
n_(4.0),
UName_(word::null), UName_(word::null),
Cmu_(0.09), Cmu_(0.09),
kappa_(0.41), kappa_(0.41),
@ -116,6 +141,8 @@ Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(ptf, p, iF, mapper), fixedValueFvPatchScalarField(ptf, p, iF, mapper),
blending_(ptf.blending_),
n_(ptf.n_),
UName_(ptf.UName_), UName_(ptf.UName_),
Cmu_(ptf.Cmu_), Cmu_(ptf.Cmu_),
kappa_(ptf.kappa_), kappa_(ptf.kappa_),
@ -134,6 +161,24 @@ Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(p, iF, dict), fixedValueFvPatchScalarField(p, iF, dict),
blending_
(
blendingTypeNames.getOrDefault
(
"blending",
dict,
blendingType::STEPWISE
)
),
n_
(
dict.getCheckOrDefault<scalar>
(
"n",
4.0,
scalarMinMax::ge(0)
)
),
UName_(dict.getOrDefault<word>("U", word::null)), UName_(dict.getOrDefault<word>("U", word::null)),
Cmu_(dict.getOrDefault<scalar>("Cmu", 0.09)), Cmu_(dict.getOrDefault<scalar>("Cmu", 0.09)),
kappa_(dict.getOrDefault<scalar>("kappa", 0.41)), kappa_(dict.getOrDefault<scalar>("kappa", 0.41)),
@ -150,6 +195,8 @@ Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(wfpsf), fixedValueFvPatchScalarField(wfpsf),
blending_(wfpsf.blending_),
n_(wfpsf.n_),
UName_(wfpsf.UName_), UName_(wfpsf.UName_),
Cmu_(wfpsf.Cmu_), Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_), kappa_(wfpsf.kappa_),
@ -167,6 +214,8 @@ Foam::nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(wfpsf, iF), fixedValueFvPatchScalarField(wfpsf, iF),
blending_(wfpsf.blending_),
n_(wfpsf.n_),
UName_(wfpsf.UName_), UName_(wfpsf.UName_),
Cmu_(wfpsf.Cmu_), Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_), kappa_(wfpsf.kappa_),
@ -203,15 +252,73 @@ Foam::scalar Foam::nutWallFunctionFvPatchScalarField::yPlusLam
{ {
scalar ypl = 11.0; scalar ypl = 11.0;
for (int i = 0; i < 10; ++i) for (label i = 0; i < 10; ++i)
{ {
ypl = log(max(E*ypl, 1))/kappa; ypl = log(max(E*ypl, 1.0))/kappa;
} }
return ypl; return ypl;
} }
Foam::scalar Foam::nutWallFunctionFvPatchScalarField::blend
(
const scalar nutVis,
const scalar nutLog,
const scalar yPlus
) const
{
scalar nutw = 0.0;
switch (blending_)
{
case blendingType::STEPWISE:
{
if (yPlus > yPlusLam_)
{
nutw = nutLog;
}
else
{
nutw = nutVis;
}
break;
}
case blendingType::MAX:
{
// (PH:Eq. 27)
nutw = max(nutVis, nutLog);
break;
}
case blendingType::BINOMIAL:
{
// (ME:Eqs. 15-16)
nutw =
pow
(
pow(nutVis, n_) + pow(nutLog, n_),
1.0/n_
);
break;
}
case blendingType::EXPONENTIAL:
{
// (PH:Eq. 31)
const scalar Gamma = 0.01*pow4(yPlus)/(1.0 + 5.0*yPlus);
const scalar invGamma = 1.0/(Gamma + ROOTVSMALL);
nutw = nutVis*exp(-Gamma) + nutLog*exp(-invGamma);
break;
}
}
return nutw;
}
Foam::scalar Foam::nutWallFunctionFvPatchScalarField::yPlusLam() const Foam::scalar Foam::nutWallFunctionFvPatchScalarField::yPlusLam() const
{ {
return yPlusLam_; return yPlusLam_;

View File

@ -33,37 +33,127 @@ Group
Description Description
The class \c nutWallFunction is a base class that parents the derived The class \c nutWallFunction is a base class that parents the derived
boundary conditions which provide a wall constraint on various fields, such boundary conditions which provide a wall constraint on various fields, such
as turbulence kinematic viscosity, i.e. \c nut, for low- and high-Reynolds as turbulent viscosity, i.e. \c nut, or turbulent kinetic energy dissipation
number turbulence models. rate, i.e. \c epsilon, for low- and high-Reynolds number turbulence models.
Reference: Reference:
\verbatim \verbatim
Default model coefficients: Default model coefficients (tag:VM):
Versteeg, H. K., & Malalasekera, W. (2011). Versteeg, H. K., & Malalasekera, W. (2011).
An introduction to computational fluid dynamics: the finite An introduction to computational fluid dynamics: The finite
volume method. Harlow: Pearson Education. volume method. Harlow: Pearson Education.
Subsection "3.5.2 k-epsilon model". Subsection "3.5.2 k-epsilon model".
Binomial blending of the viscous and inertial sublayers (tag:ME):
Menter, F., & Esch, T. (2001).
Elements of industrial heat transfer prediction.
In Proceedings of the 16th Brazilian Congress of Mechanical
Engineering (COBEM), November 2001. vol. 20, p. 117-127.
Exponential/Max blending of the viscous and inertial sublayers (tag:PH):
Popovac, M., & Hanjalić, K. (2007).
Compound wall treatment for RANS computation of complex
turbulent flows and heat transfer.
Flow, turbulence and combustion, 78(2), 177-202.
DOI:10.1007/s10494-006-9067-x
\endverbatim \endverbatim
Usage Usage
\table Example of the boundary condition specification:
Property | Description | Required | Default value
Cmu | Cmu coefficient | no | 0.09
kappa | Von Karman constant | no | 0.41
E | E coefficient | no | 9.8
\endtable
Examples of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory and other optional entries
type nutWallFunction; ...
// Optional entries // Optional (inherited) entries
Cmu 0.09;
kappa 0.41;
E 9.8;
blending stepwise;
n 4.0;
// Optional (inherited) entries
...
} }
\endverbatim \endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
Cmu | Empirical model coefficient | scalar | no | 0.09
kappa | von Kármán constant | scalar | no | 0.41
E | Wall roughness parameter | scalar | no | 9.8
blending | Viscous/inertial sublayer blending | word | no | stepwise
n | Binomial blending exponent | scalar | no | 2.0
\endtable
The inherited entries are elaborated in:
- \link fixedValueFvPatchFields.H \endlink
Options for the \c blending entry:
\verbatim
stepwise | Stepwise switch (discontinuous)
max | Maximum value switch (discontinuous)
binomial | Binomial blending (smooth)
exponential | Exponential blending (smooth)
\endverbatim
wherein \c nut predictions for the viscous and inertial sublayers are
blended according to the following expressions:
- \c stepwise (default):
\f[
\nu_t = {\nu_t}_{log} \qquad if \quad y^+ > y^+_{lam}
\f]
\f[
\nu_t = {\nu_t}_{vis} \qquad if \quad y^+ <= y^+_{lam}
\f]
where
\vartable
{\nu_t}_{vis} | \f$\nu_t\f$ prediction in the viscous sublayer
{\nu_t}_{log} | \f$\nu_t\f$ prediction in the inertial sublayer
y^+ | estimated wall-normal height of the cell centre in wall units
y^+_{lam} | estimated intersection of the viscous and inertial sublayers
\endvartable
- \c max (PH:Eq. 27):
\f[
\nu_t = max({\nu_t}_{vis}, {\nu_t}_{log})
\f]
- \c binomial (ME:Eqs. 15-16):
\f[
\nu_t = (({\nu_t}_{vis})^n + ({\nu_t}_{log})^n)^{1/n}
\f]
where
\vartable
n | Binomial blending exponent
\endvartable
- \c exponential (PH:Eq. 32):
\f[
\nu_t = {\nu_t}_{vis} \exp[-\Gamma] + {\nu_t}_{log} \exp[-1/\Gamma]
\f]
where (PH:Eq. 31)
\vartable
\Gamma | Blending expression
\Gamma | \f$0.01 (y^+)^4 / (1.0 + 5.0 y^+)\f$
\endvartable
Note
- \c nutWallFunction is not directly usable.
See also See also
Foam::fixedValueFvPatchField Foam::fixedValueFvPatchField
@ -94,23 +184,46 @@ class nutWallFunctionFvPatchScalarField
{ {
protected: protected:
// Protected Enumerations
//- Options for the blending treatment of viscous and inertial sublayers
enum blendingType
{
STEPWISE, //!< "Stepwise switch (discontinuous)"
MAX, //!< "Maximum value switch (discontinuous)"
BINOMIAL, //!< "Binomial blending (smooth)"
EXPONENTIAL //!< "Exponential blending (smooth)"
};
//- Names for blendingType
static const Enum<blendingType> blendingTypeNames;
// Protected Data // Protected Data
//- Blending treatment (default = blendingType::STEPWISE)
const enum blendingType blending_;
//- Binomial blending exponent being used when
//- blendingType is blendingType::BINOMIAL (default = 4)
const scalar n_;
//- Name of velocity field //- Name of velocity field
// Default is null (not specified) in which case the velocity is // Default is null (not specified) in which case the velocity is
// retrieved from the turbulence model // retrieved from the turbulence model
word UName_; word UName_;
//- Cmu coefficient //- Empirical model coefficient
scalar Cmu_; scalar Cmu_;
//- Von Karman constant //- von Kármán constant
scalar kappa_; scalar kappa_;
//- E coefficient //- Wall roughness parameter
scalar E_; scalar E_;
//- Estimated y+ value at the edge of the viscous sublayer //- Estimated y+ value at the intersection
//- of the viscous and inertial sublayers
scalar yPlusLam_; scalar yPlusLam_;
@ -123,7 +236,7 @@ protected:
//- Check the type of the patch //- Check the type of the patch
virtual void checkType(); virtual void checkType();
//- Calculate the turbulence viscosity //- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const = 0; virtual tmp<scalarField> calcNut() const = 0;
//- Write local wall function variables //- Write local wall function variables
@ -207,13 +320,22 @@ public:
const label patchi const label patchi
); );
//- Calculate the y+ at the edge of the viscous sublayer //- Estimate the y+ at the intersection of the two sublayers
static scalar yPlusLam(const scalar kappa, const scalar E); static scalar yPlusLam(const scalar kappa, const scalar E);
//- Return the y+ at the edge of the viscous sublayer //- Return the estimated y+ at the two-sublayer intersection
scalar yPlusLam() const; scalar yPlusLam() const;
//- Return the blended nut according to the chosen blending treatment
scalar blend
(
const scalar nutVis,
const scalar nutLog,
const scalar yPlus
) const;
//- Calculate and return the yPlus at the boundary //- Calculate and return the yPlus at the boundary
// yPlus is the first-cell-centre height from boundary in wall units
virtual tmp<scalarField> yPlus() const = 0; virtual tmp<scalarField> yPlus() const = 0;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016, 2019 OpenFOAM Foundation Copyright (C) 2011-2016, 2019 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -33,38 +33,38 @@ Group
Description Description
This boundary condition provides a wall constraint on the turbulent This boundary condition provides a wall constraint on the turbulent
kinematic viscosity, i.e. \c nut, when using wall functions for rough walls, kinematic viscosity, i.e. \c nut, when using wall functions for rough walls,
based on turbulent kinetic energy, \c k. The condition manipulates the \c E based on the turbulent kinetic energy, \c k. The condition manipulates the
parameter to account for roughness effects. wall roughness parameter, i.e. \c E, to account for roughness effects.
Parameter ranges Parameter ranges:
- roughness height = sand-grain roughness (0 for smooth walls) - roughness height = sand-grain roughness (0 for smooth walls)
- roughness constant = 0.5-1.0 - roughness constant = 0.5-1.0
Usage Usage
\table
Property | Description | Required | Default value
Ks | Sand-grain roughness height | yes |
Cs | Roughness constant | yes |
Cmu | Model coefficient | no | 0.09
kappa | Von Karman constant | no | 0.41
E | Model coefficient | no | 9.8
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type nutkRoughWallFunction; type nutkRoughWallFunction;
Ks uniform 0; Ks uniform 0;
Cs uniform 0.5; Cs uniform 0.5;
// Optional entries // Optional (inherited) entries
...
} }
\endverbatim \endverbatim
See also where the entries mean:
Foam::nutkRoughWallFunctionFvPatchScalarField \table
Property | Description | Type | Req'd | Dflt
type | Type name: nutkRoughWallFunction | word | yes | -
Ks | Sand-grain roughness height | scalarField | yes | -
Cs | Roughness constant | scalarField | yes | -
\endtable
The inherited entries are elaborated in:
- \link nutkWallFunctionFvPatchScalarField.H \endlink
SourceFiles SourceFiles
nutkRoughWallFunctionFvPatchScalarField.C nutkRoughWallFunctionFvPatchScalarField.C

View File

@ -67,10 +67,13 @@ calcNut() const
const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei]; const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei];
if (yPlusLam_ < yPlus) // Viscous sublayer contribution
{ const scalar nutVis = 0.0;
nutw[facei] = nuw[facei]*(yPlus*kappa_/log(E_*yPlus) - 1.0);
} // Inertial sublayer contribution
const scalar nutLog = nuw[facei]*(yPlus*kappa_/log(E_*yPlus) - 1.0);
nutw[facei] = blend(nutVis, nutLog, yPlus);
} }
return tnutw; return tnutw;

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2019 OpenFOAM Foundation Copyright (C) 2011-2019 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -32,30 +32,34 @@ Group
Description Description
This boundary condition provides a wall constraint on the turbulent This boundary condition provides a wall constraint on the turbulent
kinematic viscosity, i.e. \c nut, when using wall functions, viscosity, i.e. \c nut, when using wall functions,
based on turbulent kinetic energy, \c k. based on the turbulent kinetic energy, \c k.
Usage Usage
\table
Property | Description | Required | Default value
Cmu | Model coefficient | no | 0.09
kappa | Von Karman constant | no | 0.41
E | Model coefficient | no | 9.8
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type nutkWallFunction; type nutkWallFunction;
// Optional entries // Optional (inherited) entries
...
} }
\endverbatim \endverbatim
See also where the entries mean:
Foam::nutWallFunctionFvPatchScalarField \table
Property | Description | Type | Req'd | Dflt
type | Type name: nutkWallFunction | word | yes | -
\endtable
The inherited entries are elaborated in:
- \link nutWallFunctionFvPatchScalarField.H \endlink
Note
- See \link nutWallFunctionFvPatchScalarField.H \endlink for the wall
function blending treatments.
SourceFiles SourceFiles
nutkWallFunctionFvPatchScalarField.C nutkWallFunctionFvPatchScalarField.C
@ -84,7 +88,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Calculate the turbulence viscosity //- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const; virtual tmp<scalarField> calcNut() const;

View File

@ -32,9 +32,22 @@ License
#include "fvMatrix.H" #include "fvMatrix.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum
<
Foam::omegaWallFunctionFvPatchScalarField::blendingType
>
Foam::omegaWallFunctionFvPatchScalarField::blendingTypeNames
({
{ blendingType::STEPWISE , "stepwise" },
{ blendingType::MAX , "max" },
{ blendingType::BINOMIAL2 , "binomial2" },
{ blendingType::BINOMIAL , "binomial" },
{ blendingType::EXPONENTIAL, "exponential" },
{ blendingType::TANH, "tanh" }
});
Foam::scalar Foam::omegaWallFunctionFvPatchScalarField::tolerance_ = 1e-5; Foam::scalar Foam::omegaWallFunctionFvPatchScalarField::tolerance_ = 1e-5;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -106,18 +119,16 @@ void Foam::omegaWallFunctionFvPatchScalarField::createAveragingWeights()
omegaPatches.append(patchi); omegaPatches.append(patchi);
const labelUList& faceCells = bf[patchi].patch().faceCells(); const labelUList& faceCells = bf[patchi].patch().faceCells();
forAll(faceCells, i) for (const auto& celli : faceCells)
{ {
const label celli = faceCells[i]; ++weights[celli];
weights[celli]++;
} }
} }
} }
cornerWeights_.setSize(bf.size()); cornerWeights_.setSize(bf.size());
forAll(omegaPatches, i) for (const auto& patchi : omegaPatches)
{ {
const label patchi = omegaPatches[i];
const fvPatchScalarField& wf = weights.boundaryField()[patchi]; const fvPatchScalarField& wf = weights.boundaryField()[patchi];
cornerWeights_[patchi] = 1.0/wf.patchInternalField(); cornerWeights_[patchi] = 1.0/wf.patchInternalField();
} }
@ -212,43 +223,80 @@ void Foam::omegaWallFunctionFvPatchScalarField::calculate
forAll(nutw, facei) forAll(nutw, facei)
{ {
const label celli = patch.faceCells()[facei]; const label celli = patch.faceCells()[facei];
const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei]; const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei];
const scalar w = cornerWeights[facei]; const scalar w = cornerWeights[facei];
const scalar omegaVis = 6*nuw[facei]/(beta1_*sqr(y[facei])); // Contribution from the viscous sublayer
const scalar omegaVis = 6.0*nuw[facei]/(beta1_*sqr(y[facei]));
// Contribution from the inertial sublayer
const scalar omegaLog = sqrt(k[celli])/(Cmu25*nutw.kappa()*y[facei]); const scalar omegaLog = sqrt(k[celli])/(Cmu25*nutw.kappa()*y[facei]);
// Switching between the laminar sub-layer and the log-region rather switch (blending_)
// 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
// Generation contribution is included using the blended option, or
// when using the switching option if operating in the laminar
// sub-layer
bool includeG = true;
if (blended_)
{ {
omega0[celli] += w*sqrt(sqr(omegaVis) + sqr(omegaLog)); case blendingType::STEPWISE:
}
else
{
if (nutw.yPlusLam() < yPlus)
{ {
omega0[celli] += w*omegaLog; if (yPlus > nutw.yPlusLam())
{
omega0[celli] += w*omegaLog;
}
else
{
omega0[celli] += w*omegaVis;
}
break;
} }
else
case blendingType::MAX:
{ {
omega0[celli] += w*omegaVis; // (PH:Eq. 27)
includeG = false; omega0[celli] += max(omegaVis, omegaLog);
break;
}
case blendingType::BINOMIAL2:
{
// (ME:Eq. 15)
omega0[celli] += w*sqrt(sqr(omegaVis) + sqr(omegaLog));
break;
}
case blendingType::BINOMIAL:
{
omega0[celli] +=
w*pow
(
pow(omegaVis, n_) + pow(omegaLog, n_),
1.0/n_
);
break;
}
case blendingType::EXPONENTIAL:
{
// (PH:Eq. 31)
const scalar Gamma = 0.01*pow4(yPlus)/(1.0 + 5.0*yPlus);
const scalar invGamma = 1.0/(Gamma + ROOTVSMALL);
omega0[celli] +=
w*(omegaVis*exp(-Gamma) + omegaLog*exp(-invGamma));
break;
}
case blendingType::TANH:
{
// (KAS:Eqs. 33-34)
const scalar phiTanh = tanh(pow4(yPlus/10.0));
const scalar omegab1 = omegaVis + omegaLog;
const scalar omegab2 =
pow(pow(omegaVis, 1.2) + pow(omegaLog, 1.2), 1.0/1.2);
omega0[celli] += phiTanh*omegab1 + (1.0 - phiTanh)*omegab2;
break;
} }
} }
if (includeG) if (!(blending_ == blendingType::STEPWISE) || yPlus > nutw.yPlusLam())
{ {
G0[celli] += G0[celli] +=
w w
@ -270,7 +318,8 @@ Foam::omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(p, iF), fixedValueFvPatchField<scalar>(p, iF),
blended_(true), blending_(blendingType::BINOMIAL2),
n_(2.0),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
beta1_(0.075), beta1_(0.075),
@ -289,7 +338,8 @@ Foam::omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
blended_(ptf.blended_), blending_(ptf.blending_),
n_(ptf.n_),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
beta1_(ptf.beta1_), beta1_(ptf.beta1_),
@ -307,7 +357,24 @@ Foam::omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(p, iF, dict), fixedValueFvPatchField<scalar>(p, iF, dict),
blended_(dict.getOrDefault("blended", true)), blending_
(
blendingTypeNames.getOrDefault
(
"blending",
dict,
blendingType::BINOMIAL2
)
),
n_
(
dict.getCheckOrDefault<scalar>
(
"n",
2.0,
scalarMinMax::ge(0)
)
),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
beta1_(dict.getOrDefault<scalar>("beta1", 0.075)), beta1_(dict.getOrDefault<scalar>("beta1", 0.075)),
@ -315,6 +382,29 @@ Foam::omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
omega_(), omega_(),
cornerWeights_() cornerWeights_()
{ {
// The deprecated 'blended' keyword is superseded by the enum 'blending'
if (dict.found("blended"))
{
IOWarningInFunction(dict)
<< "Using deprecated 'blended' keyword"
<< nl << " Please use either of the below for the same behaviour:"
<< nl << " 'blending binomial2;' for 'blended on;'"
<< nl << " 'blending stepwise;' for 'blended off;'"
<< nl << " OVERWRITING: 'blended' keyword -> 'blending' enum"
<< endl;
bool blended = dict.get<bool>("blended");
if (blended)
{
blending_ = blendingType::BINOMIAL2;
}
else
{
blending_ = blendingType::STEPWISE;
}
}
// apply zero-gradient condition on start-up // apply zero-gradient condition on start-up
this->operator==(patchInternalField()); this->operator==(patchInternalField());
} }
@ -326,7 +416,8 @@ Foam::omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(owfpsf), fixedValueFvPatchField<scalar>(owfpsf),
blended_(owfpsf.blended_), blending_(owfpsf.blending_),
n_(owfpsf.n_),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
beta1_(owfpsf.beta1_), beta1_(owfpsf.beta1_),
@ -343,7 +434,8 @@ Foam::omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchField<scalar>(owfpsf, iF), fixedValueFvPatchField<scalar>(owfpsf, iF),
blended_(owfpsf.blended_), blending_(owfpsf.blending_),
n_(owfpsf.n_),
initialised_(false), initialised_(false),
master_(-1), master_(-1),
beta1_(owfpsf.beta1_), beta1_(owfpsf.beta1_),
@ -481,7 +573,7 @@ void Foam::omegaWallFunctionFvPatchScalarField::updateWeightedCoeffs
{ {
const scalar w = weights[facei]; const scalar w = weights[facei];
if (tolerance_ < w) if (w > tolerance_)
{ {
const label celli = patch().faceCells()[facei]; const label celli = patch().faceCells()[facei];
@ -559,7 +651,9 @@ void Foam::omegaWallFunctionFvPatchScalarField::write
Ostream& os Ostream& os
) const ) const
{ {
os.writeEntry("blended", blended_); os.writeKeyword("blending") << blendingTypeNames[blending_]
<< token::END_STATEMENT << nl;
os.writeEntry("n", n_);
os.writeEntry("beta1", beta1_); os.writeEntry("beta1", beta1_);
fixedValueFvPatchField<scalar>::write(os); fixedValueFvPatchField<scalar>::write(os);
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016, 2019 OpenFOAM Foundation Copyright (C) 2011-2016, 2019 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -31,68 +31,167 @@ Group
grpWallFunctions grpWallFunctions
Description Description
This boundary condition provides a wall constraint on specific turbulent This boundary condition provides a wall constraint on the specific
kinetic energy dissipation rate, i.e. \c omega, for low- and high-Reynolds dissipation rate, i.e. \c omega, and the turbulent kinetic energy
number turbulence models. production contribution, i.e. \c G, for low- and high-Reynolds number
turbulence models.
The near-wall omega may be either blended between the viscous region and Reference:
logarithmic region values using:
\f[
\omega = sqrt(\omega_{vis}^2 + \omega_{log}^2)
\f]
where
\vartable
\omega_{vis} | omega in viscous region
\omega_{log} | omega in logarithmic region
\endvartable
see eq.(15) of:
\verbatim \verbatim
Menter, F., Esch, T. Binomial blending of the viscous and inertial sublayers (tag:ME):
"Elements of Industrial Heat Transfer Prediction" Menter, F., & Esch, T. (2001).
16th Brazilian Congress of Mechanical Engineering (COBEM), Elements of industrial heat transfer prediction.
Nov. 2001 In Proceedings of the 16th Brazilian Congress of Mechanical
Engineering (COBEM), November 2001. vol. 20, p. 117-127.
Exponential/Max blending of the viscous and inertial sublayers (tag:PH):
Popovac, M., & Hanjalić, K. (2007).
Compound wall treatment for RANS computation of complex
turbulent flows and heat transfer.
Flow, turbulence and combustion, 78(2), 177-202.
DOI:10.1007/s10494-006-9067-x
Tanh blending of the viscous and inertial sublayers (tag:KAS):
Knopp, T., Alrutz, T., & Schwamborn, D. (2006).
A grid and flow adaptive wall-function method for RANS
turbulence modelling.
Journal of Computational Physics, 220(1), 19-40.
DOI:10.1016/j.jcp.2006.05.003
\endverbatim \endverbatim
or switched between these values based on the viscous-to-turbulent \c y+
value derived from \c kappa and \c E.
Usage Usage
\table
Property | Description | Required | Default value
beta1 | Model coefficient | no | 0.075
blended | Blending switch | no | false
\endtable
Example of the boundary condition specification: Example of the boundary condition specification:
\verbatim \verbatim
<patchName> <patchName>
{ {
// Mandatory entries // Mandatory entries (unmodifiable)
type omegaWallFunction; type omegaWallFunction;
// Optional entries // Optional entries (unmodifiable)
beta1 0.075;
blending binomial2;
n 2.0;
// Optional (inherited) entries
...
} }
\endverbatim \endverbatim
\table
Property | Description | Type | Req'd | Dflt
type | Type name: omegaWallFunction | word | yes | -
blended | Blending switch (Deprecated) | bool | no | true
beta1 | Model coefficient | scalar | no | 0.075
blending | Viscous/inertial sublayer blending method <!--
--> | word | no | binomial2
n | Binomial blending exponent | sclar | no | 2.0
\endtable
The inherited entries are elaborated in:
- \link fixedValueFvPatchField.H \endlink
- \link nutWallFunctionFvPatchScalarField.H \endlink
Options for the \c blending entry:
\verbatim
stepwise | Stepwise switch (discontinuous)
max | Maximum value switch (discontinuous)
binomial2 | Binomial blending (smooth) n = 2
binomial | Binomial blending (smooth)
exponential | Exponential blending (smooth)
tanh | Tanh blending (smooth)
\endverbatim
wherein \c omega predictions for the viscous and inertial sublayers are
blended according to the following expressions:
- \c stepwise:
\f[
\omega = \omega_{log} \qquad if \quad y^+ > y^+_{lam}
\f]
\f[
\omega = \omega_{vis} \qquad if \quad y^+ <= y^+_{lam}
\f]
where
\vartable
\omega | \f$\omega\f$ at \f$y^+\f$
\omega_{vis} | \f$\omega\f$ computed by using viscous sublayer assumptions
\omega_{log} |\f$\omega\f$ computed by using inertial sublayer assumptions
y^+ | estimated wall-normal height of the cell centre in wall units
y^+_{lam} | estimated intersection of the viscous and inertial sublayers
\endvartable
- \c max (PH:Eq. 27):
\f[
\omega = max(\omega_{vis}, \omega_{log})
\f]
- \c binomial2 (ME:Eq. 15) (default):
\f[
\omega = \sqrt{(\omega_{vis})^2 + (\omega_{log})^2}
\f]
- \c binomial:
\f[
\omega = ((\omega_{vis})^n + (\omega_{log})^n)^{1/n}
\f]
where
\vartable
n | Binomial blending exponent
\endvartable
- \c exponential (PH:Eq. 32):
\f[
\omega = \omega_{vis} \exp[-\Gamma] + \omega_{log} \exp[-1/\Gamma]
\f]
where (PH:Eq. 31)
\vartable
\Gamma | Blending expression
\Gamma | \f$0.01 (y^+)^4 / (1.0 + 5.0 y^+)\f$
\endvartable
- \c tanh (KAS:Eqs. 33-34):
\f[
\omega = \phi \omega_{b1} + (1 - \phi)\omega_{b2}
\f]
where
\vartable
\phi | \f$tanh((y^+/10)^4)\f$
\omega_{b1} | \f$\omega_{vis} + \omega_{log}\f$
\omega_{b2} | \f$(\omega_{vis}^{1.2} + \omega_{log}^1.2)^{1/1.2}\f$
\endvartable
\c G predictions for the viscous and inertial sublayers are blended
in a stepwise manner, and \c G below \f$y^+_{lam}\f$ (i.e. in the viscous
sublayer) is presumed to be zero.
Note Note
The coefficients \c Cmu, \c kappa, and \c E are obtained from - The coefficients \c Cmu, \c kappa, and \c E are obtained from
the specified \c nutWallFunction in order to ensure that each patch the specified \c nutWallFunction in order to ensure that each patch
possesses the same set of values for these coefficients. possesses the same set of values for these coefficients.
- The reason why \c binomial2 and \c binomial blending methods exist at
Some tests have shown that the stepwise switching method provides the same time is to ensure the elementwise backward compatibility with
more accurate predictions for 10 < y+ < 30 when used with high Reynolds the previous versions since \c binomial2 and \c binomial with n=2 will
number wall-functions. yield slightly different output due to the miniscule differences in the
implementation of the basic functions (i.e. pow, sqrt, sqr).
In addition, the stepwise switching method provides accurate predictions
when used with continuous wall-functions.
See also See also
Foam::fixedInternalValueFvPatchField - Foam::epsilonWallFunctionFvPatchScalarField
Foam::epsilonWallFunctionFvPatchScalarField
SourceFiles SourceFiles
omegaWallFunctionFvPatchScalarField.C omegaWallFunctionFvPatchScalarField.C
@ -119,6 +218,35 @@ class omegaWallFunctionFvPatchScalarField
: :
public fixedValueFvPatchField<scalar> public fixedValueFvPatchField<scalar>
{ {
private:
// Private Enumerations
//- Options for the blending treatment of viscous and inertial sublayers
enum blendingType
{
STEPWISE, //!< "Stepwise switch (discontinuous)"
MAX, //!< "Maximum value switch (discontinuous)"
BINOMIAL2, //!< "Binomial blending (smooth) n = 2"
BINOMIAL, //!< "Binomial blending (smooth)"
EXPONENTIAL, //!< "Exponential blending (smooth)"
TANH //!< "Tanh blending (smooth)"
};
//- Names for blendingType
static const Enum<blendingType> blendingTypeNames;
// Private Data
//- Blending treatment (default = blendingType::BINOMIAL2)
enum blendingType blending_;
//- Blending exponent being used when
//- blendingType is blendingType::BINOMIAL (default = 2)
const scalar n_;
protected: protected:
// Protected Data // Protected Data
@ -126,7 +254,8 @@ protected:
//- Tolerance used in weighted calculations //- Tolerance used in weighted calculations
static scalar tolerance_; static scalar tolerance_;
//- Blending switch //- Deprecated(2019-11) Blending switch
// \deprecated(2019-11) - use blending:: options
bool blended_; bool blended_;
//- Initialised flag //- Initialised flag