Abstract Static Units

Note

These units are for process simulation only and do not have design and cost algorithms.

QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems

This module is developed by:

Part of this module is based on the biosteam package: https://github.com/BioSTEAMDevelopmentGroup/biosteam

This module is under the University of Illinois/NCSA Open Source License. Please refer to https://github.com/QSD-Group/QSDsan/blob/main/LICENSE.txt for license details.

class qsdsan.unit_operations.static._abstract.ComponentSplitter(ID='', ins: Sequence[AbstractStream] | None = None, outs: Sequence[AbstractStream] | None = (), thermo=None, init_with='WasteStream', split_keys=())

Split the influent into individual components, the last effluent contains all remaining components.

Parameters:

split_keys (iterable) –

IDs of components to be split to different effluents. Element of the item in the iterable can be str or another iterable containing component IDs. If the item is also iterable, all components whose ID are in the iterable will be split to the same effluent. The split is always 1 for a certain component to an effluent (i.e., complete split).

Note

Length of the split_keys() (which determines size of the outs) cannot be changed after initiation.

Examples

bwaise systems

line: str = 'Component splitter'

class-attribute Name denoting the type of Unit class. Defaults to the class name of the first child class

run()

Run mass and energy balance. This method also runs specifications user defined specifications unless it is being run within a specification (to avoid infinite loops).

See also

_run, specifications, add_specification, add_bounded_numerical_specification

property split_keys

[iterable] IDs of components to be split to different effluents. Element of the item in the iterable can be str or another iterable containing component IDs. If the item is also iterable, all components whose ID are in the iterable will be split to the same effluent. The split is always 1 for a certain component to an effluent (i.e., complete split).

Note

Length of the split_keys() (which determines size of the outs) cannot be changed after initiation.

class qsdsan.unit_operations.static._abstract.PhaseChanger(ID='', ins: Sequence[AbstractStream] | None = None, outs: Sequence[AbstractStream] | None = (), thermo=None, init_with='WasteStream', phase='l')

Change the effluent phase to the desired one; can also bridge between stream types (e.g., WasteStream to plain thermosteam.Stream) via the init_with argument.

The outlet stream class is selected by init_with. The inlet is copied into the outlet (creating the type conversion if those classes differ), then the outlet’s phase is set to the requested value.

Parameters:
  • ins (Iterable(stream)) – Influent.

  • outs (Iterable(stream)) – Effluent.

  • init_with (str) – Stream class for the outlet: 'WasteStream' (default), 'SanStream', or 'Stream'. Use 'Stream' to bridge from a WasteStream feed to a plain thermosteam.Stream outlet – for example, as the inlet of a HeatExchangerNetwork branch, which cannot consume WasteStream.

  • phase (str) – Desired outlet phase; one of 'g', 'l', or 's'.

Examples

Setting the outlet phase only (outlet remains a WasteStream):

>>> import qsdsan as qs
>>> from qsdsan.utils import create_example_components
>>> qs.set_thermo(create_example_components())
>>> ws = qs.WasteStream('pc_feed', Water=1000, Methanol=10, units='kg/hr')
>>> pc = qs.unit_operations.PhaseChanger('PC1', ins=ws, phase='g')
>>> pc.simulate()
>>> pc.outs[0].phase
'g'
>>> type(pc.outs[0]).__name__
'WasteStream'

Bridging from WasteStream to plain Stream (e.g., to feed a HeatExchangerNetwork branch that cannot accept WasteStream):

>>> ws2 = qs.WasteStream('pc_feed2', Water=1000, units='kg/hr')
>>> pc2 = qs.unit_operations.PhaseChanger(
...     'PC2', ins=ws2, init_with='Stream', phase='l',
... )
>>> pc2.simulate()
>>> type(pc2.outs[0]).__name__
'Stream'
line: str = 'Phase changer'

class-attribute Name denoting the type of Unit class. Defaults to the class name of the first child class

run()

Run mass and energy balance. This method also runs specifications user defined specifications unless it is being run within a specification (to avoid infinite loops).

See also

_run, specifications, add_specification, add_bounded_numerical_specification