48void Foam::regionModels::regionModel::constructMeshObjects()
52 fvMesh* regionMeshPtr =
64 regionMeshPtr->objectRegistry::store();
69void Foam::regionModels::regionModel::initialise()
73 Pout<<
"regionModel::initialise()" <<
endl;
76 label nBoundaryFaces = 0;
77 DynamicList<label> primaryPatchIDs;
78 DynamicList<label> intCoupledPatchIDs;
79 const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
83 const polyPatch& regionPatch = rbm[patchi];
84 if (isA<mappedPatchBase>(regionPatch))
89 <<
" " << regionPatch.name() <<
endl;
92 intCoupledPatchIDs.append(patchi);
94 nBoundaryFaces += regionPatch.faceCells().size();
96 const mappedPatchBase& mapPatch =
97 refCast<const mappedPatchBase>(regionPatch);
101 primaryMesh_.time().foundObject<polyMesh>
103 mapPatch.sampleRegion()
108 const label primaryPatchi = mapPatch.samplePolyPatch().index();
109 primaryPatchIDs.append(primaryPatchi);
114 primaryPatchIDs_.transfer(primaryPatchIDs);
115 intCoupledPatchIDs_.transfer(intCoupledPatchIDs);
120 <<
"Region model has no mapped boundary conditions - transfer "
121 <<
"between regions will not be possible" <<
endl;
124 if (!outputPropertiesPtr_)
126 const fileName uniformPath(word(
"uniform")/
"regionModels");
128 outputPropertiesPtr_.reset
134 regionName_ +
"OutputProperties",
136 uniformPath/regionName_,
155 if (
const dictionary* dictptr = findDict(modelName_ +
"Coeffs"))
157 coeffs_ <<= *dictptr;
160 infoOutput_.readIfPresent(
"infoOutput", *
this);
174 if (
const dictionary* dictptr =
dict.findDict(modelName_ +
"Coeffs"))
176 coeffs_ <<= *dictptr;
179 infoOutput_.readIfPresent(
"infoOutput",
dict);
191 const label regionPatchi,
192 const label nbrPatchi,
196 label nbrRegionID = interRegionAMINames_.find(nbrRegion.
name());
200 if (nbrRegionID != -1)
202 if (!interRegionAMI_[nbrRegionID].set(regionPatchi))
204 const polyPatch&
p = regionMesh().boundaryMesh()[regionPatchi];
210 interRegionAMI_[nbrRegionID].set
221 interRegionAMI_[nbrRegionID][regionPatchi].calculate(
p, nbrP);
226 return interRegionAMI_[nbrRegionID][regionPatchi];
230 label nbrRegionID = interRegionAMINames_.size();
232 interRegionAMINames_.append(nbrRegion.
name());
234 const polyPatch&
p = regionMesh().boundaryMesh()[regionPatchi];
237 label nPatch = regionMesh().boundaryMesh().
size();
240 interRegionAMI_.resize(nbrRegionID + 1);
251 interRegionAMI_[nbrRegionID].set
262 interRegionAMI_[nbrRegionID][regionPatchi].calculate(
p, nbrP);
266 return interRegionAMI_[nbrRegionID][regionPatchi];
274 const label regionPatchi
277 label nbrPatchi = -1;
287 if (regionPatchi > pbm.
size() - 1)
290 <<
"region patch index out of bounds: "
291 <<
"region patch index = " << regionPatchi
292 <<
", maximum index = " << pbm.
size() - 1
298 if (!isA<mappedPatchBase>(pp))
316 refCast<const mappedPatchBase>(nbrPbm[nbrRegionPatchi]);
320 nbrPatchi = nbrRegionPatchi;
327 const polyPatch&
p = regionMesh().boundaryMesh()[regionPatchi];
330 <<
"Unable to find patch pair for local patch "
331 <<
p.name() <<
" and region " << nbrRegion.
name()
344 const word& regionType
351 regionType +
"Properties",
364 outputPropertiesPtr_(nullptr),
366 intCoupledPatchIDs_(),
369 interRegionAMINames_(),
377 const word& regionType,
378 const word& modelName,
386 regionType +
"Properties",
395 active_(get<
Switch>(
"active")),
397 modelName_(modelName),
398 coeffs_(subOrEmptyDict(modelName +
"Coeffs")),
399 outputPropertiesPtr_(nullptr),
401 intCoupledPatchIDs_(),
402 regionName_(
lookup(
"region")),
403 functions_(*this, subOrEmptyDict(
"functions"))
407 constructMeshObjects();
421 const word& regionType,
422 const word& modelName,
431 regionType +
"Properties",
444 modelName_(modelName),
445 coeffs_(
dict.subOrEmptyDict(modelName +
"Coeffs")),
446 outputPropertiesPtr_(nullptr),
448 intCoupledPatchIDs_(),
450 functions_(*this, subOrEmptyDict(
"functions"))
454 constructMeshObjects();
471 Info<<
"\nEvolving " << modelName_ <<
" for region "
472 << regionMesh().name() <<
endl;
488 if (time_.writeTime())
490 outputProperties().writeObject
502 functions_.preEvolveRegion();
512 functions_.postEvolveRegion();
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
The IOstreamOption is a simple container for options an IOstream can normally have.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
static int & msgType() noexcept
Message tag of standard messages.
label size() const noexcept
The number of elements in the list.
const word & name() const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
bool foundObject(const word &name, const bool recursive=false) const
Is the named Type found?
constant condensation/saturation model.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Lookup type of boundary radiation properties.
virtual bool read()
Read object.
Base class for region models.
Switch active_
Active flag.
const Time & time_
Reference to the time database.
virtual void postEvolveRegion()
Post-evolve region.
label nbrCoupledPatchID(const regionModel &nbrRegion, const label regionPatchi) const
Return the coupled patch ID paired with coupled patch.
word regionName_
Region name.
virtual const AMIPatchToPatchInterpolation & interRegionAMI(const regionModel &nbrRegion, const label regionPatchi, const label nbrPatchi, const bool flip) const
Create or return a new inter-region AMI object.
const fvMesh & regionMesh() const
Return the region mesh database.
virtual void preEvolveRegion()
Pre-evolve region.
virtual void evolve()
Main driver routing to evolve the region - calls other evolves.
virtual void info()
Provide some feedback.
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
virtual bool read()
Read control parameters from dictionary.
virtual void evolveRegion()
Evolve the region.
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.
#define WarningInFunction
Report a warning using Foam::Warning.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.