51 if (!cyclicACMIPolyPatch_.
owner())
56 if (updated || !cyclicACMIPolyPatch_.
upToDate(areaTime_))
60 Pout<<
"cyclicACMIFvPatch::updateAreas() : updating fv areas for "
67 const fvPatch& nbrNonOverlapPatch = nbrACMI.nonOverlapPatch();
77 cyclicACMIPolyPatch_.setUpToDate(areaTime_);
85 const_cast<vectorField&
>(fvp.Sf()) = fvp.patch().faceAreas();
86 const_cast<vectorField&
>(fvp.Cf()) = fvp.patch().faceCentres();
90 << fvp.patch().name() <<
" area:" <<
sum(fvp.magSf()) <<
endl;
107 nbrPatch.
nf() & nbrPatch.coupledFvPatch::delta()
116 scalar di =
mag(deltas[facei]);
117 scalar dni =
mag(nbrDeltas[facei]);
128 w[facei] = dni/(di + dni);
144 const polyPatch& patch,
145 const fvBoundaryMesh& bm
148 coupledFvPatch(patch, bm),
149 cyclicACMILduInterface(),
150 cyclicACMIPolyPatch_(
refCast<const cyclicACMIPolyPatch>(patch)),
156 boundaryMesh().
mesh().pointsInstance(),
157 boundaryMesh().
mesh(),
160 IOobject::NO_REGISTER
257 const vector& ddi = patchD[facei];
258 const vector& dni = nbrPatchD[facei];
260 pdv[facei] = ddi - dni;
267 const vector& ddi = patchD[facei];
268 const vector& dni = nbrPatchD[facei];
270 pdv[facei] = ddi -
transform(forwardT()[0], dni);
317 const bool updated = updateAreas();
320 if (cyclicACMIPolyPatch_.owner() && updated)
324 Pout<<
"cyclicACMIFvPatch::movePoints() : areas updated for "
325 <<
name() <<
"; updating mesh flux now"
331 const fvPatch& nonOverlapPatch = this->nonOverlapPatch();
332 const cyclicACMIFvPatch& nbrACMI = neighbPatch();
333 const fvPatch& nbrNonOverlapPatch = nbrACMI.nonOverlapPatch();
338 const fvMesh&
mesh = boundaryMesh().mesh();
344 scalarField& phip = meshPhiBf[cyclicACMIPolyPatch_.index()];
346 meshPhiBf[nonOverlapPatch.patch().index()];
352 if (newSrcAddr[facei].empty())
360 const face& fAMI = cyclicACMIPolyPatch_[facei];
365 const scalar geomArea = fAMI.
mag(
points);
366 phip[facei] *= magSf()[facei]/geomArea;
370 forAll(phiNonOverlapp, facei)
372 const scalar w = 1.0 - cyclicACMIPolyPatch_.srcMask()[facei];
373 phiNonOverlapp[facei] *= w;
377 scalarField& nbrPhip = meshPhiBf[nbrPatch.index()];
379 meshPhiBf[nbrNonOverlapPatch.patch().index()];
383 if (newTgtAddr[facei].empty())
385 nbrPhip[facei] = 0.0;
389 const face& fAMI = nbrPatch[facei];
394 const scalar geomArea = fAMI.
mag(
points);
395 nbrPhip[facei] *= nbrACMI.magSf()[facei]/geomArea;
399 forAll(nbrPhiNonOverlapp, facei)
401 const scalar w = 1.0 - cyclicACMIPolyPatch_.tgtMask()[facei];
402 nbrPhiNonOverlapp[facei] *= w;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void size(const label n)
Older name for setAddressableSize.
commsTypes
Communications types.
static bool & parRun() noexcept
Test if this a parallel run.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
const bMesh & mesh() const
virtual const labelUList & faceCells() const
Return faceCell addressing.
coupledFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
virtual tmp< vectorField > delta() const =0
Return delta (P to N) vectors across coupled patch.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI).
const cyclicACMIFvPatch & neighbFvPatch() const
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
void resetPatchAreas(const fvPatch &fvp) const
Helper function to reset the FV patch areas from the primitive patch.
void makeWeights(scalarField &) const
Make patch weighting factors.
virtual void movePoints()
Correct patches after moving points.
virtual bool coupled() const
Return true if this patch is coupled.
virtual bool parallel() const
Are the cyclic planes parallel.
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return local reference cast into the cyclic patch.
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
cyclicACMIFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
virtual const fvPatch & nonOverlapPatch() const
Return non-overlapping fvPatch.
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to the interface as a field.
virtual const AMIPatchToPatchInterpolation & AMI() const
Return a reference to the AMI interpolator.
virtual const cyclicACMIFvPatch & neighbPatch() const
Return neighbour fvPatch.
virtual bool updateAreas() const
Update the AMI and patch areas. Return true if anything updated.
tmp< Field< Type > > interpolate(const Field< Type > &fld) const
Interpolate (make sure to have uptodate areas).
virtual const tensorField & forwardT() const
Return face transformation tensor.
cyclicACMILduInterface() noexcept=default
Default construct.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI).
bool upToDate(const regIOobject &) const
Return true if given object is up to date with *this.
static scalar tolerance()
Overlap tolerance.
virtual bool updateAreas() const
Update the AMI and patch areas. Return true if anything.
virtual bool owner() const
Does this side own the patch?
Smooth ATC in cells next to a set of patches supplied by type.
A face is a list of labels corresponding to mesh vertices.
scalar mag(const UList< point > &p) const
Magnitude of face area.
A fvBoundaryMesh is a fvPatch list with a reference to the associated fvMesh, with additional search ...
Mesh data needed to do the Finite Volume discretisation.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual label size() const
Patch size is the number of faces, but can be overloaded.
virtual const word & name() const
Return name.
const polyPatch & patch() const noexcept
Return the polyPatch.
virtual void makeWeights(scalarField &) const
Make patch weighting factors.
const scalarField & magSf() const
Return face area magnitudes, like the fvMesh::magSf() method.
tmp< vectorField > nf() const
Return face unit normals, like the fvMesh::unitSf() method Same as unitSf().
const vectorField & Cf() const
Return face centres.
void patchInternalField(const UList< Type > &internalData, const labelUList &addressing, UList< Type > &pfld) const
Extract internal field next to patch using specified addressing.
const vectorField & Sf() const
Return face area vectors, like the fvMesh::Sf() method.
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
A patch is a list of labels that address the faces in the global face list.
const vectorField::subField faceAreas() const
Return face normals.
const vectorField::subField faceCentres() const
Return face centres.
label eventNo() const noexcept
Event number at last update.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define DebugPout
Report an information message using Foam::Pout.
Namespace for handling debugging switches.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
List< labelList > labelListList
List of labelList.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.