45scalar alphatJayatillekeWallFunctionFvPatchScalarField::maxExp_ = 50.0;
46scalar alphatJayatillekeWallFunctionFvPatchScalarField::tolerance_ = 0.01;
47label alphatJayatillekeWallFunctionFvPatchScalarField::maxIters_ = 10;
51void alphatJayatillekeWallFunctionFvPatchScalarField::checkType()
56 <<
"Patch type for patch " <<
patch().name() <<
" must be wall\n"
57 <<
"Current patch type is " <<
patch().type() <<
nl
63tmp<scalarField> alphatJayatillekeWallFunctionFvPatchScalarField::yPlus
68 const label patchi =
patch().index();
70 const tmp<volScalarField> tnut = turbModel.nut();
76 dynamic_cast<const nutWallFunctionFvPatchScalarField&
>
78 nut.boundaryField()[patchi]
89 y*
sqrt(turbModel.nuEff(patchi)*
mag(Uw.snGrad()))
90 /turbModel.nu(patchi);
95scalar alphatJayatillekeWallFunctionFvPatchScalarField::Psmooth
100 return 9.24*(
pow(Prat, 0.75) - 1.0)*(1.0 + 0.28*
exp(-0.007*Prat));
104scalar 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 fixedValueFvPatchScalarField(
p, iF),
163 fixedValueFvPatchScalarField(ptf,
p, iF, mapper),
178 fixedValueFvPatchScalarField(
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))
193 fixedValueFvPatchScalarField(awfpsf),
195 kappa_(awfpsf.kappa_),
209 fixedValueFvPatchScalarField(awfpsf, iF),
211 kappa_(awfpsf.kappa_),
227 const label patchi = patch().index();
235 internalField().group()
253 const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
255 turbModel.transport().he().boundaryField()[patchi];
262 turbModel.transport().alphaEff(alphatw, patchi)*hew.
snGrad()
268 const scalar
yPlus = yPlusp[facei];
270 const scalar
uTau =
yPlus/
y[facei]*(muw[facei]/rhow[facei]);
273 const scalar
Pr = muw[facei]/alphaw[facei];
276 const scalar Prat =
Pr/Prt_;
279 const scalar P = Psmooth(Prat);
280 const scalar yPlusTherm = this->yPlusTherm(P, Prat);
284 if (
yPlus < yPlusTherm)
286 const scalar
A = qDot[facei]*rhow[facei]*
uTau*
y[facei];
287 const scalar
B = qDot[facei]*
Pr*
yPlus;
294 const scalar
A = qDot[facei]*rhow[facei]*
uTau*
y[facei];
295 const scalar
B = qDot[facei]*Prt_*(1.0/kappa_*
log(E_*
yPlus) + P);
297 uTau/kappa_*
log(E_*yPlusTherm) -
mag(Uw[facei]);
306 alphatw[facei] =
max(scalar(0),
alphaEff - alphaw[facei]);
311 <<
" Pr = " <<
Pr <<
nl
312 <<
" Prt = " << Prt_ <<
nl
313 <<
" qDot = " << qDot[facei] <<
nl
314 <<
" yPlus = " << yPlus <<
nl
315 <<
" yPlusTherm = " << yPlusTherm <<
nl
317 <<
" alphaw = " << alphaw[facei] <<
nl
318 <<
" alphatw = " << alphatw[facei] <<
nl
330 os.writeEntryIfDifferent<scalar>(
"Prt", 0.85, Prt_);
331 os.writeEntryIfDifferent<scalar>(
"kappa", 0.41, kappa_);
332 os.writeEntryIfDifferent<scalar>(
"E", 9.8, E_);
342 alphatJayatillekeWallFunctionFvPatchScalarField
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
Macros for easy insertion into run-time selection tables.
Graphite solid properties.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
This boundary condition provides a thermal wall function for turbulent thermal diffusivity (usuallyal...
void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
alphatJayatillekeWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A class for managing temporary objects.
static const word propertiesName
Default name of the turbulence properties dictionary.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Define a concrete fvPatchField type and add to run-time tables Example, (fvPatchScalarField,...
volScalarField alphaEff("alphaEff", turbulence->nu()/Pr+alphat)
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
Namespace for handling debugging switches.
const std::string patch
OpenFOAM patch number as a std::string.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
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...
errorManipArg< error, int > exit(error &err, const int errNo=1)
fvPatchField< vector > fvPatchVectorField
fvPatchField< scalar > fvPatchScalarField
constexpr char nl
The newline '\n' character (0x0a).
dimensionedScalar Pr("Pr", dimless, laminarTransport)
#define forAll(list, i)
Loop across all elements in list.