Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
commit
92562e83e7
@ -66,6 +66,12 @@ void Foam::actuationDiskSource::checkData() const
|
||||
<< "disk direction vector is approximately zero"
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
if (returnReduce(upstreamCellId_, maxOp<label>()) == -1)
|
||||
{
|
||||
FatalErrorIn("Foam::actuationDiskSource::checkData()")
|
||||
<< "upstream location " << upstreamPoint_ << " not found in mesh"
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +89,9 @@ Foam::actuationDiskSource::actuationDiskSource
|
||||
diskDir_(coeffs_.lookup("diskDir")),
|
||||
Cp_(readScalar(coeffs_.lookup("Cp"))),
|
||||
Ct_(readScalar(coeffs_.lookup("Ct"))),
|
||||
diskArea_(readScalar(coeffs_.lookup("diskArea")))
|
||||
diskArea_(readScalar(coeffs_.lookup("diskArea"))),
|
||||
upstreamPoint_(coeffs_.lookup("upstreamPoint")),
|
||||
upstreamCellId_(-1)
|
||||
{
|
||||
coeffs_.lookup("fieldNames") >> fieldNames_;
|
||||
applied_.setSize(fieldNames_.size(), false);
|
||||
@ -91,6 +99,8 @@ Foam::actuationDiskSource::actuationDiskSource
|
||||
Info<< " - creating actuation disk zone: "
|
||||
<< this->name() << endl;
|
||||
|
||||
upstreamCellId_ = mesh.findCell(upstreamPoint_);
|
||||
|
||||
checkData();
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ Description
|
||||
Cp 0.1; // power coefficient
|
||||
Ct 0.5; // thrust coefficient
|
||||
diskArea 5.0; // disk area
|
||||
upstreamPoint (0 0 0); // upstream point
|
||||
}
|
||||
|
||||
|
||||
@ -92,6 +93,12 @@ protected:
|
||||
//- Disk area
|
||||
scalar diskArea_;
|
||||
|
||||
//- Upstream point sample
|
||||
point upstreamPoint_;
|
||||
|
||||
//- Upstream cell ID
|
||||
label upstreamCellId_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
@ -42,20 +42,27 @@ void Foam::actuationDiskSource::addActuationDiskAxialInertialResistance
|
||||
) const
|
||||
{
|
||||
scalar a = 1.0 - Cp_/Ct_;
|
||||
scalarField T(cells.size());
|
||||
vector uniDiskDir = diskDir_/mag(diskDir_);
|
||||
tensor E(tensor::zero);
|
||||
E.xx() = uniDiskDir.x();
|
||||
E.yy() = uniDiskDir.y();
|
||||
E.zz() = uniDiskDir.z();
|
||||
|
||||
forAll(cells, i)
|
||||
vector upU = vector(VGREAT, VGREAT, VGREAT);
|
||||
scalar upRho = VGREAT;
|
||||
if (upstreamCellId_ != -1)
|
||||
{
|
||||
T[i] = 2.0*rho[cells[i]]*diskArea_*mag(U[cells[i]])*a/(1.0 - a);
|
||||
upU = U[upstreamCellId_];
|
||||
upRho = rho[upstreamCellId_];
|
||||
}
|
||||
reduce(upU, minOp<vector>());
|
||||
reduce(upRho, minOp<scalar>());
|
||||
|
||||
scalar T = 2.0*upRho*diskArea_*mag(upU)*a*(1 - a);
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
Usource[cells[i]] -= ((Vcells[cells[i]]/V())*T[i]*E) & U[cells[i]];
|
||||
Usource[cells[i]] += ((Vcells[cells[i]]/V())*T*E) & upU;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,7 @@ Description
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,11 +44,9 @@ addRadialActuationDiskAxialInertialResistance
|
||||
) const
|
||||
{
|
||||
scalar a = 1.0 - Cp_/Ct_;
|
||||
scalarField T(cells.size());
|
||||
scalarField Tr(cells.size());
|
||||
const vector uniDiskDir = diskDir_/mag(diskDir_);
|
||||
|
||||
|
||||
tensor E(tensor::zero);
|
||||
E.xx() = uniDiskDir.x();
|
||||
E.yy() = uniDiskDir.y();
|
||||
@ -65,21 +63,27 @@ addRadialActuationDiskAxialInertialResistance
|
||||
+ radialCoeffs_[1]*sqr(maxR)/2.0
|
||||
+ radialCoeffs_[2]*pow4(maxR)/3.0;
|
||||
|
||||
vector upU = vector(VGREAT, VGREAT, VGREAT);
|
||||
scalar upRho = VGREAT;
|
||||
if (upstreamCellId_ != -1)
|
||||
{
|
||||
upU = U[upstreamCellId_];
|
||||
upRho = rho[upstreamCellId_];
|
||||
}
|
||||
reduce(upU, minOp<vector>());
|
||||
reduce(upRho, minOp<scalar>());
|
||||
|
||||
scalar T = 2.0*upRho*diskArea_*mag(upU)*a*(1.0 - a);
|
||||
forAll(cells, i)
|
||||
{
|
||||
T[i] = 2.0*rho[cells[i]]*diskArea_*mag(U[cells[i]])*a/(1.0 - a);
|
||||
|
||||
scalar r2 = magSqr(mesh().cellCentres()[cells[i]] - avgCentre);
|
||||
|
||||
Tr[i] =
|
||||
T[i]
|
||||
T
|
||||
*(radialCoeffs_[0] + radialCoeffs_[1]*r2 + radialCoeffs_[2]*sqr(r2))
|
||||
/intCoeffs;
|
||||
}
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
Usource[cells[i]] -= ((Vcells[cells[i]]/V_)*Tr[i]*E) & U[cells[i]];
|
||||
Usource[cells[i]] += ((Vcells[cells[i]]/V_)*Tr[i]*E) & upU;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
|
@ -29,6 +29,7 @@ $(nutWallFunctions)/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScal
|
||||
$(nutWallFunctions)/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C
|
||||
$(nutWallFunctions)/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C
|
||||
$(nutWallFunctions)/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C
|
||||
$(nutWallFunctions)/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C
|
||||
|
||||
epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions
|
||||
$(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
|
||||
|
@ -51,6 +51,8 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
|
||||
z_(pTraits<vector>::zero),
|
||||
z0_(0),
|
||||
kappa_(0.41),
|
||||
Uref_(0),
|
||||
Href_(0),
|
||||
zGround_(0)
|
||||
{}
|
||||
|
||||
@ -69,6 +71,8 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
|
||||
z_(ptf.z_),
|
||||
z0_(ptf.z0_),
|
||||
kappa_(ptf.kappa_),
|
||||
Uref_(ptf.Uref_),
|
||||
Href_(ptf.Href_),
|
||||
zGround_(ptf.zGround_)
|
||||
{}
|
||||
|
||||
@ -82,10 +86,12 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchScalarField(p, iF),
|
||||
Ustar_(readScalar(dict.lookup("Ustar"))),
|
||||
Ustar_(p.size()),
|
||||
z_(dict.lookup("z")),
|
||||
z0_(readScalar(dict.lookup("z0"))),
|
||||
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
||||
Uref_(readScalar(dict.lookup("Uref"))),
|
||||
Href_(readScalar(dict.lookup("Href"))),
|
||||
zGround_("zGround", dict, p.size())
|
||||
{
|
||||
if (mag(z_) < SMALL)
|
||||
@ -103,6 +109,11 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
forAll (Ustar_, i)
|
||||
{
|
||||
Ustar_[i] = kappa_*Uref_/(log((Href_ + z0_[i])/max(z0_[i] , 0.001)));
|
||||
}
|
||||
|
||||
z_ /= mag(z_);
|
||||
|
||||
evaluate();
|
||||
@ -121,6 +132,8 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
|
||||
z_(blpsf.z_),
|
||||
z0_(blpsf.z0_),
|
||||
kappa_(blpsf.kappa_),
|
||||
Uref_(blpsf.Uref_),
|
||||
Href_(blpsf.Href_),
|
||||
zGround_(blpsf.zGround_)
|
||||
{}
|
||||
|
||||
@ -138,14 +151,16 @@ void atmBoundaryLayerInletEpsilonFvPatchScalarField::updateCoeffs()
|
||||
void atmBoundaryLayerInletEpsilonFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchScalarField::write(os);
|
||||
os.writeKeyword("Ustar")
|
||||
<< Ustar_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("z")
|
||||
<< z_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("z0")
|
||||
<< z0_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("kappa")
|
||||
<< kappa_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("Uref")
|
||||
<< Uref_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("Href")
|
||||
<< Href_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("zGround")
|
||||
<< zGround_ << token::END_STATEMENT << nl;
|
||||
writeEntry("value", os);
|
||||
|
@ -41,6 +41,16 @@ Description
|
||||
z0 is the surface roughness lenght
|
||||
zGround minium vlaue in z direction
|
||||
|
||||
|
||||
and:
|
||||
|
||||
Ustar = K Uref/ln((Zref + z0)/z0)
|
||||
|
||||
where:
|
||||
|
||||
Uref is the reference velocity at Zref
|
||||
Zref is the reference height.
|
||||
|
||||
\endverbatim
|
||||
|
||||
Reference:
|
||||
@ -78,17 +88,23 @@ class atmBoundaryLayerInletEpsilonFvPatchScalarField
|
||||
// Private data
|
||||
|
||||
//- Frictional velocity
|
||||
const scalar Ustar_;
|
||||
scalarField Ustar_;
|
||||
|
||||
//- Direction of the z-coordinate
|
||||
vector z_;
|
||||
|
||||
//- Surface roughness lenght
|
||||
const scalar z0_;
|
||||
scalarField z0_;
|
||||
|
||||
//- Von Karman constant
|
||||
const scalar kappa_;
|
||||
|
||||
//- Reference velocity
|
||||
const scalar Uref_;
|
||||
|
||||
//- Reference hight
|
||||
const scalar Href_;
|
||||
|
||||
//- Minimum corrdinate value in z direction
|
||||
const scalarField zGround_;
|
||||
|
||||
@ -158,7 +174,7 @@ public:
|
||||
// Member functions
|
||||
|
||||
//- Return max value
|
||||
scalar Ustar() const
|
||||
scalarField Ustar() const
|
||||
{
|
||||
return Ustar_;
|
||||
}
|
||||
|
@ -88,16 +88,16 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchVectorField(p, iF),
|
||||
Ustar_(0),
|
||||
Ustar_(p.size()),
|
||||
n_(dict.lookup("n")),
|
||||
z_(dict.lookup("z")),
|
||||
z0_(readScalar(dict.lookup("z0"))),
|
||||
z0_("z0", dict, p.size()),
|
||||
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
||||
Uref_(readScalar(dict.lookup("Uref"))),
|
||||
Href_(readScalar(dict.lookup("Href"))),
|
||||
zGround_("zGround", dict, p.size())
|
||||
{
|
||||
if (mag(n_) < SMALL || mag(z_) < SMALL || mag(z0_) < SMALL)
|
||||
if (mag(n_) < SMALL || mag(z_) < SMALL)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
@ -108,14 +108,17 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
|
||||
"onst dictionary&"
|
||||
")"
|
||||
)
|
||||
<< "magnitude of n, z and z0 vectors must be greater than zero"
|
||||
<< "magnitude of n or z must be greater than zero"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
n_ /= mag(n_);
|
||||
z_ /= mag(z_);
|
||||
|
||||
Ustar_ = kappa_*Uref_/(log((Href_ + z0_)/max(z0_ , 0.001)));
|
||||
forAll (Ustar_, i)
|
||||
{
|
||||
Ustar_[i] = kappa_*Uref_/(log((Href_ + z0_[i])/max(z0_[i] , 0.001)));
|
||||
}
|
||||
|
||||
evaluate();
|
||||
}
|
||||
@ -153,12 +156,12 @@ void atmBoundaryLayerInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
if ((coord[i] - zGround_[i]) < Href_)
|
||||
{
|
||||
Un[i] =
|
||||
(Ustar_/kappa_)
|
||||
* log((coord[i] - zGround_[i] + z0_)/max(z0_, 0.001));
|
||||
(Ustar_[i]/kappa_)
|
||||
* log((coord[i] - zGround_[i] + z0_[i])/max(z0_[i], 0.001));
|
||||
}
|
||||
else
|
||||
{
|
||||
Un[i] = (Uref_);
|
||||
Un[i] = Uref_;
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,8 +174,7 @@ void atmBoundaryLayerInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
void atmBoundaryLayerInletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchVectorField::write(os);
|
||||
os.writeKeyword("z0")
|
||||
<< z0_ << token::END_STATEMENT << nl;
|
||||
zGround_.writeEntry("z0", os) ;
|
||||
os.writeKeyword("n")
|
||||
<< n_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("z")
|
||||
|
@ -92,7 +92,7 @@ class atmBoundaryLayerInletVelocityFvPatchVectorField
|
||||
// Private data
|
||||
|
||||
//- Frictional velocity
|
||||
scalar Ustar_;
|
||||
scalarField Ustar_;
|
||||
|
||||
//- Flow direction
|
||||
vector n_;
|
||||
@ -101,7 +101,7 @@ class atmBoundaryLayerInletVelocityFvPatchVectorField
|
||||
vector z_;
|
||||
|
||||
//- Surface roughness lenght
|
||||
const scalar z0_;
|
||||
scalarField z0_;
|
||||
|
||||
//- Von Karman constant
|
||||
const scalar kappa_;
|
||||
@ -181,7 +181,7 @@ public:
|
||||
// Member functions
|
||||
|
||||
//- Return Ustar
|
||||
scalar& Ustar()
|
||||
scalarField& Ustar()
|
||||
{
|
||||
return Ustar_;
|
||||
}
|
||||
|
@ -0,0 +1,200 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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 "nutkAtmRoughWallFunctionFvPatchScalarField.H"
|
||||
#include "RASModel.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "volFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace incompressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
tmp<scalarField> nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const
|
||||
{
|
||||
const label patchI = patch().index();
|
||||
|
||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||
const scalarField& y = rasModel.y()[patchI];
|
||||
const tmp<volScalarField> tk = rasModel.k();
|
||||
const volScalarField& k = tk();
|
||||
const tmp<volScalarField> tnu = rasModel.nu();
|
||||
const volScalarField& nu = tnu();
|
||||
const scalarField& nuw = nu.boundaryField()[patchI];
|
||||
|
||||
const scalar Cmu25 = pow025(Cmu_);
|
||||
|
||||
tmp<scalarField> tnutw(new scalarField(*this));
|
||||
scalarField& nutw = tnutw();
|
||||
|
||||
forAll(nutw, faceI)
|
||||
{
|
||||
label faceCellI = patch().faceCells()[faceI];
|
||||
|
||||
scalar uStar = Cmu25*sqrt(k[faceCellI]);
|
||||
scalar yPlus = uStar*y[faceI]/nuw[faceI];
|
||||
|
||||
scalar Edash = (y[faceI] + z0_[faceI])/z0_[faceI];
|
||||
|
||||
nutw[faceI] =
|
||||
nuw[faceI]*(yPlus*kappa_/log(max(Edash, 1+1e-4)) - 1);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "yPlus = " << yPlus
|
||||
<< ", Edash = " << Edash
|
||||
<< ", nutw = " << nutw[faceI]
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
return tnutw;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField::
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(p, iF),
|
||||
z0_(p.size(), 0.0)
|
||||
{}
|
||||
|
||||
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField::
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkAtmRoughWallFunctionFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
|
||||
z0_(ptf.z0_, mapper)
|
||||
{}
|
||||
|
||||
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField::
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(p, iF, dict),
|
||||
z0_("z0", dict, p.size())
|
||||
{}
|
||||
|
||||
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField::
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkAtmRoughWallFunctionFvPatchScalarField& rwfpsf
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(rwfpsf),
|
||||
z0_(rwfpsf.z0_)
|
||||
{}
|
||||
|
||||
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField::
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkAtmRoughWallFunctionFvPatchScalarField& rwfpsf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
nutkWallFunctionFvPatchScalarField(rwfpsf, iF),
|
||||
z0_(rwfpsf.z0_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void nutkAtmRoughWallFunctionFvPatchScalarField::autoMap
|
||||
(
|
||||
const fvPatchFieldMapper& m
|
||||
)
|
||||
{
|
||||
nutkWallFunctionFvPatchScalarField::autoMap(m);
|
||||
z0_.autoMap(m);
|
||||
}
|
||||
|
||||
|
||||
void nutkAtmRoughWallFunctionFvPatchScalarField::rmap
|
||||
(
|
||||
const fvPatchScalarField& ptf,
|
||||
const labelList& addr
|
||||
)
|
||||
{
|
||||
nutkWallFunctionFvPatchScalarField::rmap(ptf, addr);
|
||||
|
||||
const nutkAtmRoughWallFunctionFvPatchScalarField& nrwfpsf =
|
||||
refCast<const nutkAtmRoughWallFunctionFvPatchScalarField>(ptf);
|
||||
|
||||
z0_.rmap(nrwfpsf.z0_, addr);
|
||||
}
|
||||
|
||||
|
||||
void nutkAtmRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
writeLocalEntries(os);
|
||||
z0_.writeEntry("z0", os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchScalarField,
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace RASModels
|
||||
} // End namespace incompressible
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
@ -0,0 +1,195 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
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::incompressible::RASModels::
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
|
||||
Description
|
||||
Boundary condition for turbulent (kinematic) viscosity for atmospheric
|
||||
velocity profiles.
|
||||
Desinged to be used togheter with atmBoundaryLayerInletVelocity.
|
||||
It follows U = (Ustar/K) ln((z - zGround + z0)/z0)
|
||||
|
||||
where:
|
||||
|
||||
Ustar is the frictional velocity
|
||||
K is karman's constant
|
||||
z0 is the surface roughness lenght
|
||||
z is the verical coordinate
|
||||
zGround is the minumum coordinate value in z direction.
|
||||
|
||||
|
||||
SourceFiles
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef nutkAtmRoughWallFunctionFvPatchScalarField_H
|
||||
#define nutkAtmRoughWallFunctionFvPatchScalarField_H
|
||||
|
||||
#include "nutkWallFunctionFvPatchScalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace incompressible
|
||||
{
|
||||
namespace RASModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class nutkAtmRoughWallFunctionFvPatchScalarField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
:
|
||||
public nutkWallFunctionFvPatchScalarField
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Surface roughness lenght
|
||||
scalarField z0_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
|
||||
//- Calculate the turbulence viscosity
|
||||
virtual tmp<scalarField> calcNut() const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("nutkAtmRoughWallFunction");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
// onto a new patch
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkAtmRoughWallFunctionFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkAtmRoughWallFunctionFvPatchScalarField&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchScalarField> clone() const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new nutkAtmRoughWallFunctionFvPatchScalarField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
nutkAtmRoughWallFunctionFvPatchScalarField
|
||||
(
|
||||
const nutkAtmRoughWallFunctionFvPatchScalarField&,
|
||||
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 nutkAtmRoughWallFunctionFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Acces functions
|
||||
|
||||
// Return z0
|
||||
scalarField& z0()
|
||||
{
|
||||
return z0_;
|
||||
}
|
||||
|
||||
|
||||
// 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 RASModels
|
||||
} // End namespace incompressible
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
@ -40,7 +40,8 @@ boundaryField
|
||||
inlet
|
||||
{
|
||||
type atmBoundaryLayerInletEpsilon;
|
||||
Ustar $Ustar;
|
||||
Uref $Uref;
|
||||
Href $Href;
|
||||
z $zDirection;
|
||||
z0 $z0;
|
||||
value $internalField;
|
||||
|
@ -6,10 +6,9 @@
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
Ustar 0.82;
|
||||
Uref 10.0;
|
||||
Href 20;
|
||||
z0 0.1;
|
||||
z0 uniform 0.1;
|
||||
turbulentKE 1.3;
|
||||
windDirection (1 0 0);
|
||||
zDirection (0 0 1);
|
||||
|
@ -36,9 +36,8 @@ boundaryField
|
||||
|
||||
"terrain_.*"
|
||||
{
|
||||
type nutkRoughWallFunction;
|
||||
Ks uniform 0.2; //Ks = 20 Z0
|
||||
Cs uniform 0.5;
|
||||
type nutkAtmRoughWallFunction;
|
||||
z0 $Z0;
|
||||
value uniform 0.0;
|
||||
}
|
||||
|
||||
|
@ -15,43 +15,37 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
6
|
||||
5
|
||||
(
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
nFaces 922;
|
||||
startFace 364825;
|
||||
nFaces 600;
|
||||
startFace 51900;
|
||||
}
|
||||
sides
|
||||
{
|
||||
type patch;
|
||||
nFaces 1834;
|
||||
startFace 365747;
|
||||
nFaces 1200;
|
||||
startFace 52500;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
nFaces 923;
|
||||
startFace 367581;
|
||||
nFaces 600;
|
||||
startFace 53700;
|
||||
}
|
||||
ground
|
||||
{
|
||||
type wall;
|
||||
nFaces 0;
|
||||
startFace 368504;
|
||||
nFaces 900;
|
||||
startFace 54300;
|
||||
}
|
||||
top
|
||||
{
|
||||
type patch;
|
||||
nFaces 900;
|
||||
startFace 368504;
|
||||
}
|
||||
terrain_patch0
|
||||
{
|
||||
type wall;
|
||||
nFaces 16037;
|
||||
startFace 369404;
|
||||
startFace 55200;
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -27,10 +27,11 @@ disk1
|
||||
actuationDiskSourceCoeffs
|
||||
{
|
||||
fieldNames (U);
|
||||
diskDir (-1 0 0); // orientation of the disk
|
||||
Cp 0.53; // Cp
|
||||
Ct 0.58; // Ct
|
||||
diskArea 40; // disk area
|
||||
diskDir (-1 0 0); // orientation of the disk
|
||||
Cp 0.386; // Cp
|
||||
Ct 0.58; // Ct
|
||||
diskArea 40; // disk area
|
||||
upstreamPoint (581849 4785810 1065);
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,6 +51,7 @@ disk2
|
||||
Cp 0.53;
|
||||
Ct 0.58;
|
||||
diskArea 40;
|
||||
upstreamPoint (581753 4785663 1070);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ FoamFile
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "$FOAM_CASE/0/include/initialConditions"
|
||||
#include "$FOAM_CASE/0/include/ABLConditions"
|
||||
|
||||
dictionaryReplacement
|
||||
{
|
||||
@ -99,12 +100,12 @@ dictionaryReplacement
|
||||
inlet
|
||||
{
|
||||
type atmBoundaryLayerInletVelocity;
|
||||
Uref 10.0;
|
||||
Href 20;
|
||||
n (1 0 0);
|
||||
z (0 0 1);
|
||||
z0 0.1;
|
||||
zGround 935.0;
|
||||
Uref $Uref;
|
||||
Href $Href;
|
||||
n $windDirection;
|
||||
z $zDirection;
|
||||
z0 $z0;
|
||||
zGround $zGround;
|
||||
value uniform $flowVelocity;
|
||||
}
|
||||
"terrain_.*"
|
||||
@ -141,9 +142,8 @@ dictionaryReplacement
|
||||
}
|
||||
"terrain_.*"
|
||||
{
|
||||
type nutkRoughWallFunction;
|
||||
Ks uniform 0.2; //Ks = 20 Z0
|
||||
Cs uniform 0.5;
|
||||
type nutkAtmRoughWallFunction;
|
||||
z0 $z0;
|
||||
value uniform 0.0;
|
||||
}
|
||||
ground
|
||||
@ -170,11 +170,12 @@ dictionaryReplacement
|
||||
inlet
|
||||
{
|
||||
type atmBoundaryLayerInletEpsilon;
|
||||
Ustar 0.82;
|
||||
z (0 0 1);
|
||||
z0 0.1;
|
||||
z $zDirection;
|
||||
z0 $z0;
|
||||
zGround $zGround;
|
||||
Uref $Uref;
|
||||
Href $Href;
|
||||
value uniform $turbulentEpsilon;
|
||||
zGround 935.0;
|
||||
}
|
||||
"terrain_.*"
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user