Go to the documentation of this file.
37 namespace functionObjects
51 {selectionModeTypes::rtCellZone,
"cellZone"},
52 {selectionModeTypes::rtAll,
"all"},
62 {functionTypes::ftNdf,
"numberDensity"},
63 {functionTypes::ftVdf,
"volumeDensity"},
64 {functionTypes::ftNc,
"numberConcentration"},
65 {functionTypes::ftMom,
"moments"},
76 {abszissaTypes::atDiameter,
"diameter"},
77 {abszissaTypes::atVolume,
"volume"},
88 switch (functionType_)
122 switch (abszissaType_)
152 << selectionModeTypeNames_[selectionModeType_]
153 <<
'(' << selectionModeTypeName_ <<
"):" <<
nl
160 << selectionModeTypeNames_[selectionModeType_]
161 <<
'(' << selectionModeTypeName_ <<
"):" <<
nl
162 <<
" total cells = " << nCells_ <<
nl
163 <<
" total volume = " << volume_
183 <<
". Valid cellZone names are: "
216 return gSum(filterField(
mesh().V()));
231 ListListOps::combine<scalarField>
257 switch (functionType_)
284 switch (abszissaType_)
288 writeCommented(file,
"Time/volume");
294 writeCommented(file,
"Time/diameter");
299 switch (functionType_)
303 for (label i = 0; i <= momentOrder_; i++)
312 forAll(popBal_.sizeGroups(), sizeGroupi)
315 popBal_.sizeGroups()[sizeGroupi];
317 switch (abszissaType_)
357 selectionModeTypeNames_.get(
"selectionMode",
dict)
360 functionType_(functionTypeNames_.get(
"functionType",
dict)),
361 abszissaType_(abszissaTypeNames_.get(
"abszissaType",
dict)),
365 writeVolume_(
dict.getOrDefault(
"writeVolume",
false)),
373 N_(popBal_.sizeGroups().size()),
374 momentOrder_(
dict.getOrDefault<label>(
"momentOrder", 0)),
375 normalize_(
dict.getOrDefault(
"normalize",
false)),
418 writeCurrentTime(file());
450 sumV_ += N_[i]*fi.
x().
value();
455 switch (functionType_)
459 for (label m = 0; m <= momentOrder_; m++)
466 popBal_.sizeGroups()[i];
468 switch (abszissaType_)
486 file() <<
tab << result;
494 forAll(popBal_.sizeGroups(), i)
497 popBal_.sizeGroups()[i];
502 switch (abszissaType_)
506 delta = popBal_.v()[i+1].value()
507 - popBal_.v()[i].value();
514 const scalar& formFactor =
520 popBal_.v()[i+1].value()
526 popBal_.v()[i].value()
535 switch (functionType_)
539 if (normalize_ ==
true)
541 result = N_[i]/
delta/sumN_;
545 result = N_[i]/
delta;
553 if (normalize_ ==
true)
567 if (normalize_ ==
true)
569 result = N_[i]/sumN_;
585 file()<<
tab << result;
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
virtual ~sizeDistribution()
Destructor.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A class for managing temporary objects.
const velocityGroup & VelocityGroup() const
Return const-reference to the velocityGroup.
Computes the power of an input volScalarField.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
const dimensionedScalar & formFactor() const
Return the form factor.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
bool read(const char *buf, int32_t &val)
Same as readInt32.
virtual bool read(const dictionary &dict)
Read from dictionary.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
static bool master(const label communicator=worldComm)
Am I the master process.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const wordList volume
Standard volume field types (scalar, vector, tensor, etc)
const Type & value() const
Return const reference to value.
Type gSum(const FieldField< Field, Type > &f)
static void writeHeader(Ostream &os, const word &fieldName)
void combineFields(scalarField &field)
Combine fields from all processor domains into single field.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
dictionary dict_
Construction dictionary.
#define forAll(list, i)
Loop across all elements in list.
static const Enum< functionTypes > functionTypeNames_
Function type names.
static const Enum< selectionModeTypes > selectionModeTypeNames_
Selection mode type names.
virtual bool read(const dictionary &dict)
Read.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
functionTypes
Function type enumeration.
void setCellZoneCells()
Set cells to evaluate based on a cell zone.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
scalar volume() const
Calculate and return volume of the evaluated cell zone.
selectionModeTypes
Selection mode type enumeration.
This class represents a single sizeGroup belonging to a velocityGroup. The main property of a sizeGro...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Class that solves the univariate population balance equation by means of a class method (also called ...
void initialise(const dictionary &dict)
Initialise, e.g. cell addressing.
virtual bool read(const dictionary &dict)
Read optional controls.
Macros for easy insertion into run-time selection tables.
tmp< scalarField > filterField(const scalarField &field) const
Filter field according to cellIds.
label nCells_
Global number of cells.
sizeDistribution(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
selectionModeTypes selectionModeType_
Selection mode type.
const dictionary & dict() const
Return the reference to the construction dictionary.
wordList names() const
A list of the zone names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
virtual bool write()
Write.
static const Enum< abszissaTypes > abszissaTypeNames_
Abszissa type names.
const dimensionedScalar & d() const
Return representative diameter of the sizeGroup.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
abszissaTypes
abszissa type enumeration
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
defineTypeNameAndDebug(ObukhovLength, 0)
static const word null
An empty word.
word selectionModeTypeName_
Name of selection.
labelList cellId_
Local list of cell IDs.
const fvMesh & mesh() const
Helper function to return the reference to the mesh.
Base class for writing single files from the function objects.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
void writeFileHeader(const label i=0)
Output file header information.
const dimensionedScalar & x() const
Return representative volume of the sizeGroup.
const phaseModel & phase() const
Return the phase.
virtual bool execute()
Execute.
static label nProcs(const label communicator=worldComm)
Number of processes in parallel run, and 1 for serial run.