41namespace functionObjects
92 parcelSelect_.clear();
103 Info<<
"applying to clouds:" <<
nl;
104 for (
const word& cldName : names())
106 Info<<
" " << cldName <<
nl;
111 parcelSelect_ =
dict.subOrEmptyDict(
"selection");
113 verbose_ =
dict.getOrDefault(
"verbose",
false);
114 onExecute_ =
dict.getOrDefault(
"sampleOnExecute",
false);
118 Info<<
"no clouds to be processed" <<
nl <<
endl;
125 writeFileHeader(files(cloudi));
136 if (!request || names().empty())
144 label nTotParcels = 0;
145 scalar totMass = 0, Dmax = 0, D10 = 0, D32 = 0;
146 bool applyFilter =
false;
158 const auto& kinCloud = *kinCloudPtr;
159 const auto* plainCloudPtr = isA<cloud>(kinCloud);
161 if (!parcelSelect_.empty() && plainCloudPtr)
163 const auto& plainCloud = *plainCloudPtr;
172 obr_.time().constant(),
180 plainCloud.writeObjects(obrTmp);
183 applyFilter = calculateFilter(obrTmp,
log);
188 const auto* nParticleFldPtr =
194 #define doLocalCode(FldPtr, FldName) \
195 if (applyFilter && !FldPtr) \
198 << "Missing \"" << #FldName \
199 << "\" field - disabling filter" << nl; \
200 applyFilter = false; \
215 const auto& diams = *diamFldPtr;
216 const auto& rhos = *rhoFldPtr;
217 const auto& nParts = *nParticleFldPtr;
221 for (
const label particlei : parcelAddr_)
225 const scalar d = diams[particlei];
226 const scalar
rho = rhos[particlei];
227 const scalar np = nParts[particlei];
234 Dsums[2] += np*(
sqr(d));
235 Dsums[3] += np*(
pow3(d));
246 D10 = Dsums[1]/(
max(Dsums[0], VSMALL));
247 D32 = Dsums[3]/(
max(Dsums[2], VSMALL));
257 Dmax = kinCloud.Dmax();
258 D10 = kinCloud.Dij(1, 0);
259 D32 = kinCloud.Dij(3, 2);
263 <<
" number of parcels : " << nTotParcels <<
nl
264 <<
" mass in system : " << totMass <<
nl
265 <<
" maximum diameter : " << Dmax <<
nl
266 <<
" D10 diameter : " << D10 <<
nl
267 <<
" D32 diameter : " << D32 <<
nl
270 if ((request & ACTION_WRITE) && writeToFile())
272 auto&
os = files(cloudi);
274 writeCurrentTime(
os);
293 return performAction(ACTION_ALL & ~ACTION_WRITE);
302 return performAction(ACTION_ALL);
Inter-processor communication reduction functions.
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D vector of objects of type <T> with a fixed length <N>.
A primitive field of type <T> with automated input and output.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read()
Re-read model coefficients if they have changed.
The TAB Method for Numerical Calculation of Spray Droplet Breakup.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
Outputs Lagrangian cloud information to a file.
bool performAction(unsigned request)
Perform operation report/write.
virtual bool read(const dictionary &dict)
Read the controls.
virtual void writeFileHeader(Ostream &os) const
File header information.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write.
functionObject base class for creating, maintaining and writing log files e.g. integrated or averaged...
virtual void resetNames(const wordList &names)
Reset the list of names from a wordList.
Computes the natural logarithm of an input volScalarField.
Specialization of Foam::functionObject for a region and providing a reference to the region Foam::obj...
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
Virtual abstract base class for templated KinematicCloud.
Registry of regIOobjects.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
constexpr scalar pi(M_PI)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar pow3(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
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)
#define forAll(list, i)
Loop across all elements in list.
const word cloudName(propsDict.get< word >("cloud"))
#define doLocalCode(GeoField)