40 mixedFvPatchVectorField(p, iF),
43 psiName_(
"thermo:psi"),
49 refValue() = patchInternalField();
63 mixedFvPatchVectorField(p, iF),
67 UInf_(dict.
lookup(
"UInf")),
68 pInf_(dict.
lookup<scalar>(
"pInf")),
69 TInf_(dict.
lookup<scalar>(
"TInf")),
70 gamma_(dict.
lookup<scalar>(
"gamma"))
72 if (dict.
found(
"value"))
93 ) <<
" unphysical pInf specified (pInf <= 0.0)" 94 <<
"\n on patch " << this->patch().name()
95 <<
" of field " << this->internalField().name()
96 <<
" in file " << this->internalField().objectPath()
111 mixedFvPatchVectorField(ptf, p, iF, mapper),
114 psiName_(ptf.psiName_),
129 mixedFvPatchVectorField(sfspvf, iF),
130 TName_(sfspvf.TName_),
131 pName_(sfspvf.pName_),
132 psiName_(sfspvf.psiName_),
136 gamma_(sfspvf.gamma_)
144 if (!size() || updated())
160 scalar
R = 1.0/(ppsi[0]*pT[0]);
162 scalar MachInf =
mag(UInf_)/
sqrt(gamma_*R*TInf_);
167 <<
"\n on patch " << this->patch().name()
168 <<
" of field " << this->internalField().name()
169 <<
" in file " << this->internalField().objectPath()
202 sqrt((gamma_ + 1)/(gamma_ - 1))
203 *
atan(
sqrt((gamma_ - 1)/(gamma_ + 1)*(
sqr(MachInf) - 1)))
212 if (pp[facei] >= pInf_)
219 /(gamma_*
sqr(MachInf))*
mag(Ut[facei])*
log(pp[facei]/pInf_);
221 Up[facei] = Ut[facei] + fpp*nHatInf[facei];
224 scalar Mach =
mag(Up[facei])/
sqrt(gamma_/ppsi[facei]);
230 Up[facei] = U[facei];
231 valueFraction()[facei] = 0;
242 (2/(gamma_ - 1))*(1 + ((gamma_ - 1)/2)*
sqr(MachInf))
243 *
pow(pp[facei]/pInf_, (1 - gamma_)/gamma_)
253 sqrt((gamma_ + 1)/(gamma_ - 1))
254 *
atan(
sqrt((gamma_ - 1)/(gamma_ + 1)*(
sqr(Mach) - 1)))
257 scalar fpp = (nuMachInf - nuMachf)*
mag(Ut[facei]);
259 Up[facei] = Ut[facei] + fpp*nHatInf[facei];
264 <<
"unphysical subsonic inflow has been generated" 265 <<
"\n on patch " << this->patch().name()
266 <<
" of field " << this->internalField().name()
268 << this->internalField().objectPath()
274 mixedFvPatchVectorField::updateCoeffs();
281 writeEntryIfDifferent<word>(os,
"T",
"T", TName_);
282 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
283 writeEntryIfDifferent<word>(os,
"psi",
"thermo:psi", psiName_);
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
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...
volVectorField vectorField(fieldObject, mesh)
virtual void write(Ostream &) const
Write.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void write(Ostream &) const
Write.
A class for handling words, derived from string.
Foam::fvPatchFieldMapper.
virtual label size() const
Return size.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
This boundary condition provides a supersonic free-stream condition.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define R(A, B, C, D, E, F, K, M)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
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 > &)
A class for managing temporary objects.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
supersonicFreestreamFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.