37namespace 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"},
163 <<
" total volume = " <<
volume_
170 switch (selectionModeType_)
174 dict().readEntry(
"cellZone", selectionModeTypeName_);
177 mesh().cellZones().findZoneID(selectionModeTypeName_);
182 <<
"Unknown cellZone name: " << selectionModeTypeName_
183 <<
". Valid cellZone names are: "
184 <<
mesh().cellZones().names()
188 cellId_ =
mesh().cellZones()[zoneId];
207 selectionModeTypeNames_
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)
359 selectionModeTypeName_(
word::null),
360 functionType_(functionTypeNames_.get(
"functionType",
dict)),
361 abszissaType_(abszissaTypeNames_.get(
"abszissaType",
dict)),
365 writeVolume_(
dict.getOrDefault(
"writeVolume", false)),
368 obr_.lookupObject<
Foam::diameterModels::populationBalanceModel>
373 N_(popBal_.sizeGroups().size()),
374 momentOrder_(
dict.getOrDefault<label>(
"momentOrder", 0)),
375 normalize_(
dict.getOrDefault(
"normalize", false)),
418 writeCurrentTime(file());
439 combineFields(values);
445 N_[i] =
sum(V*values)/
sum(V);
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;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to file stream, using an OSstream.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
virtual bool read()
Re-read model coefficients if they have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const phaseModel & phase() const
Return the phase.
This class represents a single sizeGroup belonging to a velocityGroup. The main property of a sizeGro...
const dimensionedScalar & d() const
Return representative diameter of the sizeGroup.
const dimensionedScalar & x() const
Return representative volume of the sizeGroup.
const velocityGroup & VelocityGroup() const
Return const-reference to the velocityGroup.
const dimensionedScalar & formFactor() const
Return the form factor.
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.
Abstract base-class for Time/database function objects.
const word & name() const noexcept
Return the name of this functionObject.
virtual const word & type() const =0
Runtime type information.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Computes the power of an input volScalarField.
This function object calculates and outputs information about the size distribution of the dispersed ...
label nCells_
Global number of cells.
abszissaTypes
abszissa type enumeration
word selectionModeTypeName_
Name of selection.
selectionModeTypes
Selection mode type enumeration.
selectionModeTypes selectionModeType_
Selection mode type.
void setCellZoneCells()
Set cells to evaluate based on a cell zone.
scalar volume() const
Calculate and return volume of the evaluated cell zone.
abszissaTypes abszissaType_
Abszissa type.
virtual bool read(const dictionary &dict)
Read from dictionary.
functionTypes functionType_
Function type.
virtual ~sizeDistribution()
Destructor.
static const Enum< selectionModeTypes > selectionModeTypeNames_
Selection mode type names.
const dictionary & dict() const
Return the reference to the construction dictionary.
void writeFileHeader(const label i=0)
Output file header information.
static const Enum< abszissaTypes > abszissaTypeNames_
Abszissa type names.
static const Enum< functionTypes > functionTypeNames_
Function type names.
void combineFields(scalarField &field)
Combine fields from all processor domains into single field.
tmp< scalarField > filterField(const scalarField &field) const
Filter field according to cellIds.
virtual bool execute()
Execute.
virtual bool write()
Write.
scalar volume_
Total volume of the evaluated selection.
functionTypes
Function type enumeration.
Base class for writing single files from the function objects.
virtual autoPtr< OFstream > createFile(const word &name, scalar timeValue) const
Return autoPtr to a new file for a given time.
virtual void resetFile(const word &name)
Reset internal file pointer to new file with new name.
int myProcNo() const noexcept
Return processor number.
splitCell * master() const
A class for managing temporary objects.
void initialise()
Initialise integral-scale box properties.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Type gSum(const FieldField< Field, Type > &f)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
static void writeHeader(Ostream &os, const word &fieldName)
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.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
constexpr char tab
The tab '\t' character(0x09)
#define forAll(list, i)
Loop across all elements in list.