Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2012-02-02 18:58:31 +00:00
18 changed files with 526 additions and 72 deletions

View File

@ -66,6 +66,12 @@ void Foam::actuationDiskSource::checkData() const
<< "disk direction vector is approximately zero" << "disk direction vector is approximately zero"
<< exit(FatalIOError); << 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")), diskDir_(coeffs_.lookup("diskDir")),
Cp_(readScalar(coeffs_.lookup("Cp"))), Cp_(readScalar(coeffs_.lookup("Cp"))),
Ct_(readScalar(coeffs_.lookup("Ct"))), 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_; coeffs_.lookup("fieldNames") >> fieldNames_;
applied_.setSize(fieldNames_.size(), false); applied_.setSize(fieldNames_.size(), false);
@ -91,6 +99,8 @@ Foam::actuationDiskSource::actuationDiskSource
Info<< " - creating actuation disk zone: " Info<< " - creating actuation disk zone: "
<< this->name() << endl; << this->name() << endl;
upstreamCellId_ = mesh.findCell(upstreamPoint_);
checkData(); checkData();
} }

View File

@ -48,6 +48,7 @@ Description
Cp 0.1; // power coefficient Cp 0.1; // power coefficient
Ct 0.5; // thrust coefficient Ct 0.5; // thrust coefficient
diskArea 5.0; // disk area diskArea 5.0; // disk area
upstreamPoint (0 0 0); // upstream point
} }
@ -92,6 +93,12 @@ protected:
//- Disk area //- Disk area
scalar diskArea_; scalar diskArea_;
//- Upstream point sample
point upstreamPoint_;
//- Upstream cell ID
label upstreamCellId_;
private: private:

View File

@ -42,20 +42,27 @@ void Foam::actuationDiskSource::addActuationDiskAxialInertialResistance
) const ) const
{ {
scalar a = 1.0 - Cp_/Ct_; scalar a = 1.0 - Cp_/Ct_;
scalarField T(cells.size());
vector uniDiskDir = diskDir_/mag(diskDir_); vector uniDiskDir = diskDir_/mag(diskDir_);
tensor E(tensor::zero); tensor E(tensor::zero);
E.xx() = uniDiskDir.x(); E.xx() = uniDiskDir.x();
E.yy() = uniDiskDir.y(); E.yy() = uniDiskDir.y();
E.zz() = uniDiskDir.z(); 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) 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;
} }
} }

View File

@ -53,6 +53,7 @@ Description
Ct 0.5; // thrust coefficient Ct 0.5; // thrust coefficient
diskArea 5.0; // disk area diskArea 5.0; // disk area
coeffs (0.1 0.5 0.01); // radial distribution coefficients coeffs (0.1 0.5 0.01); // radial distribution coefficients
upstreamPoint (0 0 0); // upstream point
} }

View File

@ -44,11 +44,9 @@ addRadialActuationDiskAxialInertialResistance
) const ) const
{ {
scalar a = 1.0 - Cp_/Ct_; scalar a = 1.0 - Cp_/Ct_;
scalarField T(cells.size());
scalarField Tr(cells.size()); scalarField Tr(cells.size());
const vector uniDiskDir = diskDir_/mag(diskDir_); const vector uniDiskDir = diskDir_/mag(diskDir_);
tensor E(tensor::zero); tensor E(tensor::zero);
E.xx() = uniDiskDir.x(); E.xx() = uniDiskDir.x();
E.yy() = uniDiskDir.y(); E.yy() = uniDiskDir.y();
@ -65,21 +63,27 @@ addRadialActuationDiskAxialInertialResistance
+ radialCoeffs_[1]*sqr(maxR)/2.0 + radialCoeffs_[1]*sqr(maxR)/2.0
+ radialCoeffs_[2]*pow4(maxR)/3.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) 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); scalar r2 = magSqr(mesh().cellCentres()[cells[i]] - avgCentre);
Tr[i] = Tr[i] =
T[i] T
*(radialCoeffs_[0] + radialCoeffs_[1]*r2 + radialCoeffs_[2]*sqr(r2)) *(radialCoeffs_[0] + radialCoeffs_[1]*r2 + radialCoeffs_[2]*sqr(r2))
/intCoeffs; /intCoeffs;
}
forAll(cells, i) Usource[cells[i]] += ((Vcells[cells[i]]/V_)*Tr[i]*E) & upU;
{
Usource[cells[i]] -= ((Vcells[cells[i]]/V_)*Tr[i]*E) & U[cells[i]];
} }
if (debug) if (debug)

View File

@ -29,6 +29,7 @@ $(nutWallFunctions)/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScal
$(nutWallFunctions)/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C $(nutWallFunctions)/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C
epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions
$(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C $(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C

View File

@ -51,6 +51,8 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
z_(pTraits<vector>::zero), z_(pTraits<vector>::zero),
z0_(0), z0_(0),
kappa_(0.41), kappa_(0.41),
Uref_(0),
Href_(0),
zGround_(0) zGround_(0)
{} {}
@ -69,6 +71,8 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
z_(ptf.z_), z_(ptf.z_),
z0_(ptf.z0_), z0_(ptf.z0_),
kappa_(ptf.kappa_), kappa_(ptf.kappa_),
Uref_(ptf.Uref_),
Href_(ptf.Href_),
zGround_(ptf.zGround_) zGround_(ptf.zGround_)
{} {}
@ -82,10 +86,12 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
Ustar_(readScalar(dict.lookup("Ustar"))), Ustar_(p.size()),
z_(dict.lookup("z")), z_(dict.lookup("z")),
z0_(readScalar(dict.lookup("z0"))), z0_(readScalar(dict.lookup("z0"))),
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
Uref_(readScalar(dict.lookup("Uref"))),
Href_(readScalar(dict.lookup("Href"))),
zGround_("zGround", dict, p.size()) zGround_("zGround", dict, p.size())
{ {
if (mag(z_) < SMALL) if (mag(z_) < SMALL)
@ -103,6 +109,11 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
<< abort(FatalError); << abort(FatalError);
} }
forAll (Ustar_, i)
{
Ustar_[i] = kappa_*Uref_/(log((Href_ + z0_[i])/max(z0_[i] , 0.001)));
}
z_ /= mag(z_); z_ /= mag(z_);
evaluate(); evaluate();
@ -121,6 +132,8 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
z_(blpsf.z_), z_(blpsf.z_),
z0_(blpsf.z0_), z0_(blpsf.z0_),
kappa_(blpsf.kappa_), kappa_(blpsf.kappa_),
Uref_(blpsf.Uref_),
Href_(blpsf.Href_),
zGround_(blpsf.zGround_) zGround_(blpsf.zGround_)
{} {}
@ -138,14 +151,16 @@ void atmBoundaryLayerInletEpsilonFvPatchScalarField::updateCoeffs()
void atmBoundaryLayerInletEpsilonFvPatchScalarField::write(Ostream& os) const void atmBoundaryLayerInletEpsilonFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
os.writeKeyword("Ustar")
<< Ustar_ << token::END_STATEMENT << nl;
os.writeKeyword("z") os.writeKeyword("z")
<< z_ << token::END_STATEMENT << nl; << z_ << token::END_STATEMENT << nl;
os.writeKeyword("z0") os.writeKeyword("z0")
<< z0_ << token::END_STATEMENT << nl; << z0_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") os.writeKeyword("kappa")
<< kappa_ << token::END_STATEMENT << nl; << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("Uref")
<< Uref_ << token::END_STATEMENT << nl;
os.writeKeyword("Href")
<< Href_ << token::END_STATEMENT << nl;
os.writeKeyword("zGround") os.writeKeyword("zGround")
<< zGround_ << token::END_STATEMENT << nl; << zGround_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);

View File

@ -41,6 +41,16 @@ Description
z0 is the surface roughness lenght z0 is the surface roughness lenght
zGround minium vlaue in z direction 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 \endverbatim
Reference: Reference:
@ -78,17 +88,23 @@ class atmBoundaryLayerInletEpsilonFvPatchScalarField
// Private data // Private data
//- Frictional velocity //- Frictional velocity
const scalar Ustar_; scalarField Ustar_;
//- Direction of the z-coordinate //- Direction of the z-coordinate
vector z_; vector z_;
//- Surface roughness lenght //- Surface roughness lenght
const scalar z0_; scalarField z0_;
//- Von Karman constant //- Von Karman constant
const scalar kappa_; const scalar kappa_;
//- Reference velocity
const scalar Uref_;
//- Reference hight
const scalar Href_;
//- Minimum corrdinate value in z direction //- Minimum corrdinate value in z direction
const scalarField zGround_; const scalarField zGround_;
@ -158,7 +174,7 @@ public:
// Member functions // Member functions
//- Return max value //- Return max value
scalar Ustar() const scalarField Ustar() const
{ {
return Ustar_; return Ustar_;
} }

View File

@ -88,16 +88,16 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
) )
: :
fixedValueFvPatchVectorField(p, iF), fixedValueFvPatchVectorField(p, iF),
Ustar_(0), Ustar_(p.size()),
n_(dict.lookup("n")), n_(dict.lookup("n")),
z_(dict.lookup("z")), z_(dict.lookup("z")),
z0_(readScalar(dict.lookup("z0"))), z0_("z0", dict, p.size()),
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
Uref_(readScalar(dict.lookup("Uref"))), Uref_(readScalar(dict.lookup("Uref"))),
Href_(readScalar(dict.lookup("Href"))), Href_(readScalar(dict.lookup("Href"))),
zGround_("zGround", dict, p.size()) zGround_("zGround", dict, p.size())
{ {
if (mag(n_) < SMALL || mag(z_) < SMALL || mag(z0_) < SMALL) if (mag(n_) < SMALL || mag(z_) < SMALL)
{ {
FatalErrorIn FatalErrorIn
( (
@ -108,14 +108,17 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
"onst dictionary&" "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); << abort(FatalError);
} }
n_ /= mag(n_); n_ /= mag(n_);
z_ /= mag(z_); 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(); evaluate();
} }
@ -153,12 +156,12 @@ void atmBoundaryLayerInletVelocityFvPatchVectorField::updateCoeffs()
if ((coord[i] - zGround_[i]) < Href_) if ((coord[i] - zGround_[i]) < Href_)
{ {
Un[i] = Un[i] =
(Ustar_/kappa_) (Ustar_[i]/kappa_)
* log((coord[i] - zGround_[i] + z0_)/max(z0_, 0.001)); * log((coord[i] - zGround_[i] + z0_[i])/max(z0_[i], 0.001));
} }
else else
{ {
Un[i] = (Uref_); Un[i] = Uref_;
} }
} }
@ -171,8 +174,7 @@ void atmBoundaryLayerInletVelocityFvPatchVectorField::updateCoeffs()
void atmBoundaryLayerInletVelocityFvPatchVectorField::write(Ostream& os) const void atmBoundaryLayerInletVelocityFvPatchVectorField::write(Ostream& os) const
{ {
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
os.writeKeyword("z0") zGround_.writeEntry("z0", os) ;
<< z0_ << token::END_STATEMENT << nl;
os.writeKeyword("n") os.writeKeyword("n")
<< n_ << token::END_STATEMENT << nl; << n_ << token::END_STATEMENT << nl;
os.writeKeyword("z") os.writeKeyword("z")

View File

@ -92,7 +92,7 @@ class atmBoundaryLayerInletVelocityFvPatchVectorField
// Private data // Private data
//- Frictional velocity //- Frictional velocity
scalar Ustar_; scalarField Ustar_;
//- Flow direction //- Flow direction
vector n_; vector n_;
@ -101,7 +101,7 @@ class atmBoundaryLayerInletVelocityFvPatchVectorField
vector z_; vector z_;
//- Surface roughness lenght //- Surface roughness lenght
const scalar z0_; scalarField z0_;
//- Von Karman constant //- Von Karman constant
const scalar kappa_; const scalar kappa_;
@ -181,7 +181,7 @@ public:
// Member functions // Member functions
//- Return Ustar //- Return Ustar
scalar& Ustar() scalarField& Ustar()
{ {
return Ustar_; return Ustar_;
} }

View File

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

View File

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

View File

@ -40,7 +40,8 @@ boundaryField
inlet inlet
{ {
type atmBoundaryLayerInletEpsilon; type atmBoundaryLayerInletEpsilon;
Ustar $Ustar; Uref $Uref;
Href $Href;
z $zDirection; z $zDirection;
z0 $z0; z0 $z0;
value $internalField; value $internalField;

View File

@ -6,10 +6,9 @@
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
Ustar 0.82;
Uref 10.0; Uref 10.0;
Href 20; Href 20;
z0 0.1; z0 uniform 0.1;
turbulentKE 1.3; turbulentKE 1.3;
windDirection (1 0 0); windDirection (1 0 0);
zDirection (0 0 1); zDirection (0 0 1);

View File

@ -36,9 +36,8 @@ boundaryField
"terrain_.*" "terrain_.*"
{ {
type nutkRoughWallFunction; type nutkAtmRoughWallFunction;
Ks uniform 0.2; //Ks = 20 Z0 z0 $Z0;
Cs uniform 0.5;
value uniform 0.0; value uniform 0.0;
} }

View File

@ -15,43 +15,37 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
6 5
( (
outlet outlet
{ {
type patch; type patch;
nFaces 922; nFaces 600;
startFace 364825; startFace 51900;
} }
sides sides
{ {
type patch; type patch;
nFaces 1834; nFaces 1200;
startFace 365747; startFace 52500;
} }
inlet inlet
{ {
type patch; type patch;
nFaces 923; nFaces 600;
startFace 367581; startFace 53700;
} }
ground ground
{ {
type wall; type wall;
nFaces 0; nFaces 900;
startFace 368504; startFace 54300;
} }
top top
{ {
type patch; type patch;
nFaces 900; nFaces 900;
startFace 368504; startFace 55200;
}
terrain_patch0
{
type wall;
nFaces 16037;
startFace 369404;
} }
) )

View File

@ -27,10 +27,11 @@ disk1
actuationDiskSourceCoeffs actuationDiskSourceCoeffs
{ {
fieldNames (U); fieldNames (U);
diskDir (-1 0 0); // orientation of the disk diskDir (-1 0 0); // orientation of the disk
Cp 0.53; // Cp Cp 0.386; // Cp
Ct 0.58; // Ct Ct 0.58; // Ct
diskArea 40; // disk area diskArea 40; // disk area
upstreamPoint (581849 4785810 1065);
} }
} }
@ -50,6 +51,7 @@ disk2
Cp 0.53; Cp 0.53;
Ct 0.58; Ct 0.58;
diskArea 40; diskArea 40;
upstreamPoint (581753 4785663 1070);
} }
} }

View File

@ -15,6 +15,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "$FOAM_CASE/0/include/initialConditions" #include "$FOAM_CASE/0/include/initialConditions"
#include "$FOAM_CASE/0/include/ABLConditions"
dictionaryReplacement dictionaryReplacement
{ {
@ -99,12 +100,12 @@ dictionaryReplacement
inlet inlet
{ {
type atmBoundaryLayerInletVelocity; type atmBoundaryLayerInletVelocity;
Uref 10.0; Uref $Uref;
Href 20; Href $Href;
n (1 0 0); n $windDirection;
z (0 0 1); z $zDirection;
z0 0.1; z0 $z0;
zGround 935.0; zGround $zGround;
value uniform $flowVelocity; value uniform $flowVelocity;
} }
"terrain_.*" "terrain_.*"
@ -141,9 +142,8 @@ dictionaryReplacement
} }
"terrain_.*" "terrain_.*"
{ {
type nutkRoughWallFunction; type nutkAtmRoughWallFunction;
Ks uniform 0.2; //Ks = 20 Z0 z0 $z0;
Cs uniform 0.5;
value uniform 0.0; value uniform 0.0;
} }
ground ground
@ -170,11 +170,12 @@ dictionaryReplacement
inlet inlet
{ {
type atmBoundaryLayerInletEpsilon; type atmBoundaryLayerInletEpsilon;
Ustar 0.82; z $zDirection;
z (0 0 1); z0 $z0;
z0 0.1; zGround $zGround;
Uref $Uref;
Href $Href;
value uniform $turbulentEpsilon; value uniform $turbulentEpsilon;
zGround 935.0;
} }
"terrain_.*" "terrain_.*"
{ {