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_)
132 const Field<Type>& iField = this->primitiveField();
134 cyclicPatch().cyclicPatch().neighbPatch().faceCells();
142 forwardT()[0], iField[nbrFaceCells[facei]]
150 pnf[facei] = iField[nbrFaceCells[facei]];
160 auto tpnf = tmp<Field<Type>>
::New(this->size());
161 this->patchNeighbourField(tpnf.ref());
173 this->primitiveField()
176 return refCast<const cyclicFvPatchField<Type>>
178 fld.boundaryField()[this->cyclicPatch().neighbPatchID()]
200 this->cyclicPatch().neighbPatchID()
206 transformCoupleField(pnf, cmpt);
212 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
231 this->cyclicPatch().neighbPatchID()
237 transformCoupleField(pnf);
242 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
261 if (this->cyclicPatch().owner())
263 label index = this->
patch().index();
265 const label globalPatchID =
286 label globalFaceI =
faceMap[faceI];
288 const scalar boundCorr = -boundCoeffsCmpt[faceI];
289 const scalar intCorr = -intCoeffsCmpt[faceI];
291 matrix.
upper()[globalFaceI] += boundCorr;
292 matrix.
diag()[u[globalFaceI]] -= boundCorr;
293 matrix.
diag()[l[globalFaceI]] -= intCorr;
297 matrix.
lower()[globalFaceI] += intCorr;
301 if (matrix.
psi(mat).mesh().fluxRequired(this->internalField().
name()))
305 globalPatchID, intCoeffsCmpt*pTraits<Type>::one
309 globalPatchID, boundCoeffsCmpt*pTraits<Type>::one
312 const label nbrPathID = this->cyclicPatch().neighbPatchID();
314 const label nbrGlobalPatchID =
319 nbrGlobalPatchID, intCoeffsCmpt*pTraits<Type>::one
324 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.
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)
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
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))
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.
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.
virtual 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.
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.