32 template<
class CloudType>
35 const scalar d0 = this->owner().Dmin(), d1 = this->owner().Dmax();
44 const scalar
f = scalar(i)/(nPoints_ - 1);
45 ds[i] = (1 -
f)*d0 +
f*d1;
49 scalarField particlePDF(nPoints_, 0), parcelPDF(nPoints_, 0);
52 const scalar nParticle = iter().nParticle();
53 const scalar d = iter().d();
55 const scalar
f = (d - d0)/(d1 - d0);
56 const label i =
min(floor(
f*(nPoints_ - 1)), nPoints_ - 2);
57 const scalar g =
f*(nPoints_ - 1) - scalar(i);
59 particlePDF[i] += nParticle*(1 - g);
60 particlePDF[i + 1] += nParticle*g;
62 parcelPDF[i] += 1 - g;
63 parcelPDF[i + 1] += g;
67 Pstream::listCombineScatter(particlePDF);
70 Pstream::listCombineScatter(parcelPDF);
72 particlePDF.first() *= 2;
73 particlePDF.last() *= 2;
74 particlePDF /=
sum(particlePDF)*(d1 - d0)/(nPoints_ - 1);
76 parcelPDF.
first() *= 2;
77 parcelPDF.
last() *= 2;
78 parcelPDF /=
sum(parcelPDF)*(d1 - d0)/(nPoints_ - 1);
81 if (Pstream::master())
83 mkDir(this->writeTimeDir());
101 template<
class CloudType>
106 const word& modelName
115 template<
class CloudType>
122 nPoints_(vf.nPoints_),
123 formatter_(vf.formatter_, false)
129 template<
class CloudType>
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Templated cloud function object base class.
Templated base class for dsmc cloud.
Creates graphs of a cloud's size distribution.
virtual ~SizeDistribution()
Destructor.
virtual void write()
Write post-processing info.
SizeDistribution(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
T & first()
Return the first element of the list.
T & last()
Return the last element of the list.
Holds list of sampling positions.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Base class for writing coordinate sets with data.
A class for handling words, derived from string.
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)