Base class for patch-based injection models. More...
Public Member Functions | |
patchInjectionBase (const polyMesh &mesh, const word &patchName) | |
Construct from mesh and patch name. More... | |
patchInjectionBase (const patchInjectionBase &pib) | |
Copy constructor. More... | |
virtual | ~patchInjectionBase () |
Destructor. More... | |
virtual void | updateMesh (const polyMesh &mesh) |
Update patch geometry and derived info for injection locations. More... | |
virtual void | setPositionAndCell (const fvMesh &mesh, Random &rnd, vector &position, label &cellOwner, label &tetFacei, label &tetPti) |
Set the injection position and owner cell, tetFace and tetPt. More... | |
Protected Attributes | |
const word | patchName_ |
Patch name. More... | |
const label | patchId_ |
Patch ID. More... | |
scalar | patchArea_ |
Patch area - total across all processors. More... | |
vectorList | patchNormal_ |
Patch face normal directions. More... | |
labelList | cellOwners_ |
List of cell labels corresponding to injector positions. More... | |
triFaceList | triFace_ |
Decomposed patch faces as a list of triangles. More... | |
labelList | triToFace_ |
Addressing from per triangle to patch face. More... | |
scalarList | triCumulativeMagSf_ |
Cumulative triangle area per triangle face. More... | |
scalarList | sumTriMagSf_ |
Cumulative area fractions per processor. More... | |
Base class for patch-based injection models.
Class handles injecting at a random point adjacent to the patch faces to provide a more stochastic view of the injection process. Patch faces are triangulated, and area fractions accumulated. The fractional areas are then applied to determine across which face a parcel is to be injected.
Definition at line 63 of file patchInjectionBase.H.
patchInjectionBase | ( | const polyMesh & | mesh, |
const word & | patchName | ||
) |
Construct from mesh and patch name.
Definition at line 38 of file patchInjectionBase.C.
References polyMesh::boundaryMesh(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, polyBoundaryMesh::names(), and Foam::nl.
patchInjectionBase | ( | const patchInjectionBase & | pib | ) |
Copy constructor.
Definition at line 65 of file patchInjectionBase.C.
|
virtual |
Destructor.
Definition at line 81 of file patchInjectionBase.C.
|
virtual |
Update patch geometry and derived info for injection locations.
Definition at line 87 of file patchInjectionBase.C.
References polyMesh::boundaryMesh(), patchInjectionBase::cellOwners_, f(), polyPatch::faceAreas(), polyPatch::faceCells(), forAll, Pstream::listCombineGather(), Pstream::listCombineScatter(), polyPatch::magFaceAreas(), UPstream::myProcNo(), patchInjectionBase::patchArea_, patchInjectionBase::patchId_, patchInjectionBase::patchNormal_, points, PrimitivePatch< FaceList, PointField >::points(), Foam::reduce(), patchInjectionBase::setPositionAndCell(), List< T >::size(), Foam::sum(), patchInjectionBase::sumTriMagSf_, List< T >::transfer(), patchInjectionBase::triCumulativeMagSf_, triFace(), patchInjectionBase::triFace_, polygonTriangulate::triPoints(), and patchInjectionBase::triToFace_.
Referenced by PatchInjection< CloudType >::clone(), and PatchFlowRateInjection< CloudType >::clone().
|
virtual |
Set the injection position and owner cell, tetFace and tetPt.
Definition at line 154 of file patchInjectionBase.C.
References polyMesh::boundaryMesh(), primitiveMesh::cellCentres(), patchInjectionBase::cellOwners_, polyMeshTetDecomposition::cellTetIndices(), polyMesh::findCellFacePt(), polyMesh::findTetFacePt(), forAll, forAllReverse, Random::globalScalar01(), UList< T >::last(), Foam::mag(), UPstream::myProcNo(), patchInjectionBase::patchArea_, patchInjectionBase::patchId_, patchInjectionBase::patchNormal_, points, PrimitivePatch< FaceList, PointField >::points(), triangle< Point, PointRef >::randomPoint(), Random::sample01(), Random::scalarAB(), List< T >::size(), patchInjectionBase::sumTriMagSf_, tf, patchInjectionBase::triCumulativeMagSf_, patchInjectionBase::triFace_, patchInjectionBase::triToFace_, and fvMesh::V().
Referenced by PatchInjection< CloudType >::clone(), PatchFlowRateInjection< CloudType >::clone(), and patchInjectionBase::updateMesh().
|
protected |
Patch name.
Definition at line 70 of file patchInjectionBase.H.
|
protected |
Patch ID.
Definition at line 73 of file patchInjectionBase.H.
Referenced by patchInjectionBase::setPositionAndCell(), and patchInjectionBase::updateMesh().
|
protected |
Patch area - total across all processors.
Definition at line 76 of file patchInjectionBase.H.
Referenced by patchInjectionBase::setPositionAndCell(), and patchInjectionBase::updateMesh().
|
protected |
Patch face normal directions.
Definition at line 79 of file patchInjectionBase.H.
Referenced by patchInjectionBase::setPositionAndCell(), and patchInjectionBase::updateMesh().
|
protected |
List of cell labels corresponding to injector positions.
Definition at line 82 of file patchInjectionBase.H.
Referenced by patchInjectionBase::setPositionAndCell(), and patchInjectionBase::updateMesh().
|
protected |
Decomposed patch faces as a list of triangles.
Definition at line 85 of file patchInjectionBase.H.
Referenced by patchInjectionBase::setPositionAndCell(), and patchInjectionBase::updateMesh().
|
protected |
Addressing from per triangle to patch face.
Definition at line 88 of file patchInjectionBase.H.
Referenced by patchInjectionBase::setPositionAndCell(), and patchInjectionBase::updateMesh().
|
protected |
Cumulative triangle area per triangle face.
Definition at line 91 of file patchInjectionBase.H.
Referenced by patchInjectionBase::setPositionAndCell(), and patchInjectionBase::updateMesh().
|
protected |
Cumulative area fractions per processor.
Definition at line 94 of file patchInjectionBase.H.
Referenced by patchInjectionBase::setPositionAndCell(), and patchInjectionBase::updateMesh().