# PSD functions

Several global functions are defined to work with particle size distributions. These functions can be called from any place of the code.

All functions receive grid as the input parameter. The grid can be previously obtained with the help of the function CBaseUnit::GetNumericGrid(EDistrTypes) const.

Note

- d_i - diameter of particle in class i

- \Delta d_i - size of the class i

- M_k - k-th moment

- q - density distribution

- q_0 - number related density distribution

- Q_0 - number related cumulative distribution

- q_2 - surface-area-related density distribution

- Q_2 - surface-area-related cumulative distribution

- q_3 - mass-related density distribution

- Q_3 - mass-related cumulative distribution

- w_i - mass fraction of particles of class i

- N_i - number of particles of class i

- N_{tot} - total number of particles

Functions

inline double GetMMoment(int _moment, const std::vector<double> &_grid, const std::vector<double> &_q)

  Calculates moment of the density distribution.

  M_k = \sum_i d_i^k q_i \Delta d_i.

  Parameters:

    - _moment – Value of moment.

    - _grid – Distribution grid.

    - _q – Input distribution.

  Returns:

    Value of the density distribution moment.

inline double GetQ(const std::vector<double> &_QiDistr, const std::vector<double> &_grid, double _size)

  Calculates Q.

  Parameters:

    - _QiDistr – Input distribution.

    - _grid – Distribution grid.

    - _size – Value of size.

  Returns:

    Calculated Q.

inline std::vector<double> Q2q(const std::vector<double> &_grid, const std::vector<double> &_Q)

  Performs conversion from cumulative to density distributions.

  q_0 = \frac{Q_0}{\Delta d_i} and q_i = \frac{Q_i - Q_{i-1}}{\Delta d_i}.

  Parameters:

    - _grid – Distribution grid.

    - _Q – Input distribution.

  Returns:

    Density distribution.

inline std::vector<double> q2Q(const std::vector<double> &_grid, const std::vector<double> &_q)

  Performs conversion from density to cumulative distributions.

  Q_i = \sum_i q_i \Delta d_i = Q_i-1 + q_i \Delta d_i.

  Parameters:

    - _grid – Distribution grid.

    - _q – Input distribution.

  Returns:

    Cumulative distribution.

inline std::vector<double> qx2qy(const std::vector<double> &_grid, const std::vector<double> &_qx, int _x, int _y)

  Performs conversion from one density distribution to another.

  q_i = \frac{d_i^{y-x} q_i}{M^{y-x}(q_x)}.

  Parameters:

    - _grid – Distribution grid.

    - _qx – Input distribution.

    - _x – Input density distribution.

    - _y – Output density distribution.

  Returns:

    Density distribution.

inline std::vector<double> ConvertQ0Toq0(const std::vector<double> &_grid, const std::vector<double> &_Q0)

  Performs conversion from Q0 to q0 distributions.

  Using information about the size grid: q_{0,0} = \frac{Q_{0,0}}{\Delta d_i} and q_{0,i} = \frac{Q_{0,i} - Q_{0,i-1}}{\Delta d_i}. Refer to function Q2q(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q0 – Input distribution.

  Returns:

    Converted q0 distribution.

inline std::vector<double> Convertq0ToQ0(const std::vector<double> &_grid, const std::vector<double> &_q0)

  Performs conversion from q0 to Q0 distributions.

  Using information about the size grid: Q_{0,i} = \sum_i q_{0,i} \Delta d_i = Q_{0,i-1} + q_{0,i} \Delta d_i. Refer to function q2Q(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q0 – Input distribution.

  Returns:

    Converted Q0 distribution.

inline std::vector<double> ConvertQ2Toq2(const std::vector<double> &_grid, const std::vector<double> &_Q2)

  Performs conversion from Q2 to q2 distributions.

  Using information about the size grid: q_{2,0} = \frac{Q_{2,0}}{\Delta d_i} and q_{2,i} = \frac{Q_{2,i} - Q_{2,i-1}}{\Delta d_i}. Refer to function Q2q(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q2 – Input distribution.

  Returns:

    Converted q2 distribution.

inline std::vector<double> Convertq2ToQ2(const std::vector<double> &_grid, const std::vector<double> &_q2)

  Performs conversion from q2 to Q2 distributions.

  Using information about the size grid: Q_{2,i} = \sum_i q_{2,i} \Delta d_i = Q_{2,i-1} + q_{2,i} \Delta d_i. Refer to function q2Q(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q2 – Input distribution.

  Returns:

    Converted Q2 distribution.

inline std::vector<double> ConvertQ3Toq3(const std::vector<double> &_grid, const std::vector<double> &_Q3)

  Performs conversion from Q3 to q3 distributions.

  Using information about the size grid: q_{3,0} = \dfrac{Q_{3,0}}{\Delta d_i} and q_{3,i} = \frac{Q_{3,i} - Q_{3,i-1}}{\Delta d_i}. Refer to function Q2q(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q3 – Input distribution.

  Returns:

    Converted q3 distribution.

inline std::vector<double> Convertq3ToQ3(const std::vector<double> &_grid, const std::vector<double> &_q3)

  Performs conversion from q3 to Q3 distributions.

  Using information about the size grid: Q_{3,i} = \sum_i q_{3,i} \Delta d_i = Q_{3,i-1} + q_{3,i} \Delta d_i. Refer to function q2Q(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q3 – Input distribution.

  Returns:

    Converted Q3 distribution.

inline std::vector<double> Convertq0Toq2(const std::vector<double> &_grid, const std::vector<double> &_q0)

  Performs conversion from q0 to q2 distributions.

  Using information about the size grid by q_{2,i} = \frac{d_i^2 q_{0,i}}{M_2(q_0)}. Refer to function qx2qy(const std::vector<double>&, const std::vector<double>&, int, int).

  Parameters:

    - _grid – Distribution grid.

    - _q0 – Input distribution.

  Returns:

    Converted q2 distribution.

inline std::vector<double> Convertq0Toq3(const std::vector<double> &_grid, const std::vector<double> &_q0)

  Performs conversion from q0 to q3 distributions.

  Using information about the size grid by q_{3,i} = \frac{d_i^3 q_{0,i}}{M_3(q_0)}. Refer to function qx2qy(const std::vector<double>&, const std::vector<double>&, int, int).

  Parameters:

    - _grid – Distribution grid.

    - _q0 – Input distribution.

  Returns:

    Converted q3 distribution.

inline std::vector<double> Convertq2Toq0(const std::vector<double> &_grid, const std::vector<double> &_q2)

  Performs conversion from q2 to q0 distributions.

  Using information about the size grid by q_{0,i} = \frac{d_i^{-2} q_{2,i}}{M_{-2}(q_2)}. Refer to function qx2qy(const std::vector<double>&, const std::vector<double>&, int, int).

  Parameters:

    - _grid – Distribution grid.

    - _q2 – Input distribution.

  Returns:

    Converted q0 distribution.

inline std::vector<double> Convertq2Toq3(const std::vector<double> &_grid, const std::vector<double> &_q2)

  Performs conversion from q2 to q3 distributions.

  Using information about the size grid by q_{3,i} = \frac{d_i q_{2,i}}{M_1(q_2)}. Refer to function qx2qy(const std::vector<double>&, const std::vector<double>&, int, int).

  Parameters:

    - _grid – Distribution grid.

    - _q2 – Input distribution.

  Returns:

    Converted q3 distribution.

inline std::vector<double> Convertq3Toq0(const std::vector<double> &_grid, const std::vector<double> &_q3)

  Performs conversion from q3 to q0 distributions.

  Using information about the size grid by q_{0,i} = \frac{d_i^{-3} q_{3,i}}{M_{-3}(q_3)}. Refer to function qx2qy(const std::vector<double>&, const std::vector<double>&, int, int).

  Parameters:

    - _grid – Distribution grid.

    - _q3 – Input distribution.

  Returns:

    Converted q0 distribution.

inline std::vector<double> Convertq3Toq2(const std::vector<double> &_grid, const std::vector<double> &_q3)

  Performs conversion from q3 to q2 distributions.

  Using information about the size grid by q_{2,i} = \frac{d_i^{-1} q_{3,i}}{M_{-1}(q_3)}. Refer to function qx2qy(const std::vector<double>&, const std::vector<double>&, int, int).

  Parameters:

    - _grid – Distribution grid.

    - _q3 – Input distribution.

  Returns:

    Converted q2 distribution.

inline std::vector<double> ConvertMassFractionsToq3(const std::vector<double> &_grid, const std::vector<double> &_massFrac)

  Calculates q3 distribution.

  Using the size grid and the distribution of mass fractions by q_3 = w_i / \Delta d_i.

  Parameters:

    - _grid – Distribution grid.

    - _massFrac – Input distribution.

  Returns:

    Calculated q3 distribution.

inline std::vector<double> ConvertMassFractionsToQ3(const std::vector<double> &_massFrac)

  Calculates Q3 distribution.

  Using the distribution of mass fractions: Q_{3,0} = w_i and Q_{3,i} = Q_{3,i-1} + w_i.

  Parameters:

    _massFrac – Input distribution.

  Returns:

    Calculated Q3 distribution.

inline std::vector<double> ConvertMassFractionsToq2(const std::vector<double> &_grid, const std::vector<double> &_massFrac)

  Calculates q2 distribution.

  Refer to the functions ConvertMassFractionsToq3(const std::vector<double>&, const std::vector<double>&) and Convertq3Toq2(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _massFrac – Input distribution.

  Returns:

    Calculated q2 distribution.

inline std::vector<double> ConvertMassFractionsToQ2(const std::vector<double> &_grid, const std::vector<double> &_massFrac)

  Calculates Q2 distribution.

  Refer to the functions ConvertMassFractionsToq2(const std::vector<double>&, const std::vector<double>&) and Convertq2ToQ2(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _massFrac – Input distribution.

  Returns:

    Calculated Q2 distribution.

inline std::vector<double> ConvertMassFractionsToq0(const std::vector<double> &_grid, const std::vector<double> &_massFrac)

  Calculates q0 distribution.

  Refer to the functions ConvertMassFractionsToq3(const std::vector<double>&, const std::vector<double>&) and Convertq3Toq0(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _massFrac – Input distribution.

  Returns:

    Calculated q0 distribution.

inline std::vector<double> ConvertMassFractionsToQ0(const std::vector<double> &_grid, const std::vector<double> &_massFrac)

  Calculates Q0 distribution.

  Refer to the functions ConvertMassFractionsToq0(const std::vector<double>&, const std::vector<double>&) and Convertq0ToQ0(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _massFrac – Input distribution.

  Returns:

    Calculated q0 distribution.

inline std::vector<double> Convertq3ToMassFractions(const std::vector<double> &_grid, const std::vector<double> &_q3)

  Calculates mass fractions from q3.

  Using the size grid by w_i = q_{3,i}\cdot \Delta d_i.

  Parameters:

    - _grid – Distribution grid.

    - _q3 – Input distribution.

  Returns:

    Calculated mass fractions.

inline std::vector<double> ConvertQ3ToMassFractions(const std::vector<double> &_Q3)

  Calculates mass fractions from Q3 distribution.

  Using the size grid: w_0 = Q_{3,0} and w_i = Q_{3,i} - Q_{3,i-1}.

  Parameters:

    _Q3 – Input distribution.

  Returns:

    Calculated mass fractions.

inline std::vector<double> Convertq2ToMassFractions(const std::vector<double> &_grid, const std::vector<double> &_q2)

  Calculates mass fractions from q2 distribution.

  Refer to the functions Convertq2Toq3(const std::vector<double>&, const std::vector<double>&) and Convertq3ToMassFractions(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q2 – Input distribution.

  Returns:

    Calculated mass fractions.

inline std::vector<double> ConvertQ2ToMassFractions(const std::vector<double> &_grid, const std::vector<double> &_Q2)

  Calculates mass fractions from Q2 distribution.

  Refer to the functions ConvertQ2Toq2(const std::vector<double>&, const std::vector<double>&) and Convertq2ToMassFractions(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q2 – Input distribution.

  Returns:

    Calculated mass fractions.

inline std::vector<double> Convertq0ToMassFractions(const std::vector<double> &_grid, const std::vector<double> &_q0)

  Calculates mass fractions from q0 distribution.

  Refer to the functions Convertq0Toq3(const std::vector<double>&, const std::vector<double>&) and Convertq3ToMassFractions(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q0 – Input distribution.

  Returns:

    Calculated mass fractions.

inline std::vector<double> ConvertQ0ToMassFractions(const std::vector<double> &_grid, const std::vector<double> &_Q0)

  Calculates mass fractions from Q0 distribution.

  Refer to the functions ConvertQ0Toq0(const std::vector<double>&, const std::vector<double>&) and Convertq0ToMassFractions(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q0 – Input distribution.

  Returns:

    Calculated mass fractions.

inline std::vector<double> ConvertNumbersToq0(const std::vector<double> &_grid, const std::vector<double> &_number)

  Calculates q0 distribution using the number distribution and the size grid.

  q_{0,i} = \frac{N_i}{\Delta d_i N_{tot}}.

  Parameters:

    - _grid – Distribution grid.

    - _number – Number distribution.

  Returns:

    Calculated q0 distribution.

inline std::vector<double> ConvertNumbersToQ0(const std::vector<double> &_grid, const std::vector<double> &_number)

  Calculates Q0 distribution using the number distribution.

  Refer to the functions ConvertNumbersToq0(const std::vector<double>&, const std::vector<double>&) and Convertq0ToQ0(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _number – Number distribution.

  Returns:

    Calculated Q0 distribution.

inline std::vector<double> ConvertNumbersToQ2(const std::vector<double> &_grid, const std::vector<double> &_number)

  Calculates Q2 distribution using the number distribution and the size grid.

  Q_{2,i} = \frac{\sum_{j=0}^i N_j \pi d_j^2}{\sum_j N_j \pi d_j^2}.

  Parameters:

    - _grid – Distribution grid.

    - _number – Number distribution.

  Returns:

    Calculated Q2 distribution.

inline std::vector<double> ConvertNumbersToq2(const std::vector<double> &_grid, const std::vector<double> &_number)

  Calculates q2 distribution using the number distribution.

  Refer to the functions ConvertNumbersToQ2(const std::vector<double>&, const std::vector<double>&) and ConvertQ2Toq2(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _number – Number distribution.

  Returns:

    Calculated q2 distribution.

inline std::vector<double> ConvertNumbersToq3(const std::vector<double> &_grid, const std::vector<double> &_number)

  Calculates q3 distribution using the number distribution.

  Refer to the functions ConvertNumbersToq0(const std::vector<double>&, const std::vector<double>&) and Convertq0Toq3(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _number – Number distribution.

  Returns:

    Calculated q3 distribution.

inline std::vector<double> ConvertNumbersToQ3(const std::vector<double> &_grid, const std::vector<double> &_number)

  Calculates Q3 distribution using the number distribution.

  Refer to the functions ConvertNumbersToq3(const std::vector<double>&, const std::vector<double>&) and Convertq3ToQ3(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _number – Number distribution.

  Returns:

    Calculated Q3 distribution.

inline std::vector<double> ConvertNumbersToMassFractions(const std::vector<double> &_grid, const std::vector<double> &_number)

  Calculates mass fractions from the number distribution.

  Refer to the functions ConvertNumbersToq0(const std::vector<double>&, const std::vector<double>&) and Convertq0ToMassFractions(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _number – Number distribution.

  Returns:

    Calculated mass fractions.

inline std::vector<double> Convertq0ToQ2(const std::vector<double> &_grid, const std::vector<double> &_q0)

  Calculates Q2 distribution.

  Refer to the functions Convertq0Toq2(const std::vector<double>&, const std::vector<double>&) and Convertq2ToQ2(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q0 – Input distribution.

  Returns:

    Calculated Q2 distribution.

inline std::vector<double> Convertq0ToQ3(const std::vector<double> &_grid, const std::vector<double> &_q0)

  Calculates Q3 distribution.

  Refer to the functions Convertq0Toq3(const std::vector<double>&, const std::vector<double>&) and Convertq3ToQ3(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q0 – Input distribution.

  Returns:

    Calculated Q3 distribution.

inline std::vector<double> Convertq2ToQ0(const std::vector<double> &_grid, const std::vector<double> &_q2)

  Calculates Q0 distribution.

  Refer to the functions Convertq2Toq0(const std::vector<double>&, const std::vector<double>&) and Convertq0ToQ0(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q2 – Input distribution.

  Returns:

    Calculated Q0 distribution.

inline std::vector<double> Convertq2ToQ3(const std::vector<double> &_grid, const std::vector<double> &_q2)

  Calculates Q3 distribution.

  Refer to the functions Convertq2Toq3(const std::vector<double>&, const std::vector<double>&) and Convertq3ToQ3(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q2 – Input distribution.

  Returns:

    Calculated Q3 distribution.

inline std::vector<double> Convertq3ToQ0(const std::vector<double> &_grid, const std::vector<double> &_q3)

  Calculates Q0 distribution.

  Refer to the functions Convertq3Toq0(const std::vector<double>&, const std::vector<double>&) and Convertq0ToQ0(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q3 – Input distribution.

  Returns:

    Calculated Q0 distribution.

inline std::vector<double> Convertq3ToQ2(const std::vector<double> &_grid, const std::vector<double> &_q3)

  Calculates Q2 distribution.

  Refer to the functions Convertq3Toq2(const std::vector<double>&, const std::vector<double>&) and Convertq2ToQ2(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q3 – Input distribution.

  Returns:

    Calculated Q2 distribution.

inline std::vector<double> ConvertQ0Toq2(const std::vector<double> &_grid, const std::vector<double> &_Q0)

  Calculates q2 distribution.

  Refer to the functions ConvertQ0Toq0(const std::vector<double>&, const std::vector<double>&) and Convertq0Toq2(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q0 – Input distribution.

  Returns:

    Calculated q2 distribution.

inline std::vector<double> ConvertQ0Toq3(const std::vector<double> &_grid, const std::vector<double> &_Q0)

  Calculates q3 distribution.

  Refer to the functions ConvertQ0Toq0(const std::vector<double>&, const std::vector<double>&) and Convertq0Toq3(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q0 – Input distribution.

  Returns:

    Calculated q3 distribution.

inline std::vector<double> ConvertQ2Toq0(const std::vector<double> &_grid, const std::vector<double> &_Q2)

  Calculates q0 distribution.

  Refer to the functions ConvertQ2Toq2(const std::vector<double>&, const std::vector<double>&) and Convertq2Toq0(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q2 – Input distribution.

  Returns:

    Calculated q0 distribution.

inline std::vector<double> ConvertQ2Toq3(const std::vector<double> &_grid, const std::vector<double> &_Q2)

  Calculates q3 distribution.

  Refer to the functions ConvertQ2Toq2(const std::vector<double>&, const std::vector<double>&) and Convertq2Toq3(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q2 – Input distribution.

  Returns:

    Calculated q3 distribution.

inline std::vector<double> ConvertQ3Toq0(const std::vector<double> &_grid, const std::vector<double> &_Q3)

  Calculates q0 distribution.

  Refer to the functions ConvertQ3Toq3(const std::vector<double>&, const std::vector<double>&) and Convertq3Toq0(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q3 – Input distribution.

  Returns:

    Calculated q0 distribution.

inline std::vector<double> ConvertQ3Toq2(const std::vector<double> &_grid, const std::vector<double> &_Q3)

  Calculates q2 distribution.

  Refer to the functions ConvertQ3Toq3(const std::vector<double>&, const std::vector<double>&) and Convertq3Toq2(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q3 – Input distribution.

  Returns:

    Calculated q2 distribution.

inline std::vector<double> ConvertQ0ToQ2(const std::vector<double> &_grid, const std::vector<double> &_Q0)

  Calculates Q2 distribution.

  Refer to the functions ConvertQ0ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToQ2(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q0 – Input distribution.

  Returns:

    Calculated Q2 distribution.

inline std::vector<double> ConvertQ0ToQ3(const std::vector<double> &_grid, const std::vector<double> &_Q0)

  Calculates Q3 distribution.

  Refer to the functions ConvertQ0ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToQ3(const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q0 – Input distribution.

  Returns:

    Calculated Q3 distribution.

inline std::vector<double> ConvertQ2ToQ0(const std::vector<double> &_grid, const std::vector<double> &_Q2)

  Calculates Q0 distribution.

  Refer to the functions ConvertQ2ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToQ0(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q2 – Input distribution.

  Returns:

    Calculated Q0 distribution.

inline std::vector<double> ConvertQ2ToQ3(const std::vector<double> &_grid, const std::vector<double> &_Q2)

  Calculates Q3 distribution.

  Refer to the functions ConvertQ2ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToQ3(const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q2 – Input distribution.

  Returns:

    Calculated Q3 distribution.

inline std::vector<double> ConvertQ3ToQ0(const std::vector<double> &_grid, const std::vector<double> &_Q0)

  Calculates Q0 distribution.

  Refer to the functions ConvertQ0ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToQ0(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q0 – Input distribution.

  Returns:

    Calculated Q0 distribution.

inline std::vector<double> ConvertQ3ToQ2(const std::vector<double> &_grid, const std::vector<double> &_Q3)

  Calculates Q2 distribution.

  Refer to the functions ConvertQ3ToMassFractions(const std::vector<double>&) and ConvertMassFractionsToQ2(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q3 – Input distribution.

  Returns:

    Calculated Q2 distribution.

inline std::vector<double> ConvertMassFractionsToNumbers(const std::vector<double> &_grid, const std::vector<double> &_massFrac)

  Assumes unity density and unity total mass.

  N_i = \frac{6 \cdot w_i}{\pi \cdot \Delta d_i^3}.

  Parameters:

    - _grid – Distribution grid.

    - _massFrac – Input distribution.

  Returns:

    Number distribution.

inline std::vector<double> Convertq0ToNumbers(const std::vector<double> &_grid, const std::vector<double> &_q0)

  Assumes unity density and unity total mass.

  Refer to the functions Convertq0ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToNumbers(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q0 – Input distribution.

  Returns:

    Number distribution.

inline std::vector<double> Convertq2ToNumbers(const std::vector<double> &_grid, const std::vector<double> &_q2)

  Assumes unity density and unity total mass.

  Refer to the functions Convertq2ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToNumbers(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q2 – Input distribution.

  Returns:

    Number distribution.

inline std::vector<double> Convertq3ToNumbers(const std::vector<double> &_grid, const std::vector<double> &_q3)

  Assumes unity density and unity total mass.

  Refer to the functions Convertq3ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToNumbers(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _q3 – Input distribution.

  Returns:

    Number distribution.

inline std::vector<double> ConvertQ0ToNumbers(const std::vector<double> &_grid, const std::vector<double> &_Q0)

  Assumes unity density and unity total mass.

  Refer to the functions ConvertQ0ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToNumbers(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q0 – Input distribution.

  Returns:

    Number distribution.

inline std::vector<double> ConvertQ2ToNumbers(const std::vector<double> &_grid, const std::vector<double> &_Q2)

  Assumes unity density and unity total mass.

  Refer to the functions ConvertQ2ToMassFractions(const std::vector<double>&, const std::vector<double>&) and ConvertMassFractionsToNumbers(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q2 – Input distribution.

  Returns:

    Number distribution.

inline std::vector<double> ConvertQ3ToNumbers(const std::vector<double> &_grid, const std::vector<double> &_Q3)

  Assumes unity density and unity total mass.

  Refer to the functions ConvertQ3ToMassFractions(const std::vector<double>&) and ConvertMassFractionsToNumbers(const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _grid – Distribution grid.

    - _Q3 – Input distribution.

  Returns:

    Number distribution.

inline std::vector<double> ConvertOnNewGrid(const std::vector<std::string> &_grid, const std::vector<double> &_w, const std::vector<std::string> &_gridNew)

  Converts the mass fraction distribution defined on the numeric grid to the new grid.

  Parameters:

    - _grid – Old mass fraction distribution.

    - _w – Old symbolic distribution grid.

    - _gridNew – New distribution grid.

  Returns:

    Converted distribution on the modified size grid.

inline std::vector<double> ConvertOnNewGrid(const std::vector<double> &_grid, const std::vector<double> &_w, const std::vector<double> &_gridNew)

  Converts the mass fraction distribution defined on the numeric grid to the new grid.

  Parameters:

    - _grid – Old mass fraction distribution.

    - _w – Old numeric distribution grid.

    - _gridNew – New distribution grid.

  Returns:

    Converted distribution on the modified size grid.

inline std::vector<double> ConvertqOnNewGrid(const std::vector<double> &_grid, const std::vector<double> &_q, const std::vector<double> &_gridNew)

  Converts density distribution defined on the numeric grid to the new grid.

  Parameters:

    - _grid – Old numeric distribution grid.

    - _q – Old density distribution.

    - _gridNew – New distribution grid.

  Returns:

    Converted distribution on the modified size grid.

inline std::vector<double> Convertq0Toq0(const std::vector<double> &_gridOld, const std::vector<double> &_q0Old, std::vector<double> &_gridNew)

  Converts q0 distribution to the same distribution on the modified size grid.

  Refer to function ConvertqOnNewGrid(const std::vector<double>&, const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _gridOld – Old distribution grid.

    - _q0Old – Old distribution.

    - _gridNew – New distribution grid.

  Returns:

    Converted q0 distribution on the modified size grid.

inline std::vector<double> Convertq2Toq2(const std::vector<double> &_gridOld, const std::vector<double> &_q2Old, std::vector<double> &_gridNew)

  Converts q2 distribution to the same distribution on the modified size grid.

  Refer to function ConvertqOnNewGrid(const std::vector<double>&, const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _gridOld – Old distribution grid.

    - _q2Old – Old distribution.

    - _gridNew – New distribution grid.

  Returns:

    Converted q2 distribution on the modified size grid.

inline std::vector<double> Convertq3Toq3(const std::vector<double> &_gridOld, const std::vector<double> &_q3Old, std::vector<double> &_gridNew)

  Converts q3 distribution to the same distribution on the modified size grid.

  Refer to function ConvertqOnNewGrid(const std::vector<double>&, const std::vector<double>&, const std::vector<double>&).

  Parameters:

    - _gridOld – Old distribution grid.

    - _q3Old – Old distribution.

    - _gridNew – New distribution grid.

  Returns:

    Converted q3 distribution on the modified size grid.

inline void NormalizeDensityDistribution(const std::vector<double> &_grid, std::vector<double> &_qiDistr)

  Normalizes density distribution q0 or q3.

  q_i = \frac{q_i}{\sum_j q_j \Delta d_j}.

  Parameters:

    - _grid – Distribution grid.

    - _qiDistr – Input distribution.

inline double GetDistributionValue(const std::vector<double> &_grid, const std::vector<double> &_QiDistr, double _val)

  Returns value of the grid in the measurement units of the grid, which corresponds to a specified value of cumulative distribution Q0 or Q3.

  For PSD, returns particle diameter in [m]. Input value should range between 0 and 1.

  Parameters:

    - _grid – Distribution grid.

    - _QiDistr – Input distribution.

    - _val – Value in range between 0 and 1.

  Returns:

    Distribution value.

inline double GetDistributionMedian(const std::vector<double> &_grid, const std::vector<double> &_QiDistr)

  Returns median in the measurement units of the grid of Q0 or Q3 distribution. Median is a value of the grid, which corresponds to a value of distribution equal to 0.5.

  For PSD, returns particle diameter in [m]. Refer to function GetDistributionValue(const std::vector<double>&, const std::vector<double>&, double).

  Parameters:

    - _grid – Distribution grid.

    - _QiDistr – Input distribution.

  Returns:

    Median of distribution.

inline double GetDistributionMode(const std::vector<double> &_grid, const std::vector<double> &_qiDistr)

  Returns value of the grid in the measurement units of the grid, which corresponds to a maximum value of density distribution.

  For PSD, returns particle diameter in [m].

  Parameters:

    - _grid – Distribution grid.

    - _qiDistr – Input distribution.

  Returns:

    Mode of distribution.

inline double GetDistributionMean(const std::vector<double> &_grid, const std::vector<double> &_qiDistr)

  Returns value of the grid in the measurement units of the grid, which corresponds to a mean value of density distribution.

  For PSD, returns particle diameter in [m]. Calculated as \mu = \frac{\sum q_{i} d_{i}}{\sum q_{i}} with \mu mean value of the distribution, q_{i} value of the distribution at class i, d_{i} mean value of the class i.

  Parameters:

    - _grid – Distribution grid.

    - _qiDistr – Input density distribution.

  Returns:

    Mean of distribution.

inline double GetDistributionVariance(const std::vector<double> &_grid, const std::vector<double> &_qiDistr)

  Returns variance of the density distribution around its mean value in the measurement units of the grid.

  For PSD, calculates in the terms of particle diameter in [m]. Calculated as \sigma^2 = \frac{\sum q_{i} d_{i}^2}{\sum q_{i}}-\mu^2 with \sigma^2 variance of the distribution, q_{i} value of the distribution at class i, d_{i} mean value of the class i, \mu mean value of the distribution (Refer to function GetDistributionMean(const std::vector<double>&, const std::vector<double>&)).

  Parameters:

    - _grid – Distribution grid.

    - _qiDistr – Input density distribution.

  Returns:

    Variance of distribution.

inline double GetDistributionStdDev(const std::vector<double> &_grid, const std::vector<double> &_qiDistr)

  Returns standard deviation of the density distribution around its mean value in the measurement units of the grid.

  For PSD, calculates in the terms of particle diameter in [m]. Calculated as \sigma = \sqrt{\frac{\sum q_{i} d_{i}^2}{\sum q_{i}}-\mu^2} with \sigma standard deviation of the distribution, q_{i} value of the distribution at class i, d_{i} mean value of the class i, \mu mean value of the distribution (Refer to function GetDistributionMean(const std::vector<double>&, const std::vector<double>&)).

  Parameters:

    - _grid – Distribution grid.

    - _qiDistr – Input density distribution.

  Returns:

    Standard deviation of distribution.

inline double GetAverageDiameter(const std::vector<double> &_grid, const std::vector<double> &_qiDistr)

  Returns average diameter in [m] of the distribution q0 or q3.

  Parameters:

    - _grid – Distribution grid.

    - _qiDistr – Input distribution.

  Returns:

    Average diameter of distribution.

inline double GetSpecificSurface(const std::vector<double> &_grid, const std::vector<double> &_q3)

  Calculates specific surface of q3 distribution in [m2].

  Parameters:

    - _grid – Distribution grid.

    - _q3 – Input distribution.

  Returns:

    Specific surface of distribution.

inline double GetSauterDiameter(const std::vector<double> &_grid, const std::vector<double> &_q3)

  Calculates Sauter diameter (d32) of q3 distribution in [m].

  Parameters:

    - _grid – Distribution grid.

    - _q3 – Input distribution.

  Returns:

    Sauter diameter of distribution.