ENH: New atmospheric boundary layer (ABL) model suite (Part 1)

Please refer to the header file documentation for complete set of details.

  ENH: add new fvOptions for ABL modelling

    - atmAmbientTurbSource
    - atmBuoyancyTurbSource
    - atmCoriolisUSource
    - atmLengthScaleTurbSource
    - atmPlantCanopyTurbSource
    - atmPlantCanopyUSource
    - atmPlantCanopyTSource
    - atmNutSource

  ENH: add new boundary conditions for ABL modelling
       with PatchFunction1 and TimeFunction1 support

    - atmAlphatkWallFunction
    - atmEpsilonWallFunction
    - atmNutkWallFunction
    - atmNutUWallFunction
    - atmNutWallFunction
    - atmOmegaWallFunction
    - atmTurbulentHeatFluxTemperature

  STYLE: change names of nutkAtmRoughWallFunction -> atmNutkWallFunction by
         ensuring the bitwise backward compatibility

  ENH: add new variable-scaling force computation method to actuationDiskSource

  ENH: review actuationDiskSource and radialActuationDiskSource

  ENH: add new function object, ObukhovLength

  ENH: add new ABL tutorials/verifications

    - verificationAndValidation/atmosphericModels/atmFlatTerrain
      - verification with the Leipzig field experiment
      - illustration of precursor/successor field mapping
    - verificationAndValidation/atmosphericModels/atmForestStability
      - verification with the Sweden field experiment
    - update incompressible/simpleFoam/turbineSiting
This commit is contained in:
Kutalmis Bercin
2020-05-05 14:20:45 +01:00
committed by Andrew Heather
parent 70cd6c6176
commit 41e264f27d
386 changed files with 53513 additions and 349 deletions

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Version: v1912
\\ / A nd | Website: www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Computes the Obukhov length field and associated friction velocity field.
\*---------------------------------------------------------------------------*/
type ObukhovLength;
libs (fieldFunctionObjects);
U <fieldName>;
kappa 0.4;
beta 3e-3;
executeControl writeTime;
writeControl writeTime;
// ************************************************************************* //

View File

@ -1,22 +1,41 @@
/* Models */
atmosphericTurbulentTransportModels.C
porosityModels/powerLawLopesdaCosta/powerLawLopesdaCosta.C
/* Boundary conditions */
derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C
derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C
derivedFvPatchFields/atmBoundaryLayerInletK/atmBoundaryLayerInletKFvPatchScalarField.C
derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C
derivedFvPatchFields/atmBoundaryLayerInletOmega/atmBoundaryLayerInletOmegaFvPatchScalarField.C
derivedFvPatchFields/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C
derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.C
/* Wall function BCs */
wallFunctions = derivedFvPatchFields/wallFunctions
$(wallFunctions)/atmAlphatkWallFunction/atmAlphatkWallFunctionFvPatchScalarField.C
$(wallFunctions)/atmEpsilonWallFunction/atmEpsilonWallFunctionFvPatchScalarField.C
$(wallFunctions)/atmNutkWallFunction/atmNutkWallFunctionFvPatchScalarField.C
$(wallFunctions)/atmNutUWallFunction/atmNutUWallFunctionFvPatchScalarField.C
$(wallFunctions)/atmNutWallFunction/atmNutWallFunctionFvPatchScalarField.C
$(wallFunctions)/atmOmegaWallFunction/atmOmegaWallFunctionFvPatchScalarField.C
/* fvOptions */
fvOptions/atmAmbientTurbSource/atmAmbientTurbSource.C
fvOptions/atmBuoyancyTurbSource/atmBuoyancyTurbSource.C
fvOptions/atmCoriolisUSource/atmCoriolisUSource.C
fvOptions/atmLengthScaleTurbSource/atmLengthScaleTurbSource.C
fvOptions/atmPlantCanopyTurbSource/atmPlantCanopyTurbSource.C
fvOptions/atmPlantCanopyUSource/atmPlantCanopyUSource.C
fvOptions/atmPlantCanopyTSource/atmPlantCanopyTSource.C
fvOptions/atmNutSource/atmNutSource.C
/* functionObjects */
functionObjects/ObukhovLength/ObukhovLength.C
LIB = $(FOAM_LIBBIN)/libatmosphericModels

View File

@ -2,10 +2,15 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude
LIB_LIBS = \
@ -13,6 +18,8 @@ LIB_LIBS = \
-lfvOptions \
-lmeshTools \
-lsurfMesh \
-lfluidThermophysicalModels \
-lsolidThermo \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels
-lcompressibleTurbulenceModels

View File

@ -0,0 +1,255 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmTurbulentHeatFluxTemperatureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "turbulenceModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum
<
Foam::atmTurbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType
>
Foam::atmTurbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames
({
{ heatSourceType::POWER , "power" },
{ heatSourceType::FLUX , "flux" }
});
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
atmTurbulentHeatFluxTemperatureFvPatchScalarField::
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(p, iF),
heatSource_(heatSourceType::POWER),
alphaEffName_("undefinedAlphaEff"),
Cp0_(db().time(), "Cp0"),
q_(nullptr)
{}
atmTurbulentHeatFluxTemperatureFvPatchScalarField::
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const atmTurbulentHeatFluxTemperatureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
heatSource_(ptf.heatSource_),
alphaEffName_(ptf.alphaEffName_),
Cp0_(ptf.Cp0_),
q_(ptf.q_.clone(p.patch()))
{}
atmTurbulentHeatFluxTemperatureFvPatchScalarField::
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchScalarField(p, iF),
heatSource_
(
heatSourceTypeNames.getOrDefault
(
"heatSource",
dict,
heatSourceType::POWER
)
),
alphaEffName_(dict.get<word>("alphaEff")),
Cp0_(TimeFunction1<scalar>(db().time(), "Cp0", dict)),
q_(PatchFunction1<scalar>::New(p.patch(), "q", dict))
{
if (dict.found("value") && dict.found("gradient"))
{
fvPatchField<scalar>::operator =
(
Field<scalar>("value", dict, p.size())
);
gradient() = Field<scalar>("gradient", dict, p.size());
}
else
{
fvPatchField<scalar>::operator=(patchInternalField());
gradient() = 0.0;
}
}
atmTurbulentHeatFluxTemperatureFvPatchScalarField::
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const atmTurbulentHeatFluxTemperatureFvPatchScalarField& atmpsf
)
:
fixedGradientFvPatchScalarField(atmpsf),
heatSource_(atmpsf.heatSource_),
alphaEffName_(atmpsf.alphaEffName_),
Cp0_(atmpsf.Cp0_),
q_(atmpsf.q_.clone(this->patch().patch()))
{}
atmTurbulentHeatFluxTemperatureFvPatchScalarField::
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const atmTurbulentHeatFluxTemperatureFvPatchScalarField& atmpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(atmpsf, iF),
heatSource_(atmpsf.heatSource_),
alphaEffName_(atmpsf.alphaEffName_),
Cp0_(atmpsf.Cp0_),
q_(atmpsf.q_.clone(this->patch().patch()))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void atmTurbulentHeatFluxTemperatureFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
scalarField::autoMap(m);
q_->autoMap(m);
}
void atmTurbulentHeatFluxTemperatureFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
fixedGradientFvPatchScalarField::rmap(ptf, addr);
const atmTurbulentHeatFluxTemperatureFvPatchScalarField& atmptf =
refCast<const atmTurbulentHeatFluxTemperatureFvPatchScalarField>(ptf);
q_->rmap(atmptf.q_(), addr);
}
void atmTurbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const scalarField& alphaEffp =
patch().lookupPatchField<volScalarField, scalar>(alphaEffName_);
const scalar t = db().time().timeOutputValue();
const scalar Cp0 = Cp0_.value(t);
if (Cp0 < SMALL)
{
FatalErrorInFunction
<< "Cp0 = " << Cp0 << " must be positive."
<< exit(FatalIOError);
}
const scalarField q(q_->value(t));
switch (heatSource_)
{
case heatSourceType::POWER:
{
const scalar Ap = gSum(patch().magSf());
gradient() = q/(Ap*Cp0*alphaEffp + SMALL);
break;
}
case heatSourceType::FLUX:
{
gradient() = q/(Cp0*alphaEffp + SMALL);
break;
}
default:
{
FatalErrorInFunction
<< "Unknown heat source type. Valid types are: "
<< heatSourceTypeNames << nl
<< exit(FatalIOError);
}
}
fixedGradientFvPatchScalarField::updateCoeffs();
}
void atmTurbulentHeatFluxTemperatureFvPatchScalarField::write(Ostream& os) const
{
fixedGradientFvPatchScalarField::write(os);
os.writeEntry("heatSource", heatSourceTypeNames[heatSource_]);
os.writeEntry("alphaEff", alphaEffName_);
Cp0_.writeData(os);
q_->writeData(os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
atmTurbulentHeatFluxTemperatureFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,247 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::atmTurbulentHeatFluxTemperatureFvPatchScalarField
Group
grpAtmWallFunctions
Description
This boundary condition provides a fixed heat constraint on temperature,
i.e. \c T, to specify temperature gradient. Input heat source either
specified in terms of an absolute power [W], or as a flux [W/m2].
Required fields:
\verbatim
nut | Turbulent viscosity [m2/s]
k | Turbulent kinetic energy [m2/s2]
\endverbatim
Usage
Example of the boundary condition specification:
\verbatim
<patchName>
{
// Mandatory entries (unmodifiable)
type atmTurbulentHeatFluxTemperature;
heatSource flux;
alphaEff alphaEff;
// Mandatory entries (runtime modifiable)
Cp0 0.001;
q uniform 10;
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
heatSource | Heat source type | word | yes | -
alphaEff | Name of turbulent thermal diff. field [kg/m/s] <!--
--> | word | yes | -
Cp0 | Specific heat capacity | TimeFunction1<scalar> | yes | -
q | Heat source value | PatchFunction1<scalar> | yes | -
\endtable
Options for the \c heatSource entry:
\verbatim
power | Absolute power heat source [W]
flux | Flux heat source [W/m^2]
\endverbatim
The inherited entries are elaborated in:
- \link fixedGradientFvPatchScalarField.H \endlink
- \link TimeFunction1.H \endlink
- \link PatchFunction1.H \endlink
SourceFiles
atmTurbulentHeatFluxTemperatureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef atmTurbulentHeatFluxTemperatureFvPatchScalarFields_H
#define atmTurbulentHeatFluxTemperatureFvPatchScalarFields_H
#include "fvPatchFields.H"
#include "fixedGradientFvPatchFields.H"
#include "TimeFunction1.H"
#include "PatchFunction1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class atmTurbulentHeatFluxTemperatureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class atmTurbulentHeatFluxTemperatureFvPatchScalarField
:
public fixedGradientFvPatchScalarField
{
// Private Enumerations
//- Options for the heat source input modes
enum heatSourceType
{
POWER, //!< "Absolute power heat source"
FLUX //!< "Flux heat source"
};
//- Names for heatSourceType
static const Enum<heatSourceType> heatSourceTypeNames;
// Private Data
//- Heat source type
const enum heatSourceType heatSource_;
//- Name of effective thermal diffusivity field [kg/m/s]
word alphaEffName_;
//- Specific heat capacity [-]
TimeFunction1<scalar> Cp0_;
//- Heat power [W] or flux [W/m2]
// Divided by density, rho, if used in kinematic form
autoPtr<PatchFunction1<scalar>> q_;
public:
//- Runtime type information
TypeName("atmTurbulentHeatFluxTemperature");
// Constructors
//- Construct from patch and internal field
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
//- atmTurbulentHeatFluxTemperatureFvPatchScalarField onto
//- a new patch
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const atmTurbulentHeatFluxTemperatureFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const atmTurbulentHeatFluxTemperatureFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new atmTurbulentHeatFluxTemperatureFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
const atmTurbulentHeatFluxTemperatureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new atmTurbulentHeatFluxTemperatureFvPatchScalarField
(
*this,
iF
)
);
}
// Member Functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper&);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
// I-O
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,309 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmAlphatkWallFunctionFvPatchScalarField.H"
#include "turbulenceModel.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "wallFvPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
scalar atmAlphatkWallFunctionFvPatchScalarField::tolerance_ = 0.01;
label atmAlphatkWallFunctionFvPatchScalarField::maxIters_ = 10;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void atmAlphatkWallFunctionFvPatchScalarField::checkType()
{
if (!isA<wallFvPatch>(patch()))
{
FatalErrorInFunction
<< "Invalid wall function specification" << nl
<< " Patch type for patch " << patch().name()
<< " must be wall" << nl
<< " Current patch type is " << patch().type() << nl << endl
<< abort(FatalError);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
atmAlphatkWallFunctionFvPatchScalarField::
atmAlphatkWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(p, iF),
Cmu_(0.09),
kappa_(0.41),
Pr_(db().time(), "Pr"),
Prt_(nullptr),
z0_(nullptr)
{
checkType();
}
atmAlphatkWallFunctionFvPatchScalarField::
atmAlphatkWallFunctionFvPatchScalarField
(
const atmAlphatkWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
Cmu_(ptf.Cmu_),
kappa_(ptf.kappa_),
Pr_(ptf.Pr_),
Prt_(ptf.Prt_.clone(p.patch())),
z0_(ptf.z0_.clone(p.patch()))
{
checkType();
}
atmAlphatkWallFunctionFvPatchScalarField::
atmAlphatkWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF, dict),
Cmu_
(
dict.getCheckOrDefault<scalar>
(
"Cmu",
0.09,
scalarMinMax::ge(0)
)
),
kappa_
(
dict.getCheckOrDefault<scalar>
(
"kappa",
0.41,
scalarMinMax::ge(0)
)
),
Pr_(TimeFunction1<scalar>(db().time(), "Pr", dict)),
Prt_(PatchFunction1<scalar>::New(p.patch(), "Prt", dict)),
z0_(PatchFunction1<scalar>::New(p.patch(), "z0", dict))
{
checkType();
}
atmAlphatkWallFunctionFvPatchScalarField::
atmAlphatkWallFunctionFvPatchScalarField
(
const atmAlphatkWallFunctionFvPatchScalarField& wfpsf
)
:
fixedValueFvPatchScalarField(wfpsf),
Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_),
Pr_(wfpsf.Pr_),
Prt_(wfpsf.Prt_.clone(this->patch().patch())),
z0_(wfpsf.z0_.clone(this->patch().patch()))
{
checkType();
}
atmAlphatkWallFunctionFvPatchScalarField::
atmAlphatkWallFunctionFvPatchScalarField
(
const atmAlphatkWallFunctionFvPatchScalarField& wfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(wfpsf, iF),
Cmu_(wfpsf.Cmu_),
kappa_(wfpsf.kappa_),
Pr_(wfpsf.Pr_),
Prt_(wfpsf.Prt_.clone(this->patch().patch())),
z0_(wfpsf.z0_.clone(this->patch().patch()))
{
checkType();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void atmAlphatkWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const label patchi = patch().index();
// Retrieve turbulence properties from model
const turbulenceModel& turbModel = db().lookupObject<turbulenceModel>
(
IOobject::groupName
(
turbulenceModel::propertiesName,
internalField().group()
)
);
const scalarField& y = turbModel.y()[patchi];
const tmp<scalarField> tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
const tmp<volScalarField> tk = turbModel.k();
const volScalarField& k = tk();
const scalar Cmu25 = pow025(Cmu_);
const scalar t = db().time().timeOutputValue();
const scalar Pr = Pr_.value(t);
#ifdef FULLDEBUG
if (Pr < VSMALL)
{
FatalErrorInFunction
<< "Pr cannot be negative or zero. "
<< "Please check input Pr = " << Pr
<< exit(FatalIOError);
}
#endif
const scalarField Prt(Prt_->value(t));
const scalarField z0(z0_->value(t));
#ifdef FULLDEBUG
forAll(Prt, i)
{
if (Prt[i] < VSMALL || z0[i] < VSMALL)
{
FatalErrorInFunction
<< "Elements of input surface fields can only be positive. "
<< "Please check input fields z0 and Prt."
<< exit(FatalIOError);
}
}
#endif
const labelUList& faceCells = patch().faceCells();
scalarField& alphatw = *this;
forAll(alphatw, facei)
{
const label celli = faceCells[facei];
const scalar uStar = Cmu25*Foam::sqrt(k[celli]);
const scalar Edash = (y[facei] + z0[facei])/(z0[facei] + 1e-4);
// Update turbulent thermal conductivity
alphatw[facei] =
uStar*kappa_*y[facei]/(Prt[facei]*log(max(Edash, 1 + 1e-4)))
+ nuw[facei]/Pr;
}
// lower bound values to avoid unrealistic
// negative temperatures on the ground
alphatw = max(alphatw, 0.01);
fixedValueFvPatchField<scalar>::updateCoeffs();
}
void atmAlphatkWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
fixedValueFvPatchScalarField::autoMap(m);
Prt_->autoMap(m);
z0_->autoMap(m);
}
void atmAlphatkWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
fixedValueFvPatchScalarField::rmap(ptf, addr);
const atmAlphatkWallFunctionFvPatchScalarField& nrwfpsf =
refCast<const atmAlphatkWallFunctionFvPatchScalarField>(ptf);
z0_->rmap(nrwfpsf.z0_(), addr);
Prt_->rmap(nrwfpsf.Prt_(), addr);
}
void atmAlphatkWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
os.writeEntry("Cmu", Cmu_);
os.writeEntry("kappa", kappa_);
Pr_.writeData(os);
Prt_->writeData(os);
z0_->writeData(os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
atmAlphatkWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,249 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::atmAlphatkWallFunctionFvPatchScalarField
Group
grpAtmWallFunctions
Description
This boundary condition provides a wall constraint on kinematic turbulent
thermal conductivity, \c alphat, for atmospheric boundary layer modelling.
It assumes a logarithmic distribution of the potential temperature within
the first cell.
Required fields:
\verbatim
alphat | Kinematic turbulent thermal conductivity [m2/s]
\endverbatim
Usage
Example of the boundary condition specification:
\verbatim
<patchName>
{
// Mandatory entries (unmodifiable)
type alphatkAtmWallFunction;
// Mandatory entries (runtime modifiable)
Pr 0.90;
Prt uniform 0.85;
z0 uniform 0.001;
// Optional entries (unmodifiable)
Cmu 0.09;
kappa 0.41;
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: alphatAtmWallFunction | word | yes | -
Pr | Molecular Prandtl number | TimeFunction1<scalar> | yes | -
Prt | Turbulent Prandtl number | PatchFunction1<scalar> | yes | -
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
Cmu | Empirical model constant | scalar | no | 0.09
kappa | von Kármán constant | scalar | no | 0.41
\endtable
The inherited entries are elaborated in:
- \link fixedValueFvPatchField.H \endlink
- \link TimeFunction1.H \endlink
- \link PatchFunction1.H \endlink
See also
- Foam::fixedValueFvPatchField
SourceFiles
atmAlphatkWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef atmAlphatkWallFunctionFvPatchScalarField_H
#define atmAlphatkWallFunctionFvPatchScalarField_H
#include "fixedValueFvPatchFields.H"
#include "TimeFunction1.H"
#include "PatchFunction1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class turbulenceModel;
/*---------------------------------------------------------------------------*\
Class atmAlphatkWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class atmAlphatkWallFunctionFvPatchScalarField
:
public fixedValueFvPatchScalarField
{
protected:
// Protected Data
//- Empirical model constant
const scalar Cmu_;
//- von Kármán constant
const scalar kappa_;
//- Molecular Prandtl number
TimeFunction1<scalar> Pr_;
//- Turbulent Prandtl number field
autoPtr<PatchFunction1<scalar>> Prt_;
//- Surface roughness length [m]
autoPtr<PatchFunction1<scalar>> z0_;
//- Solution parameters
static scalar tolerance_;
static label maxIters_;
// Protected Member Functions
//- Check the type of the patch
virtual void checkType();
public:
//- Runtime type information
TypeName("atmAlphatkWallFunction");
// Constructors
//- Construct from patch and internal field
atmAlphatkWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
atmAlphatkWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
//- atmAlphatkWallFunctionFvPatchScalarField
//- onto a new patch
atmAlphatkWallFunctionFvPatchScalarField
(
const atmAlphatkWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
atmAlphatkWallFunctionFvPatchScalarField
(
const atmAlphatkWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new atmAlphatkWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
atmAlphatkWallFunctionFvPatchScalarField
(
const atmAlphatkWallFunctionFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new atmAlphatkWallFunctionFvPatchScalarField(*this, iF)
);
}
// Member Functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper&);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// I-O
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,230 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmEpsilonWallFunctionFvPatchScalarField.H"
#include "nutWallFunctionFvPatchScalarField.H"
#include "turbulenceModel.H"
#include "fvMatrix.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void Foam::atmEpsilonWallFunctionFvPatchScalarField::calculate
(
const turbulenceModel& turbModel,
const List<scalar>& cornerWeights,
const fvPatch& patch,
scalarField& G0,
scalarField& epsilon0
)
{
const label patchi = patch.index();
const nutWallFunctionFvPatchScalarField& nutw =
nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi);
const scalarField& y = turbModel.y()[patchi];
const tmp<scalarField> tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
const tmp<volScalarField> tk = turbModel.k();
const volScalarField& k = tk();
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const scalarField magGradUw(mag(Uw.snGrad()));
const scalar Cmu25 = pow025(nutw.Cmu());
const scalar Cmu75 = pow(nutw.Cmu(), 0.75);
const scalar t = db().time().timeOutputValue();
const scalarField z0(z0_->value(t));
#ifdef FULLDEBUG
for (const auto& z : z0)
{
if (z < VSMALL)
{
FatalErrorInFunction
<< "z0 field can only contain positive values. "
<< "Please check input field z0."
<< exit(FatalIOError);
}
}
#endif
const labelUList& faceCells = patch.faceCells();
// Set epsilon and G
forAll(nutw, facei)
{
const label celli = faceCells[facei];
const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei];
const scalar w = cornerWeights[facei];
// (PGVB:Eq. 7, RH:Eq. 8)
scalar epsilonc =
w*Cmu75*pow(k[celli], 1.5)/(nutw.kappa()*(y[facei] + z0[facei]));
scalar Gc =
w
*(nutw[facei] + nuw[facei])
*magGradUw[facei]
*Cmu25*sqrt(k[celli])
/(nutw.kappa()*(y[facei] + z0[facei]));
if (lowReCorrection_ && yPlus < nutw.yPlusLam())
{
epsilonc = w*2.0*k[celli]*nuw[facei]/sqr(y[facei] + z0[facei]);
Gc = 0;
}
epsilon0[celli] += epsilonc;
G0[celli] += Gc;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::atmEpsilonWallFunctionFvPatchScalarField::
atmEpsilonWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
epsilonWallFunctionFvPatchScalarField(p, iF),
z0_(nullptr)
{}
Foam::atmEpsilonWallFunctionFvPatchScalarField::
atmEpsilonWallFunctionFvPatchScalarField
(
const atmEpsilonWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
epsilonWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
z0_(ptf.z0_.clone(p.patch()))
{}
Foam::atmEpsilonWallFunctionFvPatchScalarField::
atmEpsilonWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
epsilonWallFunctionFvPatchScalarField(p, iF, dict),
z0_(PatchFunction1<scalar>::New(p.patch(), "z0", dict))
{}
Foam::atmEpsilonWallFunctionFvPatchScalarField::
atmEpsilonWallFunctionFvPatchScalarField
(
const atmEpsilonWallFunctionFvPatchScalarField& ewfpsf
)
:
epsilonWallFunctionFvPatchScalarField(ewfpsf),
z0_(ewfpsf.z0_.clone(this->patch().patch()))
{}
Foam::atmEpsilonWallFunctionFvPatchScalarField::
atmEpsilonWallFunctionFvPatchScalarField
(
const atmEpsilonWallFunctionFvPatchScalarField& ewfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
epsilonWallFunctionFvPatchScalarField(ewfpsf, iF),
z0_(ewfpsf.z0_.clone(this->patch().patch()))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::atmEpsilonWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
epsilonWallFunctionFvPatchScalarField::autoMap(m);
z0_->autoMap(m);
}
void Foam::atmEpsilonWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
epsilonWallFunctionFvPatchScalarField::rmap(ptf, addr);
const atmEpsilonWallFunctionFvPatchScalarField& atmpsf =
refCast<const atmEpsilonWallFunctionFvPatchScalarField>(ptf);
z0_->rmap(atmpsf.z0_(), addr);
}
void Foam::atmEpsilonWallFunctionFvPatchScalarField::write
(
Ostream& os
) const
{
epsilonWallFunctionFvPatchScalarField::write(os);
z0_->writeData(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
atmEpsilonWallFunctionFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,234 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::atmEpsilonWallFunctionFvPatchScalarField
Group
grpAtmWallFunctions
Description
This boundary condition provides a wall constraint on turbulent kinetic
energy dissipation rate, i.e. \c epsilon, for atmospheric boundary layer
flows in neutral stratification conditions.
Required fields:
\verbatim
epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
\endverbatim
References:
\verbatim
Theoretical expressions (tags:PGVB, RH):
Parente, A., Gorlé, C., Van Beeck, J., & Benocci, C. (2011).
Improved kε model and wall function formulation
for the RANS simulation of ABL flows.
J. of wind engineering and industrial aerodynamics, 99(4), 267-278.
DOI:10.1016/j.jweia.2010.12.017
Richards, P. J., & Hoxey, R. P. (1993).
Appropriate boundary conditions for computational wind
engineering models using the k-ε turbulence model.
In Computational Wind Engineering 1 (pp. 145-153).
DOI:10.1016/B978-0-444-81688-7.50018-8
\endverbatim
Usage
Example of the boundary condition specification:
\verbatim
<patchName>
{
// Mandatory entries (unmodifiable)
type atmEpsilonWallFunction;
// Mandatory entries (runtime modifiable)
z0 uniform 0.001;
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmEpsilonWallFunction | word | yes | -
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
\endtable
The inherited entries are elaborated in:
- \link epsilonWallFunctionFvPatchScalarField.H \endlink
- \link nutWallFunctionFvPatchScalarField.H \endlink
- \link PatchFunction1 \endlink
See also
- Foam::epsilonWallFunctionFvPatchScalarField
SourceFiles
atmEpsilonWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef atmEpsilonWallFunctionFvPatchScalarField_H
#define atmEpsilonWallFunctionFvPatchScalarField_H
#include "epsilonWallFunctionFvPatchScalarField.H"
#include "PatchFunction1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class atmEpsilonWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class atmEpsilonWallFunctionFvPatchScalarField
:
public epsilonWallFunctionFvPatchScalarField
{
protected:
// Protected Data
//- Surface roughness length field [m]
autoPtr<PatchFunction1<scalar>> z0_;
// Protected Member Functions
//- Calculate the epsilon and G
virtual void calculate
(
const turbulenceModel& turbulence,
const List<scalar>& cornerWeights,
const fvPatch& patch,
scalarField& G,
scalarField& epsilon
) override final;
public:
//- Runtime type information
TypeName("atmEpsilonWallFunction");
// Constructors
//- Construct from patch and internal field
atmEpsilonWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
atmEpsilonWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
//- atmEpsilonWallFunctionFvPatchScalarField
//- onto a new patch
atmEpsilonWallFunctionFvPatchScalarField
(
const atmEpsilonWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
atmEpsilonWallFunctionFvPatchScalarField
(
const atmEpsilonWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new atmEpsilonWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
atmEpsilonWallFunctionFvPatchScalarField
(
const atmEpsilonWallFunctionFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new atmEpsilonWallFunctionFvPatchScalarField(*this, iF)
);
}
// Member Functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper&);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// I-O
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,212 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmNutUWallFunctionFvPatchScalarField.H"
#include "turbulenceModel.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
tmp<scalarField> atmNutUWallFunctionFvPatchScalarField::calcNut() const
{
const label patchi = patch().index();
const turbulenceModel& turbModel = db().lookupObject<turbulenceModel>
(
IOobject::groupName
(
turbulenceModel::propertiesName,
internalField().group()
)
);
const scalarField& y = turbModel.y()[patchi];
const fvPatchVectorField& Uw = U(turbModel).boundaryField()[patchi];
const vectorField Up(Uw.patchInternalField() - Uw);
const scalarField magUpn(mag(Up - (Up & patch().nf())*patch().nf()));
const tmp<scalarField> tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
const scalar t = db().time().timeOutputValue();
const scalarField z0(z0_->value(t));
#ifdef FULLDEBUG
for (const auto& z : z0)
{
if (z < VSMALL)
{
FatalErrorInFunction
<< "z0 field can only contain positive values. "
<< "Please check input field z0."
<< exit(FatalIOError);
}
}
#endif
tmp<scalarField> tnutw(new scalarField(*this));
scalarField& nutw = tnutw.ref();
forAll(nutw, facei)
{
const scalar Edash = (y[facei] + z0[facei])/(z0[facei] + 1e-4);
const scalar uStar = magUpn[facei]*kappa_/log(max(Edash, 1.0 + 1e-4));
nutw[facei] = sqr(uStar)/max(magUpn[facei], 1e-6)*y[facei] - nuw[facei];
}
if (boundNut_)
{
nutw = max(nutw, 0.0);
}
return tnutw;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
atmNutUWallFunctionFvPatchScalarField::atmNutUWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
nutUWallFunctionFvPatchScalarField(p, iF),
boundNut_(true),
z0_(nullptr)
{}
atmNutUWallFunctionFvPatchScalarField::atmNutUWallFunctionFvPatchScalarField
(
const atmNutUWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
nutUWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
boundNut_(ptf.boundNut_),
z0_(ptf.z0_.clone(p.patch()))
{}
atmNutUWallFunctionFvPatchScalarField::atmNutUWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
nutUWallFunctionFvPatchScalarField(p, iF, dict),
boundNut_(dict.getOrDefault<Switch>("boundNut", true)),
z0_(PatchFunction1<scalar>::New(p.patch(), "z0", dict))
{}
atmNutUWallFunctionFvPatchScalarField::atmNutUWallFunctionFvPatchScalarField
(
const atmNutUWallFunctionFvPatchScalarField& rwfpsf
)
:
nutUWallFunctionFvPatchScalarField(rwfpsf),
boundNut_(rwfpsf.boundNut_),
z0_(rwfpsf.z0_.clone(this->patch().patch()))
{}
atmNutUWallFunctionFvPatchScalarField::atmNutUWallFunctionFvPatchScalarField
(
const atmNutUWallFunctionFvPatchScalarField& rwfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
nutUWallFunctionFvPatchScalarField(rwfpsf, iF),
boundNut_(rwfpsf.boundNut_),
z0_(rwfpsf.z0_.clone(this->patch().patch()))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void atmNutUWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
nutUWallFunctionFvPatchScalarField::autoMap(m);
z0_->autoMap(m);
}
void atmNutUWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
nutUWallFunctionFvPatchScalarField::rmap(ptf, addr);
const atmNutUWallFunctionFvPatchScalarField& nrwfpsf =
refCast<const atmNutUWallFunctionFvPatchScalarField>(ptf);
z0_->rmap(nrwfpsf.z0_(), addr);
}
void atmNutUWallFunctionFvPatchScalarField::write(Ostream& os) const
{
nutUWallFunctionFvPatchScalarField::write(os);
os.writeEntry("boundNut", boundNut_);
z0_->writeData(os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
atmNutUWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -5,7 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -24,57 +25,82 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::nutkAtmRoughWallFunctionFvPatchScalarField
Foam::atmNutUWallFunctionFvPatchScalarField
Group
grpWallFunctions
grpAtmWallFunctions
Description
This boundary condition provides a turbulent kinematic viscosity for
atmospheric velocity profiles. It is designed to be used in conjunction
with the atmBoundaryLayerInletVelocity boundary condition. The values
are calculated using:
This boundary condition provides a wall constraint on the turbulent
viscosity, i.e. \c nut, based on velocity, \c U, for atmospheric boundary
layer modelling. It is designed to be used in conjunction with the
\c atmBoundaryLayerInletVelocity boundary condition.
The governing equation of the boundary condition:
\f[
U = \frac{U_f}{K} ln \left(\frac{z + z_0}{z_0}\right)
\u = \frac{\u^*}{\kappa} ln \left(\frac{z + z_0}{z_0}\right)
\f]
where
\vartable
U_f | frictional velocity
K | Von Karman's constant
z_0 | surface roughness length
z | vertical coordinate
\u^* | Friction velocity
\kappa | von Kármán constant
z_0 | Surface roughness length [m]
z | Ground-normal coordinate
\endvartable
Usage
\table
Property | Description | Required | Default value
z0 | surface roughness length| yes |
\endtable
Required fields:
\verbatim
nut | Turbulent viscosity [m2/s]
U | Velocity [m/s]
\endverbatim
Usage
Example of the boundary condition specification:
\verbatim
<patchName>
{
type nutkAtmRoughWallFunction;
z0 uniform 0;
// Mandatory entries (unmodifiable)
type atmNutUWallFunction;
// Mandatory entries (runtime modifiable)
z0 uniform 0.001;
// Optional entries (unmodifiable)
boundNut true;
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmNutUWallFunction | word | yes | -
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
boundNut | Flag: zero-bound nut at the wall | bool | no | true
\endtable
The inherited entries are elaborated in:
- \link nutUWallFunctionFvPatchScalarField.H \endlink
- \link PatchFunction1.H \endlink
See also
Foam::nutkWallFunctionFvPatchField
- Foam::nutUWallFunctionFvPatchScalarField
- Foam::atmNutkWallFunctionFvPatchScalarField
SourceFiles
nutkAtmRoughWallFunctionFvPatchScalarField.C
atmNutUWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef nutkAtmRoughWallFunctionFvPatchScalarField_H
#define nutkAtmRoughWallFunctionFvPatchScalarField_H
#ifndef atmNutUWallFunctionFvPatchScalarField_H
#define atmNutUWallFunctionFvPatchScalarField_H
#include "nutkWallFunctionFvPatchScalarField.H"
#include "nutUWallFunctionFvPatchScalarField.H"
#include "PatchFunction1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -82,45 +108,48 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nutkAtmRoughWallFunctionFvPatchScalarField Declaration
Class atmNutUWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class nutkAtmRoughWallFunctionFvPatchScalarField
class atmNutUWallFunctionFvPatchScalarField
:
public nutkWallFunctionFvPatchScalarField
public nutUWallFunctionFvPatchScalarField
{
// Private Data
//- Flag to zero-bound nut to prevent negative nut
//- at the wall arising from negative heat fluxes
const Switch boundNut_;
//- Surface roughness length field [m]
autoPtr<PatchFunction1<scalar>> z0_;
protected:
// Protected data
//- Surface roughness length
scalarField z0_;
// Protected Member Functions
//- Calculate the turbulence viscosity
//- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const;
public:
//- Runtime type information
TypeName("nutkAtmRoughWallFunction");
TypeName("atmNutUWallFunction");
// Constructors
//- Construct from patch and internal field
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutUWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutUWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
@ -128,20 +157,20 @@ public:
);
//- Construct by mapping given
// nutkAtmRoughWallFunctionFvPatchScalarField
// onto a new patch
nutkAtmRoughWallFunctionFvPatchScalarField
//- atmNutUWallFunctionFvPatchScalarField
//- onto a new patch
atmNutUWallFunctionFvPatchScalarField
(
const nutkAtmRoughWallFunctionFvPatchScalarField&,
const atmNutUWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutUWallFunctionFvPatchScalarField
(
const nutkAtmRoughWallFunctionFvPatchScalarField&
const atmNutUWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
@ -149,14 +178,14 @@ public:
{
return tmp<fvPatchScalarField>
(
new nutkAtmRoughWallFunctionFvPatchScalarField(*this)
new atmNutUWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutUWallFunctionFvPatchScalarField
(
const nutkAtmRoughWallFunctionFvPatchScalarField&,
const atmNutUWallFunctionFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
@ -168,21 +197,12 @@ public:
{
return tmp<fvPatchScalarField>
(
new nutkAtmRoughWallFunctionFvPatchScalarField(*this, iF)
new atmNutUWallFunctionFvPatchScalarField(*this, iF)
);
}
// Member functions
// Access functions
// Return z0
scalarField& z0()
{
return z0_;
}
// Member Functions
// Mapping functions

View File

@ -0,0 +1,233 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 CENER
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmNutWallFunctionFvPatchScalarField.H"
#include "turbulenceModel.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "bound.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
tmp<scalarField> atmNutWallFunctionFvPatchScalarField::calcNut() const
{
const label patchi = patch().index();
const turbulenceModel& turbModel = db().lookupObject<turbulenceModel>
(
IOobject::groupName
(
turbulenceModel::propertiesName,
internalField().group()
)
);
const scalarField& y = turbModel.y()[patchi];
const tmp<volScalarField> tk = turbModel.k();
const volScalarField& k = tk();
const tmp<scalarField> tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
tmp<scalarField> tnutw(new scalarField(*this));
scalarField& nutw = tnutw.ref();
const scalar Cmu25 = pow025(Cmu_);
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
const scalar t = db().time().timeOutputValue();
const scalarField z0(z0_->value(t));
#ifdef FULLDEBUG
for (const auto& z : z0)
{
if (z < VSMALL)
{
FatalErrorInFunction
<< "z0 field can only contain positive values. "
<< "Please check input field z0."
<< exit(FatalIOError);
}
}
#endif
const labelList& faceCells = patch().faceCells();
forAll(nutw, facei)
{
const label celli = faceCells[facei];
// (RH:Eq. 6)
const scalar Edash = (y[facei] + z0[facei])/(z0[facei] + z0Min_);
// (RH:Eq. 6)
const scalar uStarU = magUp[facei]*kappa_/log(max(Edash, 1 + SMALL));
// (RH:Eq. 7)
const scalar uStarK = Cmu25*Foam::sqrt(k[celli]);
// (SBJM:Eq. 7; SM:Eq. 25)
const scalar tauw = uStarU*uStarK;
nutw[facei] =
max(tauw*y[facei]/(max(magUp[facei], SMALL)) - nuw[facei], 0.0);
}
return tnutw;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
atmNutWallFunctionFvPatchScalarField::atmNutWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(p, iF),
z0Min_(SMALL),
z0_(nullptr)
{}
atmNutWallFunctionFvPatchScalarField::atmNutWallFunctionFvPatchScalarField
(
const atmNutWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
z0Min_(ptf.z0Min_),
z0_(ptf.z0_.clone(p.patch()))
{}
atmNutWallFunctionFvPatchScalarField::atmNutWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
nutkWallFunctionFvPatchScalarField(p, iF, dict),
z0Min_
(
dict.getCheckOrDefault<scalar>
(
"z0Min",
SMALL,
scalarMinMax::ge(0)
)
),
z0_(PatchFunction1<scalar>::New(p.patch(), "z0", dict))
{}
atmNutWallFunctionFvPatchScalarField::atmNutWallFunctionFvPatchScalarField
(
const atmNutWallFunctionFvPatchScalarField& rwfpsf
)
:
nutkWallFunctionFvPatchScalarField(rwfpsf),
z0Min_(rwfpsf.z0Min_),
z0_(rwfpsf.z0_.clone(this->patch().patch()))
{}
atmNutWallFunctionFvPatchScalarField::atmNutWallFunctionFvPatchScalarField
(
const atmNutWallFunctionFvPatchScalarField& rwfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(rwfpsf, iF),
z0Min_(rwfpsf.z0Min_),
z0_(rwfpsf.z0_.clone(this->patch().patch()))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void atmNutWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
nutkWallFunctionFvPatchScalarField::autoMap(m);
z0_->autoMap(m);
}
void atmNutWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
nutkWallFunctionFvPatchScalarField::rmap(ptf, addr);
const atmNutWallFunctionFvPatchScalarField& nrwfpsf =
refCast<const atmNutWallFunctionFvPatchScalarField>(ptf);
z0_->rmap(nrwfpsf.z0_(), addr);
}
void atmNutWallFunctionFvPatchScalarField::write(Ostream& os) const
{
nutkWallFunctionFvPatchScalarField::write(os);
os.writeEntry("z0Min", z0Min_);
z0_->writeData(os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
atmNutWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,270 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 CENER
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::atmNutWallFunctionFvPatchScalarField
Group
grpAtmWallFunctions
Description
This boundary condition provides a wall constraint on the turbulent
viscosity, i.e. \c nut, based on turbulent kinetic energy, \c k, and
velocity, i.e. \c U, for atmospheric boundary layer modelling.
The governing equation of the boundary condition:
\f[
\tau_w = {U^*_u} {U^*_k}
\f]
with
\f[
{U^*_u} = \frac{\kappa U_w}{ln(z_p / z_0)}
\f]
\f[
{U^*_k} = C_{\mu}^{1/4} \sqrt{k}
\f]
where
\vartable
\tau_w | wall shear stress
U^*_u | local friction velocity based on near-ground velocity
U^*_k | local friction velocity based on near-ground k
\kappa | von Kármán constant
U_w | near-ground velocity
z_p | vertical coordinate
z_0 | surface roughness length [m]
C_mu | empirical model constant
k | turbulent kinetic energy
\endvartable
Required fields:
\verbatim
nut | Turbulent viscosity [m2/s]
k | Turbulent kinetic energy [m2/s2]
\endverbatim
References:
\verbatim
Richards, P. J., & Hoxey, R. P. (1993).
Appropriate boundary conditions for computational wind
engineering models using the k-ε turbulence model.
In Computational Wind Engineering 1 (pp. 145-153).
DOI:10.1016/B978-0-444-81688-7.50018-8
Sørensen, N. N., Bechmann, A., Johansen, J., Myllerup, L.,
Botha, P., Vinther, S., & Nielsen, B. S. (2007).
Identification of severe wind conditions using
a Reynolds Averaged Navier-Stokes solver.
In Journal of Physics: Conference series (Vol. 75, No. 1, p. 012053).
DOI:10.1088/1742-6596/75/1/012053
Sumner, J., & Masson, C. (2012).
k ε simulations of the neutral atmospheric boundary layer:
analysis and correction of discretization errors on practical grids.
International journal for numerical methods in fluids, 70(6), 724-741.
DOI:10.1002/fld.2709
\endverbatim
Usage
Example of the boundary condition specification:
\verbatim
<patchName>
{
// Mandatory entries (unmodifiable)
type atmNutWallFunction;
z0Min 0.001;
// Mandatory entries (runtime modifiable)
z0 uniform 0.001;
// Optional (inherited) entries
...
}
\endverbatim
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 | -
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
\endtable
The inherited entries are elaborated in:
- \link nutkWallFunctionFvPatchScalarField.H \endlink
- \link PatchFunction1.H \endlink
See also
- Foam::nutkWallFunctionFvPatchScalarField
- Foam::atmNutkWallFunctionFvPatchScalarField
- Foam::atmNutUWallFunctionFvPatchScalarField
SourceFiles
atmNutWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef atmNutWallFunctionFvPatchScalarField_H
#define atmNutWallFunctionFvPatchScalarField_H
#include "nutkWallFunctionFvPatchScalarField.H"
#include "PatchFunction1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class atmNutWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class atmNutWallFunctionFvPatchScalarField
:
public nutkWallFunctionFvPatchScalarField
{
// Private Data
//- Minimum surface roughness length [m]
const scalar z0Min_;
//- Surface roughness length field [m]
autoPtr<PatchFunction1<scalar>> z0_;
protected:
// Protected Member Functions
//- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const;
public:
//- Runtime type information
TypeName("atmNutWallFunction");
// Constructors
//- Construct from patch and internal field
atmNutWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
atmNutWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
//- atmNutWallFunctionFvPatchScalarField
//- onto a new patch
atmNutWallFunctionFvPatchScalarField
(
const atmNutWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
atmNutWallFunctionFvPatchScalarField
(
const atmNutWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new atmNutWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
atmNutWallFunctionFvPatchScalarField
(
const atmNutWallFunctionFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new atmNutWallFunctionFvPatchScalarField(*this, iF)
);
}
// Member Functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper&);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// I-O
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -6,6 +6,8 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -25,10 +27,11 @@ License
\*---------------------------------------------------------------------------*/
#include "nutkAtmRoughWallFunctionFvPatchScalarField.H"
#include "atmNutkWallFunctionFvPatchScalarField.H"
#include "turbulenceModel.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "bound.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -38,7 +41,7 @@ namespace Foam
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
tmp<scalarField> nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const
tmp<scalarField> atmNutkWallFunctionFvPatchScalarField::calcNut() const
{
const label patchi = patch().index();
@ -51,35 +54,51 @@ tmp<scalarField> nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const
)
);
const scalarField& y = turbModel.y()[patchi];
const tmp<volScalarField> tk = turbModel.k();
const volScalarField& k = tk();
const tmp<scalarField> tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
const scalar Cmu25 = pow025(Cmu_);
tmp<scalarField> tnutw(new scalarField(*this));
scalarField& nutw = tnutw.ref();
const scalar Cmu25 = pow025(Cmu_);
const scalar t = db().time().timeOutputValue();
const scalarField z0(z0_->value(t));
#ifdef FULLDEBUG
for (const auto& z : z0)
{
if (z < VSMALL)
{
FatalErrorInFunction
<< "z0 field can only contain positive values. "
<< "Please check input field z0."
<< exit(FatalIOError);
}
}
#endif
const labelList& faceCells = patch().faceCells();
// (HW:Eq. 5)
forAll(nutw, facei)
{
label celli = patch().faceCells()[facei];
const label celli = faceCells[facei];
scalar uStar = Cmu25*sqrt(k[celli]);
scalar yPlus = uStar*y[facei]/nuw[facei];
const scalar uStar = Cmu25*sqrt(k[celli]);
const scalar yPlus = uStar*y[facei]/nuw[facei];
const scalar Edash = (y[facei] + z0[facei])/z0[facei];
scalar Edash = (y[facei] + z0_[facei])/z0_[facei];
nutw[facei] = nuw[facei]*(yPlus*kappa_/log(max(Edash, 1 + 1e-4)) - 1);
}
nutw[facei] =
nuw[facei]*(yPlus*kappa_/log(max(Edash, 1+1e-4)) - 1);
if (debug)
{
Info<< "yPlus = " << yPlus
<< ", Edash = " << Edash
<< ", nutw = " << nutw[facei]
<< endl;
}
if (boundNut_)
{
nutw = max(nutw, 0.0);
}
return tnutw;
@ -88,34 +107,33 @@ tmp<scalarField> nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
nutkAtmRoughWallFunctionFvPatchScalarField::
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutkWallFunctionFvPatchScalarField::atmNutkWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(p, iF),
z0_(p.size(), Zero)
boundNut_(true),
z0_(nullptr)
{}
nutkAtmRoughWallFunctionFvPatchScalarField::
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutkWallFunctionFvPatchScalarField::atmNutkWallFunctionFvPatchScalarField
(
const nutkAtmRoughWallFunctionFvPatchScalarField& ptf,
const atmNutkWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
z0_(ptf.z0_, mapper)
boundNut_(ptf.boundNut_),
z0_(ptf.z0_.clone(p.patch()))
{}
nutkAtmRoughWallFunctionFvPatchScalarField::
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutkWallFunctionFvPatchScalarField::atmNutkWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
@ -123,46 +141,47 @@ nutkAtmRoughWallFunctionFvPatchScalarField
)
:
nutkWallFunctionFvPatchScalarField(p, iF, dict),
z0_("z0", dict, p.size())
boundNut_(dict.getOrDefault<Switch>("boundNut", false)),
z0_(PatchFunction1<scalar>::New(p.patch(), "z0", dict))
{}
nutkAtmRoughWallFunctionFvPatchScalarField::
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutkWallFunctionFvPatchScalarField::atmNutkWallFunctionFvPatchScalarField
(
const nutkAtmRoughWallFunctionFvPatchScalarField& rwfpsf
const atmNutkWallFunctionFvPatchScalarField& rwfpsf
)
:
nutkWallFunctionFvPatchScalarField(rwfpsf),
z0_(rwfpsf.z0_)
boundNut_(rwfpsf.boundNut_),
z0_(rwfpsf.z0_.clone(this->patch().patch()))
{}
nutkAtmRoughWallFunctionFvPatchScalarField::
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutkWallFunctionFvPatchScalarField::atmNutkWallFunctionFvPatchScalarField
(
const nutkAtmRoughWallFunctionFvPatchScalarField& rwfpsf,
const atmNutkWallFunctionFvPatchScalarField& rwfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(rwfpsf, iF),
z0_(rwfpsf.z0_)
boundNut_(rwfpsf.boundNut_),
z0_(rwfpsf.z0_.clone(this->patch().patch()))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void nutkAtmRoughWallFunctionFvPatchScalarField::autoMap
void atmNutkWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
nutkWallFunctionFvPatchScalarField::autoMap(m);
z0_.autoMap(m);
z0_->autoMap(m);
}
void nutkAtmRoughWallFunctionFvPatchScalarField::rmap
void atmNutkWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
@ -170,18 +189,18 @@ void nutkAtmRoughWallFunctionFvPatchScalarField::rmap
{
nutkWallFunctionFvPatchScalarField::rmap(ptf, addr);
const nutkAtmRoughWallFunctionFvPatchScalarField& nrwfpsf =
refCast<const nutkAtmRoughWallFunctionFvPatchScalarField>(ptf);
const atmNutkWallFunctionFvPatchScalarField& nrwfpsf =
refCast<const atmNutkWallFunctionFvPatchScalarField>(ptf);
z0_.rmap(nrwfpsf.z0_, addr);
z0_->rmap(nrwfpsf.z0_(), addr);
}
void nutkAtmRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
void atmNutkWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
writeLocalEntries(os);
z0_.writeEntry("z0", os);
nutkWallFunctionFvPatchScalarField::write(os);
os.writeEntry("boundNut", boundNut_);
z0_->writeData(os);
writeEntry("value", os);
}
@ -191,7 +210,7 @@ void nutkAtmRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
makePatchTypeField
(
fvPatchScalarField,
nutkAtmRoughWallFunctionFvPatchScalarField
atmNutkWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,248 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::atmNutkWallFunctionFvPatchScalarField
Group
grpAtmWallFunctions
Description
This boundary condition provides a wall constraint on turbulent
viscosity, i.e. \c nut, based on turbulent kinetic energy, \c k
for atmospheric boundary layer modelling. It is designed to be used in
conjunction with the \c atmBoundaryLayerInletVelocity boundary condition.
The governing equation of the boundary condition:
\f[
\u = \frac{\u^*}{\kappa} ln \left(\frac{z + z_0}{z_0}\right)
\f]
where
\vartable
\u^* | Friction velocity
\kappa | von Kármán constant
z_0 | Surface roughness length [m]
z | Ground-normal coordinate
\endvartable
Required fields:
\verbatim
nut | Turbulent viscosity [m2/s]
k | Turbulent kinetic energy [m2/s2]
\endverbatim
References:
\verbatim
Theoretical expressions (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.
J. of wind engineering and industrial aerodynamics, 95(5), 355-369.
DOI:10.1016/j.jweia.2006.08.002
\endverbatim
Usage
Example of the boundary condition specification:
\verbatim
<patchName>
{
// Mandatory entries (unmodifiable)
type atmNutkWallFunction;
// Mandatory entries (runtime modifiable)
z0 uniform 0.001;
// Optional entries (unmodifiable)
boundNut false;
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmNutkWallFunction | word | yes | -
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
boundNut | Flag: zero-bound nut at the wall | bool | no | false
\endtable
The inherited entries are elaborated in:
- \link nutkWallFunctionFvPatchScalarField.H \endlink
- \link PatchFunction1.H \endlink
Note
- \c boundNut entry is set \c false for backward compatibility reasons.
See also
- Foam::nutkWallFunctionFvPatchField
SourceFiles
atmNutkWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef atmNutkWallFunctionFvPatchScalarField_H
#define atmNutkWallFunctionFvPatchScalarField_H
#include "nutkWallFunctionFvPatchScalarField.H"
#include "PatchFunction1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class atmNutkWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class atmNutkWallFunctionFvPatchScalarField
:
public nutkWallFunctionFvPatchScalarField
{
// Private Data
//- Flag to zero-bound nut to prevent negative nut
//- at the wall arising from negative heat fluxes
const Switch boundNut_;
//- Surface roughness length field [m]
autoPtr<PatchFunction1<scalar>> z0_;
protected:
// Protected Member Functions
//- Calculate the turbulent viscosity
virtual tmp<scalarField> calcNut() const;
public:
//- Runtime type information
TypeName("atmNutkWallFunction");
// Constructors
//- Construct from patch and internal field
atmNutkWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
atmNutkWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
//- atmNutkWallFunctionFvPatchScalarField
//- onto a new patch
atmNutkWallFunctionFvPatchScalarField
(
const atmNutkWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
atmNutkWallFunctionFvPatchScalarField
(
const atmNutkWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new atmNutkWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
atmNutkWallFunctionFvPatchScalarField
(
const atmNutkWallFunctionFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new atmNutkWallFunctionFvPatchScalarField(*this, iF)
);
}
// Member Functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper&);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// I-O
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,217 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmOmegaWallFunctionFvPatchScalarField.H"
#include "nutWallFunctionFvPatchScalarField.H"
#include "turbulenceModel.H"
#include "fvMatrix.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::atmOmegaWallFunctionFvPatchScalarField::calculate
(
const turbulenceModel& turbModel,
const List<scalar>& cornerWeights,
const fvPatch& patch,
scalarField& G0,
scalarField& omega0
)
{
const label patchi = patch.index();
const nutWallFunctionFvPatchScalarField& nutw =
nutWallFunctionFvPatchScalarField::nutw(turbModel, patchi);
const scalarField& y = turbModel.y()[patchi];
const tmp<scalarField> tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
const tmp<volScalarField> tk = turbModel.k();
const volScalarField& k = tk();
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const scalarField magGradUw(mag(Uw.snGrad()));
const scalar Cmu25 = pow025(nutw.Cmu());
const scalar t = db().time().timeOutputValue();
const scalarField z0(z0_->value(t));
#ifdef FULLDEBUG
for (const auto& z : z0)
{
if (z < VSMALL)
{
FatalErrorInFunction
<< "z0 field can only contain positive values. "
<< "Please check input field z0."
<< exit(FatalIOError);
}
}
#endif
const labelUList& faceCells = patch.faceCells();
// Set omega and G
forAll(nutw, facei)
{
const label celli = faceCells[facei];
const scalar w = cornerWeights[facei];
omega0[celli] +=
w*sqrt(k[celli])/(Cmu25*nutw.kappa()*(y[facei] + z0[facei]));
G0[celli] +=
w
*(nutw[facei] + nuw[facei])
*magGradUw[facei]
*Cmu25*sqrt(k[celli])
/(nutw.kappa()*(y[facei] + z0[facei]));
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::atmOmegaWallFunctionFvPatchScalarField::
atmOmegaWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
omegaWallFunctionFvPatchScalarField(p, iF),
z0_(nullptr)
{}
Foam::atmOmegaWallFunctionFvPatchScalarField::
atmOmegaWallFunctionFvPatchScalarField
(
const atmOmegaWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
omegaWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
z0_(ptf.z0_.clone(p.patch()))
{}
Foam::atmOmegaWallFunctionFvPatchScalarField::
atmOmegaWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
omegaWallFunctionFvPatchScalarField(p, iF, dict),
z0_(PatchFunction1<scalar>::New(p.patch(), "z0", dict))
{}
Foam::atmOmegaWallFunctionFvPatchScalarField::
atmOmegaWallFunctionFvPatchScalarField
(
const atmOmegaWallFunctionFvPatchScalarField& owfpsf
)
:
omegaWallFunctionFvPatchScalarField(owfpsf),
z0_(owfpsf.z0_.clone(this->patch().patch()))
{}
Foam::atmOmegaWallFunctionFvPatchScalarField::
atmOmegaWallFunctionFvPatchScalarField
(
const atmOmegaWallFunctionFvPatchScalarField& owfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
omegaWallFunctionFvPatchScalarField(owfpsf, iF),
z0_(owfpsf.z0_.clone(this->patch().patch()))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::atmOmegaWallFunctionFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
omegaWallFunctionFvPatchScalarField::autoMap(m);
z0_->autoMap(m);
}
void Foam::atmOmegaWallFunctionFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
omegaWallFunctionFvPatchScalarField::rmap(ptf, addr);
const atmOmegaWallFunctionFvPatchScalarField& atmpsf =
refCast<const atmOmegaWallFunctionFvPatchScalarField>(ptf);
z0_->rmap(atmpsf.z0_(), addr);
}
void Foam::atmOmegaWallFunctionFvPatchScalarField::write
(
Ostream& os
) const
{
omegaWallFunctionFvPatchScalarField::write(os);
z0_->writeData(os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
atmOmegaWallFunctionFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,232 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::atmOmegaWallFunctionFvPatchScalarField
Group
grpAtmWallFunctions
Description
This boundary condition provides a wall constraint on specific dissipation
rate, i.e. \c omega, for atmospheric boundary layer modelling.
Required fields:
\verbatim
omega | Specific dissipation rate [1/s]
\endverbatim
References:
\verbatim
Theoretical expressions (tags:PGVB, B):
Parente, A., Gorlé, C., Van Beeck, J., & Benocci, C. (2011).
Improved kε model and wall function formulation
for the RANS simulation of ABL flows.
J. of wind engineering and industrial aerodynamics, 99(4), 267-278.
DOI:10.1016/j.jweia.2010.12.017
Bredberg, J. (2000).
On the wall boundary condition for turbulence models.
Chalmers University of Technology, Depart. of Thermo and Fluid Dyn.
Internal Report 00/4. Sweden: Göteborg.
\endverbatim
Usage
Example of the boundary condition specification:
\verbatim
<patchName>
{
// Mandatory entries (unmodifiable)
type atmOmegaWallFunction;
// Mandatory entries (runtime modifiable)
z0 uniform 0.001;
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmOmegaWallFunction | word | yes | -
z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
\endtable
The inherited entries are elaborated in:
- \link omegaWallFunctionFvPatchScalarField.H \endlink
- \link nutWallFunctionFvPatchScalarField.H \endlink
- \link PatchFunction1.H \endlink
See also
- Foam::omegaWallFunctionFvPatchScalarField
SourceFiles
atmOmegaWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef atmOmegaWallFunctionFvPatchScalarField_H
#define atmOmegaWallFunctionFvPatchScalarField_H
#include "omegaWallFunctionFvPatchScalarField.H"
#include "PatchFunction1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class atmOmegaWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class atmOmegaWallFunctionFvPatchScalarField
:
public omegaWallFunctionFvPatchScalarField
{
protected:
// Protected Data
//- Surface roughness length field [m]
autoPtr<PatchFunction1<scalar>> z0_;
// Protected Member Functions
//- Calculate the omega and G
virtual void calculate
(
const turbulenceModel& turbulence,
const List<scalar>& cornerWeights,
const fvPatch& patch,
scalarField& G,
scalarField& omega
) override final;
public:
//- Runtime type information
TypeName("atmOmegaWallFunction");
// Constructors
//- Construct from patch and internal field
atmOmegaWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
atmOmegaWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
//- atmOmegaWallFunctionFvPatchScalarField
//- onto a new patch
atmOmegaWallFunctionFvPatchScalarField
(
const atmOmegaWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
atmOmegaWallFunctionFvPatchScalarField
(
const atmOmegaWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new atmOmegaWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
atmOmegaWallFunctionFvPatchScalarField
(
const atmOmegaWallFunctionFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new atmOmegaWallFunctionFvPatchScalarField(*this, iF)
);
}
// Member Functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper&);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// I-O
//- Write
virtual void write(Ostream&) const override;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,266 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "ObukhovLength.H"
#include "volFields.H"
#include "dictionary.H"
#include "Time.H"
#include "mapPolyMesh.H"
#include "addToRunTimeSelectionTable.H"
#include "zeroGradientFvPatchField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
defineTypeNameAndDebug(ObukhovLength, 0);
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary);
}
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
bool Foam::functionObjects::ObukhovLength::calcOL()
{
const auto* rhoPtr = mesh_.findObject<volScalarField>("rho");
const volScalarField& nut = mesh_.lookupObject<volScalarField>("nut");
const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
const volScalarField& alphat = mesh_.lookupObject<volScalarField>("alphat");
const volScalarField& T = mesh_.lookupObject<volScalarField>("T");
volScalarField* result1 = mesh_.getObjectPtr<volScalarField>(resultName1_);
volScalarField* result2 = mesh_.getObjectPtr<volScalarField>(resultName2_);
const bool isNew = !result1;
if (!result1)
{
result1 = new volScalarField
(
IOobject
(
resultName1_,
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
true
),
mesh_,
dimLength,
zeroGradientFvPatchField<scalar>::typeName
);
result1->store();
result2 = new volScalarField
(
IOobject
(
resultName2_,
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
true
),
mesh_,
dimVelocity,
zeroGradientFvPatchField<scalar>::typeName
);
result2->store();
}
volScalarField B(alphat*beta_*(fvc::grad(T) & g_));
if (rhoPtr)
{
const auto& rho = *rhoPtr;
B /= rho;
}
else
{
const dimensionedScalar rho(dimless, rhoRef_);
B /= rho;
}
*result2 = // Ustar
sqrt
(
max
(
nut*sqrt(2*magSqr(symm(fvc::grad(U)))),
dimensionedScalar(sqr(U.dimensions()), VSMALL)
)
);
// (O:Eq. 26)
*result1 = // ObukhovLength
-min
(
dimensionedScalar(dimLength, ROOTVGREAT), // neutral stratification
pow3(*result2)/
(
sign(B)*kappa_
*max(mag(B), dimensionedScalar(B.dimensions(), VSMALL))
)
);
return isNew;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::ObukhovLength::ObukhovLength
(
const word& name,
const Time& runTime,
const dictionary& dict
)
:
fvMeshFunctionObject(name, runTime, dict),
UName_("U"),
resultName1_("ObukhovLength"),
resultName2_("Ustar"),
rhoRef_(1.0),
kappa_(0.40),
beta_
(
dimensionedScalar
(
dimless/dimTemperature,
dict.getCheckOrDefault<scalar>
(
"beta",
3e-3,
[&](const scalar x){ return x > SMALL; }
)
)
),
g_
(
"g",
dimLength/sqr(dimTime),
meshObjects::gravity::New(mesh_.time()).value()
)
{
read(dict);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::ObukhovLength::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict),
UName_ = dict.getOrDefault<word>("U", "U");
resultName1_ = dict.getOrDefault<word>("ObukhovLength", "ObukhovLength");
resultName2_ = dict.getOrDefault<word>("Ustar", "Ustar");
if (UName_ != "U" && resultName1_ == "ObukhovLength")
{
resultName1_ += '(' + UName_ + ')';
}
if (UName_ != "U" && resultName1_ == "Ustar")
{
resultName2_ += '(' + UName_ + ')';
}
rhoRef_ = dict.getOrDefault<scalar>("rhoRef", 1.0);
kappa_ = dict.getOrDefault<scalar>("kappa", 0.4);
beta_.value() = dict.getOrDefault<scalar>("beta", 3e-3);
return true;
}
bool Foam::functionObjects::ObukhovLength::execute()
{
Log << type() << " " << name() << " execute:" << endl;
bool isNew = false;
isNew = calcOL();
if (isNew) Log << " (new)" << nl << endl;
return true;
}
bool Foam::functionObjects::ObukhovLength::write()
{
const auto* ioptr1 = mesh_.cfindObject<regIOobject>(resultName1_);
const auto* ioptr2 = mesh_.cfindObject<regIOobject>(resultName2_);
if (ioptr1)
{
Log << type() << " " << name() << " write:" << nl
<< " writing field " << ioptr1->name() << nl
<< " writing field " << ioptr2->name() << endl;
ioptr1->write();
ioptr2->write();
}
return true;
}
void Foam::functionObjects::ObukhovLength::removeObukhovLength()
{
mesh_.thisDb().checkOut(resultName1_);
mesh_.thisDb().checkOut(resultName2_);
}
void Foam::functionObjects::ObukhovLength::updateMesh(const mapPolyMesh& mpm)
{
if (&mpm.mesh() == &mesh_)
{
removeObukhovLength();
}
}
void Foam::functionObjects::ObukhovLength::movePoints(const polyMesh& m)
{
if (&m == &mesh_)
{
removeObukhovLength();
}
}
// ************************************************************************* //

View File

@ -0,0 +1,271 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::functionObjects::ObukhovLength
Group
grpFieldFunctionObjects
Description
Computes the Obukhov length field and associated friction velocity field.
When scaled by the ground-normal height, i.e. z, the Obukhov length becomes
a dimensionless stability parameter, i.e. z/L, for atmospheric boundary
layer modelling, expressing the relative roles of buoyancy and shear in the
production and dissipation of turbulent kinetic energy.
\f[
u^* = \sqrt{\max (\nu_t \sqrt{2 |\symm{\grad{\u}}|^2}, VSMALL)}
\f]
\f[
L_o = - \frac{(u^*)^3}{sign(B) \kappa \max (|B|, VSMALL)}
\f]
with
\f[
B = \alpha_t \beta \frac{\grad{T} \cdot \vec{g}}{\rho}
\f]
where
\vartable
u^* | Friction velocity [m/s]
\nu_t | Turbulent viscosity [m2/s]
\u | Velocity [m/s]
L_o | Obukhov length [m]
B | Buoyancy production term [m2/s3]
\alpha_t | Kinematic turbulent thermal conductivity [m2/s]/[kg/m/s]
\rho | Density of fluid [-]/[kg/m3]
\beta | Thermal expansion coefficient [1/K]
T | Temperature [K]
g | Gravitational acceleration [m/s2]
VSMALL | A very small number to avoid floating point exceptions
\endvartable
References:
\verbatim
Definition of the Obukhov length (tag:O):
Obukhov, A. M. (1946).
Turbulentnost'v temperaturnoj-neodnorodnoj atmosfere.
Trudy Inst. Theor. Geofiz. AN SSSR, 1, 95-115.
Obukhov, A. M. (1971).
Turbulence in an atmosphere with a non-uniform temperature.
Boundary-layer meteorology, 2(1), 7-29.
DOI:10.1007/BF00718085
Obukhov length. (2016).
In American Meteorological Society - Glossary of meteorology.
Retrieved Apr 1, 2020, from glossary.ametsoc.org/wiki/Obukhov_length
\endverbatim
Required fields:
\verbatim
U | Velocity [m/s]
T | Temperature [K]
nut | Turbulent viscosity [m2/s]
alphat | Kinematic turbulent thermal conductivity [m2/s]/[kg/m/s]
g | Gravitational acceleration [m/s2]
\endverbatim
\table
Operand | Type | Location
input | - | -
output file | - | -
output field 1 | volScalarField | $FOAM_CASE/\<time\>/\<ObukhovLength\>
output field 2 | volScalarField | $FOAM_CASE/\<time\>/\<Ustar\>
\endtable
Usage
Minimal example by using \c system/controlDict.functions:
\verbatim
ObukhovLength1
{
// Mandatory entries (unmodifiable)
type ObukhovLength;
libs (fieldFunctionObjects);
// Optional entries (runtime modifiable)
U U;
result1 ObukhovLength;
result2 Ustar;
rhoRef 1.0;
kappa 0.4;
beta 3e-3;
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: ObukhovLength | word | yes | -
libs | Library name: fieldFunctionObjects | word | yes | -
U | Name of the velocity field | word | no | U
result1 | Name of the output field for ObukhovLength | word | no <!--
--> | ObukhovLength
result2 | Name of the output field for Ustar | word | no | Ustar
rhoRef | Reference density (to convert from kinematic to static <!--
--> pressure) | scalar | no | 1.0
kappa | von Kármán constant | scalar | no | 0.40
beta | Thermal expansion coefficient [1/K] | scalar | no | 3e-3
\endtable
The inherited entries are elaborated in:
- \link functionObject.H \endlink
Minimal example by using the \c postProcess utility:
\verbatim
postProcess -func "ObukhovLength(<UField>)"
\endverbatim
See also
- Foam::functionObjects::fvMeshFunctionObject
- ExtendedCodeGuide::atmosphericModels::functionObjects::ObukhovLength
SourceFiles
ObukhovLength.C
\*---------------------------------------------------------------------------*/
#ifndef functionObjects_ObukhovLength_H
#define functionObjects_ObukhovLength_H
#include "fvMeshFunctionObject.H"
#include "turbulentTransportModel.H"
#include "gravityMeshObject.H"
#include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
/*---------------------------------------------------------------------------*\
Class ObukhovLength Declaration
\*---------------------------------------------------------------------------*/
class ObukhovLength
:
public fvMeshFunctionObject
{
protected:
// Protected Data
//- Name of velocity field
word UName_;
//- Name of the output field for ObukhovLength
word resultName1_;
//- Name of the output field for Ustar
word resultName2_;
//- Reference density (to convert from kinematic to static pressure)
scalar rhoRef_;
//- von Kármán constant [-]
scalar kappa_;
//- Thermal expansion coefficient [1/K]
dimensionedScalar beta_;
//- Gravitational acceleration vector [m/s2]
const dimensionedVector g_;
// Protected Member Functions
//- Hard-coded Obukhov length field and friction velocity
// \return true if fields did not previously exist
bool calcOL();
public:
//- Run-time type information
TypeName("ObukhovLength");
// Constructors
//- Construct from Time and dictionary
ObukhovLength
(
const word& name,
const Time& runTime,
const dictionary& dict
);
//- No copy construct
ObukhovLength(const ObukhovLength&) = delete;
//- No copy assignment
void operator=(const ObukhovLength&) = delete;
//- Destructor
virtual ~ObukhovLength() = default;
// Member Functions
//- Remove (checkOut) the output fields from the object registry
void removeObukhovLength();
//- Read the data
virtual bool read(const dictionary& dict);
//- Calculate the output fields
virtual bool execute();
//- Write the output fields
virtual bool write();
//- Update for changes of mesh
virtual void updateMesh(const mapPolyMesh& mpm);
//- Update for mesh point-motion
virtual void movePoints(const polyMesh& m);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,243 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmAmbientTurbSource.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(atmAmbientTurbSource, 0);
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::atmAmbientTurbSource::atmAmbientTurbSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
cellSetOption(sourceName, modelType, dict, mesh),
isEpsilon_(true),
rhoName_(coeffs_.getOrDefault<word>("rho", "rho")),
kAmb_
(
dimensionedScalar
(
sqr(dimLength)/sqr(dimTime),
coeffs_.getCheckOrDefault<scalar>
(
"kAmb",
SMALL,
[&](const scalar k){ return k > -VSMALL; }
)
)
),
epsilonAmb_
(
dimensionedScalar
(
sqr(dimLength)/pow3(dimTime),
coeffs_.getOrDefault<scalar>
(
"epsilonAmb",
Zero
)
)
),
omegaAmb_
(
dimensionedScalar
(
dimless/dimTime,
coeffs_.getOrDefault<scalar>
(
"omegaAmb",
Zero
)
)
),
Cmu_(Zero),
C2_(Zero)
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
if (!turbPtr)
{
FatalErrorInFunction
<< "Unable to find a turbulence model."
<< abort(FatalError);
}
fieldNames_.setSize(2, "undefined");
tmp<volScalarField> tepsilon = turbPtr->epsilon();
tmp<volScalarField> tomega = turbPtr->omega();
if (!tepsilon.isTmp())
{
fieldNames_[0] = tepsilon().name();
const dictionary& turbDict = turbPtr->coeffDict();
C2_.read("C2", turbDict);
}
else if (!tomega.isTmp())
{
isEpsilon_ = false;
fieldNames_[0] = tomega().name();
const dictionary& turbDict = turbPtr->coeffDict();
Cmu_.read("betaStar", turbDict);
C2_.read("C2", turbDict);
}
else
{
FatalErrorInFunction
<< "Unable to find neither epsilon nor omega field." << nl
<< "atmAmbientTurbSource needs either epsilon or omega field."
<< abort(FatalError);
}
fieldNames_[1] = turbPtr->k()().name();
applied_.setSize(fieldNames_.size(), false);
Log << " Applying atmAmbientTurbSource to: "
<< fieldNames_[0] << " and " << fieldNames_[1]
<< endl;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::atmAmbientTurbSource::addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (fieldi == 1)
{
atmAmbientTurbSourceK
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
return;
}
if (isEpsilon_)
{
atmAmbientTurbSourceEpsilon
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
}
else
{
atmAmbientTurbSourceOmega
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
}
}
void Foam::fv::atmAmbientTurbSource::addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (fieldi == 1)
{
atmAmbientTurbSourceK(geometricOneField(), rho, eqn, fieldi);
return;
}
if (isEpsilon_)
{
atmAmbientTurbSourceEpsilon(geometricOneField(), rho, eqn, fieldi);
}
else
{
atmAmbientTurbSourceOmega(geometricOneField(), rho, eqn, fieldi);
}
}
void Foam::fv::atmAmbientTurbSource::addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (fieldi == 1)
{
atmAmbientTurbSourceK(alpha, rho, eqn, fieldi);
return;
}
if (isEpsilon_)
{
atmAmbientTurbSourceEpsilon(alpha, rho, eqn, fieldi);
}
else
{
atmAmbientTurbSourceOmega(alpha, rho, eqn, fieldi);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,266 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::atmAmbientTurbSource
Group
grpFvOptionsSources
Description
Applies sources on \c k and either \c epsilon or \c omega to prevent them
droping below a specified ambient value for atmospheric boundary
layer modelling. Such adjustment reportedly increases numerical
stability for very stable atmospheric conditions, and prevents
nonphysical oscillations in regions of low shear at higher altitudes.
Corrections applied to:
\verbatim
k | Turbulent kinetic energy [m2/s2]
\endverbatim
Corrections applied to either of the below, if exist:
\verbatim
epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
omega | Specific dissipation rate [1/s]
\endverbatim
Required fields:
\verbatim
k | Turbulent kinetic energy [m2/s2]
epsilon/omega | Dissipation rate OR Specific dissipation rate [m2/s3]/[1/s]
\endverbatim
References:
\verbatim
Background turbulence (tag:RS):
Rumsey, C. L., & Spalart, P. R. (2009).
Turbulence model behavior in low Reynolds number
regions of aerodynamic flowfields.
AIAA journal, 47(4), 982-993.
DOI:10.2514/1.39947
\endverbatim
Usage
Example by using \c constant/fvOptions:
\verbatim
atmAmbientTurbSource1
{
// Mandatory entries (unmodifiable)
type atmAmbientTurbSource;
atmAmbientTurbSourceCoeffs
{
// Mandatory (inherited) entries (unmodifiable)
selectionMode all;
// Mandatory entries (unmodifiable)
kAmb 0.0;
// Optional entries (unmodifiable)
rho rho;
epsilonAmb 0.0;
omegaAmb 0.0;
}
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmAmbientTurbSource | word | yes | -
kAmb | Ambient value for k | scalar | yes | -
rho | Name of density field | word | no | rho
epsilonAmb | Ambient value for epsilon | scalar | no | 0.0
omegaAmb | Ambient value for omega | scalar | no | 0.0
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
SourceFiles
atmAmbientTurbSource.C
atmAmbientTurbSourceTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef fv_atmAmbientTurbSource_H
#define fv_atmAmbientTurbSource_H
#include "cellSetOption.H"
#include "turbulentTransportModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class atmAmbientTurbSource Declaration
\*---------------------------------------------------------------------------*/
class atmAmbientTurbSource
:
public cellSetOption
{
// Private Data
//- Internal flag to determine the working field is epsilon or omega
Switch isEpsilon_;
//- Name of density field
const word rhoName_;
//- Ambient turbulent kinetic energy value [m2/s2]
const dimensionedScalar kAmb_;
//- Ambient turbulent kinetic energy dissipation rate value [m2/s3]
const dimensionedScalar epsilonAmb_;
//- Ambient specific dissipation rate value [1/s]
const dimensionedScalar omegaAmb_;
//- Required turbulence model coefficients (copied from turb model)
dimensionedScalar Cmu_;
dimensionedScalar C2_;
// Private Member Functions
//- Apply atmAmbientTurbSource to epsilon field
template<class AlphaFieldType, class RhoFieldType>
void atmAmbientTurbSourceEpsilon
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
//- Apply atmAmbientTurbSource to omega field
template<class AlphaFieldType, class RhoFieldType>
void atmAmbientTurbSourceOmega
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
//- Apply atmAmbientTurbSource to k field
template<class AlphaFieldType, class RhoFieldType>
void atmAmbientTurbSourceK
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
public:
//- Runtime type information
TypeName("atmAmbientTurbSource");
// Constructors
//- Construct from explicit source name and mesh
atmAmbientTurbSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- No copy construct
atmAmbientTurbSource(const atmAmbientTurbSource&) = delete;
//- No copy assignment
void operator=(const atmAmbientTurbSource&) = delete;
// Member Functions
//- Add explicit contribution to epsilon or omega equation
//- for incompressible flow computations
virtual void addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to epsilon or omega equation
//- for compressible flow computations
virtual void addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to epsilon or omega equation
//- for multiphase flow computations
virtual void addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Read source dictionary (effectively no-op)
virtual bool read(const dictionary& dict)
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "atmAmbientTurbSourceTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmAmbientTurbSource.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmAmbientTurbSource::atmAmbientTurbSourceEpsilon
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
const volScalarField& epsilon = turbPtr->epsilon();
// (Heuristically derived from RS:Eq. 4, rhs-term:5)
eqn +=
fvm::Sp(alpha()*rho()*C2_*sqr(epsilonAmb_)/(kAmb_*epsilon()), epsilon);
}
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmAmbientTurbSource::atmAmbientTurbSourceOmega
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
const volScalarField& omega = turbPtr->omega();
const volScalarField::Internal& beta =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":beta")
);
// (RS:Eq. 4, rhs-term:5)
eqn += fvm::Sp(alpha()*rho()*Cmu_*beta*sqr(omegaAmb_)/omega(), omega);
}
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmAmbientTurbSource::atmAmbientTurbSourceK
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
const volScalarField& k = turbPtr->k();
if (isEpsilon_)
{
// (Heuristically derived from RS:Eq. 3, rhs-term:4)
eqn += fvm::Sp(alpha()*rho()*epsilonAmb_/k(), k);
}
else
{
// (RS:Eq. 3, rhs-term:4)
eqn += fvm::Sp(alpha()*rho()*Cmu_*omegaAmb_*kAmb_/k(), k);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,354 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmBuoyancyTurbSource.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(atmBuoyancyTurbSource, 0);
addToRunTimeSelectionTable(option, atmBuoyancyTurbSource, dictionary);
}
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
void Foam::fv::atmBuoyancyTurbSource::calcB()
{
//- Temperature field [K]
const volScalarField& T = mesh_.lookupObjectRef<volScalarField>("T");
//- Turbulent heat transfer coefficient field [m2/s]
const volScalarField& alphat =
mesh_.lookupObjectRef<volScalarField>("alphat");
// (ARAL:Eq. 7)
B_ = beta_*alphat()*(fvc::grad(T) & g_)();
}
Foam::tmp<Foam::volScalarField::Internal>
Foam::fv::atmBuoyancyTurbSource::calcC3
(
const volScalarField::Internal& k,
const volScalarField::Internal& epsilon,
const volScalarField::Internal& G
) const
{
// Gradient Richardson number (ARAL:p. 4)
const volScalarField::Internal Rig
(
-B_/(G + dimensionedScalar(G.dimensions(), SMALL))
);
// Mixing-length scale estimation (P:Eq. 10.37 & p. 374) normalised by Lmax_
const volScalarField::Internal LbyLmax
(
(pow(Cmu_, 0.75)/Lmax_)*pow(k, 1.5)/epsilon
);
// (ARAL:Eq. 10), with a typo of (C2_) instead of using (C2_ - 1.0)
volScalarField::Internal alphaB(1.0 - LbyLmax);
alphaB ==
neg0(Rig)*(1.0 - (1.0 + (C2_ - 1.0)/(C2_ - C1_))*LbyLmax)
+ pos(Rig)*(1.0 - LbyLmax);
// (SKL:Eq. 18, rhs-term:3); (ARAL:Eq. 5, rhs-term:3) has a typo
return (C1_ - C2_)*alphaB + 1.0;
}
Foam::tmp<Foam::volScalarField::Internal>
Foam::fv::atmBuoyancyTurbSource::calcC3
(
const volScalarField::Internal& k,
const volScalarField::Internal& omega,
const volScalarField::Internal& G,
const volScalarField::Internal& gamma,
const volScalarField::Internal& beta
) const
{
// Gradient Richardson number (ARAL:p. 4)
const volScalarField::Internal Rig
(
-B_/(G + dimensionedScalar(G.dimensions(), SMALL))
);
// Mixing-length scale estimation (L:Eq. 3.20) normalised by Lmax_
const volScalarField::Internal LbyLmax
(
(1.0/(pow025(Cmu_)*Lmax_))*sqrt(k)/omega
);
// (ARAL:Eq. 10)
volScalarField::Internal alphaB(1.0 - LbyLmax);
alphaB ==
neg0(Rig)*(1.0 - (1.0 + beta/(beta - gamma))*LbyLmax)
+ pos(Rig)*(1.0 - LbyLmax);
// (SKL:Eq. 19, rhs-term:3); (ARAL:Eq. 5, rhs-term:3) has a typo
return (gamma - beta)*alphaB;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::atmBuoyancyTurbSource::atmBuoyancyTurbSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
cellSetOption(sourceName, modelType, dict, mesh),
isEpsilon_(true),
rhoName_(coeffs_.getOrDefault<word>("rho", "rho")),
Lmax_
(
dimensionedScalar
(
dimLength,
coeffs_.getCheckOrDefault<scalar>
(
"Lmax",
41.575,
[&](const scalar Lmax){ return Lmax > SMALL; }
)
)
),
n_
(
dimensionedScalar
(
dimless,
coeffs_.getCheckOrDefault<scalar>
(
"n",
3.0,
[&](const scalar n){ return n > SMALL; }
)
)
),
beta_
(
dimensionedScalar
(
dimless/dimTemperature,
coeffs_.getCheckOrDefault<scalar>
(
"beta",
3.3e-3,
[&](const scalar x){ return x > SMALL; }
)
)
),
Cmu_(Zero),
C1_(Zero),
C2_(Zero),
g_
(
"g",
dimLength/sqr(dimTime),
meshObjects::gravity::New(mesh_.time()).value()
),
B_
(
IOobject
(
"B",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(sqr(dimLength)/pow3(dimTime), Zero)
)
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
if (!turbPtr)
{
FatalErrorInFunction
<< "Unable to find a turbulence model."
<< abort(FatalError);
}
fieldNames_.setSize(2, "undefined");
tmp<volScalarField> tepsilon = turbPtr->epsilon();
tmp<volScalarField> tomega = turbPtr->omega();
if (!tepsilon.isTmp())
{
fieldNames_[0] = tepsilon().name();
const dictionary& turbDict = turbPtr->coeffDict();
Cmu_.read("Cmu", turbDict);
C1_.read("C1", turbDict);
C2_.read("C2", turbDict);
}
else if (!tomega.isTmp())
{
isEpsilon_ = false;
fieldNames_[0] = tomega().name();
const dictionary& turbDict = turbPtr->coeffDict();
Cmu_.read("betaStar", turbDict);
}
else
{
FatalErrorInFunction
<< "Unable to find neither epsilon nor omega field." << nl
<< "atmBuoyancyTurbSource needs either epsilon or omega field."
<< abort(FatalError);
}
fieldNames_[1] = turbPtr->k()().name();
applied_.setSize(fieldNames_.size(), false);
Log << " Applying atmBuoyancyTurbSource to: "
<< fieldNames_[0] << " and " << fieldNames_[1]
<< endl;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::atmBuoyancyTurbSource::addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (fieldi == 1)
{
atmBuoyancyTurbSourceK
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
return;
}
calcB();
if (isEpsilon_)
{
atmBuoyancyTurbSourceEpsilon
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
}
else
{
atmBuoyancyTurbSourceOmega
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
}
}
void Foam::fv::atmBuoyancyTurbSource::addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (fieldi == 1)
{
atmBuoyancyTurbSourceK(geometricOneField(), rho, eqn, fieldi);
return;
}
calcB();
if (isEpsilon_)
{
atmBuoyancyTurbSourceEpsilon(geometricOneField(), rho, eqn, fieldi);
}
else
{
atmBuoyancyTurbSourceOmega(geometricOneField(), rho, eqn, fieldi);
}
}
void Foam::fv::atmBuoyancyTurbSource::addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (fieldi == 1)
{
atmBuoyancyTurbSourceK(alpha, rho, eqn, fieldi);
return;
}
calcB();
if (isEpsilon_)
{
atmBuoyancyTurbSourceEpsilon(alpha, rho, eqn, fieldi);
}
else
{
atmBuoyancyTurbSourceOmega(alpha, rho, eqn, fieldi);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,314 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::atmBuoyancyTurbSource
Group
grpFvOptionsSources
Description
Applies sources on \c k and either \c epsilon or \c omega to incorporate
effects of buoyancy for atmospheric boundary layer modelling.
Corrections applied to:
\verbatim
k | Turbulent kinetic energy [m2/s2]
\endverbatim
Corrections applied to either of the below, if exist:
\verbatim
epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
omega | Specific dissipation rate [1/s]
\endverbatim
Required fields:
\verbatim
k | Turbulent kinetic energy [m2/s2]
epsilon/omega | Dissipation rate OR Specific dissipation rate [m2/s3]/[1/s]
T | Temperature [K]
alphat | Turbulent heat tranfer coefficient [m2/s]
\endverbatim
References:
\verbatim
Buoyancy effects (tags:SKL, ARAL):
Sogachev, A., Kelly, M., & Leclerc, M. Y. (2012).
Consistent two-equation closure modelling for atmospheric
research: buoyancy and vegetation implementations.
Boundary-layer meteorology, 145(2), 307-327.
DOI: 10.1007/s10546-012-9726-5
Alletto, M., Radi, A., Adib, J., Langner, J.,
Peralta, C., Altmikus, A., & Letzel, M. (2018).
E-Wind: Steady state CFD approach for stratified flows
used for site assessment at Enercon.
In Journal of Physics: Conference Series, 1037(7).
DOI:10.1088/1742-6596/1037/7/072020
Mixing-length scale limiter for omega (tag:L):
Langner, J. (2016).
Implementierung und validierung von RANS-modellen der
thermisch geschichteten, atmosphärischen grenzschicht.
Masterarbeit zum thema, Technische Universität Berlin.
Mixing-length scale estimation (tag:P):
Pope, S. B. (2000).
Turbulent flows.
Cambridge, UK: Cambridge Univ. Press
DOI:10.1017/CBO9780511840531
\endverbatim
Usage
Example by using \c constant/fvOptions:
\verbatim
atmBuoyancyTurbSource1
{
// Mandatory entries (unmodifiable)
type atmBuoyancyTurbSource;
atmBuoyancyTurbSourceCoeffs
{
// Mandatory (inherited) entries (unmodifiable)
selectionMode all;
// Optional (unmodifiable)
rho rho;
Lmax 41.575;
n 3.0;
beta 3.3e-03;
}
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmBuoyancyTurbSource | word | yes | -
rho | Name of density field | word | no | rho
Lmax | Maximum mixing-length scale | scalar | no | 41.575
n | Mixing-length scale exponent | scalar | no | 3.0
beta | Thermal expansion coefficient | scalar | no | 3.3e-03
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
SourceFiles
atmBuoyancyTurbSource.C
atmBuoyancyTurbSourceTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef fv_atmBuoyancyTurbSource_H
#define fv_atmBuoyancyTurbSource_H
#include "cellSetOption.H"
#include "turbulentTransportModel.H"
#include "gravityMeshObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class atmBuoyancyTurbSource Declaration
\*---------------------------------------------------------------------------*/
class atmBuoyancyTurbSource
:
public cellSetOption
{
// Private Data
//- Internal flag to determine the working field is epsilon or omega
Switch isEpsilon_;
//- Name of density field
const word rhoName_;
//- Maximum mixing-length scale [m]
const dimensionedScalar Lmax_;
//- Mixing-length scale exponent
const dimensionedScalar n_;
//- Thermal expansion coefficient [1/K]
const dimensionedScalar beta_;
//- Required turbulence model coefficients (copied from turb model)
dimensionedScalar Cmu_;
dimensionedScalar C1_;
dimensionedScalar C2_;
//- Gravitational acceleration vector [m/s2]
const dimensionedVector g_;
// Fields
//- Buoyancy production term [m2/s3]
volScalarField::Internal B_;
// Private Member Functions
//- Compute the buoyancy production term B_
void calcB();
//- Return the buoyancy-effect modifier for epsilon-based models
tmp<volScalarField::Internal> calcC3
(
const volScalarField::Internal& k,
const volScalarField::Internal& epsilon,
const volScalarField::Internal& G
) const;
//- Return the buoyancy-effect modifier for omega-based models
tmp<volScalarField::Internal> calcC3
(
const volScalarField::Internal& k,
const volScalarField::Internal& omega,
const volScalarField::Internal& G,
const volScalarField::Internal& gamma,
const volScalarField::Internal& beta
) const;
//- Apply atmBuoyancyTurbSource to epsilon field
template<class AlphaFieldType, class RhoFieldType>
void atmBuoyancyTurbSourceEpsilon
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
//- Apply atmBuoyancyTurbSource to omega field
template<class AlphaFieldType, class RhoFieldType>
void atmBuoyancyTurbSourceOmega
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
//- Apply atmBuoyancyTurbSource to k field
template<class AlphaFieldType, class RhoFieldType>
void atmBuoyancyTurbSourceK
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
public:
//- Runtime type information
TypeName("atmBuoyancyTurbSource");
// Constructors
//- Construct from explicit source name and mesh
atmBuoyancyTurbSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- No copy construct
atmBuoyancyTurbSource(const atmBuoyancyTurbSource&) = delete;
//- No copy assignment
void operator=(const atmBuoyancyTurbSource&) = delete;
// Member Functions
//- Add explicit contribution to epsilon or omega equation
//- for incompressible flow computations
virtual void addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to epsilon or omega equation
//- for compressible flow computations
virtual void addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to epsilon or omega equation
//- for multiphase flow computations
virtual void addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Read source dictionary (effectively no-op)
virtual bool read(const dictionary& dict)
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "atmBuoyancyTurbSourceTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,130 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmBuoyancyTurbSource.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmBuoyancyTurbSource::atmBuoyancyTurbSourceEpsilon
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
// Fetch required fields from the epsilon-based model
const volScalarField& k = turbPtr->k();
const volScalarField& epsilon = turbPtr->epsilon();
const volScalarField::Internal& GbyNu =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":GbyNu")
);
const volScalarField::Internal G(GbyNu*Cmu_*sqr(k())/epsilon());
// (ARAL:Eq. 5, rhs-term:3)
eqn += fvm::Sp(alpha()*rho()*calcC3(k(), epsilon(), G)*B_/k(), epsilon);
}
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmBuoyancyTurbSource::atmBuoyancyTurbSourceOmega
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
// Fetch required fields from the omega-based model
const volScalarField& k = turbPtr->k();
const volScalarField& omega = turbPtr->omega();
const volScalarField::Internal& GbyNu =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":GbyNu")
);
const volScalarField::Internal G(GbyNu*Cmu_*k()/omega());
const volScalarField::Internal& gamma =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":gamma")
);
const volScalarField::Internal& beta =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":beta")
);
// (ARAL:Eq. 5, rhs-term:3)
eqn +=
fvm::Sp
(
alpha()*rho()*calcC3(k(), omega(), G, gamma, beta)*B_/k(),
omega
);
}
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmBuoyancyTurbSource::atmBuoyancyTurbSourceK
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
const volScalarField& k = turbPtr->k();
eqn += fvm::Sp(alpha()*rho()*B_/k(), k);
}
// ************************************************************************* //

View File

@ -0,0 +1,170 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 CENER
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmCoriolisUSource.H"
#include "fvMatrices.H"
#include "unitConversion.H"
#include "mathematicalConstants.H"
#include "addToRunTimeSelectionTable.H"
using namespace Foam::constant::mathematical;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(atmCoriolisUSource, 0);
addToRunTimeSelectionTable(option, atmCoriolisUSource, dictionary);
}
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::vector Foam::fv::atmCoriolisUSource::planetaryRotationVector() const
{
return vector
(
Zero,
twoPi/(planetaryRotationPeriod_*3600.0)*cos(degToRad(latitude_)),
twoPi/(planetaryRotationPeriod_*3600.0)*sin(degToRad(latitude_))
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::atmCoriolisUSource::atmCoriolisUSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
cellSetOption(sourceName, modelType, dict, mesh),
latitude_
(
coeffs_.getCheckOrDefault<scalar>
(
"latitude",
0.0,
[&](const scalar x){ return (90 >= mag(x)) && (mag(x) >= 0); }
)
),
planetaryRotationPeriod_
(
coeffs_.getCheckOrDefault<scalar>
(
"planetaryRotationPeriod",
23.9344694,
[&](const scalar x){ return x > SMALL; }
)
),
Omega_
(
dimensionedVector
(
dimless/dimTime,
coeffs_.getOrDefault<vector>
(
"Omega",
planetaryRotationVector()
)
)
)
{
if (mag(Omega_.value()) < SMALL)
{
WarningInFunction
<< "The magnitude of the rotation vector in atmCoriolisUSource is "
<< "effectively zero, mag(Omega) = " << mag(Omega_.value()) << nl
<< "Please check input values in atmCoriolisUSource settings."
<< endl;
}
fieldNames_.setSize(1, "U");
applied_.setSize(fieldNames_.size(), false);
Log << " Applying atmCoriolisUSource to: " << fieldNames_[0] << endl;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::atmCoriolisUSource::addSup
(
fvMatrix<vector>& eqn,
const label fieldi
)
{
const volVectorField& U = eqn.psi();
if (V_ > VSMALL)
{
eqn -= (2.0*Omega_)^U;
}
}
void Foam::fv::atmCoriolisUSource::addSup
(
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
)
{
const volVectorField& U = eqn.psi();
if (V_ > VSMALL)
{
eqn -= rho*((2.0*Omega_)^U);
}
}
void Foam::fv::atmCoriolisUSource::addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
)
{
const volVectorField& U = eqn.psi();
if (V_ > VSMALL)
{
eqn -= alpha*rho*((2.0*Omega_)^U);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,238 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 CENER
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::atmCoriolisUSource
Group
grpAtmFvOptions
Description
Applies corrections to incorporate the horizontal and vertical components
of the Coriolis force for which the rotating frame is Earth.
Corrections applied on:
\verbatim
U | Velocity [m/s]
\endverbatim
Required fields:
\verbatim
U | Velocity [m/s]
\endverbatim
The Coriolis force is an inertial or fictitious force that acts on
objects that are in motion within a frame of reference that rotates with
respect to an inertial frame.
In the atmospheric boundary layer context, for the "Coriolis effect",
the rotating reference frame implied is almost always Earth.
Because Earth spins, Earth-bound observers need to account for the
Coriolis force to correctly analyze the motion of objects. Earth
completes one rotation per day, so for motions of everyday objects the
Coriolis force is usually quite small compared with other forces; its
effects generally become noticeable only for motions occurring over large
distances and long periods of time, such as large-scale movement of air in
the atmosphere or water in the ocean. Such motions are constrained by the
surface of Earth, so only the horizontal component of the Coriolis
force is generally important.
References:
\verbatim
Coriolis force. (n.d.).
In Wikipedia. Retrieved Feb 26, 2020, from https://w.wiki/JE5
\endverbatim
Usage
Example by using \c constant/fvOptions:
\verbatim
atmCoriolisUSource1
{
// Mandatory entries (unmodifiable)
type atmCoriolisUSource;
atmCoriolisUSourceCoeffs
{
// Mandatory (inherited) entries (unmodifiable)
selectionMode all;
// Conditional mandatory entries (unmodifiable)
// Option-1: to directly input rotation vector
Omega (0 0 5.65156e-5);
// Option-2: to indirectly input rotation vector
// by a latitude-period pair
latitude 51.971;
planetaryRotationPeriod 23.9344694;
}
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmCoriolisUSource | word | yes | -
latitude | Geographic coordinate specifying the northsouth <!--
--> position of a point on the surface of a planetary <!--
--> body [degree] | scalar | conditional | 0.0
planetaryRotationPeriod | Rotation period of the planetary body <!--
--> [h] | scalar | conditional | 23.9344694
Omega | Rotation vector of the rotating reference frame <!--
--> relative to the inertial frame [rad/s] <!--
--> | vector | conditional | (0 0 0)
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
Note
- Dimensional consistencies are hard-coded; therefore, no internal
check is performed for potential dimension inconsistencies.
- The magnitude of the \c latitude is limited to [0, 90], yet its value
is allowed to be negative for the southern hemisphere.
- The Coriolis force for cell whose volume is less than \c VSMALL is
equated to zero.
SourceFiles
atmCoriolisUSource.C
\*---------------------------------------------------------------------------*/
#ifndef atmCoriolisUSource_H
#define atmCoriolisUSource_H
#include "cellSetOption.H"
#include "dimensionedVector.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class atmCoriolisUSource Declaration
\*---------------------------------------------------------------------------*/
class atmCoriolisUSource
:
public cellSetOption
{
// Private Data
//- Latitude on the planetary body
const scalar latitude_;
//- Rotation period of the planetary body
const scalar planetaryRotationPeriod_;
//- Planetary rotation vector
const dimensionedVector Omega_;
// Private Member Functions
//- Rotation vector of the planetary body
vector planetaryRotationVector() const;
public:
//- Runtime type information
TypeName("atmCoriolisUSource");
// Constructors
//- Construct from explicit source name and mesh
atmCoriolisUSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- No copy construct
atmCoriolisUSource(const atmCoriolisUSource&) = delete;
//- No copy assignment
void operator=(const atmCoriolisUSource&) = delete;
//- Destructor
virtual ~atmCoriolisUSource() = default;
// Member Functions
//- Add explicit contribution to incompressible momentum equation
virtual void addSup
(
fvMatrix<vector>& eqn,
const label fieldi
);
//- Add explicit contribution to compressible momentum equation
virtual void addSup
(
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
);
//- Add explicit contribution to phase momentum equation
virtual void addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
);
//- Read source dictionary
virtual bool read(const dictionary& dict)
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,243 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmLengthScaleTurbSource.H"
#include "geometricOneField.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(atmLengthScaleTurbSource, 0);
addToRunTimeSelectionTable(option, atmLengthScaleTurbSource, dictionary);
}
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField::Internal>Foam::fv::atmLengthScaleTurbSource::
calcC1Star
(
const volScalarField::Internal& k,
const volScalarField::Internal& epsilon
) const
{
// Mixing-length scale estimation (P:Eq. 10.37 & p. 374)
tmp<volScalarField::Internal> L_(pow(Cmu_, 0.75)*pow(k, 1.5)/epsilon);
// (AC:Eq. 16) wherein the exponentiation "n_" is not present.
// "n_" is an ad-hoc implementation.
return (C2_ - C1_)*pow(L_/Lmax_, n_);
}
Foam::tmp<Foam::volScalarField::Internal> Foam::fv::atmLengthScaleTurbSource::
calcGammaStar
(
const volScalarField::Internal& k,
const volScalarField::Internal& omega,
const volScalarField::Internal& gamma,
const volScalarField::Internal& beta
) const
{
// (L:Eq. 3.20)
tmp<volScalarField::Internal> L_(sqrt(k)/(pow025(Cmu_)*omega));
// (L:Eq. 3.34)
return (gamma - beta)*pow(L_/Lmax_, n_);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::atmLengthScaleTurbSource::atmLengthScaleTurbSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
cellSetOption(sourceName, modelType, dict, mesh),
isEpsilon_(true),
rhoName_(coeffs_.getOrDefault<word>("rho", "rho")),
Lmax_
(
dimensionedScalar
(
dimLength,
coeffs_.getCheckOrDefault<scalar>
(
"Lmax",
41.575,
[&](const scalar Lmax){ return Lmax > SMALL; }
)
)
),
n_
(
dimensionedScalar
(
dimless,
coeffs_.getCheckOrDefault<scalar>
(
"n",
3.0,
[&](const scalar n){ return n > SMALL; }
)
)
),
Cmu_(Zero),
C1_(Zero),
C2_(Zero),
C3_(Zero)
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
if (!turbPtr)
{
FatalErrorInFunction
<< "Unable to find a turbulence model."
<< abort(FatalError);
}
fieldNames_.setSize(1, "undefined");
tmp<volScalarField> tepsilon = turbPtr->epsilon();
tmp<volScalarField> tomega = turbPtr->omega();
if (!tepsilon.isTmp())
{
fieldNames_[0] = tepsilon().name();
const dictionary& turbDict = turbPtr->coeffDict();
Cmu_.read("Cmu", turbDict);
C1_.read("C1", turbDict);
C2_.read("C2", turbDict);
C3_.read("C3", turbDict);
}
else if (!tomega.isTmp())
{
isEpsilon_ = false;
fieldNames_[0] = tomega().name();
const dictionary& turbDict = turbPtr->coeffDict();
Cmu_.read("betaStar", turbDict);
}
else
{
FatalErrorInFunction
<< "Unable to find neither epsilon nor omega field." << nl
<< "atmLengthScaleTurbSource needs either epsilon or omega field."
<< abort(FatalError);
}
applied_.setSize(fieldNames_.size(), false);
Log << " Applying atmLengthScaleTurbSource to: " << fieldNames_[0]
<< endl;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::atmLengthScaleTurbSource::addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (isEpsilon_)
{
atmLengthScaleTurbSourceEpsilon
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
}
else
{
atmLengthScaleTurbSourceOmega
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
}
}
void Foam::fv::atmLengthScaleTurbSource::addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (isEpsilon_)
{
atmLengthScaleTurbSourceEpsilon(geometricOneField(), rho, eqn, fieldi);
}
else
{
atmLengthScaleTurbSourceOmega(geometricOneField(), rho, eqn, fieldi);
}
}
void Foam::fv::atmLengthScaleTurbSource::addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (isEpsilon_)
{
atmLengthScaleTurbSourceEpsilon(alpha, rho, eqn, fieldi);
}
else
{
atmLengthScaleTurbSourceOmega(alpha, rho, eqn, fieldi);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,274 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::atmLengthScaleTurbSource
Group
grpFvOptionsSources
Description
Applies sources on either \c epsilon or \c omega to correct
mixing-length scale estimations for atmospheric boundary layer modelling.
Corrections applied to either of the below, if exist:
\verbatim
epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
omega | Specific dissipation rate [1/s]
\endverbatim
Required fields, either of the below:
\verbatim
epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
omega | Specific dissipation rate [1/s]
\endverbatim
References:
\verbatim
Mixing-length scale limiter for epsilon (tag:AC):
Apsley, D. D., & Castro, I. P. (1997).
A limited-length-scale k-ε model for the neutral and
stably-stratified atmospheric boundary layer.
Boundary-layer meteorology, 83(1), 75-98.
DOI:10.1023/A:100025221
Mixing-length scale limiter for omega (tag:L):
Langner, J. (2016).
Implementierung und validierung von RANS-modellen der
thermisch geschichteten, atmosphärischen grenzschicht.
Masterarbeit zum thema, Technische Universität Berlin.
Mixing-length scale estimation (tag:P):
Pope, S. B. (2000).
Turbulent flows.
Cambridge, UK: Cambridge Univ. Press
DOI:10.1017/CBO9780511840531
\endverbatim
Usage
Example by using \c constant/fvOptions:
\verbatim
atmLengthScaleTurbSource1
{
// Mandatory entries (unmodifiable)
type atmLengthScaleTurbSource;
atmLengthScaleTurbSourceCoeffs
{
// Mandatory (inherited) entries (unmodifiable)
selectionMode all;
// Optional entries (unmodifiable)
rho rho;
Lmax 41.575;
n 3.0;
}
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmLengthScaleTurbSource | word | yes | -
rho | Name of density field | word | no | rho
Lmax | Maximum mixing-length scale [m] | scalar | no | 41.575
n | Mixing-length scale exponent | scalar | no | 3.0
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
See also
- cellSetOption.H
SourceFiles
atmLengthScaleTurbSource.C
atmLengthScaleTurbSourceTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef fv_atmLengthScaleTurbSource_H
#define fv_atmLengthScaleTurbSource_H
#include "cellSetOption.H"
#include "turbulentTransportModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class atmLengthScaleTurbSource Declaration
\*---------------------------------------------------------------------------*/
class atmLengthScaleTurbSource
:
public cellSetOption
{
// Private Data
//- Internal flag to determine the working field is epsilon or omega
bool isEpsilon_;
//- Name of density field
const word rhoName_;
//- Maximum mixing-length scale [m]
const dimensionedScalar Lmax_;
//- Mixing-length scale exponent
const dimensionedScalar n_;
//- Required turbulence model coefficients (copied from turb model)
dimensionedScalar Cmu_;
dimensionedScalar C1_;
dimensionedScalar C2_;
dimensionedScalar C3_;
// Private Member Functions
//- Return mixing-length scale modifier for epsilon-based models
tmp<volScalarField::Internal> calcC1Star
(
const volScalarField::Internal& k,
const volScalarField::Internal& epsilon
) const;
//- Return mixing-length scale modifier for omega-based models
tmp<volScalarField::Internal> calcGammaStar
(
const volScalarField::Internal& k,
const volScalarField::Internal& omega,
const volScalarField::Internal& gamma,
const volScalarField::Internal& beta
) const;
//- Apply atmLengthScaleTurbSource to epsilon
template<class AlphaFieldType, class RhoFieldType>
void atmLengthScaleTurbSourceEpsilon
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
//- Apply atmLengthScaleTurbSource to omega
template<class AlphaFieldType, class RhoFieldType>
void atmLengthScaleTurbSourceOmega
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
public:
//- Runtime type information
TypeName("atmLengthScaleTurbSource");
// Constructors
//- Construct from explicit source name and mesh
atmLengthScaleTurbSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- No copy construct
atmLengthScaleTurbSource(const atmLengthScaleTurbSource&) = delete;
//- No copy assignment
void operator=(const atmLengthScaleTurbSource&) = delete;
// Member Functions
//- Add explicit contribution to epsilon or omega equation
//- for incompressible flow computations
virtual void addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to epsilon or omega equation
//- for compressible flow computations
virtual void addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to epsilon or omega equation
//- for multiphase flow computations
virtual void addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Read source dictionary (effectively no-op)
virtual bool read(const dictionary& dict)
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "atmLengthScaleTurbSourceTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmLengthScaleTurbSource.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmLengthScaleTurbSource::atmLengthScaleTurbSourceEpsilon
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
// Fetch required fields from the epsilon-based model
const volScalarField::Internal& k = turbPtr->k()();
const volScalarField::Internal& epsilon = turbPtr->epsilon()();
const volScalarField::Internal& GbyNu =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":GbyNu")
);
eqn += alpha()*rho()*calcC1Star(k, epsilon)*GbyNu*Cmu_*k;
}
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmLengthScaleTurbSource::atmLengthScaleTurbSourceOmega
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
// Fetch required fields from the omega-based model
const volScalarField::Internal& k = turbPtr->k()();
const volScalarField::Internal& omega = turbPtr->omega()();
const volScalarField::Internal& GbyNu =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":GbyNu")
);
const volScalarField::Internal& gamma =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":gamma")
);
const volScalarField::Internal& beta =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":beta")
);
eqn += alpha()*rho()*calcGammaStar(k, omega, gamma, beta)*GbyNu;
}
// ************************************************************************* //

View File

@ -0,0 +1,125 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmNutSource.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(atmNutSource, 0);
addToRunTimeSelectionTable(option, atmNutSource, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::atmNutSource::atmNutSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
cellSetOption(sourceName, modelType, dict, mesh),
artNutName_(dict.getOrDefault<word>("nut", "artNut")),
artNut_
(
IOobject
(
artNutName_,
mesh.time().timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar(sqr(dimLength)/dimTime, Zero)
)
{
if (!(artNut_.headerOk()))
{
FatalErrorInFunction
<< "Unable to find artificial turbulent viscosity field." << nl
<< "atmNutSource requires an artificial nut field."
<< abort(FatalError);
}
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
if (!turbPtr)
{
FatalErrorInFunction
<< "Unable to find a turbulence model."
<< abort(FatalError);
}
fieldNames_.setSize(1, "undefined");
const tmp<volScalarField>& tnut = turbPtr->nut();
if (!tnut.isTmp())
{
fieldNames_[0] = tnut().name();
}
else
{
FatalErrorInFunction
<< "Unable to find nut field." << nl
<< "atmNutSource requires nut field."
<< abort(FatalError);
}
applied_.setSize(fieldNames_.size(), false);
Log << " Applying atmNutSource to: " << fieldNames_[0] << endl;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::atmNutSource::correct(volScalarField& field)
{
Log << this->name() << ": correcting " << field.name() << endl;
field += artNut_;
field.correctBoundaryConditions();
}
// ************************************************************************* //

View File

@ -0,0 +1,165 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::atmNutSource
Group
grpFvOptionsSources
Description
Adds/subtracts a given artificial turbulent viscosity field to/from \c nut
for atmospheric boundary layer modelling.
Corrections applied to:
\verbatim
nut | Turbulent viscosity [m2/s]
\endverbatim
Required fields:
\verbatim
nut | Turbulent viscosity [m2/s]
artNut | Artificial turbulent viscosity [m2/s]
\endverbatim
Usage
Example by using \c constant/fvOptions:
\verbatim
atmNutSource1
{
// Mandatory entries (unmodifiable)
type atmNutSource;
atmNutSourceCoeffs
{
// Mandatory (inherited) entries (unmodifiable)
selectionMode all;
// Optional entries (unmodifiable)
nut artNut;
}
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmNutSource | word | yes | -
nut | Field name of artificial nut | word | no | artNut
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
SourceFiles
atmNutSource.C
\*---------------------------------------------------------------------------*/
#ifndef fv_atmNutSource_H
#define fv_atmNutSource_H
#include "cellSetOption.H"
#include "turbulentTransportModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class atmNutSource Declaration
\*---------------------------------------------------------------------------*/
class atmNutSource
:
public cellSetOption
{
// Private Data
//- Name of the artificial turbulent viscosity field
const word artNutName_;
// Fields
//- Artificial turbulent viscosity field [m2/s]
volScalarField artNut_;
public:
//- Runtime type information
TypeName("atmNutSource");
// Constructors
//- Construct from explicit source name and mesh
atmNutSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- No copy construct
atmNutSource(const atmNutSource&) = delete;
//- No copy assignment
void operator=(const atmNutSource&) = delete;
// Member Functions
//- Correct the turbulent viscosity
virtual void correct(volScalarField& field);
//- Read source dictionary (effectively no-op)
virtual bool read(const dictionary& dict)
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,134 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmPlantCanopyTSource.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(atmPlantCanopyTSource, 0);
addToRunTimeSelectionTable(option, atmPlantCanopyTSource, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::atmPlantCanopyTSource::atmPlantCanopyTSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
cellSetOption(sourceName, modelType, dict, mesh),
rhoName_(coeffs_.getOrDefault<word>("rho", "rho")),
Cp0_
(
dimensionedScalar
(
sqr(dimLength)/sqr(dimTime)/dimTemperature,
coeffs_.getCheckOrDefault<scalar>
(
"Cp0",
1005.0,
scalarMinMax::ge(SMALL)
)
)
),
qPlant_
(
IOobject
(
"qPlant",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
{
fieldNames_.setSize(1, "T");
applied_.setSize(fieldNames_.size(), false);
Log << " Applying atmPlantCanopyTSource to: " << fieldNames_[0] << endl;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::atmPlantCanopyTSource::addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (V_ > VSMALL)
{
eqn -= -qPlant_/Cp0_;
}
}
void Foam::fv::atmPlantCanopyTSource::addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (V_ > VSMALL)
{
eqn -= -rho*qPlant_/Cp0_;
}
}
void Foam::fv::atmPlantCanopyTSource::addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (V_ > VSMALL)
{
eqn -= -alpha*rho*qPlant_/Cp0_;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,194 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::atmPlantCanopyTSource
Group
grpFvOptionsSources
Description
Applies sources on temperature \c T to incorporate effects
of plant canopy for atmospheric boundary layer modelling.
Corrections applied to:
\verbatim
T | Temperature [K]
\endverbatim
Required fields:
\verbatim
T | Temperature [K]
qPlant | Heat flux [m2/s3]
\endverbatim
Usage
Example by using \c constant/fvOptions:
\verbatim
atmPlantCanopyTSource1
{
// Mandatory entries (unmodifiable)
type atmPlantCanopyTSource;
atmPlantCanopyTSourceCoeffs
{
// Mandatory (inherited) entries (unmodifiable)
selectionMode all;
// Optional entries (unmodifiable)
rho rho;
Cp0 1005.0;
}
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmPlantCanopyTSource | word | yes | -
rho | Name of density field | word | no | rho
Cp0 | Specific heat capacity [m2/s2/K] | scalar | no | 1005.0
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
SourceFiles
atmPlantCanopyTSource.C
atmPlantCanopyTSourceTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef fv_atmPlantCanopyTSource_H
#define fv_atmPlantCanopyTSource_H
#include "cellSetOption.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class atmPlantCanopyTSource Declaration
\*---------------------------------------------------------------------------*/
class atmPlantCanopyTSource
:
public cellSetOption
{
// Private Data
//- Name of density field
const word rhoName_;
//- Specific heat capacity
const dimensionedScalar Cp0_;
// Fields
//- Heat flux
volScalarField qPlant_;
public:
//- Runtime type information
TypeName("atmPlantCanopyTSource");
// Constructors
//- Construct from explicit source name and mesh
atmPlantCanopyTSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- No copy construct
atmPlantCanopyTSource(const atmPlantCanopyTSource&) = delete;
//- No copy assignment
void operator=(const atmPlantCanopyTSource&) = delete;
// Member Functions
//- Add explicit contribution to temperature equation
//- for incompressible flow computations
virtual void addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to temperature equation
//- for compressible flow computations
virtual void addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to temperature equation
//- for multiphase flow computations
virtual void addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Read source dictionary (effectively no-op)
virtual bool read(const dictionary& dict)
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,216 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmPlantCanopyTurbSource.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(atmPlantCanopyTurbSource, 0);
addToRunTimeSelectionTable(option, atmPlantCanopyTurbSource, dictionary);
}
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField::Internal>
Foam::fv::atmPlantCanopyTurbSource::calcPlantCanopyTerm
(
const volVectorField::Internal& U
) const
{
// (SP:Eq. 42)
return 12.0*Foam::sqrt(Cmu_)*plantCd_()*leafAreaDensity_()*mag(U);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::atmPlantCanopyTurbSource::atmPlantCanopyTurbSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
cellSetOption(sourceName, modelType, dict, mesh),
isEpsilon_(true),
rhoName_(coeffs_.getOrDefault<word>("rho", "rho")),
Cmu_(Zero),
C1_(Zero),
C2_(Zero),
plantCd_
(
IOobject
(
"plantCd",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
),
leafAreaDensity_
(
IOobject
(
"leafAreaDensity",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
if (!turbPtr)
{
FatalErrorInFunction
<< "Unable to find a turbulence model."
<< abort(FatalError);
}
fieldNames_.setSize(1, "undefined");
tmp<volScalarField> tepsilon = turbPtr->epsilon();
tmp<volScalarField> tomega = turbPtr->omega();
if (!tepsilon.isTmp())
{
fieldNames_[0] = tepsilon().name();
const dictionary& turbDict = turbPtr->coeffDict();
Cmu_.read("Cmu", turbDict);
C1_.read("C1", turbDict);
C2_.read("C2", turbDict);
}
else if (!tomega.isTmp())
{
isEpsilon_ = false;
fieldNames_[0] = tomega().name();
const dictionary& turbDict = turbPtr->coeffDict();
Cmu_.read("betaStar", turbDict);
}
else
{
FatalErrorInFunction
<< "Unable to find neither epsilon nor omega field." << nl
<< "atmPlantCanopyTurbSource needs either epsilon or omega field."
<< abort(FatalError);
}
applied_.setSize(fieldNames_.size(), false);
Log << " Applying atmPlantCanopyTurbSource to: " << fieldNames_[0]
<< endl;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::atmPlantCanopyTurbSource::addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (isEpsilon_)
{
atmPlantCanopyTurbSourceEpsilon
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
}
else
{
atmPlantCanopyTurbSourceOmega
(
geometricOneField(),
geometricOneField(),
eqn,
fieldi
);
}
}
void Foam::fv::atmPlantCanopyTurbSource::addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (isEpsilon_)
{
atmPlantCanopyTurbSourceEpsilon(geometricOneField(), rho, eqn, fieldi);
}
else
{
atmPlantCanopyTurbSourceOmega(geometricOneField(), rho, eqn, fieldi);
}
}
void Foam::fv::atmPlantCanopyTurbSource::addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
)
{
if (isEpsilon_)
{
atmPlantCanopyTurbSourceEpsilon(alpha, rho, eqn, fieldi);
}
else
{
atmPlantCanopyTurbSourceOmega(alpha, rho, eqn, fieldi);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,247 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::atmPlantCanopyTurbSource
Group
grpFvOptionsSources
Description
Applies sources on either \c epsilon or \c omega to incorporate effects
of plant canopy for atmospheric boundary layer modelling.
Corrections applied to either of the below, if exist:
\verbatim
epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
omega | Specific dissipation rate [1/s]
\endverbatim
Required fields:
\verbatim
epsilon/omega | Dissipation rate OR specific dissipation rate [m2/s3]/[1/s]
plantCd | Plant canopy drag coefficient [-]
leafAreaDensity | Leaf area density [1/m]
\endverbatim
References:
\verbatim
Influence of forest (tag:SP):
Sogachev, A., & Panferov, O. (2006).
Modification of two-equation models to account for plant drag.
Boundary-Layer Meteorology, 121(2), 229-266.
DOI:10.1007/s10546-006-9073-5
\endverbatim
Usage
Example by using \c constant/fvOptions:
\verbatim
atmPlantCanopyTurbSource1
{
// Mandatory entries (unmodifiable)
type atmPlantCanopyTurbSource;
atmPlantCanopyTurbSourceCoeffs
{
// Mandatory (inherited) entries (unmodifiable)
selectionMode all;
// Optional entries (unmodifiable)
rho rho;
}
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmPlantCanopyTurbSource | word | yes | -
rho | Name of density field | word | no | rho
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
SourceFiles
atmPlantCanopyTurbSource.C
atmPlantCanopyTurbSourceTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef fv_atmPlantCanopyTurbSource_H
#define fv_atmPlantCanopyTurbSource_H
#include "cellSetOption.H"
#include "turbulentTransportModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class atmPlantCanopyTurbSource Declaration
\*---------------------------------------------------------------------------*/
class atmPlantCanopyTurbSource
:
public cellSetOption
{
// Private Data
//- Internal flag to determine the working field is epsilon or omega
Switch isEpsilon_;
//- Name of density field
const word rhoName_;
//- Required turbulence model coefficients (copied from turb model)
dimensionedScalar Cmu_;
dimensionedScalar C1_;
dimensionedScalar C2_;
// Fields
//- Plant canopy drag coefficient field [-]
volScalarField plantCd_;
//- Leaf area density field [1/m]
volScalarField leafAreaDensity_;
// Private Member Functions
//- Return the modifier for plant canopy effects
tmp<volScalarField::Internal> calcPlantCanopyTerm
(
const volVectorField::Internal& U
) const;
//- Apply atmPlantCanopyTurbSource to epsilon
template<class AlphaFieldType, class RhoFieldType>
void atmPlantCanopyTurbSourceEpsilon
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
//- Apply atmPlantCanopyTurbSource to omega
template<class AlphaFieldType, class RhoFieldType>
void atmPlantCanopyTurbSourceOmega
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const;
public:
//- Runtime type information
TypeName("atmPlantCanopyTurbSource");
// Constructors
//- Construct from explicit source name and mesh
atmPlantCanopyTurbSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- No copy construct
atmPlantCanopyTurbSource(const atmPlantCanopyTurbSource&) = delete;
//- No copy assignment
void operator=(const atmPlantCanopyTurbSource&) = delete;
// Member Functions
//- Add explicit contribution to epsilon or omega equation
//- for incompressible flow computations
virtual void addSup
(
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to epsilon or omega equation
//- for compressible flow computations
virtual void addSup
(
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Add explicit contribution to epsilon or omega equation
//- for multiphase flow computations
virtual void addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<scalar>& eqn,
const label fieldi
);
//- Read source dictionary (effectively no-op)
virtual bool read(const dictionary& dict)
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "atmPlantCanopyTurbSourceTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmPlantCanopyTurbSource.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmPlantCanopyTurbSource::atmPlantCanopyTurbSourceEpsilon
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
const volScalarField& epsilon = turbPtr->epsilon();
const volVectorField::Internal& U = turbPtr->U()();
eqn -= fvm::Sp(alpha()*rho()*(C1_ - C2_)*calcPlantCanopyTerm(U), epsilon);
}
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::atmPlantCanopyTurbSource::atmPlantCanopyTurbSourceOmega
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<scalar>& eqn,
const label fieldi
) const
{
const auto* turbPtr =
mesh_.findObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
const volScalarField& omega = turbPtr->omega();
const volVectorField::Internal& U = turbPtr->U()();
const volScalarField::Internal& gamma =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":gamma")
);
const volScalarField::Internal& beta =
mesh_.lookupObjectRef<volScalarField::Internal>
(
word(turbPtr->type() + ":beta")
);
eqn -= fvm::Sp(alpha()*rho()*(gamma - beta)*calcPlantCanopyTerm(U), omega);
}
// ************************************************************************* //

View File

@ -0,0 +1,140 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "atmPlantCanopyUSource.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(atmPlantCanopyUSource, 0);
addToRunTimeSelectionTable(option, atmPlantCanopyUSource, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::atmPlantCanopyUSource::atmPlantCanopyUSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
cellSetOption(sourceName, modelType, dict, mesh),
rhoName_(coeffs_.getOrDefault<word>("rho", "rho")),
plantCd_
(
IOobject
(
"plantCd",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
),
leafAreaDensity_
(
IOobject
(
"leafAreaDensity",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
{
fieldNames_.setSize(1, "U");
applied_.setSize(fieldNames_.size(), false);
Log << " Applying atmPlantCanopyUSource to: " << fieldNames_[0] << endl;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::atmPlantCanopyUSource::addSup
(
fvMatrix<vector>& eqn,
const label fieldi
)
{
const volVectorField& U = eqn.psi();
if (V_ > VSMALL)
{
// (SP:Eq. 42)
eqn -= (plantCd_*leafAreaDensity_*mag(U))*U;
}
}
void Foam::fv::atmPlantCanopyUSource::addSup
(
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
)
{
const volVectorField& U = eqn.psi();
if (V_ > VSMALL)
{
eqn -= rho*(plantCd_*leafAreaDensity_*mag(U))*U;
}
}
void Foam::fv::atmPlantCanopyUSource::addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
)
{
const volVectorField& U = eqn.psi();
if (V_ > VSMALL)
{
eqn -= alpha*rho*(plantCd_*leafAreaDensity_*mag(U))*U;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,200 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fv::atmPlantCanopyUSource
Group
grpFvOptionsSources
Description
Applies sources on velocity \c U to incorporate effects
of plant canopy for atmospheric boundary layer modelling.
Corrections applied to:
\verbatim
U | Velocity [m/s]
\endverbatim
Required fields:
\verbatim
U | Velocity [m/s]
plantCd | Plant canopy drag coefficient [-]
leafAreaDensity | Leaf area density [1/m]
\endverbatim
References:
\verbatim
Influence of forest (tag:SP):
Sogachev, A., & Panferov, O. (2006).
Modification of two-equation models to account for plant drag.
Boundary-Layer Meteorology, 121(2), 229-266.
DOI:10.1007/s10546-006-9073-5
\endverbatim
Usage
Example by using \c constant/fvOptions:
\verbatim
atmPlantCanopyUSource1
{
// Mandatory entries (unmodifiable)
type atmPlantCanopyUSource;
atmPlantCanopyUSourceCoeffs
{
// Mandatory (inherited) entries (unmodifiable)
selectionMode all;
// Optional entries (unmodifiable)
rho rho;
}
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: atmPlantCanopyUSource | word | yes | -
rho | Name of density field | word | no | rho
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
SourceFiles
atmPlantCanopyUSource.C
atmPlantCanopyUSourceTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef fv_atmPlantCanopyUSource_H
#define fv_atmPlantCanopyUSource_H
#include "cellSetOption.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class atmPlantCanopyUSource Declaration
\*---------------------------------------------------------------------------*/
class atmPlantCanopyUSource
:
public cellSetOption
{
// Private Data
//- Name of density field
const word rhoName_;
// Fields
//- Plant canopy drag coefficient field [-]
volScalarField plantCd_;
//- Leaf area density field [1/m]
volScalarField leafAreaDensity_;
public:
//- Runtime type information
TypeName("atmPlantCanopyUSource");
// Constructors
//- Construct from explicit source name and mesh
atmPlantCanopyUSource
(
const word& sourceName,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- No copy construct
atmPlantCanopyUSource(const atmPlantCanopyUSource&) = delete;
//- No copy assignment
void operator=(const atmPlantCanopyUSource&) = delete;
// Member Functions
//- Add explicit contribution to momentum equation
virtual void addSup
(
fvMatrix<vector>& eqn,
const label fieldi
);
//- Add explicit contribution to compressible momentum equation
virtual void addSup
(
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
);
//- Add explicit contribution to phase momentum equation
virtual void addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
);
//- Read source dictionary (effectively no-op)
virtual bool read(const dictionary& dict)
{
return true;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -5,7 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2018-2020 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -26,8 +27,6 @@ License
\*---------------------------------------------------------------------------*/
#include "actuationDiskSource.H"
#include "fvMesh.H"
#include "fvMatrix.H"
#include "geometricOneField.H"
#include "addToRunTimeSelectionTable.H"
@ -38,43 +37,113 @@ namespace Foam
namespace fv
{
defineTypeNameAndDebug(actuationDiskSource, 0);
addToRunTimeSelectionTable
(
option,
actuationDiskSource,
dictionary
);
addToRunTimeSelectionTable(option, actuationDiskSource, dictionary);
}
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const Foam::Enum
<
Foam::fv::actuationDiskSource::forceMethodType
>
Foam::fv::actuationDiskSource::forceMethodTypeNames
({
{ forceMethodType::FROUDE, "Froude" },
{ forceMethodType::VARIABLE_SCALING, "variableScaling" },
});
void Foam::fv::actuationDiskSource::checkData() const
const Foam::Enum
<
Foam::fv::actuationDiskSource::monitorMethodType
>
Foam::fv::actuationDiskSource::monitorMethodTypeNames
({
{ monitorMethodType::POINTS, "points" },
{ monitorMethodType::CELLSET, "cellSet" },
});
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::fv::actuationDiskSource::writeFileHeader(Ostream& os)
{
if (magSqr(diskArea_) <= VSMALL)
writeFile::writeHeader(os, "Actuation disk source");
writeFile::writeCommented(os, "Time");
writeFile::writeCommented(os, "Uref");
writeFile::writeCommented(os, "Cp");
writeFile::writeCommented(os, "Ct");
if (forceMethod_ == forceMethodType::FROUDE)
{
FatalErrorInFunction
<< "diskArea is approximately zero"
<< exit(FatalIOError);
writeFile::writeCommented(os, "a");
writeFile::writeCommented(os, "T");
}
if (Cp_ <= VSMALL || Ct_ <= VSMALL)
else if (forceMethod_ == forceMethodType::VARIABLE_SCALING)
{
FatalErrorInFunction
<< "Cp and Ct must be greater than zero"
<< exit(FatalIOError);
writeFile::writeCommented(os, "Udisk");
writeFile::writeCommented(os, "CpStar");
writeFile::writeCommented(os, "CtStar");
writeFile::writeCommented(os, "T");
writeFile::writeCommented(os, "P");
}
if (mag(diskDir_) < VSMALL)
os << endl;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::fv::actuationDiskSource::setMonitorCells(const dictionary& subDict)
{
switch (monitorMethod_)
{
FatalErrorInFunction
<< "disk direction vector is approximately zero"
<< exit(FatalIOError);
}
if (returnReduce(upstreamCellId_, maxOp<label>()) == -1)
{
FatalErrorInFunction
<< "upstream location " << upstreamPoint_ << " not found in mesh"
<< exit(FatalIOError);
case monitorMethodType::POINTS:
{
Info<< " - selecting cells using points" << endl;
labelHashSet selectedCells;
List<point> monitorPoints;
subDict.readEntry("points", monitorPoints);
for (const auto& monitorPoint : monitorPoints)
{
const label celli = mesh_.findCell(monitorPoint);
if (celli >= 0)
{
selectedCells.insert(celli);
}
const label globalCelli = returnReduce(celli, maxOp<label>());
if (globalCelli < 0)
{
WarningInFunction
<< "Unable to find owner cell for point "
<< monitorPoint << endl;
}
}
monitorCells_ = selectedCells.sortedToc();
break;
}
case monitorMethodType::CELLSET:
{
Info<< " - selecting cells using cellSet "
<< cellSetName_ << endl;
monitorCells_ = cellSet(mesh_, cellSetName_).sortedToc();
break;
}
default:
{
FatalErrorInFunction
<< "Unknown type for monitoring of incoming velocity"
<< monitorMethodTypeNames[monitorMethod_]
<< ". Valid monitor method types : "
<< monitorMethodTypeNames
<< exit(FatalError);
}
}
}
@ -90,22 +159,64 @@ Foam::fv::actuationDiskSource::actuationDiskSource
)
:
cellSetOption(name, modelType, dict, mesh),
diskDir_(coeffs_.get<vector>("diskDir")),
Cp_(coeffs_.get<scalar>("Cp")),
Ct_(coeffs_.get<scalar>("Ct")),
diskArea_(coeffs_.get<scalar>("diskArea")),
upstreamPoint_(coeffs_.get<point>("upstreamPoint")),
upstreamCellId_(-1)
writeFile(mesh, name, modelType, dict),
forceMethod_
(
forceMethodTypeNames.getOrDefault
(
"variant",
dict,
forceMethodType::FROUDE
)
),
monitorMethod_
(
monitorMethodTypeNames.get
(
"monitorMethod",
dict
)
),
sink_
(
dict.getOrDefault<bool>("sink", true)
? 1
: -1
),
writeFileStart_(dict.getOrDefault<scalar>("writeFileStart", 0)),
writeFileEnd_(dict.getOrDefault<scalar>("writeFileEnd", VGREAT)),
diskArea_
(
dict.getCheck<scalar>
(
"diskArea",
scalarMinMax::ge(VSMALL)
)
),
diskDir_
(
dict.getCheck<vector>
(
"diskDir",
[&](const vector& vec){ return mag(vec) > VSMALL; }
).normalise()
),
UvsCpPtr_(Function1<scalar>::New("Cp", dict)),
UvsCtPtr_(Function1<scalar>::New("Ct", dict)),
monitorCells_()
{
coeffs_.readEntry("fields", fieldNames_);
setMonitorCells((dict.subDict("monitorCoeffs")));
fieldNames_.setSize(1, "U");
applied_.setSize(fieldNames_.size(), false);
Info<< " - creating actuation disk zone: "
<< this->name() << endl;
Info<< " - creating actuation disk zone: " << this->name() << endl;
upstreamCellId_ = mesh.findCell(upstreamPoint_);
Info<< " - force computation method: "
<< forceMethodTypeNames[forceMethod_] << endl;
checkData();
writeFileHeader(file());
}
@ -117,20 +228,9 @@ void Foam::fv::actuationDiskSource::addSup
const label fieldi
)
{
const scalarField& cellsV = mesh_.V();
vectorField& Usource = eqn.source();
const vectorField& U = eqn.psi();
if (V() > VSMALL)
{
addActuationDiskAxialInertialResistance
(
Usource,
cells_,
cellsV,
geometricOneField(),
U
);
calc(geometricOneField(), geometricOneField(), eqn);
}
}
@ -142,34 +242,53 @@ void Foam::fv::actuationDiskSource::addSup
const label fieldi
)
{
const scalarField& cellsV = mesh_.V();
vectorField& Usource = eqn.source();
const vectorField& U = eqn.psi();
if (V() > VSMALL)
{
addActuationDiskAxialInertialResistance
(
Usource,
cells_,
cellsV,
rho,
U
);
calc(geometricOneField(), rho, eqn);
}
}
void Foam::fv::actuationDiskSource::addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
)
{
if (V() > VSMALL)
{
calc(alpha, rho, eqn);
}
}
bool Foam::fv::actuationDiskSource::read(const dictionary& dict)
{
if (cellSetOption::read(dict))
if (cellSetOption::read(dict) && writeFile::read(dict))
{
coeffs_.readIfPresent("diskDir", diskDir_);
coeffs_.readIfPresent("Cp", Cp_);
coeffs_.readIfPresent("Ct", Ct_);
coeffs_.readIfPresent("diskArea", diskArea_);
dict.readIfPresent("sink", sink_);
dict.readIfPresent("writeFileStart", writeFileStart_);
dict.readIfPresent("writeFileEnd", writeFileEnd_);
dict.readIfPresent("diskArea", diskArea_);
if (diskArea_ < VSMALL)
{
FatalErrorInFunction
<< "Actuator disk has zero area: "
<< "diskArea = " << diskArea_
<< exit(FatalIOError);
}
checkData();
dict.readIfPresent("diskDir", diskDir_);
diskDir_.normalise();
if (mag(diskDir_) < VSMALL)
{
FatalErrorInFunction
<< "Actuator disk surface-normal vector is zero: "
<< "diskDir = " << diskDir_
<< exit(FatalIOError);
}
return true;
}

View File

@ -5,7 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,36 +31,175 @@ Group
grpFvOptionsSources
Description
Actuation disk source
Applies sources on \c U to enable actuator disk models for aero/hydro thrust
loading of horizontal axis turbines on surrounding flow field in
terms of energy conversion processes.
Constant values for momentum source for actuation disk
\f[
T = 2 \rho A U_{o}^2 a (1-a)
\f]
and
\f[
U_1 = (1 - a)U_{o}
\f]
where:
\vartable
A | disk area
U_o | upstream velocity
a | 1 - Cp/Ct
U_1 | velocity at the disk
\endvartable
Usage
Example usage:
Corrections applied to:
\verbatim
fields (U); // names of fields to apply source
diskDir (-1 0 0); // disk direction
Cp 0.1; // power coefficient
Ct 0.5; // thrust coefficient
diskArea 5.0; // disk area
upstreamPoint (0 0 0); // upstream point
U | Velocity [m/s]
\endverbatim
Required fields:
\verbatim
U | Velocity [m/s]
\endverbatim
Available options for force computations:
\verbatim
Froude | Froude's one-dimensional ideal actuator disk method
variableScaling | Variable-scaling actuator disk method
\endverbatim
The expressions for \c Froude method:
\f[
T = 2 \rho A | \vec{U_o} \cdot \vec{n} |^2 a (1-a)
\f]
with
\f[
a = 1 - \frac{C_p}{C_T}
\f]
where
\vartable
T | Thrust magnitude
\rho | Monitored incoming fluid density
A | Actuator disk planar surface area
\vec{U_o} | Incoming velocity spatial-averaged on monitored region
\vec{n} | Surface-normal vector of the actuator disk pointing upstream
a | Axial induction factor
C_p | Power coefficient
C_T | Thrust coefficient
\endvartable
The expressions for \c variableScaling method:
\f[
T = 0.5 \rho A | \vec{U_m} \cdot \vec{n} |^2 C_T^*
\f]
with
\f[
C_T^* = C_T \left( \frac{ |\vec{U_{ref}}| }{ |\vec{U_m}| } \right)^2
\f]
where
\vartable
T | Thrust magnitude
\rho | Monitored incoming fluid density
A | Actuator disk planar surface area
\vec{U_m} | Incoming velocity spatial-averaged on actuator disk
\vec{n} | Surface-normal vector of the actuator disk pointing upstream
\vec{U_{ref}} | Incoming velocity spatial-averaged on monitored region
C_T | Thrust coefficient
C_T^* | Calibrated thrust coefficient
\endvartable
Reference
\verbatim
Froude's one-dimensional ideal actuator disk (tags:F,BJSB):
Froude, R. E. (1889).
On the part played in propulsion by differences of fluid pressure.
Trans. Inst. Naval Architects, 30, 390.
Burton, T., Jenkins, N., Sharpe, D., & Bossanyi, E. (2011).
Wind energy handbook, 2nd edition.
Chichester, the United Kingdom. John Wiley & Sons.
Print ISBN:978-0-470-69975-1
DOI:10.1002/9781119992714
Variable-scaling method (tags:LSRMKT,LS):
van der Laan, M. P., Sørensen, N. N., Réthoré, P. E.,
Mann, J., Kelly, M. C., & Troldborg, N. (2015).
The kεfP model applied to double wind turbine
wakes using different actuator disk force methods.
Wind Energy, 18(12), 2223-2240.
DOI:10.1002/we.1816
van der Laan, M. P., Sørensen, N. N., Réthoré, P. E., Mann, J.,
Kelly, M. C., Troldborg, N., Hansen, K. S., & Murcia, J. P. (2015).
The kεfP model applied to wind farms.
Wind Energy, 18(12), 2065-2084.
DOI:10.1002/we.1804
\endverbatim
Usage
Example by using \c constant/fvOptions:
\verbatim
actuationDiskSource1
{
// Mandatory entries (unmodifiable)
type actuationDiskSource;
monitorMethod <points|cellSet>;
monitorCoeffs
{
// Option-1
points
(
(p1x p1y p1z)
(p2x p2y p2z)
...
);
// Option-2
cellSet <monitorCellSet>;
}
// Mandatory (inherited) entries (unmodifiable)
selectionMode <mode>; // e.g. cellSet as shown below
cellSet <cellSetName>;
// Mandatory entries (runtime modifiable)
diskArea 40.0;
diskDir (1 0 0);
Cp <Function1>;
Ct <Function1>;
// Optional entries (unmodifiable)
variant <forceMethod>;
// Optional entries (runtime modifiable)
sink true;
writeFileStart 0;
writeFileEnd 100;
// Optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: actuationDiskSource | word | yes | -
diskArea | Actuator disk planar surface area [m2] | scalar | yes | -
diskDir | Surface-normal vector of the actuator disk <!--
--> pointing upstream | vector | yes | -
Cp | Power coefficient | Function1 | yes | -
Ct | Thrust coefficient | Function1 | yes | -
monitorMethod | Type of incoming velocity monitoring method <!--
--> - see below | word | yes | -
variant | Type of the force computation method - see below <!--
--> | word | no | Froude
sink | Flag for body forces to act as a source (true) <!--
--> or a sink (false) | bool | no | true
writeFileStart | Start time for file output | scalar | no | 0
writeFileEnd | End time for file output | scalar | no | VGREAT
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
- \link writeFile.H \endlink
- \link Function1.H \endlink
Options for the \c monitorMethod entry:
\verbatim
points | Monitor incoming velocity field at a given set of points
cellSet | Monitor incoming velocity field at a given cellSet
\endverbatim
Options for the \c variant entry:
\verbatim
Froude | Froude's one-dimensional ideal actuator disk method
variableScaling | Variable-scaling actuator disk method
\endverbatim
SourceFiles
actuationDiskSource.C
@ -71,6 +211,8 @@ SourceFiles
#define actuationDiskSource_H
#include "cellSetOption.H"
#include "writeFile.H"
#include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -85,55 +227,107 @@ namespace fv
class actuationDiskSource
:
public cellSetOption
public cellSetOption,
public functionObjects::writeFile
{
protected:
// Protected data
// Protected Enumerations
//- Disk area normal
vector diskDir_;
//- Options for the force computation method types
enum forceMethodType
{
FROUDE, //!< "Froude's ideal actuator disk method"
VARIABLE_SCALING, //!< "Variable-scaling actuator disk method"
};
//- Power coefficient
scalar Cp_;
//- Names for forceMethodType
static const Enum<forceMethodType> forceMethodTypeNames;
//- Thrust coefficient
scalar Ct_;
//- Options for the incoming velocity monitoring method types
enum monitorMethodType
{
POINTS, //!< "A set of points"
CELLSET //!< "A cellSet"
};
//- Disk area
//- Names for monitorMethodType
static const Enum<monitorMethodType> monitorMethodTypeNames;
// Protected Data
//- The type of the force computation method
const enum forceMethodType forceMethod_;
//- The type of incoming velocity monitoring method
const enum monitorMethodType monitorMethod_;
//- Flag for body forces to act as a source (true) or a sink (false)
label sink_;
//- Start time for file output
scalar writeFileStart_;
//- End time for file output
scalar writeFileEnd_;
//- Actuator disk planar surface area [m2]
scalar diskArea_;
//- Upstream point sample
point upstreamPoint_;
//- Surface-normal vector of the actuator disk pointing upstream
vector diskDir_;
//- Upstream cell ID
label upstreamCellId_;
//- Velocity vs power coefficients
autoPtr<Function1<scalar>> UvsCpPtr_;
//- Velocity vs thrust coefficients
autoPtr<Function1<scalar>> UvsCtPtr_;
//- Set of cells whereat the incoming velocity is monitored
labelList monitorCells_;
// Protected Member Functions
//- Output file header information
virtual void writeFileHeader(Ostream& os);
private:
// Private Member Functions
//- Check data
void checkData() const;
//- Locate the set of cells whereat the incoming velocity is monitored
void setMonitorCells(const dictionary& subDict);
//- Add resistance to the UEqn
template<class RhoFieldType>
void addActuationDiskAxialInertialResistance
//- Compute the selected force computation method type
template<class AlphaFieldType, class RhoFieldType>
void calc
(
vectorField& Usource,
const labelList& cells,
const scalarField& V,
const AlphaFieldType& alpha,
const RhoFieldType& rho,
const vectorField& U
) const;
fvMatrix<vector>& eqn
);
//- No copy construct
actuationDiskSource(const actuationDiskSource&) = delete;
//- Compute Froude's ideal actuator disk method
template<class AlphaFieldType, class RhoFieldType>
void calcFroudeMethod
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<vector>& eqn
);
//- No copy assignment
void operator=(const actuationDiskSource&) = delete;
//- Compute variable-scaling actuator disk method
template<class AlphaFieldType, class RhoFieldType>
void calcVariableScalingMethod
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<vector>& eqn
);
public:
@ -153,6 +347,12 @@ public:
const fvMesh& mesh
);
//- No copy construct
actuationDiskSource(const actuationDiskSource&) = delete;
//- No copy assignment
void operator=(const actuationDiskSource&) = delete;
//- Destructor
virtual ~actuationDiskSource() = default;
@ -162,18 +362,6 @@ public:
// Access
//- Return Cp
scalar Cp() const
{
return Cp_;
}
//- Return Ct
scalar Ct() const
{
return Ct_;
}
//- Normal disk direction
const vector& diskDir() const
{
@ -204,6 +392,15 @@ public:
const label fieldi
);
//- Source term to phase-compressible momentum equation
virtual void addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
);
// IO

View File

@ -5,8 +5,8 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd
Copyright (C) 2020 ENERCON GmbH
Copyright (C) 2018-2020 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,38 +27,219 @@ License
\*---------------------------------------------------------------------------*/
#include "actuationDiskSource.H"
#include "fvMesh.H"
#include "fvMatrix.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class RhoFieldType>
void Foam::fv::actuationDiskSource::addActuationDiskAxialInertialResistance
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::actuationDiskSource::calc
(
vectorField& Usource,
const labelList& cells,
const scalarField& Vcells,
const AlphaFieldType& alpha,
const RhoFieldType& rho,
const vectorField& U
) const
fvMatrix<vector>& eqn
)
{
scalar a = 1.0 - Cp_/Ct_;
vector uniDiskDir = diskDir_/mag(diskDir_);
vector upU = vector(VGREAT, VGREAT, VGREAT);
scalar upRho = VGREAT;
if (upstreamCellId_ != -1)
switch (forceMethod_)
{
upU = U[upstreamCellId_];
upRho = rho[upstreamCellId_];
case forceMethodType::FROUDE:
{
calcFroudeMethod(alpha, rho, eqn);
break;
}
case forceMethodType::VARIABLE_SCALING:
{
calcVariableScalingMethod(alpha, rho, eqn);
break;
}
default:
break;
}
reduce(upU, minOp<vector>());
reduce(upRho, minOp<scalar>());
}
scalar T = 2.0*upRho*diskArea_*sqr(mag(upU & uniDiskDir))*a*(1 - a);
for (const label celli : cells)
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::actuationDiskSource::calcFroudeMethod
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<vector>& eqn
)
{
const vectorField& U = eqn.psi();
vectorField& Usource = eqn.source();
const scalarField& cellsV = mesh_.V();
// Compute upstream U and rho, spatial-averaged over monitor-region
vector Uref(Zero);
scalar rhoRef = 0.0;
label szMonitorCells = monitorCells_.size();
for (const auto& celli : monitorCells_)
{
Usource[celli] += ((Vcells[celli]/V())*T)*uniDiskDir;
Uref += U[celli];
rhoRef = rhoRef + rho[celli];
}
reduce(Uref, sumOp<vector>());
reduce(rhoRef, sumOp<scalar>());
reduce(szMonitorCells, sumOp<label>());
if (szMonitorCells == 0)
{
FatalErrorInFunction
<< "No cell is available for incoming velocity monitoring."
<< exit(FatalError);
}
Uref /= szMonitorCells;
rhoRef /= szMonitorCells;
const scalar Ct = sink_*UvsCtPtr_->value(mag(Uref));
const scalar Cp = sink_*UvsCpPtr_->value(mag(Uref));
if (Cp <= VSMALL || Ct <= VSMALL)
{
FatalErrorInFunction
<< "Cp and Ct must be greater than zero." << nl
<< "Cp = " << Cp << ", Ct = " << Ct
<< exit(FatalIOError);
}
// (BJSB:Eq. 3.9)
const scalar a = 1.0 - Cp/Ct;
const scalar T = 2.0*rhoRef*diskArea_*magSqr(Uref & diskDir_)*a*(1 - a);
for (const label celli : cells_)
{
Usource[celli] += ((cellsV[celli]/V())*T)*diskDir_;
}
if
(
mesh_.time().timeOutputValue() >= writeFileStart_
&& mesh_.time().timeOutputValue() <= writeFileEnd_
)
{
Ostream& os = file();
writeCurrentTime(os);
os << Uref << tab << Cp << tab << Ct << tab << a << tab << T << tab
<< endl;
}
}
template<class AlphaFieldType, class RhoFieldType>
void Foam::fv::actuationDiskSource::calcVariableScalingMethod
(
const AlphaFieldType& alpha,
const RhoFieldType& rho,
fvMatrix<vector>& eqn
)
{
const vectorField& U = eqn.psi();
vectorField& Usource = eqn.source();
const scalarField& cellsV = mesh_.V();
// Monitor and average monitor-region U and rho
vector Uref(Zero);
scalar rhoRef = 0.0;
label szMonitorCells = monitorCells_.size();
for (const auto& celli : monitorCells_)
{
Uref += U[celli];
rhoRef = rhoRef + rho[celli];
}
reduce(Uref, sumOp<vector>());
reduce(rhoRef, sumOp<scalar>());
reduce(szMonitorCells, sumOp<label>());
if (szMonitorCells == 0)
{
FatalErrorInFunction
<< "No cell is available for incoming velocity monitoring."
<< exit(FatalError);
}
Uref /= szMonitorCells;
const scalar magUref = mag(Uref);
rhoRef /= szMonitorCells;
// Monitor and average U and rho on actuator disk
vector Udisk(Zero);
scalar rhoDisk = 0.0;
scalar totalV = 0.0;
for (const auto& celli : cells_)
{
Udisk += U[celli]*cellsV[celli];
rhoDisk += rho[celli]*cellsV[celli];
totalV += cellsV[celli];
}
reduce(Udisk, sumOp<vector>());
reduce(rhoDisk, sumOp<scalar>());
reduce(totalV, sumOp<scalar>());
if (totalV < SMALL)
{
FatalErrorInFunction
<< "No cell in the actuator disk."
<< exit(FatalError);
}
Udisk /= totalV;
const scalar magUdisk = mag(Udisk);
rhoDisk /= totalV;
if (mag(Udisk) < SMALL)
{
FatalErrorInFunction
<< "Velocity spatial-averaged on actuator disk is zero." << nl
<< "Please check if the initial U field is zero."
<< exit(FatalError);
}
// Interpolated thrust/power coeffs from power/thrust curves
const scalar Ct = sink_*UvsCtPtr_->value(magUref);
const scalar Cp = sink_*UvsCpPtr_->value(magUref);
if (Cp <= VSMALL || Ct <= VSMALL)
{
FatalErrorInFunction
<< "Cp and Ct must be greater than zero." << nl
<< "Cp = " << Cp << ", Ct = " << Ct
<< exit(FatalIOError);
}
// Calibrated thrust/power coeffs from power/thrust curves (LSRMTK:Eq. 6)
const scalar CtStar = Ct*sqr(magUref/magUdisk);
const scalar CpStar = Cp*pow3(magUref/magUdisk);
// Compute calibrated thrust/power (LSRMTK:Eq. 5)
const scalar T = 0.5*rhoRef*diskArea_*magSqr(Udisk & diskDir_)*CtStar;
const scalar P = 0.5*rhoRef*diskArea_*pow3(mag(Udisk & diskDir_))*CpStar;
for (const label celli : cells_)
{
Usource[celli] += (cellsV[celli]/totalV*T)*diskDir_;
}
if
(
mesh_.time().timeOutputValue() >= writeFileStart_
&& mesh_.time().timeOutputValue() <= writeFileEnd_
)
{
Ostream& os = file();
writeCurrentTime(os);
os << Uref << tab << Cp << tab << Ct
<< Udisk << tab << CpStar << tab << CtStar << tab << T << tab << P
<< endl;
}
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,12 +37,7 @@ namespace Foam
namespace fv
{
defineTypeNameAndDebug(radialActuationDiskSource, 0);
addToRunTimeSelectionTable
(
option,
radialActuationDiskSource,
dictionary
);
addToRunTimeSelectionTable(option, radialActuationDiskSource, dictionary);
}
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,43 +31,66 @@ Group
grpFvOptionsSources
Description
Actuation disk source including radial thrust
Applies sources on \c U to enable actuator disk models with radial thrust
distribution for aero/hydro thrust loading of horizontal axis turbines
on surrounding flow field in terms of energy conversion processes.
Constant values for momentum source for actuation disk
\f[
T = 2 \rho A U_{o}^2 a (1-a)
\f]
and
\f[
U_1 = (1 - a)U_{o}
\f]
where:
\vartable
A | disk area
U_o | upstream velocity
a | 1 - Cp/Ct
U_1 | velocity at the disk
\endvartable
The thrust is distributed by a radial function:
\f[
thrust(r) = T (C_0 + C_1 r^2 + C_2 r^4)
\f]
Usage
Example usage:
Corrections applied to:
\verbatim
fields (U); // names of fields to apply source
diskDir (-1 0 0); // disk direction
Cp 0.1; // power coefficient
Ct 0.5; // thrust coefficient
diskArea 5.0; // disk area
coeffs (0.1 0.5 0.01); // radial distribution coefficients
upstreamPoint (0 0 0); // upstream point
U | Velocity [m/s]
\endverbatim
Required fields:
\verbatim
U | Velocity [m/s]
\endverbatim
Thrust, which is computed by \link actuationDiskSource.H \endlink is
distributed as a function of actuator disk radius through a given forth
order polynomial function:
\f[
T(r) = T (C_0 + C_1 r^2 + C_2 r^4)
\f]
where
\vartable
T | Thrust magnitude computed by actuationDiskSource setup
T(r) | Thrust magnitude as a function of "r"
r | Local actuator disk radius
C_* | Polynomial coefficients
\endvartable
Usage
Example by using \c constant/fvOptions:
\verbatim
radialActuationDiskSource1
{
// Mandatory entries (unmodifiable)
type radialActuationDiskSource;
coeffs (0.1 0.5 0.01);
// Mandatory and optional (inherited) entries
...
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: radialActuationDiskSource | word | yes | -
coeffs | Radial distribution function coefficients | vector | yes | -
\endtable
The inherited entries are elaborated in:
- \link fvOption.H \endlink
- \link cellSetOption.H \endlink
- \link writeFile.H \endlink
- \link Function1.H \endlink
- \link actuationDiskSource.H \endlink
Note
- \c radialActuationDiskSource computes only \c Froude force computation
method of \c actuationDiskSource.
SourceFiles
radialActuationDiskSource.C
@ -95,7 +119,7 @@ class radialActuationDiskSource
:
public actuationDiskSource
{
// Private data
// Private Data
//- Coefficients for the radial distribution
FixedList<scalar, 3> radialCoeffs_;
@ -112,13 +136,7 @@ class radialActuationDiskSource
const scalarField& V,
const RhoFieldType& rho,
const vectorField& U
) const;
//- No copy construct
radialActuationDiskSource(const radialActuationDiskSource&) = delete;
//- No copy assignment
void operator=(const radialActuationDiskSource&) = delete;
);
public:
@ -138,6 +156,12 @@ public:
const fvMesh& mesh
);
//- No copy construct
radialActuationDiskSource(const radialActuationDiskSource&) = delete;
//- No copy assignment
void operator=(const radialActuationDiskSource&) = delete;
//- Destructor
virtual ~radialActuationDiskSource() = default;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,16 +43,14 @@ addRadialActuationDiskAxialInertialResistance
const scalarField& Vcells,
const RhoFieldType& rho,
const vectorField& U
) const
)
{
scalar a = 1.0 - Cp_/Ct_;
scalarField Tr(cells.size());
const vector uniDiskDir = diskDir_/mag(diskDir_);
tensor E(Zero);
E.xx() = uniDiskDir.x();
E.yy() = uniDiskDir.y();
E.zz() = uniDiskDir.z();
E.xx() = diskDir_.x();
E.yy() = diskDir_.y();
E.zz() = diskDir_.z();
const Field<vector> zoneCellCentres(mesh().cellCentres(), cells);
const Field<scalar> zoneCellVolumes(mesh().cellVolumes(), cells);
@ -59,32 +58,80 @@ addRadialActuationDiskAxialInertialResistance
const vector avgCentre = gSum(zoneCellVolumes*zoneCellCentres)/V();
const scalar maxR = gMax(mag(zoneCellCentres - avgCentre));
scalar intCoeffs =
const scalar intCoeffs =
radialCoeffs_[0]
+ radialCoeffs_[1]*sqr(maxR)/2.0
+ radialCoeffs_[2]*pow4(maxR)/3.0;
vector upU = vector(VGREAT, VGREAT, VGREAT);
scalar upRho = VGREAT;
if (upstreamCellId_ != -1)
if (mag(intCoeffs) < VSMALL)
{
upU = U[upstreamCellId_];
upRho = rho[upstreamCellId_];
FatalErrorInFunction
<< "Radial distribution coefficients lead to zero polynomial." << nl
<< "radialCoeffs = " << radialCoeffs_
<< exit(FatalIOError);
}
reduce(upU, minOp<vector>());
reduce(upRho, minOp<scalar>());
scalar T = 2.0*upRho*diskArea_*mag(upU)*a*(1.0 - a);
// Compute upstream U and rho, spatial-averaged over monitor-region
vector Uref(Zero);
scalar rhoRef = 0.0;
label szMonitorCells = monitorCells_.size();
for (const auto& celli : monitorCells_)
{
Uref += U[celli];
rhoRef = rhoRef + rho[celli];
}
reduce(Uref, sumOp<vector>());
reduce(rhoRef, sumOp<scalar>());
reduce(szMonitorCells, sumOp<label>());
if (szMonitorCells == 0)
{
FatalErrorInFunction
<< "No cell is available for incoming velocity monitoring."
<< exit(FatalError);
}
Uref /= szMonitorCells;
rhoRef /= szMonitorCells;
const scalar Ct = sink_*UvsCtPtr_->value(mag(Uref));
const scalar Cp = sink_*UvsCpPtr_->value(mag(Uref));
if (Cp <= VSMALL || Ct <= VSMALL)
{
FatalErrorInFunction
<< "Cp and Ct must be greater than zero." << nl
<< "Cp = " << Cp << ", Ct = " << Ct
<< exit(FatalIOError);
}
const scalar a = 1.0 - Cp/Ct;
const scalar T = 2.0*rhoRef*diskArea_*mag(Uref)*a*(1.0 - a);
forAll(cells, i)
{
scalar r2 = magSqr(mesh().cellCentres()[cells[i]] - avgCentre);
const scalar r2 = magSqr(mesh().cellCentres()[cells[i]] - avgCentre);
Tr[i] =
T
*(radialCoeffs_[0] + radialCoeffs_[1]*r2 + radialCoeffs_[2]*sqr(r2))
/intCoeffs;
Usource[cells[i]] += ((Vcells[cells[i]]/V_)*Tr[i]*E) & upU;
Usource[cells[i]] += ((Vcells[cells[i]]/V_)*Tr[i]*E) & Uref;
}
if
(
mesh_.time().timeOutputValue() >= writeFileStart_
&& mesh_.time().timeOutputValue() <= writeFileEnd_
)
{
Ostream& os = file();
writeCurrentTime(os);
os << Uref << tab << Cp << tab << Ct << tab << a << tab << T << tab
<< endl;
}
if (debug)

View File

@ -6,7 +6,7 @@
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
flowVelocity (0 0 0);
flowVelocity (10 0 0);
pressure 0;
turbulentKE 1.3;
turbulentEpsilon 0.01;

View File

@ -36,7 +36,8 @@ boundaryField
terrain
{
type nutkAtmRoughWallFunction;
type atmNutkWallFunction;
boundNut false;
z0 $z0;
value uniform 0.0;
}

View File

@ -18,31 +18,50 @@ FoamFile
disk1
{
type actuationDiskSource;
fields (U);
variant Froude; // variableScaling;
selectionMode cellSet;
cellSet actuationDisk1;
diskDir (1 0 0); // Orientation of the disk
diskArea 40;
diskDir (1 0 0);
writeToFile true;
sink true;
Cp 0.386;
Ct 0.58;
diskArea 40;
upstreamPoint (581849 4785810 1065);
monitorMethod points;
monitorCoeffs
{
points
(
(581849 4785810 1065)
);
}
}
disk2
{
type actuationDiskSource;
fields (U);
variant Froude; // variableScaling;
selectionMode cellSet;
cellSet actuationDisk2;
diskDir (1 0 0); // Orientation of the disk
writeToFile true;
sink true;
Cp 0.53;
Ct 0.58;
diskArea 40;
upstreamPoint (581753 4785663 1070);
diskDir (1 0 0);
monitorMethod points;
monitorCoeffs
{
points
(
(581753 4785663 1070)
);
}
}

View File

@ -0,0 +1,48 @@
# Stratification = Very stable
# k/k@(zRef=40m) z/zRef=20[m]
5.050476682 2.0032
4.708841902 2.94998
4.016252759 4.00501
3.328857722 4.90112
3.317729463 6.00696
3.383228433 6.88859
# Stratification = Stable
# k/k@(zRef=40m) z/zRef=20[m]
4.24970097 2.0032
4.149517291 2.94998
3.859303812 4.00501
3.463663054 4.90112
3.124025564 6.00696
3.103046306 6.88859
# Stratification = Slightly stable
# k/k@(zRef=40m) z/zRef=20[m]
3.897762917 2.0032
3.816771933 2.94998
3.707861851 4.00501
3.54779421 4.90112
3.310490034 6.00696
3.179855803 6.88859
# Stratification = Neutral
# k/k@(zRef=40m) z/zRef=20[m]
3.788680963 2.0032
3.715671223 2.94998
3.59401204 4.00501
3.465226229 4.90112
3.251834724 6.00696
3.130716879 6.88859
# Stratification = Slightly unstable
# k/k@(zRef=40m) z/zRef=20[m]
4.038160328 2.0032
4.012134117 2.94998
3.768972354 4.00501
3.6049338 4.90112
3.364303911 6.00696
3.252063911 6.88859
# Stratification = Unstable
# k/k@(zRef=40m) z/zRef=20[m]
4.198358216 2.0032
4.008932555 2.94998
3.752031 4.00501
3.566299621 4.90112
3.274208456 6.00696
3.154213326 6.88859

View File

@ -0,0 +1,48 @@
# Stratification = Very stable
# U/U@(zRef=40m) z/zRef=20[m]
13.8953 2
20.0349 2.95
25.3372 4
28.3023 4.9
31.7907 6
33.8488 6.88571
# Stratification = Stable
# U/U@(zRef=40m) z/zRef=20[m]
8.13953 2
10.5814 2.95
13.3721 4
15.0465 4.9
17.3488 6.00714
18.7791 6.88571
# Stratification = Slightly stable
# U/U@(zRef=40m) z/zRef=20[m]
6.36047 1.99286
8 2.95
9.60465 4
10.5465 4.89286
11.9419 5.99286
12.814 6.87857
# Stratification = Neutral
# U/U@(zRef=40m) z/zRef=20[m]
5.62791 2
6.95349 2.95
8.13953 4
8.76744 4.9
9.63953 6
10.2674 6.88571
# Stratification = Slightly unstable
# U/U@(zRef=40m) z/zRef=20[m]
5.31395 2
6.43023 2.95
7.26744 4
7.65116 4.9
8.2093 6
8.66279 6.88571
# Stratification = Unstable
# U/U@(zRef=40m) z/zRef=20[m]
5.06977 2
6.04651 2.95
6.74419 4
7.05814 4.9
7.44186 6
7.75581 6.88571

View File

@ -0,0 +1,47 @@
# Stratification = Very stable
# veer z/zRef=20[m]
-8.88e-16 2
5.08854 2.96326
7.19998 4.00448
9.45163 4.89879
13.7953 6.00217
17.954 6.88183
# Stratification = Stable
# veer z/zRef=20[m]
-8.88178e-16 2
3.57695 2.95679
4.31625 4.00548
5.42837 4.9002
8.91164 5.99688
12.3262 6.87681
# Stratification = Slightly stable
# veer z/zRef=20[m]
-8.88e-16 2
2.60026 2.94315
2.75811 4.00603
3.12604 4.901
5.6326 5.99104
8.39595 6.87119
# Stratification = Neutral
# veer z/zRef=20[m]
1.89764 4.00633
1.90249 2.96437
2.05627 4.90138
4.12094 5.99856
6.69821 6.88577
# Stratification = Slightly unstable
# veer z/zRef=20[m]
-8.88e-16 2
1.75811 4.00638
2.06528 2.96431
2.07953 4.90137
4.05117 5.99858
6.2796 6.88592
# Stratification = Unstable
# veer z/zRef=20[m]
-8.88e-16 2
1.3395 4.00652
1.83272 2.96439
1.89348 4.90144
4.16745 5.99854
6.41914 6.88587

View File

@ -0,0 +1,48 @@
# Lettau, H. (1950).
# A re-examination of the “Leipzig wind profile” considering some
# relations between wind and turbulence in the frictional layer.
# Tellus, 2(2), 125-129.
# DOI:10.3402/tellusa.v2i2.8534
#
# Koblitz, T. (2013).
# CFD Modeling of Non-Neutral Atmospheric Boundary Layer Conditions.
# DTU Wind Energy. DTU Wind Energy PhD, No. 0019(EN).
# Figure 4.1
## u z
10.5946 97.6744
11.7838 146.512
12.6486 209.302
13.6216 258.14
14.2703 293.023
14.8108 348.837
15.6757 397.674
16.4324 453.488
16.7568 502.326
17.4054 551.163
17.6216 600
17.9459 655.814
18.2703 704.651
18.3784 746.512
18.5946 802.326
18.7027 865.116
18.7027 865.116
## v z
1.66276 947.331
2.00115 892.363
2.35544 854.784
2.61341 799.676
2.95172 751.652
3.19357 699.989
3.46747 658.798
3.74155 600.246
3.99944 552.082
4.25741 496.975
4.56363 441.951
4.6 49.6528
4.80535 400.704
4.8567 112.598
4.96882 157.932
4.99894 348.956
5.0488 199.737
5.08 290.069
5.08041 251.876

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
(cd precursor && ./Allclean)
(cd successor && ./Allclean)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
(cd precursor && foamRunTutorials)
(cd successor && foamRunTutorials)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
bottom
{
type atmTurbulentHeatFluxTemperature;
heatSource flux;
alphaEff alphaEff;
Cp0 1005.0;
q uniform 0.0001;
value uniform 300;
}
top
{
type fixedValue;
value uniform 300;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (17.5 0.0 0.0);
boundaryField
{
bottom
{
type fixedValue;
value uniform (0 0 0);
}
top
{
type slip;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0.0;
boundaryField
{
bottom
{
type atmAlphatkWallFunction;
Cmu 0.09;
kappa 0.40;
Pr 0.90;
z0 uniform 0.30;
Prt uniform 0.74;
value uniform 0.30;
}
top
{
type calculated;
value uniform 0;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.1;
boundaryField
{
bottom
{
type atmEpsilonWallFunction;
kappa 0.40;
Cmu 0.09;
z0 uniform 0.3;
value uniform 0.3;
}
top
{
type slip;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1.285;
boundaryField
{
bottom
{
type kqRWallFunction;
value $internalField;
}
top
{
type slip;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object leafAreaDensity;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 -1 0 0 0 0 0];
internalField uniform 0.0;
boundaryField
{
"bottom|top"
{
type fixedValue;
value uniform 0;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0.0;
boundaryField
{
bottom
{
type atmNutkWallFunction;
kappa 0.40;
Cmu 0.09;
z0 uniform 0.3;
value uniform 0.3;
}
top
{
type calculated;
value uniform 0;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 -1 0 0 0 0];
internalField uniform 0.07782;
boundaryField
{
bottom
{
type atmOmegaWallFunction;
kappa 0.40;
Cmu 0.09;
z0 uniform 0.3;
value uniform 0.3;
}
top
{
type slip;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.0;
boundaryField
{
"bottom|top"
{
type fixedFluxPressure;
rho rhok;
value uniform 0;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object plantCd;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0.0;
boundaryField
{
"bottom|top"
{
type fixedValue;
value uniform 0;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object qPlant;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform Q_PLANT;
boundaryField
{
"bottom|top"
{
type fixedValue;
value uniform 0;
}
"inlet|outlet|left|right"
{
type cyclic;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,13 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
rm -f constant/fvOptions
rm -f constant/turbulenceProperties
rm -rf system/atm-Koblitz-2013
rm -rf plots
#------------------------------------------------------------------------------

View File

@ -0,0 +1,34 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
./Allrun.pre
# Settings
RASmodel="kEpsilon" # "kOmegaSST"
stability="neutral"
Lmax="41.8"
qPlant="0.0"
echo " # Computations for the atmopsheric stability = $stability:"
echo " ## Lmax = $Lmax [m], qPlant = $qPlant [-]"
#------------------------------------------------------------------------------
sed -e "s|RAS_MODEL|$RASmodel|g" constant/turbulenceProperties.temp > \
constant/turbulenceProperties
sed -e "s|L_MAX|$Lmax|g" constant/fvOptions.temp > constant/fvOptions
sed -e "s|Q_PLANT|$qPlant|g" 0.orig/qPlant.temp > 0/qPlant
runApplication renumberMesh -overwrite
runApplication $(getApplication)
# Scale up all the dimensions of the precursor computational domain
# to encapsulate the successor domain, so that mapFields can be used
runApplication transformPoints -scale '(10 10 1)' -translate '(0 0 20)'
#------------------------------------------------------------------------------

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
#------------------------------------------------------------------------------

View File

@ -0,0 +1,110 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
pressureGradient
{
type vectorSemiImplicitSource;
volumeMode specific;
selectionMode all;
injectionRateSuSp
{
U ((0 1.978046e-03 0) 0);
}
}
atmCoriolisUSource1
{
type atmCoriolisUSource;
atmCoriolisUSourceCoeffs
{
selectionMode all;
Omega (0 0 5.65156e-05);
}
}
atmAmbientTurbSource1
{
type atmAmbientTurbSource;
atmAmbientTurbSourceCoeffs
{
selectionMode all;
kAmb 0.001;
epsilonAmb 7.208e-08;
}
}
atmBuoyancyTurbSource1
{
type atmBuoyancyTurbSource;
atmBuoyancyTurbSourceCoeffs
{
selectionMode all;
rho rho;
Lmax L_MAX;
n 3.0;
beta 3.3e-03;
}
}
atmLengthScaleTurbSource1
{
type atmLengthScaleTurbSource;
atmLengthScaleTurbSourceCoeffs
{
selectionMode all;
Lmax L_MAX;
n 3.0;
}
}
atmPlantCanopyUSource1
{
type atmPlantCanopyUSource;
atmPlantCanopyUSourceCoeffs
{
selectionMode all;
}
}
atmPlantCanopyTSource1
{
type atmPlantCanopyTSource;
atmPlantCanopyTSourceCoeffs
{
selectionMode all;
}
}
atmPlantCanopyTurbSource1
{
type atmPlantCanopyTurbSource;
atmPlantCanopyTurbSourceCoeffs
{
selectionMode all;
rho rho;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 0 -9.81);
// ************************************************************************* //

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu 1.5e-05;
// Thermal expansion coefficient
beta 3e-03;
// Reference temperature
TRef 300;
// Laminar Prandtl number
Pr 0.9;
// Turbulent Prandtl number
Prt 0.74;
// ************************************************************************* //

View File

@ -0,0 +1,38 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel RAS_MODEL;
turbulence on;
printCoeffs on;
RAS_MODELCoeffs
{
Cmu 0.09;
betaStar 0.09;
sigmaEps 1.30;
sigmaK 1;
C1 1.44;
C2 1.92;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,110 @@
#!/bin/bash
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
# Benchmark dataset:
# Lettau, H. (1950).
# A re-examination of the "Leipzig wind profile" considering some
# relations between wind and turbulence in the frictional layer.
# Tellus, 2(2), 125-129.
# DOI:10.3402/tellusa.v2i2.8534
#
# Koblitz, T. (2013).
# CFD Modeling of Non-Neutral Atmospheric Boundary Layer Conditions.
# DTU Wind Energy. DTU Wind Energy PhD, No. 0019(EN).
# Figure 4.1
#------------------------------------------------------------------------------
plotU() {
sample=$1
echo " Plotting the ground-normal streamwise flow speed profile."
outName="plots/u-z.png"
gnuplot<<PLT_U
set terminal pngcairo font "helvetica,20" size 600, 1000
set xrange [0:25]
set yrange [0:3000]
set grid
set key left top
set key samplen 2
set key spacing 0.75
set xlabel "u [m/s]"
set ylabel "z [m]"
set offset .05, .05
set output "$outName"
bench="system/atm-Koblitz-2013/u-z-Leipzig.dat"
sample="$sample"
plot \
bench every ::0::16 u 1:2 t "Leipzig" w p ps 2 pt 6 lc rgb "#000000", \
sample u 2:1 t "Neutral" w l lw 2 lc rgb "#D55E00"
PLT_U
}
plotV() {
sample=$1
echo " Plotting the ground-normal spanwise flow speed profile."
outName="plots/v-z.png"
gnuplot<<PLT_V
set terminal pngcairo font "helvetica,20" size 600, 1000
set xrange [-1:6]
set yrange [0:3000]
set grid
set key right top
set key samplen 2
set key spacing 0.75
set xlabel "v [m/s]"
set ylabel "z [m]"
set offset .2, .05
set output "$outName"
bench="system/atm-Koblitz-2013/u-z-Leipzig.dat"
sample="$sample"
plot \
bench every ::17::35 u 1:2 t "Leipzig" w p ps 2 pt 6 lc rgb "#000000", \
sample u 3:1 t "Neutral" w l lw 2 lc rgb "#D55E00"
PLT_V
}
#------------------------------------------------------------------------------
# Requires gnuplot
command -v gnuplot >/dev/null || {
echo "gnuplot not found - skipping graph creation" 1>&2
exit 1
}
# Requires awk
command -v awk >/dev/null || {
echo "awk not found - skipping graph creation" 1>&2
exit 1
}
# The latestTime in postProcessing/samples
timeDir=$(foamListTimes -case postProcessing/samples -latestTime 2>/dev/null)
[ -n "$timeDir" ] || {
echo "No results found in postProcessing - skipping graph creation" 1>&2
exit 1
}
timeDir="postProcessing/samples/$timeDir"
# Settings
sample="$timeDir/lineZ1_U.xy"
stability="neutral"
# Postprocessing
mkdir -p plots
cp -rf $FOAM_TUTORIALS/resources/dataset/atm-Koblitz-2013 system/.
plotU $sample
plotV $sample
#------------------------------------------------------------------------------

View File

@ -0,0 +1,101 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(-1000 -1000 0)
( 1000 -1000 0)
( 1000 1000 0)
(-1000 1000 0)
(-1000 -1000 6000)
( 1000 -1000 6000)
( 1000 1000 6000)
(-1000 1000 6000)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (2 2 160) simpleGrading (1 1 80)
);
edges
(
);
boundary
(
top
{
type patch;
faces
(
(4 5 6 7)
);
}
bottom
{
type wall;
faces
(
(0 1 2 3)
);
}
inlet
{
type cyclic;
neighbourPatch outlet;
faces
(
(0 4 7 3)
);
}
outlet
{
type cyclic;
neighbourPatch inlet;
faces
(
(1 2 6 5)
);
}
left
{
type cyclic;
neighbourPatch right;
faces
(
(0 4 5 1)
);
}
right
{
type cyclic;
neighbourPatch left;
faces
(
(3 7 6 2)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application buoyantBoussinesqSimpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 150000;
deltaT 1;
writeControl timeStep;
writeInterval 50000;
purgeWrite 0;
writeFormat ascii;
writePrecision 16;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable false;
functions
{
#includeFunc "samples"
}
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
grad(U) cellMDLimited Gauss linear 1;
}
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;
div((nuEff*dev(T(grad(U))))) Gauss linear;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear uncorrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default uncorrected;
}
fluxRequired
{
default no;
p_rgh;
p_rghPotential;
}
wallDist
{
method meshWave;
}
// ************************************************************************* //

View File

@ -0,0 +1,76 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-15;
relTol 0.1;
maxIter 10;
}
"(U|k|epsilon|omega)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-12;
relTol 0.1;
}
T
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-15;
relTol 0.1;
maxIter 10;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
relaxationFactors
{
fields
{
p_rgh 0.15;
}
equations
{
U 0.1;
k 0.3;
omega 0.3;
epsilon 0.3;
T 0.015;
}
}
cache
{
grad(U);
grad(T);
}
// ************************************************************************* //

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*/
type sets;
libs (sampling);
interpolationScheme cellPoint;
setFormat raw;
writeControl writeTime;
fields (U);
sets
(
lineZ1
{
type midPoint;
axis z;
start (0 0 0);
end (0 0 6001);
nPoints 200;
}
);
// *********************************************************************** //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300.0;
boundaryField
{
"p[0-9]+"
{
type freestream;
freestreamBC
{
type timeVaryingMappedFixedValue;
offset 0;
setAverage off;
mapMethod nearest;
value $internalField;
}
value $internalField;
}
terrain
{
type atmTurbulentHeatFluxTemperature;
heatSource flux;
alphaEff alphaEff;
Cp0 1005.0;
q uniform 0;
value uniform 300;
}
top
{
type slip;
}
"upperInterface|lowerInterface"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 15 0);
boundaryField
{
"p[0-9]+"
{
type freestream;
freestreamBC
{
type timeVaryingMappedFixedValue;
offset (0 0 0);
setAverage off;
mapMethod nearest;
value $internalField;
}
value $internalField;
}
terrain
{
type fixedValue;
value uniform (0 0 0);
}
top
{
type slip;
}
"upperInterface|lowerInterface"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,61 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0.1;
boundaryField
{
"p[0-9]+"
{
type freestream;
freestreamBC
{
type timeVaryingMappedFixedValue;
offset 0;
setAverage off;
mapMethod nearest;
value $internalField;
}
value $internalField;
}
terrain
{
type atmAlphatkWallFunction;
kappa 0.4;
Cmu 0.09;
Pr 0.9;
Prt uniform 0.74;
z0 uniform 0.05;
value uniform 0.0;
}
top
{
type slip;
}
"upperInterface|lowerInterface"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.01;
boundaryField
{
"p[0-9]+"
{
type freestream;
freestreamBC
{
type timeVaryingMappedFixedValue;
offset 0;
setAverage off;
mapMethod nearest;
value $internalField;
}
value $internalField;
}
terrain
{
type atmEpsilonWallFunction;
kappa 0.4;
Cmu 0.09;
z0 uniform 0.05;
value uniform 0.0;
}
top
{
type slip;
}
"upperInterface|lowerInterface"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.3;
boundaryField
{
"p[0-9]+"
{
type freestream;
freestreamBC
{
type timeVaryingMappedFixedValue;
offset 0;
setAverage off;
mapMethod nearest;
value $internalField;
}
value $internalField;
}
terrain
{
type kqRWallFunction;
value uniform 0.1;
}
top
{
type slip;
}
"upperInterface|lowerInterface"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 1.1;
boundaryField
{
"p[0-9]+"
{
type freestream;
freestreamBC
{
type timeVaryingMappedFixedValue;
offset 0;
setAverage off;
mapMethod nearest;
value $internalField;
}
value $internalField;
}
terrain
{
type atmNutkWallFunction;
Cmu 0.09;
kappa 0.4;
z0 uniform 0.05;
value uniform 0.0;
}
top
{
type slip;
}
"upperInterface|lowerInterface"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 -1 0 0 0 0];
internalField uniform 0.003;
boundaryField
{
"p[0-9]+"
{
type fixedValue;
value $internalField;
}
terrain
{
type atmOmegaWallFunction;
kappa 0.4;
Cmu 0.09;
z0 uniform 0.05;
value uniform 0.0;
}
top
{
type slip;
}
"upperInterface|lowerInterface"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 10.1233;
boundaryField
{
"p[0-9]+"
{
type zeroGradient;
}
terrain
{
type fixedFluxPressure;
rho rhok;
value uniform 0;
}
top
{
type fixedValue;
value uniform 10.123;
}
"upperInterface|lowerInterface"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
rm -rf constant/polyMesh
rm -r constant/turbulenceProperties
#------------------------------------------------------------------------------

View File

@ -0,0 +1,25 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
RASModel="kEpsilon" # "kOmegaSST"
sed -e "s|RAS_MODEL|$RASModel|g" constant/turbulenceProperties.temp > \
constant/turbulenceProperties
restore0Dir
cp -rf constant/polyMesh.orig constant/polyMesh
runApplication mapFields ../precursor -sourceTime latestTime
runApplication decomposePar -force
runParallel renumberMesh -overwrite
runParallel $(getApplication)
runParallel redistributePar -reconstruct -latestTime
#------------------------------------------------------------------------------

View File

@ -0,0 +1,162 @@
(
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
)

View File

@ -0,0 +1,162 @@
(
(4.52435 1.83107 0)
(6.03706 2.43191 0)
(6.83083 2.74192 0)
(7.37136 2.94964 0)
(7.78141 3.10475 0)
(8.11312 3.22826 0)
(8.39301 3.33085 0)
(8.63628 3.4186 0)
(8.8524 3.49532 0)
(9.04767 3.56351 0)
(9.22648 3.62491 0)
(9.392 3.68078 0)
(9.54661 3.73206 0)
(9.69214 3.77948 0)
(9.83003 3.82357 0)
(9.96142 3.8648 0)
(10.0873 3.90351 0)
(10.2083 3.94 0)
(10.3252 3.97451 0)
(10.4386 4.00724 0)
(10.5488 4.03835 0)
(10.6564 4.068 0)
(10.7616 4.0963 0)
(10.8648 4.12335 0)
(10.9662 4.14924 0)
(11.0662 4.17405 0)
(11.1649 4.19784 0)
(11.2626 4.22066 0)
(11.3595 4.24255 0)
(11.4557 4.26355 0)
(11.5513 4.2837 0)
(11.6467 4.30302 0)
(11.7418 4.32151 0)
(11.8368 4.3392 0)
(11.9319 4.35609 0)
(12.0272 4.37218 0)
(12.1228 4.38746 0)
(12.2188 4.40193 0)
(12.3152 4.41558 0)
(12.4123 4.42838 0)
(12.5101 4.44031 0)
(12.6087 4.45134 0)
(12.7082 4.46144 0)
(12.8086 4.47057 0)
(12.91 4.47869 0)
(13.0126 4.48575 0)
(13.1163 4.49169 0)
(13.2213 4.49647 0)
(13.3276 4.50001 0)
(13.4353 4.50225 0)
(13.5444 4.50311 0)
(13.6549 4.50251 0)
(13.7669 4.50037 0)
(13.8805 4.4966 0)
(13.9956 4.4911 0)
(14.1122 4.48377 0)
(14.2305 4.47449 0)
(14.3503 4.46317 0)
(14.4717 4.44967 0)
(14.5946 4.43388 0)
(14.7191 4.41566 0)
(14.845 4.39489 0)
(14.9724 4.37141 0)
(15.1012 4.3451 0)
(15.2313 4.3158 0)
(15.3625 4.28335 0)
(15.4949 4.24762 0)
(15.6282 4.20843 0)
(15.7624 4.16564 0)
(15.8973 4.11909 0)
(16.0327 4.06862 0)
(16.1685 4.01406 0)
(16.3043 3.95528 0)
(16.44 3.89212 0)
(16.5753 3.82443 0)
(16.71 3.75209 0)
(16.8437 3.67497 0)
(16.9761 3.59296 0)
(17.1069 3.50595 0)
(17.2356 3.41388 0)
(17.3619 3.31668 0)
(17.4854 3.21431 0)
(17.6055 3.10677 0)
(17.7218 2.99409 0)
(17.8339 2.87633 0)
(17.9411 2.75359 0)
(18.043 2.62601 0)
(18.139 2.49381 0)
(18.2284 2.35724 0)
(18.3108 2.21661 0)
(18.3855 2.07232 0)
(18.452 1.92482 0)
(18.5097 1.77465 0)
(18.558 1.62244 0)
(18.5964 1.46889 0)
(18.6245 1.31482 0)
(18.6419 1.16112 0)
(18.6482 1.00879 0)
(18.6431 0.8589 0)
(18.6266 0.712641 0)
(18.5988 0.571266 0)
(18.5596 0.4361 0)
(18.5097 0.30852 0)
(18.4495 0.18993 0)
(18.3798 0.0817321 0)
(18.3018 -0.0147184 0)
(18.2168 -0.0981569 0)
(18.1265 -0.167471 0)
(18.0327 -0.221768 0)
(17.9378 -0.260457 0)
(17.8441 -0.283331 0)
(17.7543 -0.290663 0)
(17.6711 -0.283294 0)
(17.5971 -0.262707 0)
(17.5347 -0.231079 0)
(17.4858 -0.191279 0)
(17.4518 -0.1468 0)
(17.4329 -0.101608 0)
(17.428 -0.0597934 0)
(17.4349 -0.0250814 0)
(17.4499 -0.000264539 0)
(17.4682 0.0134608 0)
(17.4852 0.0170441 0)
(17.4973 0.0135469 0)
(17.5029 0.00727646 0)
(17.5035 0.00206725 0)
(17.5019 -0.000381603 0)
(17.5004 -0.000674178 0)
(17.4999 -0.000295595 0)
(17.4999 -5.20291e-05 0)
(17.5 1.33941e-05 0)
(17.5 1.51722e-05 0)
(17.5 7.51173e-06 0)
(17.5 2.51989e-06 0)
(17.5 3.61749e-07 0)
(17.5 -3.18029e-07 0)
(17.5 -4.04468e-07 0)
(17.5 -3.09993e-07 0)
(17.5 -1.93692e-07 0)
(17.5 -1.03497e-07 0)
(17.5 -4.52793e-08 0)
(17.5 -1.2233e-08 0)
(17.5 4.10342e-09 0)
(17.5 1.05032e-08 0)
(17.5 1.15745e-08 0)
(17.5 1.01607e-08 0)
(17.5 7.87791e-09 0)
(17.5 5.56261e-09 0)
(17.5 3.58816e-09 0)
(17.5 2.07136e-09 0)
(17.5 9.9897e-10 0)
(17.5 3.01192e-10 0)
(17.5 -1.08103e-10 0)
(17.5 -3.11229e-10 0)
(17.5 -3.78061e-10 0)
(17.5 -3.63713e-10 0)
(17.5 -3.09393e-10 0)
(17.5 -2.44614e-10 0)
(17.5 -1.89729e-10 0)
(17.5 -1.89729e-10 0)
);

View File

@ -0,0 +1,162 @@
(
0.37728
1.0511
1.73406
2.4586
3.2082
3.97473
4.75373
5.54234
6.33847
7.1404
7.94657
8.75553
9.56582
10.376
11.1845
11.9899
12.7905
13.5848
14.3712
15.148
15.9135
16.666
17.4039
18.1256
18.8294
19.5137
20.1772
20.8182
21.4355
22.0278
22.5939
23.1328
23.6435
24.1252
24.5773
24.9993
25.3906
25.7511
26.0806
26.3791
26.6468
26.8838
27.0906
27.2676
27.4154
27.5346
27.6259
27.6902
27.7282
27.7409
27.7293
27.6941
27.6365
27.5573
27.4576
27.3382
27.2001
27.0442
26.8714
26.6825
26.4783
26.2596
26.027
25.7813
25.523
25.2528
24.9711
24.6784
24.3753
24.062
23.739
23.4065
23.0649
22.7145
22.3554
21.9879
21.6122
21.2285
20.8368
20.4375
20.0305
19.6162
19.1945
18.7657
18.33
17.8873
17.438
16.9823
16.5202
16.0521
15.5782
15.0988
14.614
14.1244
13.6302
13.1318
12.6296
12.1243
11.6163
11.106
10.5941
10.0815
9.56867
9.05652
8.54589
8.03769
7.53293
7.03269
6.53813
6.0506
5.57183
5.10244
4.64453
4.19963
3.76937
3.35542
2.95998
2.58833
2.23764
1.91249
1.6148
1.35072
1.11631
0.915143
0.751801
0.617928
0.514905
0.432977
0.369164
0.318554
0.279014
0.249576
0.229701
0.2179
0.210806
0.20414
0.195226
0.184371
0.173787
0.165496
0.160178
0.15736
0.156122
0.155598
0.155137
0.154298
0.152789
0.150409
0.147023
0.14255
0.136962
0.1303
0.122695
0.114392
0.105769
0.0973623
0.0898635
0.0840057
0.080232
0.080232
)

View File

@ -0,0 +1,162 @@
(
0.620359
0.247943
0.140451
0.0951249
0.0709174
0.0560511
0.0460572
0.0389042
0.0335448
0.0293876
0.0260742
0.0233751
0.0211371
0.0192537
0.0176487
0.0162664
0.0150648
0.014012
0.0130829
0.0122579
0.0115212
0.0108601
0.0102641
0.00972454
0.00923429
0.00878724
0.00837825
0.00800293
0.0076575
0.00733871
0.00704372
0.00677003
0.00651548
0.00627812
0.00605626
0.00584837
0.00565309
0.00546919
0.00529558
0.00513127
0.00497534
0.00482699
0.00468547
0.00455011
0.00442029
0.00429545
0.00417508
0.00405871
0.00394591
0.0038363
0.00372953
0.00362529
0.00352328
0.00342325
0.00332497
0.00322824
0.00313289
0.00303876
0.00294572
0.00285366
0.0027625
0.00267216
0.00258259
0.00249376
0.00240564
0.00231823
0.00223154
0.00214558
0.00206039
0.00197601
0.00189249
0.00180989
0.00172826
0.0016477
0.00156826
0.00149004
0.00141312
0.00133759
0.00126353
0.00119104
0.00112021
0.00105112
0.00098388
0.000918562
0.000855254
0.000794035
0.000734982
0.000678164
0.000623647
0.000571488
0.000521736
0.000474435
0.000429618
0.000387307
0.000347516
0.000310249
0.000275497
0.000243238
0.00021344
0.000186098
0.00016112
0.000138445
0.000117997
9.96906e-05
8.34285e-05
6.91037e-05
5.66008e-05
4.57964e-05
3.65611e-05
2.87601e-05
2.22542e-05
1.69267e-05
1.262e-05
9.20303e-06
6.54726e-06
4.52986e-06
3.035e-06
1.95478e-06
1.22152e-06
7.29443e-07
4.13869e-07
2.20518e-07
1.13128e-07
5.47647e-08
2.48882e-08
1.12034e-08
4.93172e-09
2.21804e-09
1.01736e-09
4.81813e-10
2.36159e-10
1.20481e-10
6.47874e-11
3.74792e-11
2.38347e-11
1.68667e-11
1.32394e-11
1.13448e-11
1.03818e-11
9.9284e-12
9.75005e-12
9.71149e-12
9.73318e-12
9.7667e-12
9.78056e-12
9.75241e-12
9.66506e-12
9.50495e-12
9.26236e-12
8.93233e-12
8.51622e-12
8.02303e-12
7.47011e-12
6.88269e-12
6.29181e-12
5.73203e-12
5.24111e-12
4.86067e-12
4.62448e-12
4.62448e-12
)

View File

@ -0,0 +1,162 @@
(
1.38723
1.46384
1.41511
1.38671
1.36773
1.35344
1.34172
1.33149
1.32221
1.31352
1.30524
1.29722
1.28937
1.28164
1.27397
1.26633
1.2587
1.25104
1.24335
1.2356
1.22779
1.21991
1.21193
1.20386
1.19568
1.18738
1.17897
1.17042
1.16173
1.15289
1.14391
1.13476
1.12544
1.11595
1.10628
1.09642
1.08636
1.0761
1.06564
1.05496
1.04407
1.03295
1.0216
1.01002
0.998198
0.986138
0.973834
0.961282
0.948482
0.93543
0.922127
0.908572
0.894765
0.880708
0.866402
0.851849
0.837052
0.822015
0.806743
0.791242
0.775516
0.759573
0.74342
0.727066
0.710519
0.693789
0.676886
0.65982
0.642605
0.625252
0.607774
0.590185
0.5725
0.554734
0.536902
0.519022
0.501111
0.483186
0.465267
0.447374
0.429526
0.411745
0.394053
0.376471
0.359023
0.341733
0.324625
0.307723
0.291053
0.27464
0.258511
0.242691
0.227206
0.212083
0.197348
0.183025
0.169141
0.155718
0.14278
0.13036
0.118468
0.107126
0.0963509
0.0861593
0.076565
0.0675789
0.059209
0.0514601
0.0443334
0.0378259
0.0319301
0.0266483
0.0219531
0.0178265
0.0142449
0.0111792
0.00859444
0.0064499
0.00474067
0.0033868
0.00234415
0.00156495
0.00101899
0.000641932
0.000392231
0.000238582
0.000144496
8.8861e-05
5.55702e-05
3.55243e-05
2.3276e-05
1.57237e-05
1.10617e-05
8.19442e-06
6.42747e-06
5.32075e-06
4.60996e-06
4.14705e-06
3.85157e-06
3.67559e-06
3.58342e-06
3.54473e-06
3.53471e-06
3.53483e-06
3.5321e-06
3.51747e-06
3.48451e-06
3.42851e-06
3.34617e-06
3.23564e-06
3.09682e-06
2.9318e-06
2.74518e-06
2.54431e-06
2.33916e-06
2.14212e-06
1.96787e-06
1.8323e-06
1.74662e-06
1.74662e-06
)

View File

@ -0,0 +1,162 @@
(
0.279187
0.777814
1.2832
1.81936
2.37406
2.9413
3.51776
4.10133
4.69047
5.28389
5.88046
6.47909
7.0787
7.67822
8.27653
8.8725
9.46498
10.0528
10.6347
11.2095
11.7759
12.3328
12.8789
13.4129
13.9337
14.4402
14.9311
15.4055
15.8622
16.3005
16.7195
17.1182
17.4962
17.8526
18.1872
18.4994
18.789
19.0558
19.2996
19.5205
19.7186
19.894
20.047
20.178
20.2874
20.3756
20.4431
20.4907
20.5189
20.5283
20.5196
20.4936
20.451
20.3924
20.3186
20.2302
20.1281
20.0127
19.8848
19.7451
19.5939
19.4321
19.26
19.0781
18.887
18.687
18.4786
18.262
18.0377
17.8059
17.5668
17.3208
17.068
16.8087
16.543
16.271
15.993
15.709
15.4192
15.1237
14.8226
14.516
14.204
13.8866
13.5642
13.2366
12.9042
12.5669
12.225
11.8786
11.5279
11.1731
10.8144
10.452
10.0863
9.71749
9.34591
8.97195
8.59607
8.21842
7.83967
7.46029
7.08081
6.70182
6.32395
5.94789
5.57437
5.20419
4.83822
4.47744
4.12315
3.7758
3.43695
3.10772
2.78933
2.48301
2.19038
1.91536
1.65585
1.41524
1.19495
0.999533
0.826067
0.677205
0.556332
0.457266
0.381029
0.320403
0.273181
0.23573
0.20647
0.184686
0.169978
0.161246
0.155996
0.151063
0.144467
0.136434
0.128602
0.122467
0.118531
0.116446
0.11553
0.115142
0.114801
0.11418
0.113063
0.111302
0.108797
0.105487
0.101351
0.0964214
0.0907942
0.0846495
0.0782684
0.0720478
0.0664987
0.0621639
0.0593714
0.0593714
)

View File

@ -0,0 +1,162 @@
(
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
(10.1233)
)

View File

@ -0,0 +1,162 @@
(
( 0.00000E+00 0.00000E+00 2.10319E+01 )
( 0.00000E+00 0.00000E+00 2.31246E+01 )
( 0.00000E+00 0.00000E+00 2.52758E+01 )
( 0.00000E+00 0.00000E+00 2.74871E+01 )
( 0.00000E+00 0.00000E+00 2.97602E+01 )
( 0.00000E+00 0.00000E+00 3.20968E+01 )
( 0.00000E+00 0.00000E+00 3.44987E+01 )
( 0.00000E+00 0.00000E+00 3.69677E+01 )
( 0.00000E+00 0.00000E+00 3.95057E+01 )
( 0.00000E+00 0.00000E+00 4.21146E+01 )
( 0.00000E+00 0.00000E+00 4.47964E+01 )
( 0.00000E+00 0.00000E+00 4.75532E+01 )
( 0.00000E+00 0.00000E+00 5.03870E+01 )
( 0.00000E+00 0.00000E+00 5.33000E+01 )
( 0.00000E+00 0.00000E+00 5.62943E+01 )
( 0.00000E+00 0.00000E+00 5.93724E+01 )
( 0.00000E+00 0.00000E+00 6.25364E+01 )
( 0.00000E+00 0.00000E+00 6.57889E+01 )
( 0.00000E+00 0.00000E+00 6.91323E+01 )
( 0.00000E+00 0.00000E+00 7.25690E+01 )
( 0.00000E+00 0.00000E+00 7.61019E+01 )
( 0.00000E+00 0.00000E+00 7.97334E+01 )
( 0.00000E+00 0.00000E+00 8.34664E+01 )
( 0.00000E+00 0.00000E+00 8.73037E+01 )
( 0.00000E+00 0.00000E+00 9.12483E+01 )
( 0.00000E+00 0.00000E+00 9.53030E+01 )
( 0.00000E+00 0.00000E+00 9.94711E+01 )
( 0.00000E+00 0.00000E+00 1.03756E+02 )
( 0.00000E+00 0.00000E+00 1.08160E+02 )
( 0.00000E+00 0.00000E+00 1.12687E+02 )
( 0.00000E+00 0.00000E+00 1.17341E+02 )
( 0.00000E+00 0.00000E+00 1.22125E+02 )
( 0.00000E+00 0.00000E+00 1.27043E+02 )
( 0.00000E+00 0.00000E+00 1.32098E+02 )
( 0.00000E+00 0.00000E+00 1.37294E+02 )
( 0.00000E+00 0.00000E+00 1.42635E+02 )
( 0.00000E+00 0.00000E+00 1.48126E+02 )
( 0.00000E+00 0.00000E+00 1.53770E+02 )
( 0.00000E+00 0.00000E+00 1.59572E+02 )
( 0.00000E+00 0.00000E+00 1.65536E+02 )
( 0.00000E+00 0.00000E+00 1.71666E+02 )
( 0.00000E+00 0.00000E+00 1.77968E+02 )
( 0.00000E+00 0.00000E+00 1.84446E+02 )
( 0.00000E+00 0.00000E+00 1.91105E+02 )
( 0.00000E+00 0.00000E+00 1.97950E+02 )
( 0.00000E+00 0.00000E+00 2.04987E+02 )
( 0.00000E+00 0.00000E+00 2.12220E+02 )
( 0.00000E+00 0.00000E+00 2.19655E+02 )
( 0.00000E+00 0.00000E+00 2.27298E+02 )
( 0.00000E+00 0.00000E+00 2.35154E+02 )
( 0.00000E+00 0.00000E+00 2.43230E+02 )
( 0.00000E+00 0.00000E+00 2.51532E+02 )
( 0.00000E+00 0.00000E+00 2.60065E+02 )
( 0.00000E+00 0.00000E+00 2.68837E+02 )
( 0.00000E+00 0.00000E+00 2.77855E+02 )
( 0.00000E+00 0.00000E+00 2.87124E+02 )
( 0.00000E+00 0.00000E+00 2.96652E+02 )
( 0.00000E+00 0.00000E+00 3.06446E+02 )
( 0.00000E+00 0.00000E+00 3.16514E+02 )
( 0.00000E+00 0.00000E+00 3.26864E+02 )
( 0.00000E+00 0.00000E+00 3.37503E+02 )
( 0.00000E+00 0.00000E+00 3.48438E+02 )
( 0.00000E+00 0.00000E+00 3.59680E+02 )
( 0.00000E+00 0.00000E+00 3.71236E+02 )
( 0.00000E+00 0.00000E+00 3.83114E+02 )
( 0.00000E+00 0.00000E+00 3.95325E+02 )
( 0.00000E+00 0.00000E+00 4.07876E+02 )
( 0.00000E+00 0.00000E+00 4.20779E+02 )
( 0.00000E+00 0.00000E+00 4.34041E+02 )
( 0.00000E+00 0.00000E+00 4.47675E+02 )
( 0.00000E+00 0.00000E+00 4.61689E+02 )
( 0.00000E+00 0.00000E+00 4.76096E+02 )
( 0.00000E+00 0.00000E+00 4.90904E+02 )
( 0.00000E+00 0.00000E+00 5.06127E+02 )
( 0.00000E+00 0.00000E+00 5.21774E+02 )
( 0.00000E+00 0.00000E+00 5.37859E+02 )
( 0.00000E+00 0.00000E+00 5.54394E+02 )
( 0.00000E+00 0.00000E+00 5.71390E+02 )
( 0.00000E+00 0.00000E+00 5.88862E+02 )
( 0.00000E+00 0.00000E+00 6.06822E+02 )
( 0.00000E+00 0.00000E+00 6.25283E+02 )
( 0.00000E+00 0.00000E+00 6.44261E+02 )
( 0.00000E+00 0.00000E+00 6.63768E+02 )
( 0.00000E+00 0.00000E+00 6.83821E+02 )
( 0.00000E+00 0.00000E+00 7.04434E+02 )
( 0.00000E+00 0.00000E+00 7.25623E+02 )
( 0.00000E+00 0.00000E+00 7.47405E+02 )
( 0.00000E+00 0.00000E+00 7.69795E+02 )
( 0.00000E+00 0.00000E+00 7.92810E+02 )
( 0.00000E+00 0.00000E+00 8.16469E+02 )
( 0.00000E+00 0.00000E+00 8.40789E+02 )
( 0.00000E+00 0.00000E+00 8.65788E+02 )
( 0.00000E+00 0.00000E+00 8.91486E+02 )
( 0.00000E+00 0.00000E+00 9.17902E+02 )
( 0.00000E+00 0.00000E+00 9.45056E+02 )
( 0.00000E+00 0.00000E+00 9.72969E+02 )
( 0.00000E+00 0.00000E+00 1.00166E+03 )
( 0.00000E+00 0.00000E+00 1.03116E+03 )
( 0.00000E+00 0.00000E+00 1.06148E+03 )
( 0.00000E+00 0.00000E+00 1.09264E+03 )
( 0.00000E+00 0.00000E+00 1.12468E+03 )
( 0.00000E+00 0.00000E+00 1.15761E+03 )
( 0.00000E+00 0.00000E+00 1.19146E+03 )
( 0.00000E+00 0.00000E+00 1.22626E+03 )
( 0.00000E+00 0.00000E+00 1.26203E+03 )
( 0.00000E+00 0.00000E+00 1.29880E+03 )
( 0.00000E+00 0.00000E+00 1.33660E+03 )
( 0.00000E+00 0.00000E+00 1.37545E+03 )
( 0.00000E+00 0.00000E+00 1.41539E+03 )
( 0.00000E+00 0.00000E+00 1.45645E+03 )
( 0.00000E+00 0.00000E+00 1.49865E+03 )
( 0.00000E+00 0.00000E+00 1.54203E+03 )
( 0.00000E+00 0.00000E+00 1.58663E+03 )
( 0.00000E+00 0.00000E+00 1.63247E+03 )
( 0.00000E+00 0.00000E+00 1.67959E+03 )
( 0.00000E+00 0.00000E+00 1.72803E+03 )
( 0.00000E+00 0.00000E+00 1.77782E+03 )
( 0.00000E+00 0.00000E+00 1.82900E+03 )
( 0.00000E+00 0.00000E+00 1.88162E+03 )
( 0.00000E+00 0.00000E+00 1.93570E+03 )
( 0.00000E+00 0.00000E+00 1.99129E+03 )
( 0.00000E+00 0.00000E+00 2.04844E+03 )
( 0.00000E+00 0.00000E+00 2.10719E+03 )
( 0.00000E+00 0.00000E+00 2.16757E+03 )
( 0.00000E+00 0.00000E+00 2.22965E+03 )
( 0.00000E+00 0.00000E+00 2.29346E+03 )
( 0.00000E+00 0.00000E+00 2.35905E+03 )
( 0.00000E+00 0.00000E+00 2.42647E+03 )
( 0.00000E+00 0.00000E+00 2.49578E+03 )
( 0.00000E+00 0.00000E+00 2.56702E+03 )
( 0.00000E+00 0.00000E+00 2.64026E+03 )
( 0.00000E+00 0.00000E+00 2.71554E+03 )
( 0.00000E+00 0.00000E+00 2.79293E+03 )
( 0.00000E+00 0.00000E+00 2.87248E+03 )
( 0.00000E+00 0.00000E+00 2.95425E+03 )
( 0.00000E+00 0.00000E+00 3.03830E+03 )
( 0.00000E+00 0.00000E+00 3.12471E+03 )
( 0.00000E+00 0.00000E+00 3.21353E+03 )
( 0.00000E+00 0.00000E+00 3.30483E+03 )
( 0.00000E+00 0.00000E+00 3.39868E+03 )
( 0.00000E+00 0.00000E+00 3.49516E+03 )
( 0.00000E+00 0.00000E+00 3.59433E+03 )
( 0.00000E+00 0.00000E+00 3.69627E+03 )
( 0.00000E+00 0.00000E+00 3.80106E+03 )
( 0.00000E+00 0.00000E+00 3.90878E+03 )
( 0.00000E+00 0.00000E+00 4.01951E+03 )
( 0.00000E+00 0.00000E+00 4.13333E+03 )
( 0.00000E+00 0.00000E+00 4.25034E+03 )
( 0.00000E+00 0.00000E+00 4.37061E+03 )
( 0.00000E+00 0.00000E+00 4.49424E+03 )
( 0.00000E+00 0.00000E+00 4.62133E+03 )
( 0.00000E+00 0.00000E+00 4.75197E+03 )
( 0.00000E+00 0.00000E+00 4.88626E+03 )
( 0.00000E+00 0.00000E+00 5.02430E+03 )
( 0.00000E+00 0.00000E+00 5.16620E+03 )
( 0.00000E+00 0.00000E+00 5.31207E+03 )
( 0.00000E+00 0.00000E+00 5.46201E+03 )
( 0.00000E+00 0.00000E+00 5.61614E+03 )
( 0.00000E+00 0.00000E+00 5.77458E+03 )
( 0.00000E+00 0.00000E+00 5.93745E+03 )
)

View File

@ -0,0 +1,162 @@
(
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
)

View File

@ -0,0 +1,162 @@
(
(4.507730000e+00 1.799630000e+00 0.000000000e+00)
(6.062080000e+00 2.408310000e+00 0.000000000e+00)
(6.874000000e+00 2.720790000e+00 0.000000000e+00)
(7.429290000e+00 2.931000000e+00 0.000000000e+00)
(7.850950000e+00 3.088050000e+00 0.000000000e+00)
(8.192020000e+00 3.213060000e+00 0.000000000e+00)
(8.479620000e+00 3.316780000e+00 0.000000000e+00)
(8.729320000e+00 3.405380000e+00 0.000000000e+00)
(8.950880000e+00 3.482710000e+00 0.000000000e+00)
(9.150780000e+00 3.551330000e+00 0.000000000e+00)
(9.333530000e+00 3.613000000e+00 0.000000000e+00)
(9.502420000e+00 3.669000000e+00 0.000000000e+00)
(9.659920000e+00 3.720310000e+00 0.000000000e+00)
(9.807920000e+00 3.767640000e+00 0.000000000e+00)
(9.947900000e+00 3.811580000e+00 0.000000000e+00)
(1.008110000e+01 3.852570000e+00 0.000000000e+00)
(1.020840000e+01 3.890980000e+00 0.000000000e+00)
(1.033060000e+01 3.927110000e+00 0.000000000e+00)
(1.044850000e+01 3.961220000e+00 0.000000000e+00)
(1.056260000e+01 3.993490000e+00 0.000000000e+00)
(1.067340000e+01 4.024120000e+00 0.000000000e+00)
(1.078130000e+01 4.053240000e+00 0.000000000e+00)
(1.088680000e+01 4.080980000e+00 0.000000000e+00)
(1.099000000e+01 4.107450000e+00 0.000000000e+00)
(1.109130000e+01 4.132730000e+00 0.000000000e+00)
(1.119100000e+01 4.156910000e+00 0.000000000e+00)
(1.128940000e+01 4.180040000e+00 0.000000000e+00)
(1.138660000e+01 4.202190000e+00 0.000000000e+00)
(1.148280000e+01 4.223400000e+00 0.000000000e+00)
(1.157820000e+01 4.243710000e+00 0.000000000e+00)
(1.167300000e+01 4.263150000e+00 0.000000000e+00)
(1.176730000e+01 4.281750000e+00 0.000000000e+00)
(1.186130000e+01 4.299530000e+00 0.000000000e+00)
(1.195520000e+01 4.316490000e+00 0.000000000e+00)
(1.204900000e+01 4.332650000e+00 0.000000000e+00)
(1.214290000e+01 4.348010000e+00 0.000000000e+00)
(1.223700000e+01 4.362570000e+00 0.000000000e+00)
(1.233150000e+01 4.376320000e+00 0.000000000e+00)
(1.242630000e+01 4.389240000e+00 0.000000000e+00)
(1.252170000e+01 4.401330000e+00 0.000000000e+00)
(1.261770000e+01 4.412550000e+00 0.000000000e+00)
(1.271440000e+01 4.422890000e+00 0.000000000e+00)
(1.281200000e+01 4.432310000e+00 0.000000000e+00)
(1.291040000e+01 4.440780000e+00 0.000000000e+00)
(1.300980000e+01 4.448250000e+00 0.000000000e+00)
(1.311030000e+01 4.454680000e+00 0.000000000e+00)
(1.321190000e+01 4.460010000e+00 0.000000000e+00)
(1.331470000e+01 4.464200000e+00 0.000000000e+00)
(1.341880000e+01 4.467170000e+00 0.000000000e+00)
(1.352420000e+01 4.468870000e+00 0.000000000e+00)
(1.363100000e+01 4.469210000e+00 0.000000000e+00)
(1.373930000e+01 4.468120000e+00 0.000000000e+00)
(1.384900000e+01 4.465520000e+00 0.000000000e+00)
(1.396030000e+01 4.461310000e+00 0.000000000e+00)
(1.407310000e+01 4.455400000e+00 0.000000000e+00)
(1.418750000e+01 4.447680000e+00 0.000000000e+00)
(1.430360000e+01 4.438040000e+00 0.000000000e+00)
(1.442120000e+01 4.426380000e+00 0.000000000e+00)
(1.454040000e+01 4.412580000e+00 0.000000000e+00)
(1.466120000e+01 4.396500000e+00 0.000000000e+00)
(1.478350000e+01 4.378020000e+00 0.000000000e+00)
(1.490740000e+01 4.357000000e+00 0.000000000e+00)
(1.503270000e+01 4.333300000e+00 0.000000000e+00)
(1.515950000e+01 4.306790000e+00 0.000000000e+00)
(1.528760000e+01 4.277300000e+00 0.000000000e+00)
(1.541690000e+01 4.244690000e+00 0.000000000e+00)
(1.554740000e+01 4.208810000e+00 0.000000000e+00)
(1.567890000e+01 4.169490000e+00 0.000000000e+00)
(1.581130000e+01 4.126580000e+00 0.000000000e+00)
(1.594430000e+01 4.079920000e+00 0.000000000e+00)
(1.607800000e+01 4.029350000e+00 0.000000000e+00)
(1.621190000e+01 3.974710000e+00 0.000000000e+00)
(1.634610000e+01 3.915860000e+00 0.000000000e+00)
(1.648010000e+01 3.852630000e+00 0.000000000e+00)
(1.661370000e+01 3.784900000e+00 0.000000000e+00)
(1.674670000e+01 3.712520000e+00 0.000000000e+00)
(1.687880000e+01 3.635370000e+00 0.000000000e+00)
(1.700960000e+01 3.553330000e+00 0.000000000e+00)
(1.713870000e+01 3.466310000e+00 0.000000000e+00)
(1.726580000e+01 3.374220000e+00 0.000000000e+00)
(1.739060000e+01 3.277020000e+00 0.000000000e+00)
(1.751240000e+01 3.174660000e+00 0.000000000e+00)
(1.763090000e+01 3.067130000e+00 0.000000000e+00)
(1.774570000e+01 2.954470000e+00 0.000000000e+00)
(1.785610000e+01 2.836730000e+00 0.000000000e+00)
(1.796180000e+01 2.714020000e+00 0.000000000e+00)
(1.806200000e+01 2.586490000e+00 0.000000000e+00)
(1.815630000e+01 2.454340000e+00 0.000000000e+00)
(1.824410000e+01 2.317830000e+00 0.000000000e+00)
(1.832480000e+01 2.177280000e+00 0.000000000e+00)
(1.839770000e+01 2.033080000e+00 0.000000000e+00)
(1.846240000e+01 1.885690000e+00 0.000000000e+00)
(1.851830000e+01 1.735660000e+00 0.000000000e+00)
(1.856470000e+01 1.583630000e+00 0.000000000e+00)
(1.860120000e+01 1.430310000e+00 0.000000000e+00)
(1.862720000e+01 1.276520000e+00 0.000000000e+00)
(1.864250000e+01 1.123180000e+00 0.000000000e+00)
(1.864650000e+01 9.712870000e-01 0.000000000e+00)
(1.863920000e+01 8.219670000e-01 0.000000000e+00)
(1.862030000e+01 6.764190000e-01 0.000000000e+00)
(1.859000000e+01 5.359290000e-01 0.000000000e+00)
(1.854830000e+01 4.018570000e-01 0.000000000e+00)
(1.849570000e+01 2.756210000e-01 0.000000000e+00)
(1.843280000e+01 1.586670000e-01 0.000000000e+00)
(1.836050000e+01 5.244550000e-02 0.000000000e+00)
(1.827980000e+01 -4.163930000e-02 0.000000000e+00)
(1.819230000e+01 -1.222750000e-01 0.000000000e+00)
(1.809960000e+01 -1.883040000e-01 0.000000000e+00)
(1.800370000e+01 -2.388020000e-01 0.000000000e+00)
(1.790710000e+01 -2.731620000e-01 0.000000000e+00)
(1.781240000e+01 -2.911840000e-01 0.000000000e+00)
(1.772220000e+01 -2.931870000e-01 0.000000000e+00)
(1.763970000e+01 -2.801330000e-01 0.000000000e+00)
(1.756770000e+01 -2.537070000e-01 0.000000000e+00)
(1.750860000e+01 -2.163910000e-01 0.000000000e+00)
(1.746480000e+01 -1.715350000e-01 0.000000000e+00)
(1.743730000e+01 -1.233070000e-01 0.000000000e+00)
(1.742630000e+01 -7.643490000e-02 0.000000000e+00)
(1.742980000e+01 -3.576910000e-02 0.000000000e+00)
(1.744420000e+01 -5.522260000e-03 0.000000000e+00)
(1.746400000e+01 1.192280000e-02 0.000000000e+00)
(1.748300000e+01 1.709950000e-02 0.000000000e+00)
(1.749630000e+01 1.383620000e-02 0.000000000e+00)
(1.750230000e+01 7.646490000e-03 0.000000000e+00)
(1.750330000e+01 2.726320000e-03 0.000000000e+00)
(1.750220000e+01 2.556080000e-04 0.000000000e+00)
(1.750100000e+01 -5.044880000e-04 0.000000000e+00)
(1.750030000e+01 -5.174870000e-04 0.000000000e+00)
(1.750000000e+01 -3.421520000e-04 0.000000000e+00)
(1.749990000e+01 -1.818110000e-04 0.000000000e+00)
(1.749990000e+01 -7.710580000e-05 0.000000000e+00)
(1.749990000e+01 -1.986710000e-05 0.000000000e+00)
(1.750000000e+01 6.368990000e-06 0.000000000e+00)
(1.750000000e+01 1.515370000e-05 0.000000000e+00)
(1.750000000e+01 1.540260000e-05 0.000000000e+00)
(1.750000000e+01 1.228360000e-05 0.000000000e+00)
(1.750000000e+01 8.468680000e-06 0.000000000e+00)
(1.750000000e+01 5.140410000e-06 0.000000000e+00)
(1.750000000e+01 2.673290000e-06 0.000000000e+00)
(1.750000000e+01 1.052100000e-06 0.000000000e+00)
(1.750000000e+01 1.085860000e-07 0.000000000e+00)
(1.750000000e+01 -3.562950000e-07 0.000000000e+00)
(1.750000000e+01 -5.176130000e-07 0.000000000e+00)
(1.750000000e+01 -5.083340000e-07 0.000000000e+00)
(1.750000000e+01 -4.192940000e-07 0.000000000e+00)
(1.750000000e+01 -3.066040000e-07 0.000000000e+00)
(1.750000000e+01 -2.009070000e-07 0.000000000e+00)
(1.750000000e+01 -1.158330000e-07 0.000000000e+00)
(1.750000000e+01 -5.469850000e-08 0.000000000e+00)
(1.750000000e+01 -1.530790000e-08 0.000000000e+00)
(1.750000000e+01 6.880400000e-09 0.000000000e+00)
(1.750000000e+01 1.685500000e-08 0.000000000e+00)
(1.750000000e+01 1.905030000e-08 0.000000000e+00)
(1.750000000e+01 1.693330000e-08 0.000000000e+00)
(1.750000000e+01 1.294510000e-08 0.000000000e+00)
(1.750000000e+01 8.627990000e-09 0.000000000e+00)
(1.750000000e+01 4.830560000e-09 0.000000000e+00)
(1.750000000e+01 1.925590000e-09 0.000000000e+00)
(1.750000000e+01 6.810450000e-12 0.000000000e+00)
(1.750000000e+01 6.810450000e-12 0.000000000e+00)
);

View File

@ -0,0 +1,162 @@
(
0.37728
1.0511
1.73406
2.4586
3.2082
3.97473
4.75373
5.54234
6.33847
7.1404
7.94657
8.75553
9.56582
10.376
11.1845
11.9899
12.7905
13.5848
14.3712
15.148
15.9135
16.666
17.4039
18.1256
18.8294
19.5137
20.1772
20.8182
21.4355
22.0278
22.5939
23.1328
23.6435
24.1252
24.5773
24.9993
25.3906
25.7511
26.0806
26.3791
26.6468
26.8838
27.0906
27.2676
27.4154
27.5346
27.6259
27.6902
27.7282
27.7409
27.7293
27.6941
27.6365
27.5573
27.4576
27.3382
27.2001
27.0442
26.8714
26.6825
26.4783
26.2596
26.027
25.7813
25.523
25.2528
24.9711
24.6784
24.3753
24.062
23.739
23.4065
23.0649
22.7145
22.3554
21.9879
21.6122
21.2285
20.8368
20.4375
20.0305
19.6162
19.1945
18.7657
18.33
17.8873
17.438
16.9823
16.5202
16.0521
15.5782
15.0988
14.614
14.1244
13.6302
13.1318
12.6296
12.1243
11.6163
11.106
10.5941
10.0815
9.56867
9.05652
8.54589
8.03769
7.53293
7.03269
6.53813
6.0506
5.57183
5.10244
4.64453
4.19963
3.76937
3.35542
2.95998
2.58833
2.23764
1.91249
1.6148
1.35072
1.11631
0.915143
0.751801
0.617928
0.514905
0.432977
0.369164
0.318554
0.279014
0.249576
0.229701
0.2179
0.210806
0.20414
0.195226
0.184371
0.173787
0.165496
0.160178
0.15736
0.156122
0.155598
0.155137
0.154298
0.152789
0.150409
0.147023
0.14255
0.136962
0.1303
0.122695
0.114392
0.105769
0.0973623
0.0898635
0.0840057
0.080232
0.080232
)

View File

@ -0,0 +1,162 @@
(
0.620359
0.247943
0.140451
0.0951249
0.0709174
0.0560511
0.0460572
0.0389042
0.0335448
0.0293876
0.0260742
0.0233751
0.0211371
0.0192537
0.0176487
0.0162664
0.0150648
0.014012
0.0130829
0.0122579
0.0115212
0.0108601
0.0102641
0.00972454
0.00923429
0.00878724
0.00837825
0.00800293
0.0076575
0.00733871
0.00704372
0.00677003
0.00651548
0.00627812
0.00605626
0.00584837
0.00565309
0.00546919
0.00529558
0.00513127
0.00497534
0.00482699
0.00468547
0.00455011
0.00442029
0.00429545
0.00417508
0.00405871
0.00394591
0.0038363
0.00372953
0.00362529
0.00352328
0.00342325
0.00332497
0.00322824
0.00313289
0.00303876
0.00294572
0.00285366
0.0027625
0.00267216
0.00258259
0.00249376
0.00240564
0.00231823
0.00223154
0.00214558
0.00206039
0.00197601
0.00189249
0.00180989
0.00172826
0.0016477
0.00156826
0.00149004
0.00141312
0.00133759
0.00126353
0.00119104
0.00112021
0.00105112
0.00098388
0.000918562
0.000855254
0.000794035
0.000734982
0.000678164
0.000623647
0.000571488
0.000521736
0.000474435
0.000429618
0.000387307
0.000347516
0.000310249
0.000275497
0.000243238
0.00021344
0.000186098
0.00016112
0.000138445
0.000117997
9.96906e-05
8.34285e-05
6.91037e-05
5.66008e-05
4.57964e-05
3.65611e-05
2.87601e-05
2.22542e-05
1.69267e-05
1.262e-05
9.20303e-06
6.54726e-06
4.52986e-06
3.035e-06
1.95478e-06
1.22152e-06
7.29443e-07
4.13869e-07
2.20518e-07
1.13128e-07
5.47647e-08
2.48882e-08
1.12034e-08
4.93172e-09
2.21804e-09
1.01736e-09
4.81813e-10
2.36159e-10
1.20481e-10
6.47874e-11
3.74792e-11
2.38347e-11
1.68667e-11
1.32394e-11
1.13448e-11
1.03818e-11
9.9284e-12
9.75005e-12
9.71149e-12
9.73318e-12
9.7667e-12
9.78056e-12
9.75241e-12
9.66506e-12
9.50495e-12
9.26236e-12
8.93233e-12
8.51622e-12
8.02303e-12
7.47011e-12
6.88269e-12
6.29181e-12
5.73203e-12
5.24111e-12
4.86067e-12
4.62448e-12
4.62448e-12
)

Some files were not shown because too many files have changed in this diff Show More