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)
106 directionMixedFvPatchVectorField(ptf, iF),
107 phiName_(ptf.phiName_),
109 inletOutlet_(ptf.inletOutlet_),
110 faceCellSubset_(
nullptr),
111 faceCellSubsetTimeIndex_(-1)
120 const fvMesh&
mesh = patch().boundaryMesh().mesh();
125 !faceCellSubset_.valid()
130 faceCellSubset_->setCellSubset(patch().faceCells());
136 faceCellSubset_->subMesh().tetBasePtIs();
139 return faceCellSubset_();
145 const scalar t = db().time().timeOutputValue();
152 waves.
height(t, patch().Cf()),
153 waves.
height(t, patch().patch().localPoints()),
154 waves.
UGas(t, patch().Cf())(),
155 waves.
UGas(t, patch().patch().localPoints())(),
156 waves.
ULiquid(t, patch().Cf())(),
157 waves.
ULiquid(t, patch().patch().localPoints())()
164 const scalar t = db().time().timeOutputValue();
192 const label fs = is + meshs.
boundary()[patchis].patch().start();
195 const label i = patch().patch().whichFace(f);
214 if (isA<wavePressureFvPatchScalarField>(pp))
224 refGrad() = (
U -
Un)*patch().deltaCoeffs();
238 refValue() = (1 - out)*U;
245 const scalar QPhip =
gSum(out*phip);
246 const scalar QWave =
gSum(out*(U & patch().Sf()));
250 refValue() += out*(QWave/QPhip)*phip*nBySf;
254 refValue() += out*QWave*nBySf;
256 valueFraction() += out*
sqr(patch().nf());
265 directionMixedFvPatchVectorField::updateCoeffs();
276 writeEntryIfDifferent<word>(os,
"phi",
"phi", phiName_);
277 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
278 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...
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.
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
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.
const labelList & faceMap() const
Return face map.
virtual const pointField & points() const
Return raw points.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const labelList & patchMap() const
Return patch map.
const fvMesh & subMesh() const
Return reference to subset mesh.
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.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
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.
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.