mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: atm wall functions: fix double "value" entry issue (#1900)
STYLE: atm wall functions: use auto and bool types wherever possible TUT: atmosphericModels: changes for style consistency
This commit is contained in:
committed by
Andrew Heather
parent
14e86437ae
commit
1bc2ffad99
@ -61,7 +61,7 @@ atmBoundaryLayer::atmBoundaryLayer
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
initABL_(dict.getOrDefault<Switch>("initABL", true)),
|
||||
initABL_(dict.getOrDefault<bool>("initABL", true)),
|
||||
kappa_
|
||||
(
|
||||
dict.getCheckOrDefault<scalar>("kappa", 0.41, scalarMinMax::ge(SMALL))
|
||||
|
||||
@ -156,7 +156,7 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Deflt
|
||||
Property | Description | Type | Reqd | Deflt
|
||||
flowDir | Flow direction | TimeFunction1<vector> | yes | -
|
||||
zDir | Ground-normal direction | TimeFunction1<vector> | yes | -
|
||||
Uref | Reference mean streamwise flow speed being used in <!--
|
||||
@ -237,7 +237,7 @@ protected:
|
||||
|
||||
//- Flag to initialise profiles with the theoretical ABL expressions,
|
||||
//- otherwise initialises by using "value" entry content
|
||||
Switch initABL_;
|
||||
bool initABL_;
|
||||
|
||||
|
||||
private:
|
||||
@ -325,7 +325,7 @@ public:
|
||||
tmp<scalarField> Ustar(const scalarField& z0) const;
|
||||
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
void autoMap(const fvPatchFieldMapper&);
|
||||
@ -334,7 +334,7 @@ public:
|
||||
void rmap(const atmBoundaryLayer&, const labelList&);
|
||||
|
||||
|
||||
// Evaluate functions
|
||||
// Evaluation
|
||||
|
||||
//- Return the velocity distribution for the ATM
|
||||
tmp<vectorField> U(const vectorField& pCf) const;
|
||||
@ -348,6 +348,7 @@ public:
|
||||
//- Return the specific dissipation rate distribution for the ATM
|
||||
tmp<scalarField> omega(const vectorField& pCf) const;
|
||||
|
||||
|
||||
//- Write
|
||||
void write(Ostream&) const;
|
||||
};
|
||||
|
||||
@ -32,8 +32,8 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a log-law type ground-normal inlet
|
||||
boundary condition for the turbulent kinetic energy dissipation rate,
|
||||
i.e. \c epsilon, for homogeneous, two-dimensional, dry-air, equilibrium
|
||||
boundary condition for the turbulent kinetic energy dissipation rate
|
||||
(i.e. \c epsilon) for homogeneous, two-dimensional, dry-air, equilibrium
|
||||
and neutral atmospheric boundary layer modelling.
|
||||
|
||||
The ground-normal \c epsilon profile expression:
|
||||
@ -75,8 +75,8 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Deflt
|
||||
type | Type name: atmBoundaryLayerInletEpsilon | word | yes | -
|
||||
Property | Description | Type | Reqd | Deflt
|
||||
type | Type name: atmBoundaryLayerInletEpsilon | word | yes | -
|
||||
\endtable
|
||||
|
||||
The inherited entries are elaborated in:
|
||||
@ -183,7 +183,7 @@ public:
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap
|
||||
|
||||
@ -32,7 +32,7 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a log-law type ground-normal inlet
|
||||
boundary condition for the turbulent kinetic energy, i.e. \c k,
|
||||
boundary condition for the turbulent kinetic energy (i.e. \c k)
|
||||
for homogeneous, two-dimensional, dry-air, equilibrium and neutral
|
||||
atmospheric boundary layer modelling.
|
||||
|
||||
@ -74,8 +74,8 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Deflt
|
||||
type | Type name: atmBoundaryLayerInletK | word | yes | -
|
||||
Property | Description | Type | Reqd | Deflt
|
||||
type | Type name: atmBoundaryLayerInletK | word | yes | -
|
||||
\endtable
|
||||
|
||||
The inherited entries are elaborated in:
|
||||
@ -183,7 +183,7 @@ public:
|
||||
virtual void updateCoeffs();
|
||||
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap
|
||||
|
||||
@ -30,7 +30,7 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a log-law type ground-normal inlet
|
||||
boundary condition for the specific dissipation rate, i.e. \c omega,
|
||||
boundary condition for the specific dissipation rate (i.e. \c omega)
|
||||
for homogeneous, two-dimensional, dry-air, equilibrium and neutral
|
||||
atmospheric boundary layer modelling.
|
||||
|
||||
@ -71,8 +71,8 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Deflt
|
||||
type | Type name: atmBoundaryLayerInletOmega | word | yes | -
|
||||
Property | Description | Type | Reqd | Deflt
|
||||
type | Type name: atmBoundaryLayerInletOmega | word | yes | -
|
||||
\endtable
|
||||
|
||||
The inherited entries are elaborated in:
|
||||
@ -180,7 +180,7 @@ public:
|
||||
virtual void updateCoeffs();
|
||||
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap
|
||||
|
||||
@ -32,8 +32,8 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a log-law type ground-normal inlet
|
||||
boundary condition for the streamwise component of wind velocity,
|
||||
i.e. \c u, for homogeneous, two-dimensional, dry-air, equilibrium
|
||||
boundary condition for the streamwise component of wind velocity
|
||||
(i.e. \c u) for homogeneous, two-dimensional, dry-air, equilibrium
|
||||
and neutral atmospheric boundary layer modelling.
|
||||
|
||||
The ground-normal streamwise flow speed profile expression:
|
||||
@ -78,8 +78,8 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Deflt
|
||||
type | Type name: atmBoundaryLayerInletVelocity | word | yes | -
|
||||
Property | Description | Type | Reqd | Deflt
|
||||
type | Type name: atmBoundaryLayerInletVelocity | word | yes | -
|
||||
\endtable
|
||||
|
||||
The inherited entries are elaborated in:
|
||||
@ -186,7 +186,8 @@ public:
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
// Mapping functions
|
||||
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap
|
||||
|
||||
@ -195,7 +195,7 @@ void atmTurbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cp0 = " << Cp0 << " must be positive."
|
||||
<< exit(FatalIOError);
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const scalarField q(q_->value(t));
|
||||
@ -220,7 +220,7 @@ void atmTurbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
||||
FatalErrorInFunction
|
||||
<< "Unknown heat source type. Valid types are: "
|
||||
<< heatSourceTypeNames << nl
|
||||
<< exit(FatalIOError);
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -31,8 +31,8 @@ Group
|
||||
grpAtmWallFunctions
|
||||
|
||||
Description
|
||||
This boundary condition provides a fixed heat constraint on temperature,
|
||||
i.e. \c T, to specify temperature gradient through an input heat source
|
||||
This boundary condition provides a fixed heat constraint on temperature
|
||||
(i.e. \c T) to specify temperature gradient through an input heat source
|
||||
which can either be specified as absolute power [W], or as flux [W/m2].
|
||||
|
||||
Required fields:
|
||||
@ -62,7 +62,7 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Dflt
|
||||
Property | Description | Type | Reqd | Dflt
|
||||
heatSource | Heat source type | word | yes | -
|
||||
alphaEff | Name of turbulent thermal diff. field [kg/m/s] <!--
|
||||
--> | word | yes | -
|
||||
@ -80,7 +80,7 @@ Usage
|
||||
Options for the \c heatSource entry:
|
||||
\verbatim
|
||||
power | Absolute power heat source [W]
|
||||
flux | Flux heat source [W/m2]
|
||||
flux | Flux heat source [W/m2]
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
@ -212,7 +212,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap(const fvPatchFieldMapper&);
|
||||
@ -225,7 +225,7 @@ public:
|
||||
);
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
// Evaluation
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
@ -116,7 +116,7 @@ atmAlphatkWallFunctionFvPatchScalarField
|
||||
(
|
||||
"Cmu",
|
||||
0.09,
|
||||
scalarMinMax::ge(0)
|
||||
scalarMinMax::ge(SMALL)
|
||||
)
|
||||
),
|
||||
kappa_
|
||||
@ -125,7 +125,7 @@ atmAlphatkWallFunctionFvPatchScalarField
|
||||
(
|
||||
"kappa",
|
||||
0.41,
|
||||
scalarMinMax::ge(0)
|
||||
scalarMinMax::ge(SMALL)
|
||||
)
|
||||
),
|
||||
Pr_(TimeFunction1<scalar>(db().time(), "Pr", dict)),
|
||||
@ -183,14 +183,15 @@ void atmAlphatkWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
const label patchi = patch().index();
|
||||
|
||||
// Retrieve turbulence properties from model
|
||||
const turbulenceModel& turbModel = db().lookupObject<turbulenceModel>
|
||||
(
|
||||
IOobject::groupName
|
||||
const auto& turbModel =
|
||||
db().lookupObject<turbulenceModel>
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
internalField().group()
|
||||
)
|
||||
);
|
||||
IOobject::groupName
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
internalField().group()
|
||||
)
|
||||
);
|
||||
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
|
||||
@ -211,7 +212,7 @@ void atmAlphatkWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
FatalErrorInFunction
|
||||
<< "Pr cannot be negative or zero. "
|
||||
<< "Please check input Pr = " << Pr
|
||||
<< exit(FatalIOError);
|
||||
<< exit(FatalError);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -226,7 +227,7 @@ void atmAlphatkWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
FatalErrorInFunction
|
||||
<< "Elements of input surface fields can only be positive. "
|
||||
<< "Please check input fields z0 and Prt."
|
||||
<< exit(FatalIOError);
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -32,7 +32,7 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a wall constraint on the kinematic
|
||||
turbulent thermal conductivity, i.e. \c alphat, for atmospheric boundary
|
||||
turbulent thermal conductivity (i.e. \c alphat) for atmospheric boundary
|
||||
layer modelling. It assumes a logarithmic distribution of the potential
|
||||
temperature within the first cell.
|
||||
|
||||
@ -65,8 +65,8 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Dflt
|
||||
type | Type name: atmAlphatkWallFunction | word | yes | -
|
||||
Property | Description | Type | Reqd | Dflt
|
||||
type | Type name: atmAlphatkWallFunction | word | yes | -
|
||||
Pr | Molecular Prandtl number | TimeFunction1<scalar> | yes | -
|
||||
Prt | Turbulent Prandtl number | PatchFunction1<scalar> | yes | -
|
||||
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
|
||||
@ -212,13 +212,13 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Evaluation functions
|
||||
// Evaluation
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap(const fvPatchFieldMapper&);
|
||||
|
||||
@ -74,7 +74,7 @@ void Foam::atmEpsilonWallFunctionFvPatchScalarField::calculate
|
||||
FatalErrorInFunction
|
||||
<< "z0 field can only contain positive values. "
|
||||
<< "Please check input field z0."
|
||||
<< exit(FatalIOError);
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -32,8 +32,8 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a wall constraint on the turbulent kinetic
|
||||
energy dissipation rate, i.e. \c epsilon, and the turbulent kinetic energy
|
||||
production contribution, i.e. \c G, for atmospheric boundary layer
|
||||
energy dissipation rate (i.e. \c epsilon) and the turbulent kinetic energy
|
||||
production contribution (i.e. \c G) for atmospheric boundary layer
|
||||
modelling.
|
||||
|
||||
References:
|
||||
@ -75,7 +75,7 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Dflt
|
||||
Property | Description | Type | Reqd | Dflt
|
||||
type | Type name: atmEpsilonWallFunction | word | yes | -
|
||||
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
|
||||
\endtable
|
||||
@ -206,7 +206,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap(const fvPatchFieldMapper&);
|
||||
|
||||
@ -43,14 +43,15 @@ tmp<scalarField> atmNutUWallFunctionFvPatchScalarField::calcNut() const
|
||||
{
|
||||
const label patchi = patch().index();
|
||||
|
||||
const turbulenceModel& turbModel = db().lookupObject<turbulenceModel>
|
||||
(
|
||||
IOobject::groupName
|
||||
const auto& turbModel =
|
||||
db().lookupObject<turbulenceModel>
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
internalField().group()
|
||||
)
|
||||
);
|
||||
IOobject::groupName
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
internalField().group()
|
||||
)
|
||||
);
|
||||
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
|
||||
@ -65,20 +66,20 @@ tmp<scalarField> atmNutUWallFunctionFvPatchScalarField::calcNut() const
|
||||
const scalarField z0(z0_->value(t));
|
||||
|
||||
#ifdef FULLDEBUG
|
||||
for (const auto& z : z0)
|
||||
for (const scalar z : z0)
|
||||
{
|
||||
if (z < VSMALL)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "z0 field can only contain positive values. "
|
||||
<< "Please check input field z0."
|
||||
<< exit(FatalIOError);
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
tmp<scalarField> tnutw(new scalarField(*this));
|
||||
scalarField& nutw = tnutw.ref();
|
||||
auto tnutw = tmp<scalarField>::New(*this);
|
||||
auto& nutw = tnutw.ref();
|
||||
|
||||
forAll(nutw, facei)
|
||||
{
|
||||
@ -90,7 +91,7 @@ tmp<scalarField> atmNutUWallFunctionFvPatchScalarField::calcNut() const
|
||||
|
||||
if (boundNut_)
|
||||
{
|
||||
nutw = max(nutw, scalar(0.0));
|
||||
nutw = max(nutw, scalar(0));
|
||||
}
|
||||
|
||||
return tnutw;
|
||||
@ -133,7 +134,7 @@ atmNutUWallFunctionFvPatchScalarField::atmNutUWallFunctionFvPatchScalarField
|
||||
)
|
||||
:
|
||||
nutUWallFunctionFvPatchScalarField(p, iF, dict),
|
||||
boundNut_(dict.getOrDefault<Switch>("boundNut", true)),
|
||||
boundNut_(dict.getOrDefault<bool>("boundNut", true)),
|
||||
z0_(PatchFunction1<scalar>::New(p.patch(), "z0", dict))
|
||||
{}
|
||||
|
||||
@ -190,7 +191,8 @@ void atmNutUWallFunctionFvPatchScalarField::rmap
|
||||
|
||||
void atmNutUWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
nutUWallFunctionFvPatchScalarField::write(os);
|
||||
fvPatchField<scalar>::write(os);
|
||||
nutWallFunctionFvPatchScalarField::writeLocalEntries(os);
|
||||
os.writeEntry("boundNut", boundNut_);
|
||||
z0_->writeData(os);
|
||||
writeEntry("value", os);
|
||||
|
||||
@ -32,7 +32,7 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a wall constraint on the turbulent
|
||||
viscosity, i.e. \c nut, based on velocity, i.e. \c U, for atmospheric
|
||||
viscosity (i.e. \c nut) based on velocity (i.e. \c U) for atmospheric
|
||||
boundary layer modelling. It is designed to be used in conjunction
|
||||
with the \c atmBoundaryLayerInletVelocity boundary condition.
|
||||
|
||||
@ -52,8 +52,8 @@ Description
|
||||
|
||||
Required fields:
|
||||
\verbatim
|
||||
nut | Turbulent viscosity [m2/s]
|
||||
U | Velocity [m/s]
|
||||
nut | Turbulent viscosity [m2/s]
|
||||
U | Velocity [m/s]
|
||||
\endverbatim
|
||||
|
||||
Usage
|
||||
@ -77,10 +77,10 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Dflt
|
||||
type | Type name: atmNutUWallFunction | word | yes | -
|
||||
Property | Description | Type | Reqd | Dflt
|
||||
type | Type name: atmNutUWallFunction | word | yes | -
|
||||
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
|
||||
boundNut | Flag: zero-bound nut near wall | bool | no | true
|
||||
boundNut | Flag: zero-bound nut near wall | bool | no | true
|
||||
\endtable
|
||||
|
||||
The inherited entries are elaborated in:
|
||||
@ -119,7 +119,7 @@ class atmNutUWallFunctionFvPatchScalarField
|
||||
|
||||
//- Flag to zero-bound nut to prevent negative nut
|
||||
//- at the wall arising from negative heat fluxes
|
||||
const Switch boundNut_;
|
||||
const bool boundNut_;
|
||||
|
||||
//- Surface roughness length field [m]
|
||||
autoPtr<PatchFunction1<scalar>> z0_;
|
||||
@ -204,7 +204,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap(const fvPatchFieldMapper&);
|
||||
|
||||
@ -44,14 +44,15 @@ tmp<scalarField> atmNutWallFunctionFvPatchScalarField::calcNut() const
|
||||
{
|
||||
const label patchi = patch().index();
|
||||
|
||||
const turbulenceModel& turbModel = db().lookupObject<turbulenceModel>
|
||||
(
|
||||
IOobject::groupName
|
||||
const auto& turbModel =
|
||||
db().lookupObject<turbulenceModel>
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
internalField().group()
|
||||
)
|
||||
);
|
||||
IOobject::groupName
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
internalField().group()
|
||||
)
|
||||
);
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
|
||||
const tmp<volScalarField> tk = turbModel.k();
|
||||
@ -60,8 +61,8 @@ tmp<scalarField> atmNutWallFunctionFvPatchScalarField::calcNut() const
|
||||
const tmp<scalarField> tnuw = turbModel.nu(patchi);
|
||||
const scalarField& nuw = tnuw();
|
||||
|
||||
tmp<scalarField> tnutw(new scalarField(*this));
|
||||
scalarField& nutw = tnutw.ref();
|
||||
auto tnutw = tmp<scalarField>::New(*this);
|
||||
auto& nutw = tnutw.ref();
|
||||
|
||||
const scalar Cmu25 = pow025(Cmu_);
|
||||
|
||||
@ -72,14 +73,14 @@ tmp<scalarField> atmNutWallFunctionFvPatchScalarField::calcNut() const
|
||||
const scalarField z0(z0_->value(t));
|
||||
|
||||
#ifdef FULLDEBUG
|
||||
for (const auto& z : z0)
|
||||
for (const scalar z : z0)
|
||||
{
|
||||
if (z < VSMALL)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "z0 field can only contain positive values. "
|
||||
<< "Please check input field z0."
|
||||
<< exit(FatalIOError);
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -211,7 +212,8 @@ void atmNutWallFunctionFvPatchScalarField::rmap
|
||||
|
||||
void atmNutWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
nutkWallFunctionFvPatchScalarField::write(os);
|
||||
fvPatchField<scalar>::write(os);
|
||||
nutWallFunctionFvPatchScalarField::writeLocalEntries(os);
|
||||
os.writeEntry("z0Min", z0Min_);
|
||||
z0_->writeData(os);
|
||||
writeEntry("value", os);
|
||||
|
||||
@ -32,8 +32,8 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a wall constraint on the turbulent
|
||||
viscosity, i.e. \c nut, based on the turbulent kinetic energy, \c k,
|
||||
and velocity, i.e. \c U, for atmospheric boundary layer modelling.
|
||||
viscosity (i.e. \c nut) based on the turbulent kinetic energy (i.e. \c k)
|
||||
and velocity (i.e. \c U) for atmospheric boundary layer modelling.
|
||||
|
||||
The governing equation of the boundary condition:
|
||||
|
||||
@ -114,9 +114,9 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Dflt
|
||||
type | Type name: nutAtmWallFunction | word | yes | -
|
||||
z0Min | Minimum surface roughness length [m] | scalar | yes | -
|
||||
Property | Description | Type | Reqd | Dflt
|
||||
type | Type name: nutAtmWallFunction | word | yes | -
|
||||
z0Min | Minimum surface roughness length [m] | scalar | yes | -
|
||||
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
|
||||
\endtable
|
||||
|
||||
@ -242,7 +242,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap(const fvPatchFieldMapper&);
|
||||
|
||||
@ -45,14 +45,15 @@ tmp<scalarField> atmNutkWallFunctionFvPatchScalarField::calcNut() const
|
||||
{
|
||||
const label patchi = patch().index();
|
||||
|
||||
const turbulenceModel& turbModel = db().lookupObject<turbulenceModel>
|
||||
(
|
||||
IOobject::groupName
|
||||
const auto& turbModel =
|
||||
db().lookupObject<turbulenceModel>
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
internalField().group()
|
||||
)
|
||||
);
|
||||
IOobject::groupName
|
||||
(
|
||||
turbulenceModel::propertiesName,
|
||||
internalField().group()
|
||||
)
|
||||
);
|
||||
const scalarField& y = turbModel.y()[patchi];
|
||||
|
||||
const tmp<volScalarField> tk = turbModel.k();
|
||||
@ -61,8 +62,8 @@ tmp<scalarField> atmNutkWallFunctionFvPatchScalarField::calcNut() const
|
||||
const tmp<scalarField> tnuw = turbModel.nu(patchi);
|
||||
const scalarField& nuw = tnuw();
|
||||
|
||||
tmp<scalarField> tnutw(new scalarField(*this));
|
||||
scalarField& nutw = tnutw.ref();
|
||||
auto tnutw = tmp<scalarField>::New(*this);
|
||||
auto& nutw = tnutw.ref();
|
||||
|
||||
const scalar Cmu25 = pow025(Cmu_);
|
||||
|
||||
@ -70,14 +71,14 @@ tmp<scalarField> atmNutkWallFunctionFvPatchScalarField::calcNut() const
|
||||
const scalarField z0(z0_->value(t));
|
||||
|
||||
#ifdef FULLDEBUG
|
||||
for (const auto& z : z0)
|
||||
for (const scalar z : z0)
|
||||
{
|
||||
if (z < VSMALL)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "z0 field can only contain positive values. "
|
||||
<< "Please check input field z0."
|
||||
<< exit(FatalIOError);
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -98,7 +99,7 @@ tmp<scalarField> atmNutkWallFunctionFvPatchScalarField::calcNut() const
|
||||
|
||||
if (boundNut_)
|
||||
{
|
||||
nutw = max(nutw, scalar(0.0));
|
||||
nutw = max(nutw, scalar(0));
|
||||
}
|
||||
|
||||
return tnutw;
|
||||
@ -141,7 +142,7 @@ atmNutkWallFunctionFvPatchScalarField::atmNutkWallFunctionFvPatchScalarField
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(p, iF, dict),
|
||||
boundNut_(dict.getOrDefault<Switch>("boundNut", false)),
|
||||
boundNut_(dict.getOrDefault<bool>("boundNut", false)),
|
||||
z0_(PatchFunction1<scalar>::New(p.patch(), "z0", dict))
|
||||
{}
|
||||
|
||||
@ -198,7 +199,8 @@ void atmNutkWallFunctionFvPatchScalarField::rmap
|
||||
|
||||
void atmNutkWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
nutkWallFunctionFvPatchScalarField::write(os);
|
||||
fvPatchField<scalar>::write(os);
|
||||
nutWallFunctionFvPatchScalarField::writeLocalEntries(os);
|
||||
os.writeEntry("boundNut", boundNut_);
|
||||
z0_->writeData(os);
|
||||
writeEntry("value", os);
|
||||
|
||||
@ -33,7 +33,7 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a wall constraint on the turbulent
|
||||
viscosity, i.e. \c nut, based on the turbulent kinetic energy, i.e. \c k,
|
||||
viscosity (i.e. \c nut) based on the turbulent kinetic energy (i.e. \c k)
|
||||
for atmospheric boundary layer modelling. It is designed to be used in
|
||||
conjunction with the \c atmBoundaryLayerInletVelocity boundary condition.
|
||||
|
||||
@ -47,7 +47,7 @@ Description
|
||||
\vartable
|
||||
\u^* | Friction velocity
|
||||
\kappa | von Kármán constant
|
||||
z_0 | Surface roughness length [m]
|
||||
z_0 | Surface roughness length [m]
|
||||
z | Ground-normal coordinate
|
||||
\endvartable
|
||||
|
||||
@ -94,10 +94,10 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Dflt
|
||||
type | Type name: atmNutkWallFunction | word | yes | -
|
||||
Property | Description | Type | Reqd | Dflt
|
||||
type | Type name: atmNutkWallFunction | word | yes | -
|
||||
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
|
||||
boundNut | Flag: zero-bound nut near wall | bool | no | false
|
||||
boundNut | Flag to zero-bound nut near wall | bool | no | false
|
||||
\endtable
|
||||
|
||||
The inherited entries are elaborated in:
|
||||
@ -139,7 +139,7 @@ class atmNutkWallFunctionFvPatchScalarField
|
||||
|
||||
//- Flag to zero-bound nut to prevent negative nut
|
||||
//- at the wall arising from negative heat fluxes
|
||||
const Switch boundNut_;
|
||||
const bool boundNut_;
|
||||
|
||||
//- Surface roughness length field [m]
|
||||
autoPtr<PatchFunction1<scalar>> z0_;
|
||||
@ -224,7 +224,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap(const fvPatchFieldMapper&);
|
||||
|
||||
@ -66,14 +66,14 @@ void Foam::atmOmegaWallFunctionFvPatchScalarField::calculate
|
||||
const scalarField z0(z0_->value(t));
|
||||
|
||||
#ifdef FULLDEBUG
|
||||
for (const auto& z : z0)
|
||||
for (const scalar z : z0)
|
||||
{
|
||||
if (z < VSMALL)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "z0 field can only contain positive values. "
|
||||
<< "Please check input field z0."
|
||||
<< exit(FatalIOError);
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -198,7 +198,6 @@ void Foam::atmOmegaWallFunctionFvPatchScalarField::write
|
||||
{
|
||||
omegaWallFunctionFvPatchScalarField::write(os);
|
||||
z0_->writeData(os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -32,8 +32,8 @@ Group
|
||||
|
||||
Description
|
||||
This boundary condition provides a wall constraint on the specific
|
||||
dissipation rate, i.e. \c omega, and the turbulent kinetic energy
|
||||
production contribution, i.e. \c G, for atmospheric boundary
|
||||
dissipation rate (i.e. \c omega) and the turbulent kinetic energy
|
||||
production contribution (i.e. \c G) for atmospheric boundary
|
||||
layer modelling.
|
||||
|
||||
References:
|
||||
@ -74,7 +74,7 @@ Usage
|
||||
|
||||
where the entries mean:
|
||||
\table
|
||||
Property | Description | Type | Req'd | Dflt
|
||||
Property | Description | Type | Reqd | Dflt
|
||||
type | Type name: atmOmegaWallFunction | word | yes | -
|
||||
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
|
||||
\endtable
|
||||
@ -206,7 +206,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Mapping functions
|
||||
// Mapping
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap(const fvPatchFieldMapper&);
|
||||
|
||||
Reference in New Issue
Block a user