60 if (!isA<cyclicFvPatch>(
p))
63 <<
" patch type '" <<
p.type()
64 <<
"' not constraint type '" << typeName <<
"'" 65 <<
"\n for patch " <<
p.name()
66 <<
" of field " << this->internalField().name()
67 <<
" in file " << this->internalField().objectPath()
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 <<
"\n patch type '" << p.type()
94 <<
"' not constraint type '" << typeName <<
"'" 95 <<
"\n for patch " <<
p.name()
96 <<
" of field " << this->internalField().name()
97 <<
" in file " << this->internalField().objectPath()
106 const cyclicFvPatchField<Type>& ptf
109 cyclicLduInterfaceField(),
111 cyclicPatch_(ptf.cyclicPatch_)
123 cyclicPatch_(ptf.cyclicPatch_)
133 const Field<Type>& iField = this->primitiveField();
135 cyclicPatch().cyclicPatch().neighbPatch().faceCells();
138 auto& pnf = tpnf.ref();
147 forwardT()[0], iField[nbrFaceCells[facei]]
155 pnf[facei] = iField[nbrFaceCells[facei]];
170 this->primitiveField()
173 return refCast<const cyclicFvPatchField<Type>>
175 fld.boundaryField()[this->cyclicPatch().neighbPatchID()]
197 this->cyclicPatch().neighbPatchID()
203 transformCoupleField(pnf, cmpt);
209 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
228 this->cyclicPatch().neighbPatchID()
234 transformCoupleField(pnf);
239 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
258 if (this->cyclicPatch().owner())
260 label index = this->
patch().index();
262 const label globalPatchID =
283 label globalFaceI =
faceMap[faceI];
285 const scalar boundCorr = -boundCoeffsCmpt[faceI];
286 const scalar intCorr = -intCoeffsCmpt[faceI];
288 matrix.
upper()[globalFaceI] += boundCorr;
289 matrix.
diag()[u[globalFaceI]] -= boundCorr;
290 matrix.
diag()[l[globalFaceI]] -= intCorr;
294 matrix.
lower()[globalFaceI] += intCorr;
298 if (matrix.
psi(mat).mesh().fluxRequired(this->internalField().
name()))
302 globalPatchID, intCoeffsCmpt*pTraits<Type>::one
306 globalPatchID, boundCoeffsCmpt*pTraits<Type>::one
309 const label nbrPathID = this->cyclicPatch().neighbPatchID();
311 const label nbrGlobalPatchID =
316 nbrGlobalPatchID, intCoeffsCmpt*pTraits<Type>::one
321 nbrGlobalPatchID, boundCoeffsCmpt*pTraits<Type>::one
const scalarField & diag() const
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
commsTypes
Communications types.
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const lduPrimitiveMeshAssembly & lduMeshAssembly()
Return optional lduAdressing.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
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.
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.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
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 expressions::valueTypeCode::INVALID.
Generic templated field type.
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
const scalarField & lower() const
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.
Abstract base class for coupled patches.
This boundary condition enforces a cyclic condition between a pair of boundaries. ...
bool asymmetric() const noexcept
Matrix is asymmetric (ie, full)
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)
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 scalarField & upper() const
const lduAddressing & lduAddr() const
Return the LDU addressing.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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.