35 namespace regionModels
43 void Foam::regionModels::singleLayerRegion::constructMeshObjects()
85 void Foam::regionModels::singleLayerRegion::initialise()
89 Pout<<
"singleLayerRegion::initialise()" <<
endl;
92 label nBoundaryFaces = 0;
93 const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
96 forAll(intCoupledPatchIDs_, i)
98 const label patchi = intCoupledPatchIDs_[i];
99 const polyPatch& pp = rbm[
patchi];
100 const labelList& fCells = pp.faceCells();
102 nBoundaryFaces += fCells.
size();
104 UIndirectList<vector>(nHat, fCells) = pp.faceNormals();
105 UIndirectList<scalar>(magSf, fCells) =
mag(pp.faceAreas());
107 nHat.correctBoundaryConditions();
108 magSf.correctBoundaryConditions();
110 if (nBoundaryFaces != regionMesh().nCells())
113 <<
"Number of primary region coupled boundary faces not equal to " 114 <<
"the number of cells in the local region" <<
nl <<
nl 115 <<
"Number of cells = " << regionMesh().nCells() <<
nl 116 <<
"Boundary faces = " << nBoundaryFaces <<
nl 121 passivePatchIDs_.setSize(intCoupledPatchIDs_.size(), -1);
122 forAll(intCoupledPatchIDs_, i)
124 const label patchi = intCoupledPatchIDs_[i];
125 const polyPatch& ppIntCoupled = rbm[
patchi];
126 if (ppIntCoupled.size() > 0)
129 const cell& cFaces = regionMesh().cells()[
cellId];
131 label facei = ppIntCoupled.start();
132 label faceO = cFaces.opposingFaceLabel(facei, regionMesh().faces());
134 label passivePatchi = rbm.whichPatch(faceO);
135 passivePatchIDs_[i] = passivePatchi;
136 const polyPatch& ppPassive = rbm[passivePatchi];
137 UIndirectList<scalar>(passiveMagSf, ppPassive.faceCells()) =
138 mag(ppPassive.faceAreas());
145 magSf.field() = 0.5*(magSf + passiveMagSf);
146 magSf.correctBoundaryConditions();
160 Foam::regionModels::singleLayerRegion::singleLayerRegion
163 const word& regionType
173 Foam::regionModels::singleLayerRegion::singleLayerRegion
176 const word& regionType,
177 const word& modelName,
188 constructMeshObjects();
209 if (!nHatPtr_.valid())
212 <<
"Region patch normal vectors not available" 222 if (!magSfPtr_.valid())
225 <<
"Region patch areas not available" 236 return passivePatchIDs_;
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual ~singleLayerRegion()
Destructor.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static const char *const typeName
void size(const label)
Override size to be inconsistent with allocated storage.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< vector, fvPatchField, volMesh > volVectorField
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
defineTypeNameAndDebug(regionModel, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
bool read(const char *, int32_t &)
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual bool read()
Read control parameters from dictionary.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
prefixOSstream Pout(cout,"Pout")
virtual const volVectorField & nHat() const
Return the patch normal vectors.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual const labelList & passivePatchIDs() const
Return the list of patch IDs opposite to internally.
const dimensionSet dimArea(sqr(dimLength))
virtual bool read()
Read control parameters from dictionary.