49 MeshObject_type(
mesh),
52 radZonePropertiesPtrList_(
mesh.faceZones().size())
56 boundaryRadiationProperties::typeName,
57 mesh.time().constant(),
83 const auto&
pbm =
mesh.boundaryMesh();
84 for (
const auto&
pp :
pbm)
86 const label patchi =
pp.index();
92 if (eptr && eptr->isDict())
94 radBoundaryPropertiesPtrList_.set
105 != radBoundaryPropertiesPtrList_[patchi].nBands()
109 <<
"Radiation bands : " << nBands <<
nl
110 <<
"Bands on patch : " << patchi <<
" is "
111 << radBoundaryPropertiesPtrList_[patchi].nBands()
125 const auto& dummyRef =
mesh.boundaryMesh()[0];
127 const auto& fzs =
mesh.faceZones();
129 for (
const auto& fz : fzs)
131 const label zonei = fz.index();
133 if (!matchedEntries.
contains(fz.name()))
138 const auto* eptr = radiationDict.findEntry
144 if (eptr && eptr->isDict())
146 radZonePropertiesPtrList_.set
156 matchedEntries.
insert(fz.name());
161 != radZonePropertiesPtrList_[zonei].nBands()
165 <<
"Radiation bands : " << nBands <<
nl
166 <<
"Bands on zone : " << zonei <<
" is "
167 << radBoundaryPropertiesPtrList_
192 if (radBoundaryPropertiesPtrList_.set(patchi))
194 return radBoundaryPropertiesPtrList_[patchi].e
203 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
204 <<
" is not found in the boundaryRadiationProperties. "
221 if (radBoundaryPropertiesPtrList_.set(patchi))
223 return radBoundaryPropertiesPtrList_[patchi].e
233 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
234 <<
" is not found in the boundaryRadiationProperties. "
251 if (radBoundaryPropertiesPtrList_.set(patchi))
253 return radBoundaryPropertiesPtrList_[patchi].a
262 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
263 <<
" is not found in the boundaryRadiationProperties. "
280 if (radBoundaryPropertiesPtrList_.set(patchi))
282 return radBoundaryPropertiesPtrList_[patchi].a
292 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
293 <<
" is not found in the boundaryRadiationProperties. "
310 if (radBoundaryPropertiesPtrList_.set(patchi))
312 return radBoundaryPropertiesPtrList_[patchi].t
321 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
322 <<
" is not found in the boundaryRadiationProperties. "
339 if (radBoundaryPropertiesPtrList_.set(patchi))
341 return radBoundaryPropertiesPtrList_[patchi].t
351 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
352 <<
" is not found in the boundaryRadiationProperties. "
370 if (radZonePropertiesPtrList_.set(zonei))
373 auto&
fld = tfld.ref();
376 fld[i] = radZonePropertiesPtrList_[zonei].t
388 <<
"Zone : " <<
mesh().faceZones()[zonei].name()
389 <<
" is not found in the boundaryRadiationProperties. "
406 if (radBoundaryPropertiesPtrList_.set(patchi))
408 return radBoundaryPropertiesPtrList_[patchi].rDiff
417 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
418 <<
" is not found in the boundaryRadiationProperties. "
435 if (radBoundaryPropertiesPtrList_.set(patchi))
437 return radBoundaryPropertiesPtrList_[patchi].rDiff
447 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
448 <<
" is not found in the boundaryRadiationProperties. "
465 if (radBoundaryPropertiesPtrList_.set(patchi))
467 return radBoundaryPropertiesPtrList_[patchi].rSpec
476 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
477 <<
" is not found in the boundaryRadiationProperties. "
494 if (radBoundaryPropertiesPtrList_.set(patchi))
496 return radBoundaryPropertiesPtrList_[patchi].rSpec
506 <<
"Patch : " <<
mesh().boundaryMesh()[patchi].name()
507 <<
" is not found in the boundaryRadiationProperties. "
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const polyBoundaryMesh & pbm
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
bool contains(const Key &key) const
True if hashed key is contained (found) in table.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
@ NO_REGISTER
Do not request registration (bool: false).
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (respects is_globalIOobject trait) and check its info. A void type suppresses trait and t...
const fvMesh & mesh() const noexcept
void size(const label n)
Older name for setAddressableSize.
const entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
Mesh data needed to do the Finite Volume discretisation.
@ REGEX
Regular expression.
static autoPtr< boundaryRadiationPropertiesPatch > New(const dictionary &dict, const polyPatch &pp)
Selector.
Boundary radiation properties holder.
scalar faceTransmissivity(const label patchI, const label faceI, const label bandI=0, vector incomingDirection=Zero, scalar T=0) const
Access boundary transmissivity on face.
scalar faceSpecReflectivity(const label patchI, const label faceI, const label bandI=0, vector incomingDirection=Zero, scalar T=0) const
Access boundary specular reflectivity on face.
boundaryRadiationProperties(const fvMesh &mesh)
Construct given fvMesh.
tmp< scalarField > transmissivity(const label patchI, const label bandI=0, const vectorField *incomingDirection=nullptr, const scalarField *T=nullptr) const
Access boundary transmissivity on patch.
scalar faceDiffReflectivity(const label patchI, const label faceI, const label bandI=0, vector incomingDirection=Zero, scalar T=0) const
Access boundary diffuse reflectivity on face.
scalar faceAbsorptivity(const label patchI, const label faceI, const label bandI=0, vector incomingDirection=Zero, scalar T=0) const
Access boundary absorptivity on face.
tmp< scalarField > zoneTransmissivity(const label zoneI, const labelUList &faceIDs, const label bandI=0, vector incomingDirection=Zero, scalar T=0) const
Access transmissivity on set of (internal) faces. Zone name only.
tmp< scalarField > absorptivity(const label patchI, const label bandI=0, const vectorField *incomingDirection=nullptr, const scalarField *T=nullptr) const
Access boundary absorptivity on patch.
tmp< scalarField > emissivity(const label patchI, const label bandI=0, const vectorField *incomingDirection=nullptr, const scalarField *T=nullptr) const
Access boundary emissivity on patch.
tmp< scalarField > specReflectivity(const label patchI, const label bandI=0, const vectorField *incomingDirection=nullptr, const scalarField *T=nullptr) const
Access boundary specular reflectivity on patch.
tmp< scalarField > diffReflectivity(const label patchI, const label bandI=0, const vectorField *incomingDirection=nullptr, const scalarField *T=nullptr) const
Access boundary diffuse reflectivity on patch.
scalar faceEmissivity(const label patchI, const label faceI, const label bandI=0, vector incomingDirection=Zero, scalar T=0) const
Access boundary emissivity on face.
Top level model for radiation modelling.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Namespace for radiation modelling.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.