Modified ASM2D Property Package
This package is an extension of the base Activated Sludge Model no.2d (ASM2d) and implements properties and reactions of an activated sludge model for biological nutrient removal from wastewater using an activated sludge biological reactor with biological phosphorus removal as provided in Flores-Alsina, X. et al. (2016) [1].
Throughout this documentation, text in red has been removed in the Modified ASM2d model, text in lime has been added, and text in blue has been modified from its base ASM2d implementation.
- The following modifications have been made to the base ASM2d model as provided in [1]:
adds inorganic carbon (S_IC), potassium (S_K), and magnesium (S_Mg) as solutes
removes total suspended solids (X_TSS), metal-hydroxides (X_MeOH), metal-phosphate (X_MeP), alkalinity (S_ALK), and any variables or parameters associated with alkalinity
removes the precipitation reaction (R20) and the re-dissolution reaction (R21)
updates the Petersen matrix based on the above changes
updates the rate expressions based on the above changes
- This Modified Activated Sludge Model no.2D (ASM2D) property/reaction package:
supports ‘H2O’, ‘S_A’, ‘S_F’, ‘S_I’, S_N2, S_NH4, S_NO3, S_O2, S_PO4, S_K, S_Mg, S_IC, X_AUT, X_H, X_I, X_PAO, X_PHA, X_PP, and X_S as components
supports only liquid phase
Sets
Description |
Symbol |
Indices |
---|---|---|
Components |
\(j\) |
[‘H2O’, ‘S_A’, ‘S_F’, ‘S_I’, S_N2, S_NH4, S_NO3, S_O2, S_PO4, S_K, S_Mg, S_IC, X_AUT, X_H, X_I, X_PAO, X_PHA, X_PP, X_S] |
Phases |
\(p\) |
[‘Liq’] |
Components
The modified ASM2D model includes 18 components as outlined in the table below. Red text indicates the component has been removed in the Modified ASM2d model, and lime text indicates the component has been added.
Description |
Symbol |
Name in Model |
---|---|---|
Fermentation products, considered to be acetate |
\(S_A\) |
S_A |
Fermentable, readily bio-degradable organic substrates |
\(S_F\) |
S_F |
Inert soluble organic material |
\(S_I\) |
S_I |
Dinitrogen, N2. SN2 is assumed to be the only nitrogenous product of denitrification |
\(S_{N2}\) |
S_N2 |
Ammonium plus ammonia nitrogen |
\(S_{NH4}\) |
S_NH4 |
Nitrate plus nitrite nitrogen (N03’ + N02’ -N); SN03 is assumed to include nitrate as well as nitrite nitrogen. |
\(S_{NO3}\) |
S_NO3 |
Dissolved oxygen |
\(S_{O2}\) |
S_O2 |
Inorganic soluble phosphorus, primarily ortho-phosphates |
\(S_{PO4}\) |
S_PO4 |
Potassium |
\(S_{K}\) |
S_K |
Magnesium |
\(S_{Mg}\) |
S_Mg |
Inorganic carbon |
\(S_{IC}\) |
S_IC |
Alkalinity, [mol HCO_3- per m^3] |
\(S_{ALK}\) |
S_ALK |
Autotrophic nitrifying organisms |
\(X_{AUT}\) |
X_AUT |
Heterotrophic organisms |
\(X_H\) |
X_H |
Inert particulate organic material |
\(X_I\) |
X_I |
Metal-hydroxides |
\(X_{MeOH}\) |
X_MeOH |
Metal-phosphate |
\(X_{MeP}\) |
X_MeP |
Phosphate-accumulating organisms |
\(X_{PAO}\) |
X_PAO |
A cell internal storage product of phosphorus-accumulating organisms, primarily comprising poly-hydroxy-alkanoates (PHA) |
\(X_{PHA}\) |
X_PHA |
Poly-phosphate |
\(X_{PP}\) |
X_PP |
Slowly biodegradable substrates |
\(X_S\) |
X_S |
Total suspended solids, TSS |
\(X_{TSS}\) |
X_TSS |
State variables
Red text indicates the state variable has been removed in the Modified ASM2d model.
Description |
Symbol |
Variable |
Index |
Units |
---|---|---|---|---|
Total volumetric flowrate |
\(Q\) |
flow_vol |
None |
\(\text{m}^3\text{/s}\) |
Temperature |
\(T\) |
temperature |
None |
\(\text{K}\) |
Pressure |
\(P\) |
pressure |
None |
\(\text{Pa}\) |
Component mass concentrations |
\(C_j\) |
conc_mass_comp |
[j] |
\(\text{kg/}\text{m}^3\) |
Molar alkalinity |
\(A\) |
alkalinity |
None |
\(\text{kmol HCO}_{3}^{-}\text{/m}^{3}\) |
Stoichiometric Coefficients
Red text indicates the stoichiometric coefficient has been removed in the Modified ASM2d model, lime text indicates the stoichiometric coefficient has been added, and blue text indicates the coefficient has had its value changed from its base ASM2d implementation.
Description |
Symbol |
Parameter |
Default Value |
Units |
---|---|---|---|---|
C content of inert soluble COD S_I |
\(i_{CSI}\) |
i_CSI |
0.36718 |
\(\text{dimensionless}\) |
C content of inert soluble COD S_F |
\(i_{CSF}\) |
i_CSF |
0.31843 |
\(\text{dimensionless}\) |
C content of inert soluble COD S_A |
\(i_{CSA}\) |
i_CSA |
0.375 |
\(\text{dimensionless}\) |
C content of inert soluble COD X_I |
\(i_{CXI}\) |
i_CXI |
0.36178 |
\(\text{dimensionless}\) |
C content of inert soluble COD X_S |
\(i_{CXS}\) |
i_CXS |
0.31843 |
\(\text{dimensionless}\) |
C content of inert soluble COD X_B |
\(i_{CXB}\) |
i_CXB |
0.36612 |
\(\text{dimensionless}\) |
N content of inert soluble COD S_I |
\(i_{NSI}\) |
i_NSI |
0.06003 |
\(\text{dimensionless}\) |
N content of fermentable substrate S_F |
\(i_{NSF}\) |
i_NSF |
0.03552 |
\(\text{dimensionless}\) |
N content of inert particulate COD X_I |
\(i_{NXI}\) |
i_NXI |
0.06003 |
\(\text{dimensionless}\) |
N content of slowly biodegradable substrate X_S |
\(i_{NXS}\) |
i_NXS |
0.03552 |
\(\text{dimensionless}\) |
N content of biomass, X_H, X_PAO, X_AUT |
\(i_{NBM}\) |
i_NBM |
0.08615 |
\(\text{dimensionless}\) |
P content of inert soluble COD S_I |
\(i_{PSI}\) |
i_PSI |
0.00 |
\(\text{dimensionless}\) |
P content of fermentable substrate, S_F |
\(i_{PSF}\) |
i_PSF |
0.00559 |
\(\text{dimensionless}\) |
P content of inert particulate COD X_I |
\(i_{PXI}\) |
i_PXI |
0.00649 |
\(\text{dimensionless}\) |
P content of slowly biodegradable substrate X_S |
\(i_{PXS}\) |
i_PXS |
0.00559 |
\(\text{dimensionless}\) |
P content of biomass, X_H, X_PAO, X_AUT |
\(i_{PBM}\) |
i_PBM |
0.02154 |
\(\text{dimensionless}\) |
TSS to COD ratio for X_I |
\(i_{TSSXI}\) |
i_TSSXI |
0.75 |
\(\text{dimensionless}\) |
TSS to COD ratio for X_S |
\(i_{TSSXS}\) |
i_TSSXS |
0.75 |
\(\text{dimensionless}\) |
TSS to COD ratio for biomass, X_H, X_PAO, X_AUT |
\(i_{TSSBM}\) |
i_TSSBM |
0.90 |
\(\text{dimensionless}\) |
Production of S_I in hydrolysis |
\(f_{SI}\) |
f_SI |
0 |
\(\text{dimensionless}\) |
Yield coefficient for heterotrophic biomass X_H |
\(Y_{H}\) |
Y_H |
0.625 |
\(\text{dimensionless}\) |
Fraction of inert COD generated in lysis |
\(f_{XI}\) |
f_XI |
0.1 |
\(\text{dimensionless}\) |
Yield coefficient for P accumulating organisms (biomass/PHA) |
\(Y_{PAO}\) |
Y_PAO |
0.625 |
\(\text{dimensionless}\) |
PP requirement (PO4 release) per PHA stored |
\(Y_{PO4}\) |
Y_PO4 |
0.0129 |
\(\text{dimensionless}\) |
PHA requirement for PP storage |
\(Y_{PHA}\) |
Y_PHA |
0.2 |
\(\text{dimensionless}\) |
Yield of autotrophic biomass per NO3- N |
\(Y_{A}\) |
Y_A |
0.24 |
\(\text{dimensionless}\) |
Potassium coefficient for polyphosphates |
\(i_{KXPP}\) |
i_KXPP |
0.4204 |
\(\text{dimensionless}\) |
Magnesium coefficient for polyphosphates |
\(i_{MgXPP}\) |
i_MgXPP |
0.2614 |
\(\text{dimensionless}\) |
Kinetic Parameters
Red text indicates the parameter has been removed in the Modified ASM2d model, lime text indicates the parameter has been added, and blue text indicates the parameter has had its value changed from its base ASM2d implementation.
Description |
Symbol |
Parameter |
Value at 20°C |
Units |
---|---|---|---|---|
Hydrolysis rate constant |
\(K_H\) |
K_H |
2.46 |
\(\text{day}^{-1}\) |
Anoxic hydrolysis reduction factor |
\(hl_{NO3}\) |
hl_NO3 |
0.6 |
\(\text{dimensionless}\) |
Anaerobic hydrolysis reduction factor |
\(hl_{fe}\) |
hl_fe |
0.40 |
\(\text{dimensionless}\) |
Saturation/inhibition coefficient for oxygen |
\(KH_{O2}\) |
K_O2 |
0.0002 |
\(\text{kg O_2/}\text{m}^{3}\) |
Saturation/inhibition coefficient for nitrate |
\(KH_{NO3}\) |
K_NO3 |
0.0005 |
\(\text{kg N/}\text{m}^{3}\) |
Saturation coefficient for particulate COD |
\(KL_{X}\) |
KL_X |
0.1 |
\(\text{kg X_S/}\text{kg X_H}\) |
Maximum growth rate on substrate |
\(µ_H\) |
mu_H |
4.23 |
\(\text{kg X_S/}\text{kg X_H . day}\) |
Maximum rate for fermentation |
\(q_{fe}\) |
q_fe |
2.11 |
\(\text{kg S_F/}\text{kg X_H . day}\) |
Rate constant for lysis and decay |
\(b_H\) |
b_H |
0.28 |
\(\text{day}^{-1}\) |
Saturation coefficient for growth on SF |
\(K_F\) |
K_F |
0.004 |
\(\text{kg COD/}\text{m}^{3}\) |
Saturation coefficient for fermentation of SF |
\(K_{fe}\) |
K_fe |
0.004 |
\(\text{d}^{-1}\) |
Saturation coefficient for growth on acetate SA |
\(KH_A\) |
KH_A |
0.004 |
\(\text{kg COD/}\text{m}^{3}\) |
Saturation coefficient for ammonium (nutrient) |
\(KH_{NH4}\) |
KH_NH4 |
0.00005 |
\(\text{kg N/}\text{m}^{3}\) |
Saturation coefficient for phosphate (nutrient) |
\(KH_{PO4}\) |
KH_PO4 |
0.00001 |
\(\text{kg P/}\text{m}^{3}\) |
Saturation coefficient for alkalinity (HCO3-) |
\(K_{ALK}\) |
K_ALK |
0.0001 |
\(\text{kmol HCO_{3}^{-}/}\text{m}^{3}\) |
Rate constant for storage of X_PHA (base Xpp) |
\(q_{PHA}\) |
q_PHA |
2.46 |
\(\text{kg PHA/}\text{kg PAO . day}\) |
Rate constant for storage of X_PP |
\(q_{PP}\) |
q_PP |
1.23 |
\(\text{kg PP/}\text{kg PAO . day}\) |
Maximum growth rate of PAO |
\(µ_{PAO}\) |
mu_PAO |
0.82 |
\(\text{day}^{-1}\) |
Rate for Lysis of X_PAO |
\(b_{PAO}\) |
b_PAO |
0.14 |
\(\text{day}^{-1}\) |
Rate for Lysis of X_PP |
\(b_{PP}\) |
b_PP |
0.14 |
\(\text{day}^{-1}\) |
Rate for Lysis of X_PHA |
\(b_{PHA}\) |
b_PHA |
0.14 |
\(\text{day}^{-1}\) |
Saturation coefficient for phosphorus in storage of PP |
\(KP_P\) |
KP_P |
0.0002 |
\(\text{kg P/}\text{m}^3\) |
Saturation coefficient for poly-phosphate |
\(KP_{PP}\) |
KP_PP |
0.01 |
\(\text{kg PP/}\text{kg PAO}\) |
Maximum ratio of X_PP/X_PAO |
\(K_{MAX}\) |
K_MAX |
0.34 |
\(\text{kg PP/}\text{kg PAO}\) |
Inhibition coefficient for PP storage |
\(KI_{PP}\) |
KI_PP |
0.02 |
\(\text{kg PP/}\text{kg PAO}\) |
Saturation coefficient for PHA |
\(KP_{PHA}\) |
KP_PHA |
0.01 |
\(\text{kg PHA/}\text{kg PAO}\) |
Maximum growth rate of X_AUT |
\(µ_{AUT}\) |
mu_AUT |
0.61 |
\(\text{day}^{-1}\) |
Decay rate of X_AUT |
\(b_{AUT}\) |
b_AUT |
0.09 |
\(\text{day}^{-1}\) |
Rate constant for P precipitation |
\(k_{PRE}\) |
k_pre |
1000 |
\(\text{m/}^{3}\text{kg Fe(OH)_3 . day}\) |
Rate constant for redissolution |
\(k_{RED}\) |
k_red |
0.6 |
\(\text{day}^{-1}\) |
Reduction factor for denitrification |
\(hH_{NO3}\) |
hH_NO3 |
0.8 |
\(\text{dimensionless}\) |
Anoxic reduction factor for endogenous respiration |
\(hH_{NO3, end}\) |
hH_NO3_end |
0.5 |
\(\text{dimensionless}\) |
Reduction factor under anoxic conditions |
\(hP_{NO3}\) |
hP_NO3 |
0.6 |
\(\text{dimensionless}\) |
Anoxic reduction factor for decay of PAOs |
\(hP_{NO3, end}\) |
hP_NO3_end |
0.33 |
\(\text{dimensionless}\) |
Anoxic reduction factor for decay of PP |
\(hPP_{NO3, end}\) |
hPP_NO3_end |
0.33 |
\(\text{dimensionless}\) |
Anoxic reduction factor for decay of PHA |
\(hPHA_{NO3, end}\) |
hPHA_NO3_end |
0.33 |
\(\text{dimensionless}\) |
Anoxic reduction factor for decay of autotrophs |
\(hAUT_{NO3, end}\) |
hAUT_NO3_end |
0.33 |
\(\text{dimensionless}\) |
Properties
Description |
Symbol |
Variable |
Index |
Units |
---|---|---|---|---|
Fluid specific heat capacity |
\(c_p\) |
cp |
None |
\(\text{J/kg/K}\) |
Mass density |
\(\rho\) |
dens_mass |
[p] |
\(\text{kg/}\text{m}^3\) |
Process Rate Equations
Equations marked “(with decay)” indicate that the decay of heterotrophs and autotrophs is dependent on the electron acceptor present. Equations marked “(without decay)” indicate that the decay of heterotrophs and autotrophs does not change.
Red text indicates the equation has been removed in the Modified ASM2d model, and blue text indicates the equation has been modified from its base ASM2d implementation.
Description |
Equation |
---|---|
Aerobic hydrolysis |
\(ρ_1 = K_{H}(\frac{S_{O2}}{KL_{O2}+S_{O2}})(\frac{X_{S}/X_{H}}{KL_{X}+X_{S}/X_{H}})X_{H}\) |
Anoxic hydrolysis |
\(ρ_2 = K_{H}η_{NO3}(\frac{KL_{O2}}{KL_{O2}+S_{O2}})(\frac{S_{NO3}}{KL_{NO3}+S_{NO3}})(\frac{X_{S}/X_{H}}{KL_{X}+X_{S}/X_{H}})X_{H}\) |
Anaerobic hydrolysis |
\(ρ_3 = K_{H}η_{fe}(\frac{KL_{O2}}{KL_{O2}+S_{O2}})(\frac{KL_{NO3}}{KL_{NO3}+S_{NO3}})(\frac{X_{S}/X_{H}}{KL_{X}+X_{S}/X_{H}})X_{H}\) |
Growth on fermentable substrates, S_F |
\(ρ_4 = µ_{H}(\frac{S_{O2}}{KH_{O2}+S_{O2}})(\frac{S_{F}}{K_{F}+S_{F}})(\frac{S_{F}}{S_{F}+S_{A}})(\frac{S_{NH4}}{KH_{NH4}+S_{NH4}})(\frac{S_{PO4}}{KH_{PO4}+S_{PO4}})X_{H}\) |
Growth on fermentation products, S_A |
\(ρ_5 = µ_{H}(\frac{S_{O2}}{KH_{O2}+S_{O2}})(\frac{S_{A}}{KH_{A}+S_{A}})(\frac{S_{A}}{S_{F}+S_{A}})(\frac{S_{NH4}}{KH_{NH4}+S_{NH4}})(\frac{S_{PO4}}{KH_{PO4}+S_{PO4}})X_{H}\) |
Denitrification with fermentable substrates, S_F |
\(ρ_6 = µ_{H}hH_{NO3}(\frac{KH_{O2}}{KH_{O2}+S_{O2}})(\frac{S_{NO3}}{KH_{NO3}+S_{NO3}})(\frac{S_{F}}{K_{F}+S_{F}})(\frac{S_{F}}{S_{F}+S_{A}})(\frac{S_{NH4}}{KH_{NH4}+S_{NH4}})(\frac{S_{PO4}}{KH_{PO4}+S_{PO4}})X_{H}\) |
Denitrification with fermentation products, S_A |
\(ρ_7 = µ_{H}hH_{NO3}(\frac{KH_{O2}}{KH_{O2}+S_{O2}})(\frac{S_{NO3}}{KH_{NO3}+S_{NO3}})(\frac{S_{A}}{KH_{A}+S_{A}})(\frac{S_{A}}{S_{F}+S_{A}})(\frac{S_{NH4}}{KH_{NH4}+S_{NH4}})(\frac{S_{PO4}}{KH_{PO4}+S_{PO4}})X_{H}\) |
Fermentation |
\(ρ_8 = q_{fe}(\frac{KH_{O2}}{KH_{O2}+S_{O2}})(\frac{KH_{NO3}}{KH_{NO3}+S_{NO3}})(\frac{S_{F}}{K_{fe}+S_{F}})X_{H}\) |
Lysis (without decay) |
\(ρ_9 = b_{H}X_{H}\) |
Lysis (with decay) |
\(ρ_9 = b_{H}(\frac{S_{O2}}{KH_{O2}+S_{O2}})+hH_{NO3,end}(\frac{KH_{O2}}{KH_{O2}+S_{O2}})(\frac{S_{NO3}}{KH_{NO3}+S_{NO3}})X_{H}\) |
Storage of X_PHA |
\(ρ_{10} = q_{PHA}(\frac{S_{A}}{KP_{A}+S_{A}})(\frac{X_{PP}/X_{PAO}}{KP_{PP}+X_{PP}/X_{PAO}})X_{PAO}\) |
Aerobic storage of X_PP |
\(ρ_{11} = q_{PP}(\frac{S_{O2}}{KP_{O2}+S_{O2}})(\frac{S_{PO4}}{KP_{P}+S_{PO4}})(\frac{X_{PHA}/X_{PAO}}{KP_{PHA}+X_{PHA}/X_{PAO}})(\frac{K_{MAX} - X_{PP}/X_{PAO}}{K_{IPP}+K_{MAX} - X_{PP}/X_{PAO}})X_{PAO}\) |
Anoxic storage of X_PP |
\(ρ_{12} = q_{PP}hP_{NO3}(\frac{KP_{O2}}{KP_{O2}+S_{O2}})(\frac{S_{NO3}}{KP_{NO3}+S_{NO3}})(\frac{S_{PO4}}{KP_{P}+S_{PO4}})(\frac{X_{PHA}/X_{PAO}}{KP_{PHA}+X_{PHA}/X_{PAO}})(\frac{K_{MAX} - X_{PP}/X_{PAO}}{K_{IPP}+K_{MAX} - X_{PP}/X_{PAO}})X_{PAO}\) |
Aerobic growth on X_PHA |
\(ρ_{13} = µ_{PAO}(\frac{S_{O2}}{KP_{O2}+S_{O2}})(\frac{S_{NH4}}{KP_{NH4}+S_{NH4}})(\frac{S_{PO4}}{KP_{PO4}+S_{PO4}})(\frac{X_{PHA}/X_{PAO}}{KP_{PHA}+X_{PHA}/X_{PAO}})X_{PAO}\) |
Anoxic growth on X_PHA |
\(ρ_{14} = µ_{PAO}hP_{NO3}(\frac{KP_{O2}}{KP_{O2}+S_{O2}})(\frac{S_{NO3}}{KP_{NO3}+S_{NO3}})(\frac{S_{NH4}}{KP_{NH4}+S_{NH4}})(\frac{S_{PO4}}{KP_{PO4}+S_{PO4}})(\frac{X_{PHA}/X_{PAO}}{KP_{PHA}+X_{PHA}/X_{PAO}})X_{PAO}\) |
Lysis of X_PAO (without decay) |
\(ρ_{15} = b_{PAO}X_{PAO}\) |
Lysis of X_PAO (with decay) |
\(ρ_{15} = b_{PAO}(\frac{S_{O2}}{KP_{O2}+S_{O2}})+hP_{NO3,end}(\frac{KP_{O2}}{KP_{O2}+S_{O2}})(\frac{S_{NO3}}{KP_{NO3}+S_{NO3}})X_{PAO}\) |
Lysis of X_PP (without decay) |
\(ρ_{16} = b_{PP}X_{PP}\) |
Lysis of X_PP (with decay) |
\(ρ_{16} = b_{PP}(\frac{S_{O2}}{KP_{O2}+S_{O2}})+hPP_{NO3,end}(\frac{KP_{O2}}{KP_{O2}+S_{O2}})(\frac{S_{NO3}}{KP_{NO3}+S_{NO3}})X_{PP}\) |
Lysis of X_PHA (without decay) |
\(ρ_{17} = b_{PHA}X_{PHA}\) |
Lysis of X_PHA (with decay) |
\(ρ_{17} = b_{PHA}(\frac{S_{O2}}{KP_{O2}+S_{O2}})+hPHA_{NO3,end}(\frac{KP_{O2}}{KP_{O2}+S_{O2}})(\frac{S_{NO3}}{KP_{NO3}+S_{NO3}})X_{PHA}\) |
Aerobic growth of X_AUT |
\(ρ_{18} = µ_{AUT}(\frac{S_{O2}}{KA_{O2}+S_{O2}})(\frac{S_{NH4}}{KA_{NH4}+S_{NH4}})(\frac{S_{PO4}}{KA_{PO4}+S_{PO4}})X_{AUT}\) |
Lysis of X_AUT (without decay) |
\(ρ_{19} = b_{AUT}X_{AUT}\) |
Lysis of X_AUT (with decay) |
\(ρ_{19} = b_{AUT}(\frac{S_{O2}}{KP_{O2}+S_{O2}})+hAUT_{NO3,end}(\frac{KP_{O2}}{KP_{O2}+S_{O2}})(\frac{S_{NO3}}{KP_{NO3}+S_{NO3}})X_{AUT}\) |
Precipitation of phosphorus with ferric hydroxide |
\(ρ_{20} = k_{PRE}S_{PO4}X_{MeOH}\) |
Redissolution |
\(ρ_{21} = k_{RED}X_{MeP}(\frac{S_{ALK}}{K_{ALK}+S_{ALK}})\) |
Scaling
A thorough scaling routine for the ASM2D property package has yet to be implemented.
Class Documentation
- class watertap.property_models.unit_specific.activated_sludge.modified_asm2d_properties.ModifiedASM2dParameterBlock(*args, **kwds)
- Parameters:
rule (function) – A rule function or None. Default rule calls build().
concrete (bool) – If True, make this a toplevel model. Default - False.
ctype (class) –
Pyomo ctype of the block. Default - pyomo.environ.Block
Config args
- default_arguments
Default arguments to use with Property Package
initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.
idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.
- Returns:
(ModifiedASM2dParameterBlock) New instance
- class watertap.property_models.unit_specific.activated_sludge.modified_asm2d_properties.ModifiedASM2dParameterData(component)[source]
Property Parameter Block Class
- build()[source]
Callable method for Block construction.
- classmethod define_metadata(obj)[source]
Set all the metadata for properties and units.
This method should be implemented by subclasses. In the implementation, they should set information into the object provided as an argument.
- Parameters:
pcm (PropertyClassMetadata) – Add metadata to this object.
- Returns:
None
- class watertap.property_models.unit_specific.activated_sludge.modified_asm2d_properties._ModifiedASM2dStateBlock(*args, **kwds)[source]
This Class contains methods which should be applied to Property Blocks as a whole, rather than individual elements of indexed Property Blocks.
- initialize(state_args=None, state_vars_fixed=False, hold_state=False, outlvl=0, solver=None, optarg=None)[source]
Initialization routine for property package.
- Keyword Arguments:
state_args – Dictionary with initial guesses for the state vars chosen. Note that if this method is triggered through the control volume, and if initial guesses were not provided at the unit model level, the control volume passes the inlet values as initial guess.The keys for the state_args dictionary are:
flow_vol – value at which to initialize total volumetric flow (default=None)
conc_mass_comp – value at which to initialize component concentrations (default=None)
pressure – value at which to initialize pressure (default=None)
temperature – value at which to initialize temperature (default=None)
outlvl – sets output level of initialization routine
state_vars_fixed – Flag to denote if state vars have already been fixed. True - states have already been fixed and initialization does not need to worry about fixing and unfixing variables. False - states have not been fixed. The state block will deal with fixing/unfixing.
optarg – solver options dictionary object (default=None, use default solver options)
solver – str indicating which solver to use during initialization (default = None, use default solver)
hold_state – flag indicating whether the initialization routine should unfix any state variables fixed during initialization (default=False). True - states variables are not unfixed, and a dict of returned containing flags for which states were fixed during initialization. False - state variables are unfixed after initialization by calling the release_state method.
- Returns:
If hold_states is True, returns a dict containing flags for which states were fixed during initialization.
- release_state(flags, outlvl=0)[source]
Method to relase state variables fixed during initialization.
- Keyword Arguments:
flags – dict containing information of which state variables were fixed during initialization, and should now be unfixed. This dict is returned by initialize if hold_state=True.
outlvl – sets output level of of logging
- class watertap.property_models.unit_specific.activated_sludge.modified_asm2d_properties.ModifiedASM2dStateBlockData(*args, **kwargs)[source]
StateBlock for calculating thermophysical proeprties associated with the ASM2d reaction system.
- build()[source]
Callable method for Block construction
- define_display_vars()[source]
Method used to specify components to use to generate stream tables and other outputs. Defaults to define_state_vars, and developers should overload as required.
- define_state_vars()[source]
Method that returns a dictionary of state variables used in property package. Implement a placeholder method which returns an Exception to force users to overload this.
- get_energy_density_terms(p)[source]
Method which returns a valid expression for enthalpy density to use in the energy balances.
- get_enthalpy_flow_terms(p)[source]
Method which returns a valid expression for enthalpy flow to use in the energy balances.
- get_material_density_terms(p, j)[source]
Method which returns a valid expression for material density to use in the material balances .
- get_material_flow_basis()[source]
Method which returns an Enum indicating the basis of the material flow term.
- get_material_flow_terms(p, j)[source]
Method which returns a valid expression for material flow to use in the material balances.
- class watertap.property_models.unit_specific.activated_sludge.modified_asm2d_reactions.ModifiedASM2dReactionParameterBlock(*args, **kwds)
- Parameters:
rule (function) – A rule function or None. Default rule calls build().
concrete (bool) – If True, make this a toplevel model. Default - False.
ctype (class) –
Pyomo ctype of the block. Default - pyomo.environ.Block
Config args
- property_package
Reference to associated PropertyPackageParameter object
- default_arguments
Default arguments to use with Property Package
- decay_switch
Switching function for handling decay in reaction rate expressions, default - True. Valid values: { True - the decay of heterotrophs and autotrophs is dependent on the electron acceptor present, False - the decay of heterotrophs and autotrophs does not change
initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.
idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.
- Returns:
(ModifiedASM2dReactionParameterBlock) New instance
- class watertap.property_models.unit_specific.activated_sludge.modified_asm2d_reactions.ModifiedASM2dReactionParameterData(component)[source]
Property Parameter Block Class
- build()[source]
Callable method for Block construction.
- classmethod define_metadata(obj)[source]
Set all the metadata for properties and units.
This method should be implemented by subclasses. In the implementation, they should set information into the object provided as an argument.
- Parameters:
pcm (PropertyClassMetadata) – Add metadata to this object.
- Returns:
None
- class watertap.property_models.unit_specific.activated_sludge.modified_asm2d_reactions._ModifiedASM2dReactionBlock(*args, **kwds)[source]
This Class contains methods which should be applied to Reaction Blocks as a whole, rather than individual elements of indexed Reaction Blocks.
- initialize(outlvl=0, **kwargs)[source]
Initialization routine for reaction package.
- Keyword Arguments:
outlvl – sets output level of initialization routine
- Returns:
None
- class watertap.property_models.unit_specific.activated_sludge.modified_asm2d_reactions.ModifiedASM2dReactionBlockData(*args, **kwargs)[source]
Reaction Block for ASM2d.
- build()[source]
Callable method for Block construction
- get_reaction_rate_basis()[source]
Method which returns an Enum indicating the basis of the reaction rate term.
References
[1] X. Flores-Alsina, K. Solon, C.K. Mbamba, S. Tait, K.V. Gernaey, U. Jeppsson, D.J. Batstone, Modelling phosphorus (P), sulfur (S) and iron (Fe) interactions fordynamic simulations of anaerobic digestion processes, Water Research. 95 (2016) 370-382. https://www.sciencedirect.com/science/article/pii/S0043135416301397