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:
Kutalmis Bercin 2020-11-03 10:25:02 +00:00 committed by Andrew Heather
parent 14e86437ae
commit 1bc2ffad99
80 changed files with 323 additions and 311 deletions

View File

@ -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))

View File

@ -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;
};

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);
}
}

View File

@ -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();

View File

@ -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

View File

@ -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&);

View File

@ -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

View File

@ -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&);

View File

@ -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);

View File

@ -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&);

View File

@ -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);

View File

@ -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&);

View File

@ -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);

View File

@ -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&);

View File

@ -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);
}

View File

@ -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&);

View File

@ -18,4 +18,6 @@ runParallel renumberMesh -overwrite
runParallel $(getApplication)
runParallel redistributePar -reconstruct -latestTime
#------------------------------------------------------------------------------

View File

@ -1,117 +0,0 @@
#------------------------------------------------------------------------------
Overview
"By setting appropriate profiles for wind velocity and the turbulence
quantities at the inlet, it is often assumed that the boundary layer will
be maintained up to the buildings or obstructions in the flow." (HW:p. 355).
However, it was quantified by (HW:p. 355) that "even in the absence of
obstructions, ..., the velocity and turbulence profiles decay along the
fetch" (HW:p. 355). It was shown by (HW:p. 355) that a set of modifications
were required to maintain a neutral atmospheric boundary layer throughout
an empty and long computational domain of a RANS computation.
Aim:
Verification of the following boundary conditions in terms of the
maintenance of inlet quantities downstream within a RANS computation:
- atmBoundaryLayerInletVelocity
- atmBoundaryLayerInletK
- atmBoundaryLayerInletEpsilon
- atmBoundaryLayerInletOmega
Benchmark (Physical phenomenon):
The benchmark is an empty fetch computational domain, steady-state
RANS simulation involving the following traits:
- External flow
- The surface layer portion of the neutral-stratified equilibrium
atmospheric boundary layer (no Ekman layer)
- Dry air
- Homogeneous, smooth terrain
- Spatiotemporal-invariant aerodynamic roughness length
- No displacement height
- Newtonian, single-phase, incompressible, non-reacting
Benchmark scenario:
- Computational domain: (HW:Fig. 1)
- Benchmark dataset: (HW:Fig. 6) (Obtained by the WebPlotDigitizer-4.2
(Rohatgi, 2019))
Resources:
Computational study (tag:HW):
Hargreaves, D. M., & Wright, N. G. (2007).
On the use of the kε model in commercial CFD software
to model the neutral atmospheric boundary layer.
Journal of wind engineering and
industrial aerodynamics, 95(5), 355-369.
DOI:10.1016/j.jweia.2006.08.002
Wind profile (tag:RQP):
Richards, P. J., Quinn, A. D., & Parker, S. (2002).
A 6 m cube in an atmospheric boundary layer flow-Part 2.
Computational solutions. Wind and structures, 5(2_3_4), 177-192.
DOI:10.12989/was.2002.5.2_3_4.177
Physical modelling:
- The governing equations for:
- Steady-state, Newtonian, single-phase, incompressible fluid flows,
excluding any thermal chemical, electromagnetic and scalar
interactions
- Mathematical approach for the turbulence modelling:
- Reynolds-averaged Navier-Stokes simulation (RANS)
- Turbulence closure model:
- kEpsilon and kOmegaSST linear eddy viscosity closure models
- The sets of input (HW:Table 1):
- Reference height, Zref = 6 [m]
- Aerodynamic roughness height, z0 = 0.01 [m]
- Displacement height, d = 0 [m]
- Reference mean wind speed, Uref = 10 [m/s]
Computational domain modelling:
- Rectangular prism
- (x1, x2, x3)
= (5000, 100, 500) [m]
= (streamwise, spanwise, ground-normal) directions
Computational domain discretisation:
- Spatial resolution:
- (x1, x2, x3) = (500, 5, 50) [cells]
- Refer to the `system/blockMeshDict` for the grading details
- Temporal resolution: Steady state
Equation discretisation:
- Spatial derivatives and variables:
- Convection: Second order
- Others: Second order with various limiters
- Temporal derivatives and variables: First order
Numerical boundary/initial conditions:
- Refer to `0.orig`
Pressure-velocity coupling algorithm:
- SIMPLEC
Linear solvers:
- Refer to `system/fvSolution`
Initialisation and sampling:
- No initialisation/averaging
- Sampling at the end of the simulation via `system/sampleDict`
- Refer to `system/controlDict` for further details
#------------------------------------------------------------------------------

View File

@ -0,0 +1,112 @@
<!------------------------------------------------------------------------- -->
# Overview
"By setting appropriate profiles for wind velocity and the turbulence
quantities at the inlet, it is often assumed that the boundary layer will
be maintained up to the buildings or obstructions in the flow." (HW:p. 355).
However, it was quantified by (HW:p. 355) that "even in the absence of
obstructions, ..., the velocity and turbulence profiles decay along the
fetch" (HW:p. 355). It was shown by (HW:p. 355) that a set of modifications
were required to maintain a neutral atmospheric boundary layer throughout
an empty and long computational domain of a RANS computation.
## Aim
- Verification of the atmospheric boundary-layer boundary conditions in terms
of the maintenance of inlet quantities downstream within a RANS computation:
- atmBoundaryLayerInletVelocity
- atmBoundaryLayerInletK
- atmBoundaryLayerInletEpsilon
- atmBoundaryLayerInletOmega
## Benchmark (Physical phenomenon)
- The benchmark is an empty fetch computational
domain, steady-state RANS simulation.
- Flow characteristics:
- External flow
- The surface layer portion of the neutral-stratified
equilibrium atmospheric boundary layer (no Ekman layer)
- Dry air
- Homogeneous, smooth terrain
- Spatiotemporal-invariant aerodynamic roughness length
- No displacement height
- Newtonian, single-phase, incompressible, non-reacting
- Benchmark scenario:
- Computational domain: (HW:Fig. 1)
- Benchmark dataset: (HW:Fig. 6)
(Obtained by the WebPlotDigitizer-4.2 (Rohatgi, 2019))
## Resources
Computational study (tag:HW):
Hargreaves, D. M., & Wright, N. G. (2007).
On the use of the kε model in commercial CFD software
to model the neutral atmospheric boundary layer.
Journal of wind engineering and
industrial aerodynamics, 95(5), 355-369.
DOI:10.1016/j.jweia.2006.08.002
Wind profile (tag:RQP):
Richards, P. J., Quinn, A. D., & Parker, S. (2002).
A 6 m cube in an atmospheric boundary layer flow-Part 2.
Computational solutions. Wind and structures, 5(2_3_4), 177-192.
DOI:10.12989/was.2002.5.2_3_4.177
# Numerics
## Physical modelling:
- The governing equations for:
- Steady-state, Newtonian, single-phase, incompressible fluid flows,
excluding any thermal chemical, electromagnetic and scalar interactions
- Mathematical approach for the turbulence modelling:
- Reynolds-averaged Navier-Stokes simulation (RANS)
- Turbulence closure model:
- kEpsilon and kOmegaSST linear eddy viscosity closure models
- The sets of input (HW:Table 1):
- Reference height, Zref = 6 [m]
- Aerodynamic roughness height, z0 = 0.01 [m]
- Displacement height, d = 0 [m]
- Reference mean wind speed, Uref = 10 [m/s]
## Computational domain modelling:
- Rectangular prism
- (x1, x2, x3) = (5000, 100, 500) [m] = (streamwise, spanwise, ground-normal) directions
## Computational domain discretisation:
- Spatial resolution:
- (x1, x2, x3) = (500, 5, 50) [cells]
- Refer to the `system/blockMeshDict` for the grading details
- Temporal resolution: Steady state
## Equation discretisation:
- Spatial derivatives and variables:
- Convection: Second order
- Others: Second order with various limiters
- Temporal derivatives and variables: First order
## Numerical boundary/initial conditions:
- Refer to `0.orig`
## Pressure-velocity coupling algorithm:
- SIMPLEC
## Linear solvers:
- Refer to `system/fvSolution`
## Initialisation and sampling:
- No initialisation/averaging
- Sampling at the end of the simulation via `system/sampleDict`
- Refer to `system/controlDict` for further details
<!------------------------------------------------------------------------- -->

View File

@ -47,7 +47,6 @@ timePrecision 6;
runTimeModifiable yes;
functions
{
#include "sampleDict"

View File

@ -16,11 +16,12 @@ FoamFile
numberOfSubdomains 8;
method hierarchical;
method hierarchical;
coeffs
{
n (8 1 1);
n (8 1 1);
}
// ************************************************************************* //

View File

@ -27,10 +27,14 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) bounded Gauss linear;
div(phi,epsilon) bounded Gauss limitedLinear 1;
div(phi,omega) bounded Gauss limitedLinear 1;
div(phi,k) bounded Gauss limitedLinear 1;
turbulence bounded Gauss limitedLinear 1;
div(phi,epsilon) $turbulence;
div(phi,omega) $turbulence;
div(phi,k) $turbulence;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location system;
object sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -36,7 +36,7 @@ boundaryField
value uniform 300;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -31,7 +31,7 @@ boundaryField
type slip;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -37,7 +37,7 @@ boundaryField
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -34,7 +34,7 @@ boundaryField
type slip;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -31,7 +31,7 @@ boundaryField
type slip;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -20,13 +20,13 @@ internalField uniform 0.0;
boundaryField
{
"bottom|top"
"(bottom|top)"
{
type fixedValue;
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -35,7 +35,7 @@ boundaryField
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -34,7 +34,7 @@ boundaryField
type slip;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -27,7 +27,7 @@ boundaryField
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -20,13 +20,13 @@ internalField uniform 0.0;
boundaryField
{
"bottom|top"
"(bottom|top)"
{
type fixedValue;
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -20,13 +20,13 @@ internalField uniform Q_PLANT;
boundaryField
{
"bottom|top"
"(bottom|top)"
{
type fixedValue;
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -18,4 +17,5 @@ FoamFile
dimensions [0 1 -2 0 0 0 0];
value (0 0 -9.81);
// ************************************************************************* //

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
simulationType RAS;
RAS
{
@ -33,4 +33,5 @@ RAS
}
}
// ************************************************************************* //

View File

@ -47,10 +47,10 @@ timePrecision 6;
runTimeModifiable false;
functions
{
#includeFunc "samples"
}
// ************************************************************************* //

View File

@ -28,11 +28,14 @@ gradSchemes
divSchemes
{
default none;
div(phi,T) bounded Gauss upwind;
div(phi,U) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
turbulence bounded Gauss upwind;
div(phi,k) $turbulence;
div(phi,epsilon) $turbulence;
div(phi,omega) $turbulence;
div(phi,T) bounded Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -69,7 +69,6 @@ relaxationFactors
cache
{
grad(U);
grad(T);
}

View File

@ -1,4 +1,4 @@
/*--------------------------------*- C++ -*----------------------------------*/
// -*- C++ -*-
type sets;
libs (sampling);

View File

@ -49,7 +49,7 @@ boundaryField
type slip;
}
"upperInterface|lowerInterface"
"(upperInterface|lowerInterface)"
{
type cyclicAMI;
value $internalField;

View File

@ -45,7 +45,7 @@ boundaryField
type slip;
}
"upperInterface|lowerInterface"
"(upperInterface|lowerInterface)"
{
type cyclicAMI;
value $internalField;

View File

@ -50,7 +50,7 @@ boundaryField
type slip;
}
"upperInterface|lowerInterface"
"(upperInterface|lowerInterface)"
{
type cyclicAMI;
value $internalField;

View File

@ -48,7 +48,7 @@ boundaryField
type slip;
}
"upperInterface|lowerInterface"
"(upperInterface|lowerInterface)"
{
type cyclicAMI;
value $internalField;

View File

@ -45,7 +45,7 @@ boundaryField
type slip;
}
"upperInterface|lowerInterface"
"(upperInterface|lowerInterface)"
{
type cyclicAMI;
value $internalField;

View File

@ -48,7 +48,7 @@ boundaryField
type slip;
}
"upperInterface|lowerInterface"
"(upperInterface|lowerInterface)"
{
type cyclicAMI;
value $internalField;

View File

@ -40,7 +40,7 @@ boundaryField
type slip;
}
"upperInterface|lowerInterface"
"(upperInterface|lowerInterface)"
{
type cyclicAMI;
value $internalField;

View File

@ -38,7 +38,7 @@ boundaryField
value uniform 10.123;
}
"upperInterface|lowerInterface"
"(upperInterface|lowerInterface)"
{
type cyclicAMI;
value $internalField;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -47,7 +47,6 @@ timePrecision 6;
runTimeModifiable false;
functions
{
fieldAverage1

View File

@ -28,11 +28,14 @@ gradSchemes
divSchemes
{
default none;
div(phi,T) bounded Gauss upwind;
div(phi,U) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
turbulence bounded Gauss upwind;
div(phi,k) $turbulence;
div(phi,epsilon) $turbulence;
div(phi,omega) $turbulence;
div(phi,T) bounded Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -70,7 +70,6 @@ relaxationFactors
cache
{
grad(U);
grad(T);
}

View File

@ -21,4 +21,5 @@ cuttingPatches
terrain top
);
// ************************************************************************* //

View File

@ -1,4 +1,4 @@
/*--------------------------------*- C++ -*----------------------------------*/
// -*- C++ -*-
type sets;
libs (sampling);

View File

@ -36,7 +36,7 @@ boundaryField
value uniform 300;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -31,7 +31,7 @@ boundaryField
type slip;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -37,7 +37,7 @@ boundaryField
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -34,7 +34,7 @@ boundaryField
type slip;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -31,7 +31,7 @@ boundaryField
type slip;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -32,7 +32,7 @@ boundaryField
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -36,7 +36,7 @@ boundaryField
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -34,7 +34,7 @@ boundaryField
type slip;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -20,18 +20,17 @@ internalField uniform 0.0;
boundaryField
{
"bottom|top"
"(bottom|top)"
{
type fixedFluxPressure;
rho rhok;
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}
}

View File

@ -20,13 +20,13 @@ internalField uniform 0.2;
boundaryField
{
"bottom|top"
"(bottom|top)"
{
type fixedValue;
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -20,13 +20,13 @@ internalField uniform Q_PLANT;
boundaryField
{
"bottom|top"
"(bottom|top)"
{
type fixedValue;
value uniform 0;
}
"inlet|outlet|left|right"
"(inlet|outlet|left|right)"
{
type cyclic;
}

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -26,6 +25,7 @@ pressureGradient
}
}
atmCoriolisUSource1
{
type atmCoriolisUSource;
@ -36,6 +36,7 @@ atmCoriolisUSource1
}
}
atmAmbientTurbSource1
{
type atmAmbientTurbSource;
@ -47,6 +48,7 @@ atmAmbientTurbSource1
}
}
atmBuoyancyTurbSource1
{
type atmBuoyancyTurbSource;
@ -59,6 +61,7 @@ atmBuoyancyTurbSource1
}
}
atmLengthScaleTurbSource1
{
type atmLengthScaleTurbSource;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -14,7 +14,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
simulationType RAS;
RAS
{

View File

@ -47,7 +47,6 @@ timePrecision 6;
runTimeModifiable false;
functions
{
ObukhovLength1

View File

@ -28,11 +28,14 @@ gradSchemes
divSchemes
{
default none;
div(phi,T) bounded Gauss upwind;
div(phi,U) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
turbulence bounded Gauss upwind;
div(phi,k) $turbulence;
div(phi,epsilon) $turbulence;
div(phi,omega) $turbulence;
div(phi,T) bounded Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

View File

@ -69,7 +69,6 @@ relaxationFactors
cache
{
grad(U);
grad(T);
}

View File

@ -1,4 +1,4 @@
/*--------------------------------*- C++ -*----------------------------------*/
// -*- C++ -*-
type sets;
libs (sampling);

View File

@ -1,4 +1,4 @@
/*--------------------------------*- C++ -*----------------------------------*/
// -*- C++ -*-
type turbulenceFields;
libs (fieldFunctionObjects);