46 fixedValueFvPatchVectorField(
p, iF),
60 fixedValueFvPatchVectorField(ptf,
p, iF, mapper),
61 phiName_(ptf.phiName_)
66 <<
"Patch type '" <<
p.type()
67 <<
"' not type '" << mappedPatchBase::typeName <<
"'"
68 <<
" for patch " <<
p.name()
69 <<
" of field " << internalField().name()
70 <<
" in file " << internalField().objectPath()
80 const DimensionedField<vector, volMesh>& iF,
84 fixedValueFvPatchVectorField(
p, iF,
dict),
85 phiName_(
dict.getOrDefault<word>(
"phi",
"phi"))
90 <<
"Patch type '" <<
p.type()
91 <<
"' not type '" << mappedPatchBase::typeName <<
"'"
92 <<
" for patch " <<
p.name()
93 <<
" of field " << internalField().name()
94 <<
" in file " << internalField().objectPath()
106 <<
"Patch " <<
p.name()
107 <<
" of type '" <<
p.type()
108 <<
"' can not be used in 'nearestCell' mode"
109 <<
" of field " << internalField().name()
110 <<
" in file " << internalField().objectPath()
119 const mappedVelocityFluxFixedValueFvPatchField& ptf
122 fixedValueFvPatchVectorField(ptf),
123 phiName_(ptf.phiName_)
134 fixedValueFvPatchVectorField(ptf, iF),
135 phiName_(ptf.phiName_)
155 mappedVelocityFluxFixedValueFvPatchField::patch().patch()
158 const word& fieldName = internalField().name();
175 forAll(UField.boundaryField(), patchi)
178 const scalarField& phipf = phiField.boundaryField()[patchi];
180 label faceStart = Upf.patch().start();
184 allUValues[faceStart + facei] = Upf[facei];
185 allPhiValues[faceStart + facei] = phipf[facei];
189 mpp.distribute(allUValues);
192 mpp.distribute(allPhiValues);
193 newPhiValues.transfer(allPhiValues);
200 const label nbrPatchID =
201 nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch());
203 newUValues = UField.boundaryField()[nbrPatchID];
204 mpp.distribute(newUValues);
206 newPhiValues = phiField.boundaryField()[nbrPatchID];
207 mpp.distribute(newPhiValues);
214 <<
"patch can only be used in NEARESTPATCHFACE, "
215 <<
"NEARESTPATCHFACEAMI or NEARESTFACE mode" <<
nl
221 phiField.constCast().boundaryFieldRef()[
patch().index()] == newPhiValues;
225 fixedValueFvPatchVectorField::updateCoeffs();
235 os.writeEntryIfDifferent<
word>(
"phi",
"phi", phiName_);
247 mappedVelocityFluxFixedValueFvPatchField
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static int & msgType() noexcept
Message tag of standard messages.
static int incrMsgType(int val=1) noexcept
Increment the message tag for standard messages.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
const fvPatch & patch() const noexcept
Return the patch.
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.
label start() const noexcept
The patch start within the polyMesh face list.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
@ NEARESTCELL
nearest cell containing sample
@ NEARESTPATCHFACE
nearest face on selected patch
@ NEARESTPATCHFACEAMI
nearest patch face + AMI interpolation
@ NEARESTFACE
nearest face
const polyMesh & sampleMesh() const
Get the region mesh.
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE).
sampleMode mode() const noexcept
What to sample.
This boundary condition maps the velocity and flux from a neighbour patch to this patch.
virtual void write(Ostream &) const
Write.
mappedVelocityFluxFixedValueFvPatchField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
label nFaces() const noexcept
Number of mesh faces.
A class for handling words, derived from Foam::string.
#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.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
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...
errorManipArg< error, int > exit(error &err, const int errNo=1)
fvPatchField< vector > fvPatchVectorField
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.