39 tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcNut()
const 41 const label patchi = patch().index();
48 internalField().
group()
53 const tmp<scalarField> tnuw = turbModel.nu(patchi);
59 tmp<scalarField> tyPlus = calcYPlus(magUp);
62 tmp<scalarField> tnutw(
new scalarField(patch().size(), 0.0));
69 const scalar Re = magUp[facei]*y[facei]/nuw[facei] + ROOTVSMALL;
70 nutw[facei] = nuw[facei]*(
sqr(yPlus[facei])/Re - 1);
78 tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcYPlus
83 const label patchi = patch().index();
90 internalField().
group()
94 const tmp<scalarField> tnuw = turbModel.nu(patchi);
97 tmp<scalarField> tyPlus(
new scalarField(patch().size(), 0.0));
100 if (roughnessHeight_ > 0.0)
103 const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_;
104 static const scalar c_2 = 2.25/(90 - 2.25);
105 static const scalar c_3 = 2.0*
atan(1.0)/
log(90/2.25);
106 static const scalar c_4 = c_3*
log(2.25);
114 const scalar magUpara = magUp[facei];
115 const scalar Re = magUpara*y[facei]/nuw[facei];
119 const scalar ryPlusLam = 1.0/yp;
122 scalar yPlusLast = 0.0;
123 scalar dKsPlusdYPlus = roughnessHeight_/y[facei];
126 dKsPlusdYPlus *= roughnessFactor_;
133 scalar KsPlus = yp*dKsPlusdYPlus;
138 scalar yPlusGPrime = 0.0;
142 const scalar t_1 = 1 + roughnessConstant_*KsPlus;
144 yPlusGPrime = roughnessConstant_*KsPlus/t_1;
146 else if (KsPlus > 2.25)
148 const scalar t_1 = c_1*KsPlus - c_2;
149 const scalar t_2 = c_3*
log(KsPlus) - c_4;
150 const scalar sint_2 =
sin(t_2);
151 const scalar logt_1 =
log(t_1);
154 (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*
cos(t_2));
157 scalar denom = 1.0 +
log(
E_*yp) - G - yPlusGPrime;
158 if (
mag(denom) > VSMALL)
160 yp = (kappaRe + yp*(1 - yPlusGPrime))/denom;
164 mag(ryPlusLam*(yp - yPlusLast)) > 0.0001
169 yPlus[facei] =
max(0.0, yp);
178 const scalar magUpara = magUp[facei];
179 const scalar Re = magUpara*y[facei]/nuw[facei];
183 const scalar ryPlusLam = 1.0/yp;
186 scalar yPlusLast = 0.0;
191 yp = (kappaRe + yp)/(1.0 +
log(
E_*yp));
193 }
while (
mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10);
195 yPlus[facei] =
max(0.0, yp);
212 roughnessHeight_(
Zero),
213 roughnessConstant_(
Zero),
214 roughnessFactor_(
Zero)
227 roughnessHeight_(ptf.roughnessHeight_),
228 roughnessConstant_(ptf.roughnessConstant_),
229 roughnessFactor_(ptf.roughnessFactor_)
253 roughnessHeight_(rwfpsf.roughnessHeight_),
254 roughnessConstant_(rwfpsf.roughnessConstant_),
255 roughnessFactor_(rwfpsf.roughnessFactor_)
266 roughnessHeight_(rwfpsf.roughnessHeight_),
267 roughnessConstant_(rwfpsf.roughnessConstant_),
268 roughnessFactor_(rwfpsf.roughnessFactor_)
276 const label patchi = patch().index();
283 internalField().
group()
289 return calcYPlus(
magUp());
303 writeEntry(
"value", os);
const char *const group
Group name for atomic constants.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fvPatchField< vector > fvPatchVectorField
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions ...
dimensionedScalar log(const dimensionedScalar &ds)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const volVectorField & U() const
Access function to velocity field.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Abstract base class for turbulence models (RAS, LES and laminar).
Macros for easy insertion into run-time selection tables.
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
dimensionedScalar cos(const dimensionedScalar &ds)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
static const word propertiesName
Default name of the turbulence properties dictionary.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
Foam::fvPatchFieldMapper.
virtual void write(Ostream &os) const
Write.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
scalar kappa_
Von Karman constant.
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar sin(const dimensionedScalar &ds)
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
nutURoughWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
dimensionedScalar atan(const dimensionedScalar &ds)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensioned< scalar > mag(const dimensioned< Type > &)
nutWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
scalar yPlusLam_
Y+ at the edge of the laminar sublayer.
scalarField Re(const UList< complex > &cf)
virtual void write(Ostream &) const
Write.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.