Go to the documentation of this file.
37 namespace regionModels
45 void Foam::regionModels::singleLayerRegion::constructMeshObjects()
62 zeroGradientFvPatchField<vector>::typeName
81 zeroGradientFvPatchField<scalar>::typeName
87 void Foam::regionModels::singleLayerRegion::initialise()
91 Pout<<
"singleLayerRegion::initialise()" <<
endl;
94 label nBoundaryFaces = 0;
95 const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
98 forAll(intCoupledPatchIDs_, i)
100 const label patchi = intCoupledPatchIDs_[i];
101 const polyPatch& pp = rbm[patchi];
102 const labelList& fCells = pp.faceCells();
104 nBoundaryFaces += fCells.size();
106 UIndirectList<vector>(nHat, fCells) = pp.faceNormals();
107 UIndirectList<scalar>(magSf, fCells) =
mag(pp.faceAreas());
109 nHat.correctBoundaryConditions();
110 magSf.correctBoundaryConditions();
112 if (nBoundaryFaces != regionMesh().nCells())
115 <<
"Number of primary region coupled boundary faces not equal to "
116 <<
"the number of cells in the local region" <<
nl <<
nl
117 <<
"Number of cells = " << regionMesh().nCells() <<
nl
118 <<
"Boundary faces = " << nBoundaryFaces <<
nl
123 passivePatchIDs_.setSize(intCoupledPatchIDs_.size(), -1);
124 forAll(intCoupledPatchIDs_, i)
126 const label patchi = intCoupledPatchIDs_[i];
127 const polyPatch& ppIntCoupled = rbm[patchi];
128 if (ppIntCoupled.size() > 0)
130 label
cellId = rbm[patchi].faceCells()[0];
131 const cell& cFaces = regionMesh().cells()[
cellId];
133 label facei = ppIntCoupled.start();
134 label faceO = cFaces.opposingFaceLabel(facei, regionMesh().faces());
136 label passivePatchi = rbm.whichPatch(faceO);
137 passivePatchIDs_[i] = passivePatchi;
138 const polyPatch& ppPassive = rbm[passivePatchi];
139 UIndirectList<scalar>(passiveMagSf, ppPassive.faceCells()) =
140 mag(ppPassive.faceAreas());
147 magSf.field() = 0.5*(magSf + passiveMagSf);
148 magSf.correctBoundaryConditions();
162 Foam::regionModels::singleLayerRegion::singleLayerRegion
165 const word& regionType
175 Foam::regionModels::singleLayerRegion::singleLayerRegion
178 const word& regionType,
179 const word& modelName,
190 constructMeshObjects();
211 if (!nHatPtr_.valid())
214 <<
"Region patch normal vectors not available"
224 if (!magSfPtr_.valid())
227 <<
"Region patch areas not available"
238 return passivePatchIDs_;
int debug
Static debugging option.
virtual const labelList & passivePatchIDs() const
Return the list of patch IDs opposite to internally.
List< label > labelList
A List of labels.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
virtual ~singleLayerRegion()
Destructor.
bool read(const char *buf, int32_t &val)
Same as readInt32.
static word timeName(const scalar t, const int precision=precision_)
IOobject(const IOobject &)=default
Copy construct.
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
#define forAll(list, i)
Loop across all elements in list.
Base class for region models.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
const dimensionSet dimArea(sqr(dimLength))
autoPtr< volScalarField > magSfPtr_
Face area magnitudes / [m2].
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
const fvMesh & regionMesh() const
Return the region mesh database.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual bool read()
Read control parameters from dictionary.
defineTypeNameAndDebug(regionModel, 0)
Mesh data needed to do the Finite Volume discretisation.
errorManip< error > abort(error &err)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
GeometricField< vector, fvPatchField, volMesh > volVectorField
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Time & time_
Reference to the time database.
autoPtr< volVectorField > nHatPtr_
Patch normal vectors.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
virtual const volVectorField & nHat() const
Return the patch normal vectors.
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
virtual bool read()
Read control parameters from dictionary.