Basic stream

class CBaseStream

Basic class for material flow description.

This is a base class from which CStream and CHoldup are derived.

Subclassed by CHoldup, CStream

Public Functions

std::string GetName() const

Returns the name of the stream.

Returns

Name of the stream.

void SetName(const std::string &_name)

Sets new name of the stream.

Parameters

_name – Name of the stream.

std::string GetKey() const

Returns unique key of the stream.

Returns

Unique key of the stream.

void SetKey(const std::string &_key)

Sets new unique key of the stream.

Parameters

_key – Unique key of the stream.

void AddTimePoint(double _time)

Adds a new time point.

All data to the new time point are copied from the previous existing time point. If no other time points exist, all data are set to zero. If this time point already exists, nothing is done.

Parameters

_time – New time point.

void CopyTimePoint(double _timeDst, double _timeSrc)

Copies all data from one time point to another one.

If the destination time point does not yet exist, it is added.

Parameters
  • _timeDst – Target time point.

  • _timeSrc – Source time point.

void RemoveTimePoint(double _time)

Removes the specified time point if it already exists.

Parameters

_time – Time point.

void RemoveTimePoints(double _timeBeg, double _timeEnd, bool _inclusive = true)

Removes all existing time points in the specified interval.

The boundaries of the interval can be included or excluded from the list of deleted time points.

Parameters
  • _timeBeg – Begin of the time interval.

  • _timeEnd – End of the time interval.

  • _inclusive – Whether to include boundaries of the interval.

void RemoveTimePointsAfter(double _time, bool _inclusive = false)

Removes all existing time points after the specified one.

The time point itself can be included or excluded from the list of deleted time points.

Parameters
  • _time – Begin of the time interval.

  • _inclusive – Whether to include boundary time point.

void RemoveAllTimePoints()

Removes all existing time points.

void ReduceTimePoints(double _timeBeg, double _timeEnd, double _step)

Removes time points within the specified interval that are closer together than a specified step.

Parameters
  • _timeBeg – Begin of the time interval.

  • _timeEnd – End of the time interval.

  • _step – Step between time points to be kept.

std::vector<double> GetAllTimePoints() const

Returns all defined time points.

Returns

All time points which are defined in the stream.

std::vector<double> GetTimePoints(double _timeBeg, double _timeEnd) const

Returns all defined time points in the specified time interval.

Parameters
  • _timeBeg – Begin of the time interval.

  • _timeEnd – End of the time interval.

Returns

All time points which are defined in the stream within the time interval.

std::vector<double> GetTimePointsClosed(double _timeBeg, double _timeEnd) const

Returns all defined time points in the specified closed time interval.

Boundaries are unconditionally included into result.

Parameters
  • _timeBeg – Begin of the time interval.

  • _timeEnd – End of the time interval.

Returns

All time points which are defined in the stream within the time interval.

double GetLastTimePoint() const

Returns the last (largest) defined time point.

Returns zero if no time points have been defined in the stream.

Returns

Last defined time point in the stream.

double GetPreviousTimePoint(double _time) const

Returns the nearest time point before the given one.

Returns zero if such time point does not exist.

Parameters

_time – Target time point.

Returns

Previous time point.

double GetOverallProperty(double _time, EOverall _property) const

Returns a value of the specified overall property at the given time point.

Returns default value if such overall property has not been defined.

Parameters
  • _time – Target time point.

  • _property – Identifier of time-dependent overall property.

Returns

Value of the specified overall property at the given time point.

double GetMass(double _time) const

Returns a value of the overall mass in [kg] at the given time point.

If such time point has not been defined, interpolation of data is done.

Parameters

_time – Target time point.

Returns

Value of the overall mass at the given time point.

double GetTemperature(double _time) const

Returns a value of the overall temperature in [K] at the given time point.

Returns standard condition temperature if temperature overall property has not been defined.

Parameters

_time – Target time point.

Returns

Value of the overall temperature at the given time point.

double GetPressure(double _time) const

Returns a value of the overall pressure in [Pa] at the given time point.

Returns standard condition pressure if pressure overall property has not been defined.

Parameters

_time – Target time point.

Returns

Value of the overall pressure at the given time point.

void SetOverallProperty(double _time, EOverall _property, double _value)

Sets a value of the specified overall property at the given time point.

If the specified time point does not exist, it is added to the stream. If this property does not exist, nothing is done.

Parameters
  • _time – Target time point.

  • _property – Identifier of the time-dependent overall property.

  • _value – Value of the specified overall property.

void SetMass(double _time, double _value)

Sets a value of the overall mass in [kg] at the given time point.

If the specified time point does not exist, it is added to the stream. If this property does not exist, nothing is done.

Parameters
  • _time – Target time point.

  • _value – Value of the overall mass.

void SetTemperature(double _time, double _value)

Sets a value of the overall temperature in [K] at the given time point.

If the specified time point does not exist, it is added to the stream. If this property does not exist, nothing is done.

Parameters
  • _time – Target time point.

  • _value – Value of the overall temperature.

void SetPressure(double _time, double _value)

Sets a value of the overall pressure in [Pa] at the given time point.

If the specified time point does not exist, it is added to the stream. If this property does not exist, nothing is done.

Parameters
  • _time – Target time point.

  • _value – Value of the overall pressure.

double GetMol(double _time) const

Returns a value of the overall amount of substance in [mol] at the given time point.

m\sum_i{w_i\sum_j{\frac{f_{i,j}}{M_j}}} with m overall mass of the stream, w_i mass fraction of phase i, f_{i,j} mass fraction of compound j in phase i, M_j molar mass of compound j.

Parameters

_time – Target time point.

Returns

Value of the overall amount of substance.

void SetMol(double _time, double _value)

Sets a value of the overall amount of substance in [mol] at the given time point.

If the specified time point does not exist, it is added to the stream. The overall amount of substance _value is converted to mass as \frac{m\cdot \_value}{\nu} with m overall mass of the stream, \nu overall amount of substance in [mol] as returned by CBaseStream::GetMol(double) const.

Parameters
  • _time – Target time point.

  • _value – Value of the overall amount of substance.

std::vector<std::string> GetAllCompounds() const

Returns unique keys of all defined compounds.

Returns

List of all defined compounds.

double GetCompoundFraction(double _time, const std::string &_compoundKey) const

Returns the mass fraction of the compound in the total mixture at the given time point.

f_j = \sum_{i} w_i f_{i,j} with f_j mass fraction of compound j, w_i mass fraction of phase i, f_{i,j} mass fraction of compound j in phase i.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

Returns

Mass fraction of the compound.

double GetCompoundFraction(double _time, const std::string &_compoundKey, EPhase _phase) const

Returns the mass fraction of the compound in the specified phase at the given time point.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _phase – Phase type identifier.

Returns

Mass fraction of the compound.

double GetCompoundMass(double _time, const std::string &_compoundKey) const

Returns the mass of the compound in the total mixture at the given time point.

m_j = m f_j with m_j mass of compound j, m overall mass of the stream, f_j mass fraction of compound j.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

Returns

Mass of the compound.

double GetCompoundMass(double _time, const std::string &_compoundKey, EPhase _phase) const

Returns the mass of the compound in the specified phase at the given time point.

m_{i,j} = m w_i f_{i,j} with m_{i,j} mass of compound j in phase i, m overall mass of the stream, w_i mass fraction of phase i, f_{i,j} mass fraction of compound j in phase i.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _phase – Phase type identifier.

Returns

Mass of the compound.

std::vector<double> GetCompoundsFractions(double _time) const

Returns mass fraction of all defined compounds at the given time point.

Parameters

_time – Target time point.

Returns

Mass fraction of all defined compounds.

std::vector<double> GetCompoundsFractions(double _time, EPhase _phase) const

Returns mass fraction of all defined compounds in the specified phase at the given time point.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

Returns

Mass fraction of all defined compounds.

std::vector<double> GetCompoundsMasses(double _time) const

Returns masses of all defined compounds at the given time point.

Parameters

_time – Target time point.

Returns

Masses of all defined compounds.

std::vector<double> GetCompoundsMasses(double _time, EPhase _phase) const

Returns masses of all defined compounds in the specified phase at the given time point.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

Returns

Masses of all defined compounds.

void SetCompoundFraction(double _time, const std::string &_compoundKey, EPhase _phase, double _value)

Sets mass fraction of the compound in the specified phase at the given time point.

If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _phase – Phase type identifier.

  • _value – Value of the mass fraction of the compound.

void SetCompoundsFractions(double _time, const std::vector<double> &_value)

Sets mass fraction of all defined compounds in all defined phases at the given time point.

If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _value – List of mass fractions of all defined compounds.

void SetCompoundsFractions(double _time, EPhase _phase, const std::vector<double> &_value)

Sets mass fraction of all defined compounds in the specified phase at the given time point.

If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

  • _value – List of mass fractions of all defined compounds.

void SetCompoundMass(double _time, const std::string &_compoundKey, EPhase _phase, double _value)

Sets the mass of the specified compound in the specified phase at the given time point.

Total mass of the stream is correspondingly adjusted, masses of other compounds and phases remain the same.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _phase – Phase type identifier.

  • _value – Mass of the compound.

double GetCompoundMolFraction(double _time, const std::string &_compoundKey, EPhase _phase) const

Returns the molar fraction of the compound in the specified phase at the given time point.

f_{i,j}^{mol} = f_{i,j} \frac{M_i}{M_j} with f_{i,j}^{mol} mole fraction of compound j in phase i, f_{i,j} mass fraction of compound j in phase i, M_i molar mass of phase i, M_j molar mass of compound j.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _phase – Phase type identifier.

Returns

Molar fraction of the compound.

double GetCompoundMol(double _time, const std::string &_compoundKey, EPhase _phase) const

Returns the amount of substance of the compound in the specified phase at the given time point.

\nu_{i,j} = \frac{m w_i f_{i,j}}{M_j} with \nu_{i,j} amount of substance of compound j in phase i, m overall mass of the stream, w_i mass fraction of phase i, f_{i,j} mass fraction of compound j in phase i, M_j molar mass of compound j.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _phase – Phase type identifier.

Returns

Amount of substance of the compound.

void SetCompoundMolFraction(double _time, const std::string &_compoundKey, EPhase _phase, double _value)

Sets the molar fraction of the compound in the specified phase at the given time point.

If the specified time point does not exist, it is added to the stream. The molar fraction of the compound _value is converted to a mass fraction as f_{i,j} =_value \cdot M_j \sum_j \frac{f_{i,j}}{M_j} with f_{i,j} mass fraction of compound j in phase i, M_j molar mass of compound j.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _phase – Phase type identifier.

  • _value – Molar fraction of the compound.

double GetPhaseFraction(double _time, EPhase _phase) const

Returns the mass fraction of the specified phase at the given time point.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

Returns

Mass fraction of the specified phase.

double GetPhaseMass(double _time, EPhase _phase) const

Returns the mass of the specified phase at the given time point.

m_i = m w_i with m_i mass of phase i, m overall mass of the stream, w_i mass fraction of phase i.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

Returns

Mass of the specified phase.

double GetPhaseProperty(double _time, EPhase _phase, EOverall _property) const

Returns the value of the overall property of the specified phase at the given time point.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

  • _property – Identifier of time-dependent overall property.

Returns

Value of the overall property.

double GetPhaseProperty(double _time, EPhase _phase, ECompoundConstProperties _property) const

Returns the value of the constant physical property of the specified phase at the given time point.

  • For MOLAR_MASS: M_i = \frac{1}{\sum_j {\frac{f_{i,j}}{M_j}}} with M_i molar mass of phase i, M_j molar mass of compound j, f_{i,j} mass fraction of compound j in phase i.

  • For other const material properties: v_i = \sum_j f_{i,j} v_j with v_i const physical property of phase i, v_j value of the specified const _property of compound j, f_{i,j} mass fraction of compound j in phase i.

See also: Constant parameters

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

  • _property – Identifier of a constant material property.

Returns

Value of the constant physical property.

double GetPhaseProperty(double _time, EPhase _phase, ECompoundTPProperties _property) const

Returns the value of the temperature/pressure-dependent physical property of the specified phase at the given time point.

Available properties are:

  • DENSITY:

    • For solid phase: \rho = \sum_{i,j} \rho_i (1 - \varepsilon_j) f_{i,j} with \varepsilon_j porosity in interval j, f_{i,j} mass fraction of compound i with porosity j.

    • For liquid and vapor phase: \frac{1}{\rho} = \sum_i \frac{w_i}{\rho_i} with w_i mass fraction of compound i in _phase.

  • HEAT_CAPACITY_CP: C_p = \sum_i w_i \cdot C_{p,i} with C_{p,i} heat capacity of compound i, w_i mass fraction of compound i in _phase.

  • VAPOR_PRESSURE: P_v = \min_{i} (P_v)_i with (P_v)_i vapor pressure of compound i.

  • VISCOSITY:

    • For solid phase: \eta = \sum\limits_i w_i \eta_i with \eta_i viscosity of compound i, w_i mass fraction of compound i.

    • For liquid phase: \ln \eta = \sum_i w_i \ln \eta_i with \eta_i viscosity of compound i, w_i mass fraction of compound i in _phase.

    • For vapor phase: \eta = \frac{\sum_i x_i \sqrt{M_i} \eta_i}{\sum_i x_i \sqrt{M_i}} with \eta_i viscosity of compound i, w_i mass fraction of compound i in _phase, x_i the mole fraction of compound i in _phase.

  • THERMAL_CONDUCTIVITY:

    • For solid phase: \lambda = \sum_i w_i \lambda_i with \lambda_i thermal conductivity of compound i.

    • For liquid phase: \lambda = \frac{1}{\sqrt{\sum_i x_i \lambda_i^{-2}}} with \lambda_i thermal conductivity of compound i.

    • For vapor phase: \lambda = \sum_i \frac{x_i \lambda_i}{\sum_j x_j F_{i,j}}, F_{i,j} = \frac{(1 + \sqrt{\lambda_i^4 / \lambda_j} \sqrt{M_j / M_i})^2}{\sqrt{8(1 + M_i / M_j)}} with M_i the molar mass of compound i.

  • PERMITTIVITY: \varepsilon = \sum_i w_i \varepsilon_i with \varepsilon_i permittivity of compound i, w_i mass fraction of compound i in _phase.

  • ENTHALPY: H = \sum_i w_i H_i with H_i enthalpy of compound i, w_i mass fraction of compound i in _phase.

  • EQUILIBRIUM_MOISTURE_CONTENT: M = \sum_i w_i M_i with M_i equilibrium moisture content of compound i, w_i mass fraction of compound i in _phase.

  • TP_PROP_USER_DEFINED_01 - TP_PROP_USER_DEFINED_20: Y = \sum_i w_i Y_i with Y_i property value of compound i, w_i mass fraction of compound i in _phase.

See also: Dependent parameters

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

  • _property – Identifier of temperature/pressure-dependent property.

Returns

Value of the temperature/pressure-dependent physical property.

void SetPhaseFraction(double _time, EPhase _phase, double _value)

Sets the mass fraction of the specified phase at the given time point.

If the specified time point does not exist, it is added to the stream. If there is no specified phase in the stream, nothing is done.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

  • _value – Phase mass fraction.

void SetPhaseMass(double _time, EPhase _phase, double _value)

Sets the mass of the specified phase at the given time point.

If the specified time point does not exist, it is added to the stream. Total mass of the stream is correspondingly adjusted, masses of other phases remain the same. If there is no specified phase in the stream, nothing is done. Input parameter _value is the mass of the defined phase: m_i = _value and w_i = m_i / m. The total mass m changes due to assignment of m_i: m = m_{old} + ( _value - m_{i,old}). m_i mass of phase i, w_i mass fraction of phase i, m overall mass of the stream.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

  • _value – Phase mass.

double GetPhaseMolFraction(double _time, EPhase _phase) const

Returns the molar fraction of the specified phase at the given time point.

x_i = \frac{\nu_i}{\nu}, x_i molar fraction of phase i, \nu_i amount of substance of phase i, \nu value of the overall amount of substance.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

Returns

Molar fraction of the specified phase.

double GetPhaseMol(double _time, EPhase _phase) const

Returns the amount of substance of the specified phase at the given time point.

\nu_i = \sum_j \nu_{i,j}, \nu_i amount of substance of phase i, \nu_{i,j} amount of substance of compound j in phase i.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

Returns

Amount of substance of the specified phase.

void SetPhaseMolFraction(double _time, EPhase _phase, double _value)

Sets the molar fraction of the specified phase at the given time point.

If the specified time point does not exist, it is added to the stream. Input parameter _value is the molar fraction of the defined phase: f_i = _value \cdot \frac{f_i}{x_i} with f_i mass fraction of phase i, x_i molar fraction of phase i.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

  • _value – Molar fraction of the specified phase.

void SetPhaseMol(double _time, EPhase _phase, double _value)

Sets the amount of substance of the specified phase at the given time point.

If the specified time point does not exist, it is added to the stream. Total mass of the stream is correspondingly adjusted, masses of other phases remain the same. Input parameter _value is the amount of substance of one defined phase: m_i =_value \cdot \frac{m_i}{n_i} with m_i mass of phase i, n_i amount of substance of phase i.

Parameters
  • _time – Target time point.

  • _phase – Phase type identifier.

  • _value – Amount of substance of the specified phase.

double GetMixtureProperty(double _time, EOverall _property) const

Returns the value of the property of the total mixture in the stream at the given time point.

Refer to function CBaseStream::GetOverallProperty(double, EOverall) const.

Parameters
  • _time – Target time point.

  • _property – Identifier of time-dependent overall property.

Returns

Value of the property of the total mixture.

double GetMixtureProperty(double _time, ECompoundConstProperties _property) const

Returns the value of the constant physical property of the total mixture in the stream at the given time point.

v = \sum_i v_i w_i with v value of the const physical property of the total mixture, v_i value of the const physical property of phase i, w_i mass fraction of phase i.

Parameters
  • _time – Target time point.

  • _property – Identifier of constant material property.

Returns

Value of the constant physical property of the total mixture.

double GetMixtureProperty(double _time, ECompoundTPProperties _property) const

Returns the value of the temperature/pressure-dependent physical property of the total mixture in the stream at the given time point.

v = \sum_i v_i w_i with v value of the temperature/pressure-dependent physical property of the total mixture, v_i value of the temperature/pressure-dependent physical property of phase i, w_i mass fraction of phase i.

Parameters
  • _time – Target time point.

  • _property – Identifier of temperature/pressure-dependent property.

Returns

Value of the temperature/pressure-dependent physical property of the total mixture.

void SetMixtureProperty(double _time, EOverall _property, double _value)

Sets the value of the property of the total mixture in the stream at the given time point.

If the specified time point does not exist, it is added to the stream. Refer to function CBaseStream::SetOverallProperty(double, EOverall, double).

Parameters
  • _time – Target time point.

  • _property – Identifier of time-dependent overall property.

  • _value – Value of the property of the total mixture.

double GetCompoundProperty(const std::string &_compoundKey, ECompoundConstProperties _property) const

Returns the value of the constant physical property of the specified compound.

See also: Constant parameters

Parameters
  • _compoundKey – Unique key of the compound.

  • _property – Identifier of constant material property.

Returns

Value of the constant physical property of the specified compound.

double GetCompoundProperty(const std::string &_compoundKey, ECompoundTPProperties _property, double _temperature, double _pressure) const

Returns the value of the temperature/pressure-dependent physical property of the specified compound with the given temperature [K] and pressure [Pa].

See also: Dependent parameters

Parameters
  • _compoundKey – Unique key of the compound.

  • _property – Identifier of temperature/pressure-dependent property.

  • _temperature – Value of temperature in [K].

  • _pressure – Value of pressure in [Pa].

Returns

Value of the temperature/pressure-dependent physical property of the specified compound.

double GetCompoundProperty(double _time, const std::string &_compoundKey, ECompoundTPProperties _property) const

Returns the value of the temperature/pressure-dependent physical property of the specified compound at temperature and pressure at the given time point.

Refer to function CBaseStream::GetCompoundProperty(const std::string&, ECompoundTPProperties, double, double) const. See also: Dependent parameters

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _property – Identifier of temperature/pressure-dependent property.

Returns

Value of the temperature/pressure-dependent physical property of the specified compound.

double GetCompoundProperty(const std::string &_compoundKey1, const std::string &_compoundKey2, EInteractionProperties _property, double _temperature, double _pressure) const

Returns the value of the interaction physical property between the specified compounds with the given specified temperature [K] and pressure [Pa].

See also: Interaction properties

Parameters
  • _compoundKey1 – Unique key of the first compound.

  • _compoundKey2 – Unique key of the second compound.

  • _property – Identifier of property, defined for interaction of two compounds.

  • _temperature – Value of temperature in [K].

  • _pressure – Value of pressure in [Pa].

Returns

Value of the interaction physical property between the specified compounds.

double GetCompoundProperty(double _time, const std::string &_compoundKey1, const std::string &_compoundKey2, EInteractionProperties _property) const

Returns the value of the interaction physical property between the specified compounds at temperature and pressure at the given time point.

Refer to function CBaseStream::GetCompoundProperty(const std::string&, const std::string&, EInteractionProperties, double, double) const. See also: Interaction properties

Parameters
  • _time – Target time point.

  • _compoundKey1 – Unique key of the first compound.

  • _compoundKey2 – Unique key of the second compound.

  • _property – Identifier of property, defined for interaction of two compounds.

Returns

Value of the interaction physical property between the specified compounds.

double GetFraction(double _time, const std::vector<size_t> &_coords) const

Returns mass fraction of the solid material at the specified multidimensional coordinates given for all defined dimensions.

Parameters
  • _time – Target time point.

  • _coords – Multidimensional coordinates.

Returns

Mass fraction of the solid material.

void SetFraction(double _time, const std::vector<size_t> &_coords, double _value)

Sets mass fraction of the solid material at the specified multidimensional coordinates given for all defined dimensions.

If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _coords – Multidimensional coordinates.

  • _value – Mass fraction of the solid material.

std::vector<double> GetDistribution(double _time, EDistrTypes _distribution) const

Returns one-dimensional distribution of the solid material over the specified parameter at the given time point.

Parameters
  • _time – Target time point.

  • _distribution – Type of distributed parameter of the solid phase.

Returns

One-dimensional distribution of the solid material.

CMatrix2D GetDistribution(double _time, EDistrTypes _distribution1, EDistrTypes _distribution2) const

Returns two-dimensional distribution of the solid material over the specified parameters at the given time point.

Parameters
  • _time – Target time point.

  • _distribution1 – First distributed parameter type of the solid phase.

  • _distribution2 – Second distributed parameter type of the solid phase.

Returns

Two-dimensional distribution of the solid material.

CDenseMDMatrix GetDistribution(double _time, const std::vector<EDistrTypes> &_distributions) const

Returns multi-dimensional distribution of the solid material over the specified parameters at the given time point.

Parameters
  • _time – Target time point.

  • _distributions – List of distributed parameter types of the solid phase.

Returns

Multi-dimensional distribution of the solid material.

std::vector<double> GetDistribution(double _time, EDistrTypes _distribution, const std::string &_compoundKey) const

Returns one-dimensional distribution of the solid material over the specified parameter for the given compound and time point.

Input dimensions should not include distribution by compounds (DISTR_COMPOUNDS). If the specified compound has not been defined in the stream, empty vector is returned.

Parameters
  • _time – Target time point.

  • _distribution – Type of distributed parameter of the solid phase.

  • _compoundKey – Unique key of the compound.

Returns

One-dimensional distribution of the solid material.

CMatrix2D GetDistribution(double _time, EDistrTypes _distribution1, EDistrTypes _distribution2, const std::string &_compoundKey) const

Returns two-dimensional distribution of the solid material over the specified parameters for the given compound and time point.

Input dimensions should not include distribution by compounds (DISTR_COMPOUNDS). If the specified compound has not been defined in the stream, empty matrix is returned.

Parameters
  • _time – Target time point.

  • _distribution1 – First distributed parameter type of the solid phase.

  • _distribution2 – Second distributed parameter type of the solid phase.

  • _compoundKey – Unique key of the compound.

Returns

Two-dimensional distribution of the solid material.

CDenseMDMatrix GetDistribution(double _time, const std::vector<EDistrTypes> &_distributions, const std::string &_compoundKey) const

Returns multi-dimensional distribution of the solid material over the specified parameters for the given compound and time point.

Input dimensions should not include distribution by compounds (DISTR_COMPOUNDS). If specified compound has not been defined in the stream, empty matrix is returned.

Parameters
  • _time – Target time point.

  • _distributions – List of distributed parameter types of the solid phase.

  • _compoundKey – Unique key of the compound.

Returns

Multi-dimensional distribution of the solid material.

void SetDistribution(double _time, EDistrTypes _distribution, const std::vector<double> &_value)

Sets one-dimensional distribution of the solid material over the specified parameter at the given time point.

If such dimension does not exist, nothing is done. If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _distribution – Type of distributed parameter of the solid phase.

  • _value – One-dimensional distribution of the solid material.

void SetDistribution(double _time, EDistrTypes _distribution1, EDistrTypes _distribution2, const CMatrix2D &_value)

Sets two-dimensional distribution of the solid material over the specified parameter at the given time point.

If such dimensions do not exist, nothing is done. If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _distribution1 – First distributed parameter type of the solid phase.

  • _distribution2 – Second distributed parameter type of the solid phase.

  • _value – Two-dimensional distribution of the solid material.

void SetDistribution(double _time, const CDenseMDMatrix &_value)

Sets multi-dimensional distribution of the solid material over the specified parameter at the given time point.

If such dimensions do not exist, nothing is done. If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _value – Multi-dimensional distribution of the solid material.

void SetDistribution(double _time, EDistrTypes _distribution, const std::string &_compoundKey, const std::vector<double> &_value)

Sets one-dimensional distribution of the solid material over the specified parameter for the given compound and time point.

If such compound or dimension does not exist, nothing is done. Input dimensions should not include distribution by compounds (DISTR_COMPOUNDS). If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _distribution – Type of distributed parameter of the solid phase.

  • _compoundKey – Unique key of the compound.

  • _value – One-dimensional distribution of the solid material.

void SetDistribution(double _time, EDistrTypes _distribution1, EDistrTypes _distribution2, const std::string &_compoundKey, const CMatrix2D &_value)

Sets two-dimensional distribution of the solid material over the specified parameters for the given compound and time point.

If such time point, compound or dimensions do not exist, nothing is done. Input dimensions should not include distribution by compounds (DISTR_COMPOUNDS). If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _distribution1 – First distributed parameter type of the solid phase.

  • _distribution2 – Second distributed parameter type of the solid phase.

  • _compoundKey – Unique key of the compound.

  • _value – Two-dimensional distribution of the solid material.

void SetDistribution(double _time, const std::string &_compoundKey, const CDenseMDMatrix &_value)

Sets multi-dimensional distribution of the solid material over the specified parameters for the given compound and time point.

If such compound or dimensions do not exist, nothing is done. Input dimensions should not include distribution by compounds (DISTR_COMPOUNDS). If the specified time point does not exist, it is added to the stream.

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _value – Multi-dimensional distribution of the solid material.

void ApplyTM(double _time, const CTransformMatrix &_matrix)

Applies the transformation matrix to transform the multidimensional distributed parameters of the solid material at the given time point.

Parameters
  • _time – Target time point.

  • _matrix – Transformation matrix.

void ApplyTM(double _time, const std::string &_compoundKey, const CTransformMatrix &_matrix)

Applies the transformation matrix to transform the multidimensional distributed parameters of the solid material for the given compound and time point.

Dimensions of transformation matrix should not include distribution by compounds (DISTR_COMPOUNDS).

Parameters
  • _time – Target time point.

  • _compoundKey – Unique key of the compound.

  • _matrix – Transformation matrix.

void Normalize(double _time)

Normalizes data in the solids distribution matrix for the given time point.

If time has not been defined, nothing is done.

Parameters

_time – Target time point.

void Normalize(double _timeBeg, double _timeEnd)

Normalizes data in the solids distribution matrix for the given time interval.

Parameters
  • _timeBeg – Begin of the time interval.

  • _timeEnd – End of the time interval.

void Normalize()

Normalizes data in the solids distribution matrix for all time points.

std::vector<double> GetPSD(double _time, EPSDTypes _type, EPSDGridType _grid = EPSDGridType::DIAMETER) const

Returns the specified type of the PSD of the total mixture of all solid materials at the given time point.

Refer to function CBaseStream::GetPSD(double, EPSDTypes, const std::vector<std::string>&, EPSDGridType) const.

Parameters
  • _time – Target time point.

  • _type – Identifier of the PSD type.

  • _grid – Identifier of grid units type.

Returns

Particle size distribution.

std::vector<double> GetPSD(double _time, EPSDTypes _type, const std::string &_compoundKey, EPSDGridType _grid = EPSDGridType::DIAMETER) const

Returns the specified type of the PSD of the selected compound at the given time point.

Refer to function CBaseStream::GetPSD(double, EPSDTypes, const std::vector<std::string>&, EPSDGridType) const.

Parameters
  • _time – Target time point.

  • _type – Identifier of the PSD type.

  • _compoundKey – Unique key of the compound.

  • _grid – Identifier of grid units type.

Returns

Particle size distribution.

std::vector<double> GetPSD(double _time, EPSDTypes _type, const std::vector<std::string> &_compoundKeys, EPSDGridType _grid = EPSDGridType::DIAMETER) const

Returns the specified type of the PSD of the mixture of selected compounds at the given time point.

If the list of compounds is empty, the whole mixture is considered.

Parameters
  • _time – Target time point.

  • _type – Identifier of the PSD type.

  • _compoundKeys – Unique keys of the compounds.

  • _grid – Identifier of grid units type.

Returns

Particle size distribution.

void SetPSD(double _time, EPSDTypes _type, const std::vector<double> &_value, EPSDGridType _grid = EPSDGridType::DIAMETER)

Sets the specified type of the PSD of the total mixture of all solid materials at the given time point.

For number-related PSD, the distribution is normalized and the total particle mass remains unchanged. If the specified time point does not exist, it is added to the stream. Refer to function CBaseStream::SetPSD(double, EPSDTypes, const std::string&, const std::vector<double>&, EPSDGridType).

Parameters
  • _time – Target time point.

  • _type – Identifier of PSD type.

  • _value – Particle size distribution.

  • _grid – Identifier of grid units type.

void SetPSD(double _time, EPSDTypes _type, const std::string &_compoundKey, const std::vector<double> &_value, EPSDGridType _grid = EPSDGridType::DIAMETER)

Sets the specified type of the PSD of the selected compound at the given time point.

For number-related PSD, the distribution is normalized and the total particle mass remains unchanged. If the compound key if empty, the whole mixture is considered. If the specified time point does not exist, it is added to the stream. As mass fractions are used to store data, PSD is converted using functions Convertq0ToMassFractions(), ConvertQ0ToMassFractions(), Convertq2ToMassFractions(), ConvertQ2ToMassFractions(), Convertq3ToMassFractions(), ConvertQ3ToMassFractions(), ConvertNumbersToMassFractions().

Parameters
  • _time – Target time point.

  • _type – Identifier of PSD type.

  • _compoundKey – Unique key of the compound.

  • _value – Particle size distribution.

  • _grid – Identifier of grid units type.

void Copy(double _time, const CBaseStream &_source)

Copies all stream data at the given time point.

All data after the time point are removed from the destination stream.

Parameters
  • _time – Time point to copy.

  • _source – Source stream.

void Copy(double _timeBeg, double _timeEnd, const CBaseStream &_source)

Copies all stream data at the given time interval.

All data after the end time point are removed from the destination stream.

Parameters
  • _timeBeg – Begin of the time interval to copy.

  • _timeEnd – End of the time interval to copy.

  • _source – Source stream.

void Copy(double _timeDst, const CBaseStream &_source, double _timeSrc)

Copies all stream data to the given time point from another time point of the source stream.

All data after the time point are removed from the destination stream.

Parameters
  • _timeDst – Time point of the destination stream to copy to.

  • _source – Source stream.

  • _timeSrc – Time point of the source stream to copy.

void Add(double _time, const CBaseStream &_source)

Mixes the specified stream with the current stream at the given time point.

Can be applied only for streams with the same structure (MD dimensions, phases, materials, etc.).

Parameters
  • _time – Time point to copy.

  • _source – Source stream.

void Add(double _timeBeg, double _timeEnd, const CBaseStream &_source)

Mixes the specified stream with the current stream at the given time interval.

Can be applied only for streams with the same structure (MD dimensions, phases, materials, etc.). The stream will contain the union of time points from both streams.

Parameters
  • _timeBeg – Begin of the time interval to copy.

  • _timeEnd – End of the time interval to copy.

  • _source – Source stream.

double CalculateEnthalpyFromTemperature(double _time) const

Calculates enthalpy of the stream mixture for the temperature at the given time point using a lookup table.

See also: Thermodynamics

Parameters

_time – Target time point.

Returns

Calculated value of enthalpy.

double CalculateTemperatureFromEnthalpy(double _time) const

Calculates temperature of the stream mixture for the enthalpy at the given time point using a lookup table.

See also: Thermodynamics

Parameters

_time – Target time point.

Returns

Calculated value of temperature.