54 const bool valueRequired
60 if (!isA<cyclicFvPatch>(
p))
63 <<
" patch type '" <<
p.type()
64 <<
"' not constraint type '" <<
typeName <<
"'" 65 <<
"\n for patch " <<
p.name()
81 const cyclicFvPatchField<Type>& ptf,
83 const DimensionedField<Type, volMesh>& iF,
84 const fvPatchFieldMapper& mapper
87 coupledFvPatchField<Type>(ptf,
p, iF, mapper),
88 cyclicPatch_(
refCast<const cyclicFvPatch>(
p))
90 if (!isA<cyclicFvPatch>(this->
patch()))
93 <<
"' not constraint type '" <<
typeName <<
"'" 94 <<
"\n for patch " << p.name()
105 const cyclicFvPatchField<Type>& ptf
108 cyclicLduInterfaceField(),
110 cyclicPatch_(ptf.cyclicPatch_)
122 cyclicPatch_(ptf.cyclicPatch_)
132 const Field<Type>& iField = this->primitiveField();
134 cyclicPatch().cyclicPatch().neighbPatch().faceCells();
146 forwardT()[0], iField[nbrFaceCells[facei]]
154 pnf[facei] = iField[nbrFaceCells[facei]];
169 this->primitiveField()
172 return refCast<const cyclicFvPatchField<Type>>
174 fld.boundaryField()[this->cyclicPatch().neighbPatchID()]
196 this->cyclicPatch().neighbPatchID()
202 transformCoupleField(pnf, cmpt);
208 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
227 this->cyclicPatch().neighbPatchID()
233 transformCoupleField(pnf);
238 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
257 if (this->cyclicPatch().owner())
259 label index = this->
patch().index();
261 const label globalPatchID =
282 label globalFaceI =
faceMap[faceI];
284 const scalar boundCorr = -boundCoeffsCmpt[faceI];
285 const scalar intCorr = -intCoeffsCmpt[faceI];
287 matrix.
upper()[globalFaceI] += boundCorr;
288 matrix.
diag()[u[globalFaceI]] -= boundCorr;
289 matrix.
diag()[l[globalFaceI]] -= intCorr;
293 matrix.
lower()[globalFaceI] += intCorr;
297 if (matrix.
psi(mat).mesh().fluxRequired(this->internalField().
name()))
301 globalPatchID, intCoeffsCmpt*pTraits<Type>::one
305 globalPatchID, boundCoeffsCmpt*pTraits<Type>::one
308 const label nbrPathID = this->cyclicPatch().neighbPatchID();
310 const label nbrGlobalPatchID =
315 nbrGlobalPatchID, intCoeffsCmpt*pTraits<Type>::one
320 nbrGlobalPatchID, boundCoeffsCmpt*pTraits<Type>::one
"blocking" : (MPI_Bsend, MPI_Recv)
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
const labelListList & patchLocalToGlobalMap() const
Return patchLocalToGlobalMap.
errorManipArg< error, int > exit(error &err, const int errNo=1)
commsTypes
Types of communications.
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.
const lduPrimitiveMeshAssembly & lduMeshAssembly()
Return optional lduAdressing.
Type & refCast(U &obj)
A dynamic_cast (for references) that generates FatalError on failed casts, uses the virtual type() me...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const cyclicFvPatchField< Type > & neighbourPatchField() const
Return reference to neighbour patchField.
Generic GeometricField class.
Smooth ATC in cells next to a set of patches supplied by type.
virtual void write(Ostream &) const
Write.
virtual const labelUList & lowerAddr() const =0
Return lower addressing.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
Typename for Field.
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Generic templated field type.
virtual const labelUList & upperAddr() const =0
Return upper addressing.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
Abstract base class for coupled patches.
This boundary condition enforces a cyclic condition between a pair of boundaries. ...
bool asymmetric() const noexcept
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
OBJstream os(runTime.globalPath()/outputName)
const labelListListList & faceBoundMap() const
Return boundary face map.
virtual void manipulateMatrix(fvMatrix< Type > &m, const label iMatrix, const direction cmp)
Manipulate matrix.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const lduAddressing & lduAddr() const
Return the LDU addressing.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
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 dimensioned internal field reference.
const std::string patch
OpenFOAM patch number as a std::string.
virtual void write(Ostream &os) const
Write.
tmp< Field< Type > > patchNeighbourField() const
Return neighbour coupled internal cell data.
const FieldField< Field, Type > & internalCoeffs() const noexcept
fvBoundary scalar field containing pseudo-matrix coeffs for internal cells
The class contains the addressing required by the lduMatrix: upper, lower and losort.
const FieldField< Field, Type > & boundaryCoeffs() const noexcept
fvBoundary scalar field containing pseudo-matrix coeffs for boundary cells
A class for managing temporary objects.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
cyclicFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.