45 scalar alphatJayatillekeWallFunctionFvPatchScalarField::maxExp_ = 50.0;
46 scalar alphatJayatillekeWallFunctionFvPatchScalarField::tolerance_ = 0.01;
47 label alphatJayatillekeWallFunctionFvPatchScalarField::maxIters_ = 10;
51 void alphatJayatillekeWallFunctionFvPatchScalarField::checkType()
53 if (!isA<wallFvPatch>(
patch()))
56 <<
"Patch type for patch " <<
patch().name() <<
" must be wall\n" 57 <<
"Current patch type is " <<
patch().type() <<
nl 63 tmp<scalarField> alphatJayatillekeWallFunctionFvPatchScalarField::yPlus
68 const label patchi =
patch().index();
70 const tmp<volScalarField> tnut = turbModel.nut();
73 if (isA<nutWallFunctionFvPatchScalarField>(
nut.boundaryField()[patchi]))
76 dynamic_cast<const nutWallFunctionFvPatchScalarField&
> 78 nut.boundaryField()[patchi]
89 y*
sqrt(turbModel.nuEff(patchi)*
mag(Uw.snGrad()))
90 /turbModel.nu(patchi);
95 scalar alphatJayatillekeWallFunctionFvPatchScalarField::Psmooth
100 return 9.24*(
pow(Prat, 0.75) - 1.0)*(1.0 + 0.28*
exp(-0.007*Prat));
104 scalar alphatJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
112 for (
int iter = 0; iter < maxIters_; ++iter)
114 const scalar
f = ypt - (
log(E_*ypt)/kappa_ + P)/Prat;
115 const scalar df = 1.0 - 1.0/(ypt*kappa_*Prat);
116 const scalar yptNew = ypt -
f/df;
122 else if (
mag(yptNew - ypt) < tolerance_)
145 parent_bctype(
p, iF),
157 const this_bctype& ptf,
163 parent_bctype(ptf,
p, iF, mapper),
178 parent_bctype(
p, iF,
dict),
179 Prt_(
dict.getOrDefault<scalar>(
"Prt", 0.85)),
180 kappa_(
dict.getOrDefault<scalar>(
"kappa", 0.41)),
181 E_(
dict.getOrDefault<scalar>(
"E", 9.8))
190 const this_bctype& awfpsf,
194 parent_bctype(awfpsf, iF),
196 kappa_(awfpsf.kappa_),
212 const label patchi =
patch().index();
219 compressible::turbulenceModel::propertiesName,
220 internalField().
group()
238 const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
240 turbModel.transport().he().boundaryField()[patchi];
247 turbModel.transport().alphaEff(alphatw, patchi)*hew.
snGrad()
253 const scalar yPlus = yPlusp[facei];
255 const scalar
uTau =
yPlus/
y[facei]*(muw[facei]/rhow[facei]);
258 const scalar
Pr = muw[facei]/alphaw[facei];
261 const scalar Prat =
Pr/Prt_;
264 const scalar P = Psmooth(Prat);
265 const scalar yPlusTherm = this->yPlusTherm(P, Prat);
269 if (yPlus < yPlusTherm)
271 const scalar
A = qDot[facei]*rhow[facei]*
uTau*
y[facei];
272 const scalar
B = qDot[facei]*
Pr*
yPlus;
279 const scalar
A = qDot[facei]*rhow[facei]*
uTau*
y[facei];
280 const scalar
B = qDot[facei]*Prt_*(1.0/kappa_*
log(E_*yPlus) + P);
282 uTau/kappa_*
log(E_*yPlusTherm) -
mag(Uw[facei]);
291 alphatw[facei] =
max(scalar(0),
alphaEff - alphaw[facei]);
296 <<
" Pr = " <<
Pr <<
nl 297 <<
" Prt = " << Prt_ <<
nl 298 <<
" qDot = " << qDot[facei] <<
nl 300 <<
" yPlusTherm = " << yPlusTherm <<
nl 302 <<
" alphaw = " << alphaw[facei] <<
nl 303 <<
" alphatw = " << alphatw[facei] <<
nl 315 os.writeEntryIfDifferent<scalar>(
"Prt", 0.85, Prt_);
316 os.writeEntryIfDifferent<scalar>(
"kappa", 0.41, kappa_);
317 os.writeEntryIfDifferent<scalar>(
"E", 9.8, E_);
327 alphatJayatillekeWallFunctionFvPatchScalarField
dimensionedScalar Pr("Pr", dimless, laminarTransport)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Graphite solid properties.
fvPatchField< vector > fvPatchVectorField
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
virtual void write(Ostream &) const
Write.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
constexpr const char *const group
Group name for atomic constants.
makePatchTypeField(fvPatchScalarField, alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
alphatJayatillekeWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
dimensionedScalar exp(const dimensionedScalar &ds)
fvPatchField< scalar > fvPatchScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
int debug
Static debugging option.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
volScalarField alphaEff("alphaEff", turbulence->nu()/Pr+alphat)
A class for managing temporary objects.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)