Anaerobic Digestion Model No.1 with P extension (ADM1 P/Extension)

class qsdsan.processes.ADM1_p_extension(components=None, path=None, f_sI_xb=0, f_ch_xb=0.275, f_pr_xb=0.275, f_li_xb=0.35, f_fa_li=0.95, f_bu_su=0.13, f_pro_su=0.27, f_ac_su=0.41, f_va_aa=0.23, f_bu_aa=0.26, f_pro_aa=0.05, f_ac_aa=0.4, f_ac_fa=0.7, f_pro_va=0.54, f_ac_va=0.31, f_ac_bu=0.8, f_ac_pro=0.57, f_ac_PHA=0.4, f_bu_PHA=0.1, f_pro_PHA=0.4, Y_su=0.1, Y_aa=0.08, Y_fa=0.06, Y_c4=0.06, Y_pro=0.04, Y_ac=0.05, Y_h2=0.06, Y_PO4=0.013, q_dis=0.5, q_ch_hyd=10, q_pr_hyd=10, q_li_hyd=10, k_su=30, k_aa=50, k_fa=6, k_c4=20, k_pro=13, k_ac=8, k_h2=35, K_su=0.5, K_aa=0.3, K_fa=0.4, K_c4=0.2, K_pro=0.1, K_ac=0.15, K_h2=7e-06, K_A=0.004, K_PP=0.00032, b_su=0.02, b_aa=0.02, b_fa=0.02, b_c4=0.02, b_pro=0.02, b_ac=0.02, b_h2=0.02, q_PHA=3, b_PAO=0.2, b_PP=0.2, b_PHA=0.2, KI_h2_fa=5e-06, KI_h2_c4=1e-05, KI_h2_pro=3.5e-06, KI_nh3=0.0018, KS_IN=0.0001, KS_IP=2e-05, pH_limits_aa=(4, 5.5), pH_limits_ac=(6, 7), pH_limits_h2=(5, 6), T_base=298.15, pKa_base=[14, 9.25, 7.2, 6.35, 4.76, 4.88, 4.82, 4.86], Ka_dH=[55900, 51965, 3600, 7646, 0, 0, 0, 0], kLa=200, K_H_base=[0.00078, 0.0014, 0.035], K_H_dH=[-4180, -14240, -19410], **kwargs)

Anaerobic Digestion Model No.1 with P extension. Compatible with the original ASM2d.

Parameters:
  • components (class:CompiledComponents, optional) – Components corresponding to each entry in the stoichiometry array, defaults to thermosteam.settings.chemicals.

  • path (str, optional) – Alternative file path for the Petersen matrix. The default is None.

  • f_sI_xb (float, optional) – fraction of soluble inerts from biomass. The default is 0.

  • f_ch_xb (float, optional) – fraction of carbohydrates from biomass. The default is 0.275.

  • f_pr_xb (float, optional) – fraction of proteins from biomass. The default is 0.275.

  • f_li_xb (float, optional) – fraction of lipids from biomass. The default is 0.35.

  • f_xI_xb (float, optional) – fraction of particulate inerts from biomass. The default is 0.1.

  • f_ac_PHA (float, optional) – Yield of acetate on PHA [kg COD/kg COD]. The default is 0.4.

  • f_bu_PHA (float, optional) – Yield of butyrate on PHA [kg COD/kg COD]. The default is 0.1.

  • f_pro_PHA (float, optional) – Yield of propionate on PHA [kg COD/kg COD]. The default is 0.4.

  • f_va_PHA (float, optional) – Yield of valerate on PHA [kg COD/kg COD]. The default is 0.1.

  • Y_PO4 (float, optional) – Yield of biomass on phosphate [kmol P/kg COD]. The default is 0.013.

  • K_A (float, optional) – VFAs half saturation coefficient for PHA storage [kg COD/m3]. The default is 0.004.

  • K_PP (float, optional) – Half saturation coefficient for polyphosphate [kmol PP/kg PAO COD]. The default is 0.00032.

  • q_PHA (float, optional) – Rate constant for storage of PHA [d^(-1)]. The default is 3.

  • b_PAO (float, optional) – Lysis rate of PAOs [d^(-1)]. The default is 0.2.

  • b_PP (float, optional) – Lysis rate of polyphosphates [d^(-1)]. The default is 0.2.

  • b_PHA (float, optional) – Lysis rate of PHAs [d^(-1)]. The default is 0.2.

  • KS_IP (float, optional) – P limitation for inorganic phosphorous [kmol P/m3]. The default is 2e-5.

  • pKa_base (iterable[float], optional) – pKa (equilibrium coefficient) values of acid-base pairs at the base temperature, unitless, following the order of ADM1_p_extension._acid_base_pairs. The default is [14, 9.25, 7.20, 6.35, 4.76, 4.88, 4.82, 4.86].

  • Ka_dH (iterable[float], optional) – Heat of reaction of each acid-base pair at base temperature [J/mol], following the order of ADM1_p_extension._acid_base_pairs. The default is [55900, 51965, 3600, 7646, 0, 0, 0, 0].

Examples

>>> from qsdsan import processes as pc
>>> cmps = pc.create_adm1_p_extension_cmps()
>>> adm1_p = pc.ADM1_p_extension()
>>> adm1_p.show()
ADM1_p_extension([hydrolysis_carbs, hydrolysis_proteins, hydrolysis_lipids, uptake_sugars, uptake_amino_acids, uptake_LCFA, uptake_valerate, uptake_butyrate, uptake_propionate, uptake_acetate, uptake_h2, decay_Xsu, decay_Xaa, decay_Xfa, decay_Xc4, decay_Xpro, decay_Xac, decay_Xh2, storage_Sva_in_XPHA, storage_Sbu_in_XPHA, storage_Spro_in_XPHA, storage_Sac_in_XPHA, lysis_XPAO, lysis_XPP, lysis_XPHA, h2_transfer, ch4_transfer, IC_transfer])
>>> import numpy as np
>>> state_arr = np.ones(cmps.size + len(adm1_p._biogas_IDs) + 2)   # liquid-phase concentrations, gas-phase concentrations, liquid flowrate, and temperature
>>> state_arr[-1] = 273.15+35  # Temperature
>>> rhos = adm1_p.rate_function(state_arr)  # reaction rate for each process
>>> for i,j in zip(adm1_p.IDs, rhos):
...     print(f'{i}{(40-len(i))*" "}{j:.3g}')
hydrolysis_carbs                        10
hydrolysis_proteins                     10
hydrolysis_lipids                       10
uptake_sugars                           20
uptake_amino_acids                      38.4
uptake_LCFA                             2.14e-05
uptake_valerate                         8.32e-05
uptake_butyrate                         8.32e-05
uptake_propionate                       4.13e-05
uptake_acetate                          1.93
uptake_h2                               34.9
decay_Xsu                               0.02
decay_Xaa                               0.02
decay_Xfa                               0.02
decay_Xc4                               0.02
decay_Xpro                              0.02
decay_Xac                               0.02
decay_Xh2                               0.02
storage_Sva_in_XPHA                     0.747
storage_Sbu_in_XPHA                     0.747
storage_Spro_in_XPHA                    0.747
storage_Sac_in_XPHA                     0.747
lysis_XPAO                              0.2
lysis_XPP                               0.2
lysis_XPHA                              0.2
h2_transfer                             139
ch4_transfer                            -181
IC_transfer                             -1.66e+03

References

[1] Batstone, D. J.; Keller, J.; Angelidaki, I.; Kalyuzhnyi, S. V; Pavlostathis, S. G.; Rozzi, A.; Sanders, W. T. M.; Siegrist, H.; Vavilin, V. A. The IWA Anaerobic Digestion Model No 1 (ADM1). Water Sci. Technol. 2002, 45 (10), 65–73.

[2] Rosen, C.; Jeppsson, U. Aspects on ADM1 Implementation within the BSM2 Framework; Lund, 2006.

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

check_stoichiometric_parameters()

Check whether product COD fractions sum up to 1 for each process.

set_KS_IP(K)

Set inhibition coefficient for inorganic phosphorous as a secondary substrate [M phosphorous].

set_h2_inhibit_K(KI, process)

Set the H2 inhibition coefficient [kg/m3] for a process given its ID.

set_half_sat_K(K, process)

Set the substrate half saturation coefficient [kg/m3] for a process given its ID.

set_pH_inhibit_bounds(process, lower=None, upper=None)

Set the upper and/or lower limit(s) of pH inhibition [unitless] for a process given its ID.

class qsdsan.processes.ADM1p(components=None, path=None, f_sI_xb=0, f_ch_xb=0.275, f_pr_xb=0.275, f_li_xb=0.35, f_fa_li=0.95, f_bu_su=0.13, f_pro_su=0.27, f_ac_su=0.41, f_va_aa=0.23, f_bu_aa=0.26, f_pro_aa=0.05, f_ac_aa=0.4, f_ac_fa=0.7, f_pro_va=0.54, f_ac_va=0.31, f_ac_bu=0.8, f_ac_pro=0.57, f_ac_PHA=0.4, f_bu_PHA=0.1, f_pro_PHA=0.4, Y_su=0.1, Y_aa=0.08, Y_fa=0.06, Y_c4=0.06, Y_pro=0.04, Y_ac=0.05, Y_h2=0.06, Y_PO4=0.013, q_dis=0.5, q_ch_hyd=10, q_pr_hyd=10, q_li_hyd=10, k_su=30, k_aa=50, k_fa=6, k_c4=20, k_pro=13, k_ac=8, k_h2=35, K_su=0.5, K_aa=0.3, K_fa=0.4, K_c4=0.2, K_pro=0.1, K_ac=0.15, K_h2=7e-06, K_A=0.004, K_PP=0.00032, b_su=0.02, b_aa=0.02, b_fa=0.02, b_c4=0.02, b_pro=0.02, b_ac=0.02, b_h2=0.02, q_PHA=3, b_PAO=0.2, b_PP=0.2, b_PHA=0.2, KI_h2_fa=5e-06, KI_h2_c4=1e-05, KI_h2_pro=3.5e-06, KI_nh3=0.0018, KS_IN=0.0001, KS_IP=2e-05, pH_limits_aa=(4, 5.5), pH_limits_ac=(6, 7), pH_limits_h2=(5, 6), T_base=298.15, pKa_base=[14, 9.25, 6.37, 10.32, 2.12, 7.21, 12.32, 4.76, 4.88, 4.82, 4.86], Ka_dH=[55900, 51965, 17400, 14600, -7500, 3000, 15000, 0, 0, 0, 0], kLa=200, K_H_base=[0.00078, 0.0014, 0.035], K_H_dH=[-4180, -14240, -19410], k_mmp=(8.4, 240, 1.0, 72, 1.0, 1.0, 1.0), pKsp=(8.5, 13.7, 5.9, 28.6, 7.6, 18.2, 26.5), K_dis=(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0), K_AlOH=1e-06, K_FeOH=1e-06, **kwargs)

Anaerobic Digestion Model No.1 with P extension. [1], [2]. Compatible with mASM2d.

Parameters:
  • components (class:CompiledComponents, optional) – Components corresponding to each entry in the stoichiometry array, defaults to thermosteam.settings.chemicals.

  • path (str, optional) – Alternative file path for the Petersen matrix. The default is None.

  • f_sI_xb (float, optional) – fraction of soluble inerts from biomass. The default is 0.

  • f_ch_xb (float, optional) – fraction of carbohydrates from biomass. The default is 0.275.

  • f_pr_xb (float, optional) – fraction of proteins from biomass. The default is 0.275.

  • f_li_xb (float, optional) – fraction of lipids from biomass. The default is 0.35.

  • f_xI_xb (float, optional) – fraction of particulate inerts from biomass. The default is 0.1.

  • f_ac_PHA (float, optional) – Yield of acetate on PHA [kg COD/kg COD]. The default is 0.4.

  • f_bu_PHA (float, optional) – Yield of butyrate on PHA [kg COD/kg COD]. The default is 0.1.

  • f_pro_PHA (float, optional) – Yield of propionate on PHA [kg COD/kg COD]. The default is 0.4.

  • f_va_PHA (float, optional) – Yield of valerate on PHA [kg COD/kg COD]. The default is 0.1.

  • Y_PO4 (float, optional) – Yield of biomass on phosphate [kmol P/kg COD]. The default is 0.013.

  • K_A (float, optional) – VFAs half saturation coefficient for PHA storage [kg COD/m3]. The default is 0.004.

  • K_PP (float, optional) – Half saturation coefficient for polyphosphate [kmol PP/kg PAO COD]. The default is 0.00032.

  • q_PHA (float, optional) – Rate constant for storage of PHA [d^(-1)]. The default is 3.

  • b_PAO (float, optional) – Lysis rate of PAOs [d^(-1)]. The default is 0.2.

  • b_PP (float, optional) – Lysis rate of polyphosphates [d^(-1)]. The default is 0.2.

  • b_PHA (float, optional) – Lysis rate of PHAs [d^(-1)]. The default is 0.2.

  • KS_IP (float, optional) – P limitation for inorganic phosphorous [kmol P/m3]. The default is 2e-5.

  • pKa_base (iterable[float], optional) – pKa (equilibrium coefficient) values of acid-base pairs at the base temperature, unitless, following the order of ADM1p._acid_base_pairs. The default is [14, 9.25, 6.37, 10.32, 2.12, 7.21, 12.32, 4.76, 4.88, 4.82, 4.86].

  • Ka_dH (iterable[float], optional) – Heat of reaction of each acid-base pair at base temperature [J/mol], following the order of ADM1_p_extension._acid_base_pairs. The default is [55900, 51965, 17400, 14600, -7500, 3000, 15000, 0, 0, 0, 0].

Examples

>>> import qsdsan.processes as pc
>>> cmps = pc.create_adm1p_cmps()
>>> adm = pc.ADM1p()
>>> adm.show()
ADM1p([hydrolysis_carbs, hydrolysis_proteins, hydrolysis_lipids, uptake_sugars, uptake_amino_acids, uptake_LCFA, uptake_valerate, uptake_butyrate, uptake_propionate, uptake_acetate, uptake_h2, decay_Xsu, decay_Xaa, decay_Xfa, decay_Xc4, decay_Xpro, decay_Xac, decay_Xh2, storage_Sva_in_XPHA, storage_Sbu_in_XPHA, storage_Spro_in_XPHA, storage_Sac_in_XPHA, lysis_XPAO, lysis_XPP, lysis_XPHA, CaCO3_precipitation_dissolution, struvite_precipitation_dissolution, newberyite_precipitation_dissolution, ACP_precipitation_dissolution, MgCO3_precipitation_dissolution, AlPO4_precipitation_dissolution, FePO4_precipitation_dissolution, h2_transfer, ch4_transfer, IC_transfer])

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.

[2] Solon, K., Flores-Alsina, X., Kazadi Mbamba, C., Ikumi, D., Volcke, E. I. P., Vaneeckhaute, C., Ekama, G., Vanrolleghem, P. A., Batstone, D. J., Gernaey, K. V., & Jeppsson, U. (2017). Plant-wide modelling of phosphorus transformations in wastewater treatment systems: Impacts of control and operational strategies. Water Research, 113, 97–110.

check_stoichiometric_parameters()

Check whether product COD fractions sum up to 1 for each process.

set_KS_IP(K)

Set inhibition coefficient for inorganic phosphorous as a secondary substrate [M phosphorous].

set_h2_inhibit_K(KI, process)

Set the H2 inhibition coefficient [kg/m3] for a process given its ID.

set_half_sat_K(K, process)

Set the substrate half saturation coefficient [kg/m3] for a process given its ID.

set_pH_inhibit_bounds(process, lower=None, upper=None)

Set the upper and/or lower limit(s) of pH inhibition [unitless] for a process given its ID.