Abstract Unit#

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.sanunits._abstract.ComponentSplitter(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | 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

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'Component splitter'#

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

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

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.sanunits._abstract.FakeSplitter(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | None = (), thermo=None, init_with='WasteStream', include_construction=True, construction=[], transportation=[], equipment=[], add_OPEX={}, uptime_ratio=1.0, lifetime=None, F_BM_default=None, isdynamic=False, exogenous_vars=(), **kwargs)#

Similar to biosteam.units.FakeSplitter, but can be initialized with qsdsan.SanStream and qsdsan.WasteStream.

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'Fake splitter'#

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

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

class qsdsan.sanunits._abstract.Mixer(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | None = (), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, rigorous=False, conserve_phases=False)#

Similar to biosteam.units.Mixer, but can be initialized with qsdsan.SanStream and qsdsan.WasteStream, and allows dynamic simulation.

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'Mixer'#

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

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

property state#

The state of the Mixer, including component concentrations [mg/L] and flow rate [m^3/d].

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

Change the effluent phase to the desired one, also allow the switch between stream types.

Parameters:
  • ins (Iterable(stream)) – influent

  • outs (Iterable(stream)) – effluent

  • phase (str) – Desired phase, can only be one of (“g”, “l”, or “s”).

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'Phase changer'#

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

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

class qsdsan.sanunits._abstract.ReversedSplitter(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | None = (), thermo=None, init_with='WasteStream', include_construction=True, construction=[], transportation=[], equipment=[], add_OPEX={}, uptime_ratio=1.0, lifetime=None, F_BM_default=None, isdynamic=False, exogenous_vars=(), **kwargs)#

Similar to biosteam.units.ReversedSplitter, but can be initialized with qsdsan.SanStream and qsdsan.WasteStream.

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'Reversed splitter'#

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

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

class qsdsan.sanunits._abstract.Sampler(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | None = (), thermo=None, *, init_with='WasteStream', F_BM_default=None, isdynamic=False)#

A non-reactive (i.e., all the outs at the same as the ins) unit that is used in dynamic simulation to record the unit/stream states.

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'Sampler'#

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

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

property state#

The sampled state, including component concentrations [mg/L] and flow rate [m^3/d].

class qsdsan.sanunits._abstract.Splitter(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | None = (), thermo=None, *, split, order=None, init_with='WasteStream', F_BM_default=None, isdynamic=False)#

Similar to biosteam.units.Splitter, but can be initialized with qsdsan.SanStream and qsdsan.WasteStream, and allows dynamic simulation.

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'Splitter'#

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

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

property state#

Component concentrations and total flow rate.