46void Foam::regionModels::singleLayerRegion::constructMeshObjects()
82 zeroGradientFvPatchField<scalar>::typeName
88void Foam::regionModels::singleLayerRegion::initialise()
92 Pout<<
"singleLayerRegion::initialise()" <<
endl;
95 label nBoundaryFaces = 0;
96 const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
99 forAll(intCoupledPatchIDs_, i)
101 const label patchi = intCoupledPatchIDs_[i];
102 const polyPatch& pp = rbm[patchi];
103 const labelList& fCells = pp.faceCells();
105 nBoundaryFaces += fCells.
size();
107 UIndirectList<vector>(nHat, fCells) = pp.faceNormals();
108 UIndirectList<scalar>(magSf, fCells) =
mag(pp.faceAreas());
110 nHat.correctBoundaryConditions();
111 magSf.correctBoundaryConditions();
113 if (nBoundaryFaces != regionMesh().nCells())
116 <<
"Number of primary region coupled boundary faces not equal to "
117 <<
"the number of cells in the local region" <<
nl <<
nl
118 <<
"Number of cells = " << regionMesh().nCells() <<
nl
119 <<
"Boundary faces = " << nBoundaryFaces <<
nl
124 passivePatchIDs_.setSize(intCoupledPatchIDs_.size(), -1);
125 forAll(intCoupledPatchIDs_, i)
127 const label patchi = intCoupledPatchIDs_[i];
128 const polyPatch& ppIntCoupled = rbm[patchi];
129 if (ppIntCoupled.size() > 0)
131 label
cellId = rbm[patchi].faceCells()[0];
132 const cell& cFaces = regionMesh().cells()[
cellId];
134 label facei = ppIntCoupled.start();
135 label faceO = cFaces.opposingFaceLabel(facei, regionMesh().faces());
137 label passivePatchi = rbm.whichPatch(faceO);
138 passivePatchIDs_[i] = passivePatchi;
139 const polyPatch& ppPassive = rbm[passivePatchi];
140 UIndirectList<scalar>(passiveMagSf, ppPassive.faceCells()) =
141 mag(ppPassive.faceAreas());
147 magSf.field() = 0.5*(magSf + passiveMagSf);
148 magSf.correctBoundaryConditions();
165 const word& regionType
178 const word& regionType,
179 const word& modelName,
190 constructMeshObjects();
214 <<
"Region patch normal vectors not available"
227 <<
"Region patch areas not available"
238 return passivePatchIDs_;
static void listCombineAllGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
static word timeName(const scalar t, const int precision=precision_)
void size(const label n)
Older name for setAddressableSize.
Mesh data needed to do the Finite Volume discretisation.
Base class for region models.
Switch active_
Active flag.
const Time & time_
Reference to the time database.
const fvMesh & regionMesh() const
Return the region mesh database.
virtual bool read()
Read control parameters from dictionary.
Base class for single layer region models.
autoPtr< volVectorField > nHatPtr_
Patch normal vectors.
virtual const labelList & passivePatchIDs() const
Return the list of patch IDs opposite to internally.
virtual ~singleLayerRegion()
Destructor.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
virtual const volVectorField & nHat() const
Return the patch normal vectors.
autoPtr< volScalarField > magSfPtr_
Face area magnitudes / [m2].
virtual bool read()
Read control parameters from dictionary.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dimensionSet dimless
Dimensionless.
List< label > labelList
A List of labels.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimArea(sqr(dimLength))
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
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)
errorManip< error > abort(error &err)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
static constexpr const zero Zero
Global zero (0)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.