37template<
class CloudType>
51 Info<<
"Creating output file." <<
endl;
54 if (Pstream::master())
57 mkDir(this->writeTimeDir());
65 this->writeTimeDir()/(
type() +
'_' + zoneName +
".dat")
70 <<
"# Source : " <<
type() <<
nl
71 <<
"# Face zone : " << zoneName <<
nl
73 <<
"# Area : " << totArea <<
nl
74 <<
"# Time" <<
tab <<
"mass" <<
tab <<
"massFlowRate" <<
endl;
82template<
class CloudType>
88 scalar timeNew = time.
value();
89 scalar timeElapsed = timeNew - timeOld_;
91 totalTime_ += timeElapsed;
93 const scalar
alpha = (totalTime_ - timeElapsed)/totalTime_;
94 const scalar
beta = timeElapsed/totalTime_;
96 forAll(faceZoneIDs_, zoneI)
98 massFlowRate_[zoneI] =
99 alpha*massFlowRate_[zoneI] +
beta*mass_[zoneI]/timeElapsed;
100 massTotal_[zoneI] += mass_[zoneI];
103 const label proci = Pstream::myProcNo();
105 Info<< type() <<
" output:" <<
nl;
109 forAll(faceZoneIDs_, zoneI)
111 const word& zoneName = fzm[faceZoneIDs_[zoneI]].
name();
114 allProcMass[proci] = massTotal_[zoneI];
115 Pstream::gatherList(allProcMass);
116 zoneMassTotal[zoneI] =
117 ListListOps::combine<scalarList>
121 const scalar sumMassTotal =
sum(zoneMassTotal[zoneI]);
124 allProcMassFlowRate[proci] = massFlowRate_[zoneI];
125 Pstream::gatherList(allProcMassFlowRate);
126 zoneMassFlowRate[zoneI] =
127 ListListOps::combine<scalarList>
131 const scalar sumMassFlowRate =
sum(zoneMassFlowRate[zoneI]);
133 Info<<
" " << zoneName
134 <<
": total mass = " << sumMassTotal
135 <<
"; average mass flow rate = " << sumMassFlowRate
138 if (outputFilePtr_.set(zoneI))
142 << sumMassFlowRate<<
endl;
149 if (surfaceFormat_ !=
"none")
151 forAll(faceZoneIDs_, zoneI)
153 const faceZone& fZone = fzm[faceZoneIDs_[zoneI]];
158 mesh.globalData().mergePoints
160 fZone().meshPoints(),
161 fZone().meshPointMap(),
163 uniqueMeshPointLabels
168 allProcPoints[proci] = uniquePoints;
169 Pstream::gatherList(allProcPoints);
171 faceList faces(fZone().localFaces());
174 inplaceRenumber(pointToGlobal, faces[i]);
177 allProcFaces[proci] = faces;
178 Pstream::gatherList(allProcFaces);
180 if (Pstream::master())
184 ListListOps::combine<pointField>
192 ListListOps::combine<faceList>
198 auto writer = surfaceWriter::New
201 this->coeffDict().subOrEmptyDict(
"formatOptions")
202 .subOrEmptyDict(surfaceFormat_)
214 (this->writeTimeDir() / fZone.
name()),
219 writer->write(
"massTotal", zoneMassTotal[zoneI]);
220 writer->write(
"massFlowRate", zoneMassFlowRate[zoneI]);
228 forAll(faceZoneIDs_, zoneI)
230 massFlowRate_[zoneI] = 0.0;
247template<
class CloudType>
252 const word& modelName
257 surfaceFormat_(this->coeffDict().
lookup(
"surfaceFormat")),
258 resetOnWrite_(this->coeffDict().getBool(
"resetOnWrite")),
259 log_(this->coeffDict().getBool(
"log")),
265 timeOld_(owner.
mesh().time().value())
272 outputFilePtr_.setSize(faceZoneNames.
size());
280 const word& zoneName = faceZoneNames[i];
293 scalar totArea = 0.0;
299 totArea += magSf[fz[j]];
304 label patchi = pbm.
patchID()[bFacei];
310 || refCast<const coupledPolyPatch>(pp).owner()
320 makeLogFile(zoneName, i,
nFaces, totArea);
330template<
class CloudType>
337 faceZoneIDs_(pff.faceZoneIDs_),
338 surfaceFormat_(pff.surfaceFormat_),
339 resetOnWrite_(pff.resetOnWrite_),
341 totalTime_(pff.totalTime_),
343 massTotal_(pff.massTotal_),
344 massFlowRate_(pff.massFlowRate_),
352template<
class CloudType>
358 || this->owner().
solution().transient()
365 const faceZone& fz = fzm[faceZoneIDs_[i]];
370 if (fz[j] ==
p.face())
379 mass_[i][
faceId] +=
p.mass()*
p.nParticle();
vtk::internalMeshWriter writer(topoMesh, topoCells, vtk::formatType::INLINE_ASCII, runTime.path()/"blockTopology")
Templated cloud function object base class.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
const fvMesh & mesh() const
Return reference to the mesh.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Records particle face quantities on used-specified face zone.
void write()
Write post-processing info.
virtual void postFace(const parcelType &p, bool &keepParticle)
Post-face hook.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
const word & name() const noexcept
Return the object name.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
Output to file stream, using an OSstream.
The TAB Method for Numerical Calculation of Spray Droplet Breakup.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static word timeName(const scalar t, const int precision=precision_)
void size(const label n)
Older name for setAddressableSize.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
const MeshType & mesh() const noexcept
Return the mesh reference.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const Type & value() const
Return const reference to value.
A subset of mesh faces organised as a primitive patch.
Mesh data needed to do the Finite Volume discretisation.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
const labelList & patchID() const
Per boundary face label the patch index.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
label whichFace(const label l) const
Return label of face in patch from global face label.
label nInternalFaces() const noexcept
Number of internal faces.
Lookup type of boundary radiation properties.
Selector class for relaxation factors, solver type and solution.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
A class for handling words, derived from Foam::string.
const word & name() const noexcept
The zone name.
OBJstream os(runTime.globalPath()/outputName)
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
const labelIOList & zoneIDs
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static Ostream & output(Ostream &os, const IntRange< T > &range)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
constexpr char nl
The newline '\n' character (0x0a)
constexpr char tab
The tab '\t' character(0x09)
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
#define forAll(list, i)
Loop across all elements in list.