Junction

QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems

This module is developed by:

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.dynamic._junction.A1junction(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None, asm2d_model=None)

An abstract superclass holding common properties of modified ADM interface classes. Users should use its subclasses (e.g., mASM2dtoADM1p, ADM1ptomASM2d) instead.

See also

qsdsan.unit_operations.ADMJunction, qsdsan.unit_operations.ADM1ptomASM2d, qsdsan.unit_operations.mASM2dtoADM1p

property adm1_model

[qsdsan.CompiledProcesses] mADM1 process model.

property asm2d_model

[qsdsan.CompiledProcesses] ASM2d process model.

cod_vfa = array([ 64, 112, 160, 208])
line: str = 'A1junction'

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

class qsdsan.unit_operations.dynamic._junction.ADM1ptomASM2d(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None, asm2d_model=None)

Interface unit to convert ADM1 state variables to ASM2d components, following the A1 algorithm in [1].

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.process_models.ADM1_p_extension).

  • rtol (float) – Relative tolerance for COD and TKN balance.

  • atol (float) – Absolute tolerance for COD and TKN balance.

References

[1] Flores-Alsina, X., Solon, K., Kazadi Mbamba, C., Tait, S., Gernaey, K. V., Jeppsson, U., & Batstone, D. J. (2016). Modelling phosphorus (P), sulfur (S) and iron (FE) interactions for dynamic simulations of anaerobic digestion processes. Water Research, 95, 370–382.

See also

qsdsan.unit_operations.A1junction, qsdsan.unit_operations.mASM2dtoADM1p

line: str = 'ADM1ptom asm2d'

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

class qsdsan.unit_operations.dynamic._junction.ADM1toASM2d(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 no. 1 (ADM1) components to activated sludge model no. 2 (ASM2d) 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.process_models.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.unit_operations.ADMjunction

qsdsan.unit_operations.ASMtoADM

math.isclose <https://docs.python.org/3.8/library/math.html#math.isclose>

property alpha_vfa

[float] charge per g of VFA-COD.

cod_vfa = array([ 64, 112, 160, 208])
line: str = 'ADM1to asm2d'

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

class qsdsan.unit_operations.dynamic._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.unit_operations.Junction, qsdsan.unit_operations.ADMtoASM, qsdsan.unit_operations.ASMtoADM

property Ka_dH

[float] Heat of reaction for Ka.

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.

property alpha_vfa

[float] charge per g of VFA-COD.

cod_vfa = array([ 64, 112, 160, 208])
line: str = 'ADMjunction'

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

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.

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

class qsdsan.unit_operations.dynamic._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.process_models.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.unit_operations.ADMjunction

qsdsan.unit_operations.ASMtoADM

math.isclose <https://docs.python.org/3.8/library/math.html#math.isclose>

property T

[float] Temperature of the upstream/downstream [K].

line: str = 'ADMto ASM'

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.

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

class qsdsan.unit_operations.dynamic._junction.ASM2dtoADM1(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 No. (ASM2d) components to original anaerobic digestion model (ADM1) 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.process_models.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.unit_operations.ADMjunction

qsdsan.unit_operations.ADMtoASM

math.isclose <https://docs.python.org/3.8/library/math.html#math.isclose>

line: str = 'ASM2dto ADM1'

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

class qsdsan.unit_operations.dynamic._junction.ASM2dtomADM1(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None, asm2d_model=None, T=298.15, pH=7)

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.process_models.ADM1_p_extension).

  • 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.

[2] Flores-Alsina, X., Solon, K., Kazadi Mbamba, C., Tait, S., Gernaey, K. V., Jeppsson, U., & Batstone, D. J. (2016). Modelling phosphorus (P), sulfur (S) and iron (FE) interactions for dynamic simulations of anaerobic digestion processes. Water Research, 95, 370–382.

See also

qsdsan.unit_operations.ADMjunction

qsdsan.unit_operations.ADMtoASM

math.isclose <https://docs.python.org/3.8/library/math.html#math.isclose>

property T

[float] Temperature of the downstream [K].

line: str = 'ASM2dtom ADM1'

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

property pH

[float] downstream pH.

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

class qsdsan.unit_operations.dynamic._junction.ASMtoADM(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None, T=298.15, pH=7)

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.process_models.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.unit_operations.ADMjunction

qsdsan.unit_operations.ADMtoASM

math.isclose <https://docs.python.org/3.8/library/math.html#math.isclose>

property T

[float] Temperature of the downstream [K].

line: str = 'ASMto ADM'

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

property pH

[float] downstream pH.

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

class qsdsan.unit_operations.dynamic._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.

property downstream

[qsdsan.WasteStream] Effluent.

line: str = 'Junction'

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

property reactions

[callable] Function that takes the concentration array of the influent and convert to the concentration array of the effluent.

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 state

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

property upstream

[qsdsan.WasteStream] Influent.

class qsdsan.unit_operations.dynamic._junction.mADM1toASM2d(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None, asm2d_model=None)

Interface unit to convert modified anaerobic digestion model no. 1 (ADM1) components to activated sludge model no. 2d (ASM2d) 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.process_models.ADM1_p_extension).

  • 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. [2] Flores-Alsina, X., Solon, K., Kazadi Mbamba, C., Tait, S., Gernaey, K. V., Jeppsson, U., & Batstone, D. J. (2016). Modelling phosphorus (P), sulfur (S) and iron (FE) interactions for dynamic simulations of anaerobic digestion processes. Water Research, 95, 370–382.

See also

qsdsan.unit_operations.mADMjunction, qsdsan.unit_operations.ASM2dtomADM1

property T

[float] Temperature of the upstream/downstream [K].

line: str = 'MADM1to asm2d'

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.

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

class qsdsan.unit_operations.dynamic._junction.mADMjunction(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None, asm2d_model=None)

An abstract superclass holding common properties of modified ADM interface classes. Users should use its subclasses (e.g., ASM2dtomADM1, mADM1toASM2d) instead.

See also

qsdsan.unit_operations.ADMJunction, qsdsan.unit_operations.mADM1toASM2d, qsdsan.unit_operations.ASM2dtomADM1

property adm1_model

[qsdsan.CompiledProcesses] mADM1 process model.

property alpha_IC

[float] Charge per g of C.

property alpha_IN

[float] Charge per g of N.

property alpha_IP

[float] Charge per g of P.

property alpha_vfa

[float] charge per g of VFA-COD.

property asm2d_model

[qsdsan.CompiledProcesses] ASM2d process model.

cod_vfa = array([ 64, 112, 160, 208])
line: str = 'MADMjunction'

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

property pKa

[numpy.array] pKa array of the following acid-base pairs: (‘H+’, ‘OH-‘), (‘NH4+’, ‘NH3’), (‘H2PO4-’, ‘HPO4-2’), (‘CO2’, ‘HCO3-‘), (‘HAc’, ‘Ac-‘), (‘HPr’, ‘Pr-‘), (‘HBu’, ‘Bu-‘), (‘HVa’, ‘Va-‘)

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

class qsdsan.unit_operations.dynamic._junction.mASM2dtoADM1p(ID='', upstream=None, downstream=(), thermo=None, init_with='WasteStream', F_BM_default=None, isdynamic=False, adm1_model=None, asm2d_model=None)

Interface unit to convert ASM2d state variables to ADM1 components, following the A1 scenario in [1].

Parameters:
  • upstream (stream or str) – Influent stream with ASM components.

  • downstream (stream or str) – Effluent stream with ADM components.

  • adm1_model (qsdsan.process_models.ADM1_p_extension) – The anaerobic digestion process model.

  • xs_to_li (float) – Split of slowly biodegradable substrate COD to lipid, after all N is mapped into protein.

  • rtol (float) – Relative tolerance for COD and TKN balance.

  • atol (float) – Absolute tolerance for COD and TKN balance.

References

[1] Flores-Alsina, X., Solon, K., Kazadi Mbamba, C., Tait, S., Gernaey, K. V., Jeppsson, U., & Batstone, D. J. (2016). Modelling phosphorus (P), sulfur (S) and iron (FE) interactions for dynamic simulations of anaerobic digestion processes. Water Research, 95, 370–382.

See also

qsdsan.unit_operations.A1junction, qsdsan.unit_operations.ADM1ptomASM2d

line: str = 'MASM2dto adm1p'

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