# Stream

class CStream : public CBaseStream

  Class describes the material flow.

  Public Functions

  void CopyFromStream(double _time, const CStream *_source)

    Copies all data at the given time point from another material stream.

    All data after the target time point are removed from this material stream. Uses function CBaseStream::Copy(double, const CBaseStream&).

    Parameters:

      - _time – Target time point to copy.

      - _source – Source material stream.

  void CopyFromStream(double _timeBeg, double _timeEnd, const CStream *_source)

    Copies all data at the given time interval from another material stream.

    All data after the end time point are removed from this material stream. Uses function CBaseStream::Copy(double, double, const CBaseStream&).

    Parameters:

      - _timeBeg – Begin of the time interval to copy.

      - _timeEnd – End of the time interval to copy.

      - _source – Source material stream.

  void CopyFromStream(double _timeDst, const CStream *_source, double _timeSrc)

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

    All data after the time point are removed from this material stream. Uses function CBaseStream::Copy(double, const CBaseStream&, double).

    Parameters:

      - _timeDst – Time point of the destination material stream to copy.

      - _source – Source material stream.

      - _timeSrc – Time point of the source material stream to copy.

  void CopyFromHoldup(double _time, const CHoldup *_source, double _massFlow)

    Copies all data at the given time point from the holdup.

    All data after the time point are removed from this material stream. After data copying, sets new mass flow to the material stream.

    Parameters:

      - _time – Target time point to copy.

      - _source – Source holdup.

      - _massFlow – Value of the overall mass flow.

  void CopyFromHoldup(double _timeDst, const CHoldup *_source, double _timeSrc, double _massFlow)

    Copies all data from the given time point of the holdup to another time point of this material stream.

    All data after the time point are removed from this material stream. After data copying, sets new mass flow to the material stream.

    Parameters:

      - _timeDst – Time point of the destination material stream to copy.

      - _source – Source holdup.

      - _timeSrc – Time point of the source holdup to copy.

      - _massFlow – Value of the overall mass flow.

  void AddStream(double _time, const CStream *_source)

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

    Uses function CBaseStream::Add(double, const CBaseStream&).

    Parameters:

      - _time – Target time point to copy.

      - _source – Source material stream.

  void AddStream(double _timeBeg, double _timeEnd, const CStream *_source)

    Mixes the specified material stream with the current material stream for each time point from the given time interval.

    Uses function CBaseStream::Add(double, double, const CBaseStream&).

    Parameters:

      - _timeBeg – Begin of the time interval.

      - _timeEnd – End of the time interval.

      - _source – Source material stream.

  double GetMassFlow(double _time) const

    Returns the mass flow of the material stream in [kg/s] at the given time point.

    Uses CBaseStream::GetMass(double) const.

    Parameters:

      _time – Target time point.

    Returns:

      Mass flow.

  double GetAccumulatedMass(double _timeBeg, double _timeEnd) const

    Returns the accumulated mass over time by linear integration.

    \sum_{i = 2}^{T}{\frac{\dot{m}\left( t_{i} \right) + \dot{m}\left( t_{i - 1} \right)}{2}\left( t_{i} - t_{i - 1} \right)} with \dot{m}\left( t \right) mass flow at time t, T number of time points in the time interval.

    Parameters:

      - _timeBeg – Begin of the time interval.

      - _timeEnd – End of the time interval.

    Returns:

      Mass.

  double GetMolFlow(double _time) const

    Returns the molar flow of the material stream in [mol/s] at the given time point.

    Uses function CBaseStream::GetMol(double) const.

    Parameters:

      _time – Target time point.

    Returns:

      Molar flow.

  void SetMassFlow(double _time, double _value)

    Sets the mass flow of the material stream in [kg/s] at the given time point.

    Uses function CBaseStream::SetMass(double, double).

    Parameters:

      - _time – Target time point.

      - _value – Value of the mass flow.

  void SetMolFlow(double _time, double _value)

    Sets the molar flow of the material stream in [mol/s] at the given time point.

    Uses function CBaseStream::SetMol(double, double).

    Parameters:

      - _time – Target time point.

      - _value – Value of the molar flow.

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

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

    Uses function CBaseStream::GetCompoundMass(double, const std::string&, EPhase) const.

    Parameters:

      - _time – Target time point.

      - _compoundKey – Unique key of the compound.

      - _phase – Identifier of phase type.

    Returns:

      Mass flow of the compound.

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

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

    Uses function CBaseStream::GetCompoundMass(double, const std::string&) const.

    Parameters:

      - _time – Target time point.

      - _compoundKey – Unique key of the compound.

    Returns:

      Mass flow of the compound.

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

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

    Uses function CBaseStream::GetCompoundMol(double, const std::string&, EPhase) const.

    Parameters:

      - _time – Target time point.

      - _compoundKey – Unique key of the compound.

      - _phase – Identifier of phase type.

    Returns:

      Molar flow of the compound.

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

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

    Uses function CBaseStream::GetCompoundsMasses(double) const.

    Parameters:

      _time – Target time point.

    Returns:

      Mass flows of all defined compounds.

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

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

    Uses function CBaseStream::GetCompoundsMasses(double, EPhase) const.

    Parameters:

      - _time – Target time point.

      - _phase – Identifier of phase type.

    Returns:

      Mass flows of all defined compounds.

  double GetPhaseMassFlow(double _time, EPhase _phase) const

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

    Uses function CBaseStream::GetPhaseMass(double, EPhase) const.

    Parameters:

      - _time – Target time point.

      - _phase – Identifier of phase type.

    Returns:

      Mass flow of the specified phase.

  double GetPhaseMolFlow(double _time, EPhase _phase) const

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

    Uses function CBaseStream::GetPhaseMol(double, EPhase) const.

    Parameters:

      - _time – Target time point.

      - _phase – Identifier of phase type.

    Returns:

      Molar flow of the specified phase.

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

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

    Total mass flow of the stream is correspondingly adjusted, masses of other phases remain the same. Uses function CBaseStream::SetPhaseMass(double, EPhase, double).

    Parameters:

      - _time – Target time point.

      - _phase – Identifier of phase type.

      - _value – Value of mass flow.

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

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

    Total mass flow of the stream is correspondingly adjusted, masses of other phases remain the same. Uses function CBaseStream::SetPhaseMol(double, EPhase, double).

    Parameters:

      - _time – Target time point.

      - _phase – Identifier of phase type.

      - _value – Molar flow of the specified phase.