Junction#
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems
This module is developed by:
Joy Zhang <joycheung1994@gmail.com>
Yalin Li <mailto.yalin.li@gmail.com>
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._junction.ADMjunction(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None)#
An abstract superclass holding common properties of ADM interface classes. Users should use its subclasses (e.g.,
ASMtoADM
,ADMtoASM
) instead.See also
qsdsan.sanunits.Junction
,qsdsan.sanunits.ADMtoASM
,qsdsan.sanunits.ASMtoADM
- 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
.
- property Ka_dH#
[float] Heat of reaction for Ka.
- property T#
[float] Temperature of the upstream/downstream [K].
- property T_base#
[float] Base temperature in the ADM1 model.
- property adm1_model#
[qsdsan.Process] ADM process model.
- property alpha_IC#
[float] Charge per g of C.
- property alpha_IN#
[float] Charge per g of N.
- 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 = 'ADMjunction'#
class-attribute Name denoting the type of Unit class. Defaults to the class name of the first child class
- property pH#
[float] pH of the upstream/downstream.
- property pKa#
[numpy.array] pKa array of the following acid-base pairs: (‘H+’, ‘OH-‘), (‘NH4+’, ‘NH3’), (‘CO2’, ‘HCO3-‘), (‘HAc’, ‘Ac-‘), (‘HPr’, ‘Pr-‘), (‘HBu’, ‘Bu-‘), (‘HVa’, ‘Va-‘)
- property pKa_base#
[float] pKa of the acid-base pairs at the base temperature in the ADM1 model.
- 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._junction.ADMtoASM(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None)#
Interface unit to convert anaerobic digestion model (ADM) components to activated sludge model (ASM) components.
- Parameters:
upstream (stream or str) – Influent stream with ADM components.
downstream (stream or str) – Effluent stream with ASM components.
adm1_model (obj) – The anaerobic digestion process model (
qsdsan.processes.ADM1
).bio_to_xs (float) – Split of the total biomass COD to slowly biodegradable substrate (X_S), the rest is assumed to be mapped into X_P.
rtol (float) – Relative tolerance for COD and TKN balance.
atol (float) – Absolute tolerance for COD and TKN balance.
References
[1] Nopens, I.; Batstone, D. J.; Copp, J. B.; Jeppsson, U.; Volcke, E.; Alex, J.; Vanrolleghem, P. A. An ASM/ADM Model Interface for Dynamic Plant-Wide Simulation. Water Res. 2009, 43, 1913–1923.
See also
qsdsan.sanunits.ADMjunction
qsdsan.sanunits.ASMtoADM
math.isclose <https://docs.python.org/3.8/library/math.html#math.isclose>
- 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 = 'ADMto ASM'#
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._junction.ASMtoADM(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None)#
Interface unit to convert activated sludge model (ASM) components to anaerobic digestion model (ADM) components.
- Parameters:
upstream (stream or str) – Influent stream with ASM components.
downstream (stream or str) – Effluent stream with ADM components.
adm1_model (obj) – The anaerobic digestion process model (
qsdsan.processes.ADM1
).xs_to_li (float) – Split of slowly biodegradable substrate COD to lipid, after all N is mapped into protein.
bio_to_li (float) – Split of biomass COD to lipid, after all biomass N is mapped into protein.
frac_deg (float) – Biodegradable fraction of biomass COD.
rtol (float) – Relative tolerance for COD and TKN balance.
atol (float) – Absolute tolerance for COD and TKN balance.
References
[1] Nopens, I.; Batstone, D. J.; Copp, J. B.; Jeppsson, U.; Volcke, E.; Alex, J.; Vanrolleghem, P. A. An ASM/ADM Model Interface for Dynamic Plant-Wide Simulation. Water Res. 2009, 43, 1913–1923.
See also
qsdsan.sanunits.ADMjunction
qsdsan.sanunits.ADMtoASM
math.isclose <https://docs.python.org/3.8/library/math.html#math.isclose>
- 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 = 'ASMto ADM'#
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._junction.Junction(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, reactions=None, **kwargs)#
A non-reactive class that serves to convert a stream with one set of components and into another.
Thermal conditions of the downstream (T, P) will be copied from those of the upstream.
- Parameters:
upstream (stream or str) – Influent stream.
downstream (stream or str) – Effluent stream.
reactions (iterable(dict) | callable) –
Iterable of dict that has the conversion of upstream components to downstream components, or a function that will return the concentration of the effluent with influent concentration as the input.
If given as an iterable of dict, keys of each of the dict should be the ID or alias of components, values should be the conversion/yield, which should be negative for reactants and positive for products.
- 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.
- property downstream#
[qsdsan.WasteStream] Effluent.
- 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 = 'Junction'#
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.
- property reactions#
[callable] Function that takes the concentration array of the influent and convert to the concentration array of the effluent.
- 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 Junction, including component concentrations [mg/L] and flow rate [m^3/d].
- property upstream#
[qsdsan.WasteStream] Influent.