43 mixedFvPatchVectorField(
p, iF),
46 psiName_(
"thermo:psi"),
52 refValue() = patchInternalField();
66 mixedFvPatchVectorField(
p, iF),
67 TName_(
dict.getOrDefault<
word>(
"T",
"T")),
68 pName_(
dict.getOrDefault<
word>(
"p",
"p")),
69 psiName_(
dict.getOrDefault<
word>(
"psi",
"thermo:psi")),
71 pInf_(
dict.get<scalar>(
"pInf")),
72 TInf_(
dict.get<scalar>(
"TInf")),
73 gamma_(
dict.get<scalar>(
"gamma"))
77 if (!this->readValueEntry(
dict))
79 this->extrapolateInternal();
89 <<
" unphysical pInf specified (pInf <= 0.0)"
90 <<
"\n on patch " << this->patch().name()
91 <<
" of field " << this->internalField().name()
92 <<
" in file " << this->internalField().objectPath()
101 const supersonicFreestreamFvPatchVectorField& ptf,
103 const DimensionedField<vector, volMesh>& iF,
104 const fvPatchFieldMapper& mapper
107 mixedFvPatchVectorField(ptf,
p, iF, mapper),
110 psiName_(ptf.psiName_),
124 mixedFvPatchVectorField(sfspvf),
125 TName_(sfspvf.TName_),
126 pName_(sfspvf.pName_),
127 psiName_(sfspvf.psiName_),
131 gamma_(sfspvf.gamma_)
142 mixedFvPatchVectorField(sfspvf, iF),
143 TName_(sfspvf.TName_),
144 pName_(sfspvf.pName_),
145 psiName_(sfspvf.psiName_),
149 gamma_(sfspvf.gamma_)
157 if (!size() || updated())
162 const auto& pT = patch().lookupPatchField<
volScalarField>(TName_);
166 const auto& ppsi = patch().lookupPatchField<
volScalarField>(psiName_);
170 scalar
R = 1.0/(ppsi[0]*pT[0]);
172 scalar MachInf =
mag(UInf_)/
sqrt(gamma_*
R*TInf_);
177 <<
"\n on patch " << this->patch().name()
178 <<
" of field " << this->internalField().name()
179 <<
" in file " << this->internalField().objectPath()
212 sqrt((gamma_ + 1)/(gamma_ - 1))
213 *
atan(
sqrt((gamma_ - 1)/(gamma_ + 1)*(
sqr(MachInf) - 1)))
222 if (
pp[facei] >= pInf_)
229 /(gamma_*
sqr(MachInf))*
mag(Ut[facei])*
log(
pp[facei]/pInf_);
231 Up[facei] = Ut[facei] + fpp*nHatInf[facei];
234 scalar Mach =
mag(Up[facei])/
sqrt(gamma_/ppsi[facei]);
240 Up[facei] =
U[facei];
241 valueFraction()[facei] = 0;
252 (2/(gamma_ - 1))*(1 + ((gamma_ - 1)/2)*
sqr(MachInf))
253 *
pow(
pp[facei]/pInf_, (1 - gamma_)/gamma_)
263 sqrt((gamma_ + 1)/(gamma_ - 1))
264 *
atan(
sqrt((gamma_ - 1)/(gamma_ + 1)*(
sqr(Mach) - 1)))
267 scalar fpp = (nuMachInf - nuMachf)*
mag(Ut[facei]);
269 Up[facei] = Ut[facei] + fpp*nHatInf[facei];
274 <<
"unphysical subsonic inflow has been generated"
275 <<
"\n on patch " << this->
patch().name()
276 <<
" of field " << this->internalField().name()
278 << this->internalField().objectPath()
284 mixedFvPatchVectorField::updateCoeffs();
309 supersonicFreestreamFvPatchVectorField
#define R(A, B, C, D, E, F, K, M)
Macros for easy insertion into run-time selection tables.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual void readDict(const dictionary &dict)
Read dictionary entries.
A FieldMapper for finite-volume patch fields.
virtual void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Lookup type of boundary radiation properties.
This boundary condition provides a supersonic free-stream condition.
supersonicFreestreamFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#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,...
const std::string patch
OpenFOAM patch number as a std::string.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensionedScalar atan(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
fvPatchField< vector > fvPatchVectorField
#define forAll(list, i)
Loop across all elements in list.