Go to the documentation of this file.
45 mixedFvPatchScalarField(
p, iF),
46 phaseFraction_(
"alpha"),
51 this->refValue() = 0.0;
52 this->refGrad() = 0.0;
53 this->valueFraction() = 0.0;
65 mixedFvPatchScalarField(
p, iF),
66 phaseFraction_(
dict.getOrDefault<
word>(
"phaseFraction",
"alpha")),
67 rho_(
dict.get<scalar>(
"rho")),
68 pRefValue_(
dict.get<scalar>(
"pRefValue")),
69 pRefPoint_(
dict.lookup(
"pRefPoint"))
71 this->patchType() =
dict.getOrDefault<
word>(
"patchType", word::null);
73 this->refValue() = pRefValue_;
75 if (
dict.found(
"value"))
77 fvPatchScalarField::operator=
84 fvPatchScalarField::operator=(this->refValue());
87 this->refGrad() = 0.0;
88 this->valueFraction() = 0.0;
101 mixedFvPatchScalarField(ptf,
p, iF, mapper),
115 mixedFvPatchScalarField(ptf),
127 mixedFvPatchScalarField(ptf, iF),
156 valueFraction() =
max(
min(alphap, scalar(1)), scalar(0));
162 mixedFvPatchScalarField::updateCoeffs();
173 writeEntry(
"value", os);
179 void Foam::phaseHydrostaticPressureFvPatchScalarField::operator=
186 valueFraction()*refValue() + (1 - valueFraction())*ptf
virtual void write(Ostream &) const
Write.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
friend Ostream & operator(Ostream &, const fvPatchField< scalar > &)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
vector pRefPoint_
Reference pressure location.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
word phaseFraction_
Name of phase-fraction field.
This boundary condition provides a phase-based hydrostatic pressure condition, calculated as:
GeometricField< scalar, fvPatchField, volMesh > volScalarField
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
phaseHydrostaticPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
const uniformDimensionedVectorField & g
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const std::string patch
OpenFOAM patch number as a std::string.
scalar rho_
Constant density in the far-field.
scalar pRefValue_
Reference pressure.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
virtual void write(Ostream &) const
Write.
static const gravity & New(const Time &runTime)
Construct on Time.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...