41 directionMixedFvPatchVectorField(p, iF),
45 faceCellSubset_(
nullptr),
46 faceCellSubsetTimeIndex_(-1)
50 valueFraction() =
Zero;
61 directionMixedFvPatchVectorField(p, iF),
65 faceCellSubset_(
nullptr),
66 faceCellSubsetTimeIndex_(-1)
68 if (dict.
found(
"value"))
74 fvPatchVectorField::operator=(patchInternalField());
79 valueFraction() =
Zero;
91 directionMixedFvPatchVectorField(ptf, p, iF, mapper),
92 phiName_(ptf.phiName_),
94 inletOutlet_(ptf.inletOutlet_),
95 faceCellSubset_(
nullptr),
96 faceCellSubsetTimeIndex_(-1)
105 directionMixedFvPatchVectorField(ptf),
106 phiName_(ptf.phiName_),
108 inletOutlet_(ptf.inletOutlet_),
109 faceCellSubset_(
nullptr),
110 faceCellSubsetTimeIndex_(-1)
120 directionMixedFvPatchVectorField(ptf, iF),
121 phiName_(ptf.phiName_),
123 inletOutlet_(ptf.inletOutlet_),
124 faceCellSubset_(
nullptr),
125 faceCellSubsetTimeIndex_(-1)
134 const fvMesh&
mesh = patch().boundaryMesh().mesh();
139 !faceCellSubset_.valid()
144 faceCellSubset_->setCellSubset(patch().faceCells());
150 faceCellSubset_->subMesh().tetBasePtIs();
153 return faceCellSubset_();
159 const scalar t = db().time().timeOutputValue();
166 waves.
height(t, patch().Cf()),
167 waves.
height(t, patch().patch().localPoints()),
168 waves.
UGas(t, patch().Cf())(),
169 waves.
UGas(t, patch().patch().localPoints())(),
170 waves.
ULiquid(t, patch().Cf())(),
171 waves.
ULiquid(t, patch().patch().localPoints())()
178 const scalar t = db().time().timeOutputValue();
206 const label fs = is + meshs.
boundary()[patchis].patch().start();
209 const label i = patch().patch().whichFace(f);
228 if (isA<wavePressureFvPatchScalarField>(pp))
238 refGrad() = (
U -
Un)*patch().deltaCoeffs();
252 refValue() = (1 - out)*U;
259 const scalar QPhip =
gSum(out*phip);
260 const scalar QWave =
gSum(out*(U & patch().
Sf()));
264 refValue() += out*(QWave/QPhip)*phip*nBySf;
268 refValue() += out*QWave*nBySf;
270 valueFraction() += out*
sqr(patch().nf());
279 directionMixedFvPatchVectorField::updateCoeffs();
280 directionMixedFvPatchVectorField::evaluate();
290 writeEntryIfDifferent<word>(os,
"phi",
"phi", phiName_);
291 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
292 writeEntryIfDifferent<Switch>(os,
"inletOutlet",
true, inletOutlet_);
bool changing() const
Is mesh changing (topology changing and/or moving)
A wrapper around a list of wave models. Superimposes the modelled values of elevation and velocity...
const labelList & patchMap() const
Return patch map.
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.
virtual tmp< vectorField > UGas(const scalar t, const vectorField &p) const
Get the gas velocity at a given time and global positions.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
waveVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
const fvMeshSubset & faceCellSubset() const
Access the face-cell subset.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
T & ref() const
Return non-const reference or generate a fatal error.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual void write(Ostream &) const
Write.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual tmp< vectorField > ULiquid(const scalar t, const vectorField &p) const
Get the liquid velocity at a given time and global positions.
volVectorField vectorField(fieldObject, mesh)
const Time & time() const
Return the top-level database.
Macros for easy insertion into run-time selection tables.
virtual const pointField & points() const
Return raw points.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual tmp< scalarField > height(const scalar t, const vectorField &p) const
Get the height above the waves at a given time and global positions.
Type gSum(const FieldField< Field, Type > &f)
static const SymmTensor I
A class for handling words, derived from string.
Foam::fvPatchFieldMapper.
const labelList & faceMap() const
Return face map.
This boundary condition provides a waveVelocity condition. This sets the velocity to that specified b...
const vectorField & cellCentres() const
static const waveSuperposition & New(const objectRegistry &db)
Return a reference to the wave model on the given database,.
virtual label size() const
Return size.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar pos0(const dimensionedScalar &ds)
tmp< Field< Type > > levelSetAverage(const fvMesh &mesh, const scalarField &levelC, const scalarField &levelP, const Field< Type > &positiveC, const Field< Type > &positiveP, const Field< Type > &negativeC, const Field< Type > &negativeP)
Calculate the average value of two fields, one on each side of a level set.
Post-processing mesh subset tool. Given the original mesh and the list of selected cells...
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
tmp< vectorField > Un() const
Return the current modelled velocity field in the neighbour cell.
label timeIndex() const
Return current time index.
const fvMesh & subMesh() const
Return reference to subset mesh.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Mesh data needed to do the Finite Volume discretisation.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
ListType subset(const UList< T > &select, const T &value, const ListType &)
Extract elements of List when select is a certain value.
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
tmp< vectorField > U() const
Return the current modelled velocity field on the patch faces.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.