Skip to content
Snippets Groups Projects
Commit c0be7dfc authored by andy's avatar andy
Browse files

BUG: Corrected behaviour of atmBoundaryLayerInletEpsilon BC

parent 4f0bcd9b
Branches
Tags
No related merge requests found
......@@ -47,13 +47,13 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF),
Ustar_(0),
z_(pTraits<vector>::zero),
z0_(0),
z_(vector::zero),
kappa_(0.41),
Uref_(0),
Href_(0),
zGround_(0)
z0_(0),
zGround_(0),
Ustar_(0)
{}
......@@ -67,13 +67,13 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
Ustar_(ptf.Ustar_),
z_(ptf.z_),
z0_(ptf.z0_),
kappa_(ptf.kappa_),
Uref_(ptf.Uref_),
Href_(ptf.Href_),
zGround_(ptf.zGround_)
z0_(ptf.z0_),
zGround_(ptf.zGround_),
Ustar_(ptf.Ustar_)
{}
......@@ -86,13 +86,13 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF),
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())
z0_("z0", dict, p.size()),
zGround_("zGround", dict, p.size()),
Ustar_(p.size())
{
if (mag(z_) < SMALL)
{
......@@ -128,18 +128,47 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
)
:
fixedValueFvPatchScalarField(blpsf, iF),
Ustar_(blpsf.Ustar_),
z_(blpsf.z_),
z0_(blpsf.z0_),
kappa_(blpsf.kappa_),
Uref_(blpsf.Uref_),
Href_(blpsf.Href_),
zGround_(blpsf.zGround_)
z0_(blpsf.z0_),
zGround_(blpsf.zGround_),
Ustar_(blpsf.Ustar_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void atmBoundaryLayerInletEpsilonFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
fixedValueFvPatchScalarField::autoMap(m);
z0_.autoMap(m);
zGround_.autoMap(m);
Ustar_.autoMap(m);
}
void atmBoundaryLayerInletEpsilonFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
fixedValueFvPatchScalarField::rmap(ptf, addr);
const atmBoundaryLayerInletEpsilonFvPatchScalarField& blptf =
refCast<const atmBoundaryLayerInletEpsilonFvPatchScalarField>(ptf);
z0_.rmap(blptf.z0_, addr);
zGround_.rmap(blptf.zGround_, addr);
Ustar_.rmap(blptf.Ustar_, addr);
}
void atmBoundaryLayerInletEpsilonFvPatchScalarField::updateCoeffs()
{
const vectorField& c = patch().Cf();
......@@ -153,16 +182,14 @@ void atmBoundaryLayerInletEpsilonFvPatchScalarField::write(Ostream& os) const
fvPatchScalarField::write(os);
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;
z0_.writeEntry("z0", os);
zGround_.writeEntry("zGround", os);
writeEntry("value", os);
}
......
......@@ -87,15 +87,9 @@ class atmBoundaryLayerInletEpsilonFvPatchScalarField
{
// Private data
//- Frictional velocity
scalarField Ustar_;
//- Direction of the z-coordinate
vector z_;
//- Surface roughness lenght
scalarField z0_;
//- Von Karman constant
const scalar kappa_;
......@@ -105,8 +99,14 @@ class atmBoundaryLayerInletEpsilonFvPatchScalarField
//- Reference hight
const scalar Href_;
//- Surface roughness length
scalarField z0_;
//- Minimum corrdinate value in z direction
const scalarField zGround_;
scalarField zGround_;
//- Frictional velocity
scalarField Ustar_;
public:
......@@ -173,20 +173,42 @@ public:
// Member functions
//- Return max value
scalarField Ustar() const
{
return Ustar_;
}
// Access
//- Return z direction
const vector& z() const
{
return z_;
}
//- Return max value
scalarField Ustar() const
{
return Ustar_;
}
//- Return z direction
const vector& z() const
{
return z_;
}
// 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 coefficients
virtual void updateCoeffs();
//- Update coefficients
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment