70 phiName_(ptf.phiName_),
71 rhoName_(ptf.rhoName_),
72 fieldInf_(ptf.fieldInf_),
86 phiName_(
dict.getOrDefault<
word>(
"phi",
"phi")),
87 rhoName_(
dict.getOrDefault<
word>(
"rho",
"rho")),
108 <<
"unphysical lInf specified (lInf < 0)" <<
nl 121 const advectiveFvPatchField& ptpsf
124 mixedFvPatchField<Type>(ptpsf),
125 phiName_(ptpsf.phiName_),
126 rhoName_(ptpsf.rhoName_),
127 fieldInf_(ptpsf.fieldInf_),
140 phiName_(ptpsf.phiName_),
141 rhoName_(ptpsf.rhoName_),
142 fieldInf_(ptpsf.fieldInf_),
154 this->
patch().template lookupPatchField<surfaceScalarField>(phiName_);
159 this->
patch().template lookupPatchField<volScalarField>(rhoName_);
161 return phip/(rhop*this->
patch().magSf());
165 return phip/this->
patch().magSf();
178 const fvMesh&
mesh = this->internalField().mesh();
184 scalar deltaT = this->db().time().deltaTValue();
186 const GeometricField<Type, fvPatchField, volMesh>&
field =
187 this->db().objectRegistry::template
188 lookupObject<GeometricField<Type, fvPatchField, volMesh>>
190 this->internalField().name()
200 label patchi = this->
patch().index();
211 ddtScheme == fv::EulerDdtScheme<scalar>::typeName
212 || ddtScheme == fv::CrankNicolsonDdtScheme<scalar>::typeName
217 field.oldTime().boundaryField()[patchi] +
k*fieldInf_
220 this->valueFraction() = (1.0 +
k)/(1.0 +
alpha +
k);
222 else if (ddtScheme == fv::backwardDdtScheme<scalar>::typeName)
226 2.0*
field.oldTime().boundaryField()[patchi]
227 - 0.5*
field.oldTime().oldTime().boundaryField()[patchi]
231 this->valueFraction() = (1.5 +
k)/(1.5 +
alpha +
k);
235 ddtScheme == fv::localEulerDdtScheme<scalar>::typeName
244 w*this->
patch().deltaCoeffs()/rDeltaT.boundaryField()[patchi]
248 const scalarField k(w/(rDeltaT.boundaryField()[patchi]*lInf_));
252 field.oldTime().boundaryField()[patchi] +
k*fieldInf_
255 this->valueFraction() = (1.0 +
k)/(1.0 +
alpha +
k);
261 <<
" on patch " << this->
patch().name()
262 <<
" of field " << this->internalField().name()
263 <<
" in file " << this->internalField().objectPath()
271 ddtScheme == fv::EulerDdtScheme<scalar>::typeName
272 || ddtScheme == fv::CrankNicolsonDdtScheme<scalar>::typeName
275 this->refValue() =
field.oldTime().boundaryField()[patchi];
277 this->valueFraction() = 1.0/(1.0 +
alpha);
279 else if (ddtScheme == fv::backwardDdtScheme<scalar>::typeName)
283 2.0*
field.oldTime().boundaryField()[patchi]
284 - 0.5*
field.oldTime().oldTime().boundaryField()[patchi]
287 this->valueFraction() = 1.5/(1.5 +
alpha);
291 ddtScheme == fv::localEulerDdtScheme<scalar>::typeName
300 w*this->
patch().deltaCoeffs()/rDeltaT.boundaryField()[patchi]
303 this->refValue() =
field.oldTime().boundaryField()[patchi];
305 this->valueFraction() = 1.0/(1.0 +
alpha);
311 <<
"\n on patch " << this->
patch().name()
312 <<
" of field " << this->internalField().name()
313 <<
" in file " << this->internalField().objectPath()
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
ITstream & ddtScheme(const word &name) const
Get ddt scheme for given name, or default.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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...
const fvPatch & patch() const noexcept
Return the patch.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalar lInf_
Relaxation length-scale.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Type fieldInf_
Field value of the far-field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
This boundary condition provides a base class for 'mixed' type boundary conditions, i.e. conditions that mix fixed value and patch-normal gradient conditions.
void extrapolateInternal()
Assign the patch field from the internal field.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
label k
Boltzmann constant.
virtual void write(Ostream &) const
Write.
Macros for easy insertion into run-time selection tables.
virtual Field< Type > & refValue()
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual scalarField & valueFraction()
advectiveFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A FieldMapper for finite-volume patch fields.
static const volScalarField & localRDeltaT(const fvMesh &mesh)
Return the reciprocal of the local time-step.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
virtual tmp< scalarField > advectionSpeed() const
Calculate and return the advection speed at the boundary.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
OBJstream os(runTime.globalPath()/outputName)
virtual void write(Ostream &) const
Write.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const DimensionedField< Type, volMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
const std::string patch
OpenFOAM patch number as a std::string.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
This boundary condition provides an advective outflow condition, based on solving DDt(W...
virtual const word & name() const
Return name.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A class for managing temporary objects.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
virtual Field< Type > & refGrad()
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)