103 if (applyLowWeightCorrection())
108 nbrPatch.
nf() & nbrPatch.coupledFvPatch::delta(),
115 interpolate(nbrPatch.
nf() & nbrPatch.coupledFvPatch::delta());
123 scalar di =
mag(deltas[facei]);
124 scalar dni =
mag(nbrDeltas[facei]);
126 w[facei] = dni/(di + dni);
166 if (applyLowWeightCorrection())
171 nbrPatch.coupledFvPatch::delta(),
177 tnbrPatchD =
interpolate(nbrPatch.coupledFvPatch::delta());
190 const vector& ddi = patchD[facei];
191 const vector& dni = nbrPatchD[facei];
193 pdv[facei] = ddi - dni;
200 const vector& ddi = patchD[facei];
201 const vector& dni = nbrPatchD[facei];
203 pdv[facei] = ddi -
transform(forwardT()[0], dni);
249 if (!owner() || !cyclicAMIPolyPatch_.createAMIFaces())
257 const_cast<vectorField&
>(Sf()) = cyclicAMIPolyPatch_.faceAreas();
258 const_cast<vectorField&
>(Cf()) = cyclicAMIPolyPatch_.faceCentres();
261 const cyclicAMIFvPatch& nbr = neighbPatch();
262 const_cast<vectorField&
>(nbr.Sf()) = nbr.cyclicAMIPatch().faceAreas();
263 const_cast<vectorField&
>(nbr.Cf()) = nbr.cyclicAMIPatch().faceCentres();
271 const fvMesh&
mesh = boundaryMesh().mesh();
275 if (cyclicAMIPolyPatch_.owner())
280 const face&
f = cyclicAMIPolyPatch_.localFaces()[facei];
285 const scalar geomArea =
f.mag(cyclicAMIPolyPatch_.localPoints());
287 const scalar scaledArea = magSf()[facei];
288 phip[facei] *= scaledArea/geomArea;
292 if (AMI().distributed() && AMI().comm() != -1)
294 AMI().srcMap().distribute(srcMeshPhi);
300 forAll(tgtToSrcAddr, tgtFacei)
303 const label srcFacei = tgtToSrcAddr[tgtFacei][0];
304 nbrPhip[tgtFacei] = -srcMeshPhi[srcFacei];
308 <<
"patch:" <<
patch().name()
309 <<
" sum(area):" <<
gSum(magSf())
310 <<
" min(mag(faceAreas):" <<
gMin(magSf())
311 <<
" sum(meshPhi):" <<
gSum(phip) <<
nl
312 <<
" sum(nbrMeshPhi):" <<
gSum(nbrPhip) <<
nl
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
bool processorCase() const noexcept
True if this is a processor case.
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.
virtual tmp< vectorField > delta() const =0
Return delta (P to N) vectors across coupled patch.
Cyclic patch for Arbitrary Mesh Interface (AMI).
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
cyclicAMIFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm)
Construct from polyPatch.
virtual bool owner() const
Does this side own the patch?
void makeWeights(scalarField &) const
Make patch weighting factors.
virtual void makeNonOrthoDeltaCoeffs(scalarField &) const
Correct patch non-ortho deltaCoeffs.
const cyclicAMIPolyPatch & cyclicAMIPatch() const
Return local reference cast into the cyclic patch.
virtual void makeDeltaCoeffs(scalarField &) const
Correct patch deltaCoeffs.
virtual const cyclicAMIFvPatch & neighbPatch() const
Return a reference to the neighbour patch.
virtual void movePoints()
Correct patches after moving points.
virtual bool coupled() const
Return true if this patch is coupled. This is equivalent to the coupledPolyPatch::coupled() if parall...
virtual bool parallel() const
Are the cyclic planes parallel.
const cyclicAMIFvPatch & neighbFvPatch() const
virtual tmp< vectorField > delta() const
Return delta (P to N) vectors across coupled patch.
virtual void makeNonOrthoCorrVectors(vectorField &) const
Correct patch non-ortho correction vectors.
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 bool applyLowWeightCorrection() const
Return true if applying the low weight correction.
virtual const tensorField & forwardT() const
Return face transformation tensor.
Smooth ATC in cells next to a set of patches supplied by type.
A face is a list of labels corresponding to mesh vertices.
const fvMesh & mesh() const noexcept
Return the mesh reference.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual label size() const
Patch size is the number of faces, but can be overloaded.
const polyPatch & patch() const noexcept
Return the polyPatch.
virtual void makeWeights(scalarField &) const
Make patch weighting factors.
label index() const noexcept
The index of this patch in the boundary mesh.
const fvBoundaryMesh & boundaryMesh() const noexcept
Return boundaryMesh reference.
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.
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.
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 DebugInfo
Report an information message using Foam::Info.
const std::string patch
OpenFOAM patch number as a std::string.
Type gSum(const FieldField< Field, Type > &f)
List< labelList > labelListList
List of labelList.
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.
static constexpr const zero Zero
Global zero (0).
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
Type gMin(const FieldField< Field, Type > &f)
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.