-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from QSD-Group/beta
Merge in recent updates; release new version
- Loading branch information
Showing
21 changed files
with
1,908 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
X_CHL X_ALG X_CH X_LI S_CO2 S_A S_F S_O2 S_NH S_NO S_P X_N_ALG X_P_ALG S_N2 S_ALK S_I X_I X_S X_H X_AUT | ||
photoadaptation 1 | ||
ammonium_uptake -1 1 | ||
phosphorus_uptake -1 1 | ||
growth_pho 1 ? 1 ? ? | ||
carbohydrate_storage_pho 1 ? 1 | ||
lipid_storage_pho 1 ? 1 | ||
carbohydrate_growth_pho 1 (-Y_CH_PHO/Y_X_ALG_PHO) ? ? ? ? | ||
lipid_growth_pho 1 (-Y_LI_PHO/Y_X_ALG_PHO) ? ? ? ? | ||
carbohydrate_maintenance_pho -1 ? -1 | ||
lipid_maintenance_pho -1 ? -1 | ||
endogenous_respiration_pho -1 ? -1 ? ? | ||
growth_ace 1 ? (-1)/Y_X_ALG_HET_ACE ? ? ? | ||
carbohydrate_storage_ace 1 ? (-1)/Y_CH_ND_HET_ACE ? | ||
lipid_storage_ace 1 ? (-1)/Y_LI_ND_HET_ACE ? | ||
carbohydrate_growth_ace 1 (-Y_CH_NR_HET_ACE/Y_X_ALG_HET_ACE) ? ? ? ? | ||
lipid_growth_ace 1 (-Y_LI_NR_HET_ACE/Y_X_ALG_HET_ACE) ? ? ? ? | ||
carbohydrate_maintenance_ace -1 ? -1 | ||
lipid_maintenance_ace -1 ? -1 | ||
endogenous_respiration_ace -1 ? -1 ? ? | ||
growth_glu 1 ? (-1)/Y_X_ALG_HET_GLU ? ? ? | ||
carbohydrate_storage_glu 1 ? (-1)/Y_CH_ND_HET_GLU ? | ||
lipid_storage_glu 1 ? (-1)/Y_LI_ND_HET_GLU ? | ||
carbohydrate_growth_glu 1 (-Y_CH_NR_HET_GLU/Y_X_ALG_HET_GLU) ? ? ? ? | ||
lipid_growth_glu 1 (-Y_LI_NR_HET_GLU/Y_X_ALG_HET_GLU) ? ? ? ? | ||
carbohydrate_maintenance_glu -1 ? -1 | ||
lipid_maintenance_glu -1 ? -1 | ||
endogenous_respiration_glu -1 ? -1 ? ? | ||
aero_hydrolysis 1-f_SI ? ? ? f_SI -1 | ||
anox_hydrolysis 1-f_SI ? ? ? f_SI -1 | ||
anae_hydrolysis 1-f_SI ? ? ? f_SI -1 | ||
hetero_growth_S_F (-1)/Y_H 1-1/Y_H ? ? ? 1 | ||
hetero_growth_S_A (-1)/Y_H 1-1/Y_H ? ? ? 1 | ||
denitri_S_F (-1)/Y_H ? (Y_H-1)/(20/7*Y_H) ? (1-Y_H)/(20/7*Y_H) ? 1 | ||
denitri_S_A (-1)/Y_H ? (Y_H-1)/(20/7*Y_H) ? (1-Y_H)/(20/7*Y_H) ? 1 | ||
ferment 1 -1 ? ? ? | ||
hetero_lysis ? ? ? f_XI_H 1-f_XI_H -1 | ||
auto_aero_growth (Y_A-32/7)/Y_A ? 1/Y_A ? ? 1 | ||
auto_lysis ? ? ? f_XI_AUT 1-f_XI_AUT -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
X_CHL X_ALG X_CH X_LI S_CO2 S_A S_F S_O2 S_NH S_NO S_P X_N_ALG X_P_ALG S_N2 S_ALK S_I X_I X_S X_H X_AUT | ||
photoadaptation 1 | ||
ammonium_uptake -1 1 | ||
phosphorus_uptake -1 1 | ||
growth_pho 1 ? 1 ? ? | ||
carbohydrate_storage_pho 1 ? 1 | ||
lipid_storage_pho 1 ? 1 | ||
carbohydrate_growth_pho 1 (-Y_CH_PHO/Y_X_ALG_PHO) ? ? ? ? | ||
lipid_growth_pho 1 (-Y_LI_PHO/Y_X_ALG_PHO) ? ? ? ? | ||
carbohydrate_maintenance_pho -1 ? -1 | ||
lipid_maintenance_pho -1 ? -1 | ||
endogenous_respiration_pho -1 ? -1 ? ? | ||
growth_ace 1 ? (-1)/Y_X_ALG_HET_ACE ? ? ? | ||
carbohydrate_storage_ace 1 ? (-1)/Y_CH_ND_HET_ACE ? | ||
lipid_storage_ace 1 ? (-1)/Y_LI_ND_HET_ACE ? | ||
carbohydrate_growth_ace 1 (-Y_CH_NR_HET_ACE/Y_X_ALG_HET_ACE) ? ? ? ? | ||
lipid_growth_ace 1 (-Y_LI_NR_HET_ACE/Y_X_ALG_HET_ACE) ? ? ? ? | ||
carbohydrate_maintenance_ace -1 ? -1 | ||
lipid_maintenance_ace -1 ? -1 | ||
endogenous_respiration_ace -1 ? -1 ? ? | ||
growth_glu 1 ? (-1)/Y_X_ALG_HET_GLU ? ? ? | ||
carbohydrate_storage_glu 1 ? (-1)/Y_CH_ND_HET_GLU ? | ||
lipid_storage_glu 1 ? (-1)/Y_LI_ND_HET_GLU ? | ||
carbohydrate_growth_glu 1 (-Y_CH_NR_HET_GLU/Y_X_ALG_HET_GLU) ? ? ? ? | ||
lipid_growth_glu 1 (-Y_LI_NR_HET_GLU/Y_X_ALG_HET_GLU) ? ? ? ? | ||
carbohydrate_maintenance_glu -1 ? -1 | ||
lipid_maintenance_glu -1 ? -1 | ||
endogenous_respiration_glu -1 ? -1 ? ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
X_CHL X_ALG X_CH X_LI S_CO2 S_A S_F S_O2 S_NH S_NO S_P X_N_ALG X_P_ALG S_N2 S_ALK S_I X_I X_S X_H X_AUT | ||
aero_hydrolysis 1-f_SI ? ? ? f_SI -1 | ||
anox_hydrolysis 1-f_SI ? ? ? f_SI -1 | ||
anae_hydrolysis 1-f_SI ? ? ? f_SI -1 | ||
hetero_growth_S_F (-1)/Y_H 1-1/Y_H ? ? ? 1 | ||
hetero_growth_S_A (-1)/Y_H 1-1/Y_H ? ? ? 1 | ||
denitri_S_F (-1)/Y_H ? (Y_H-1)/(20/7*Y_H) ? (1-Y_H)/(20/7*Y_H) ? 1 | ||
denitri_S_A (-1)/Y_H ? (Y_H-1)/(20/7*Y_H) ? (1-Y_H)/(20/7*Y_H) ? 1 | ||
ferment 1 -1 ? ? ? | ||
hetero_lysis ? ? ? f_XI_H 1-f_XI_H -1 | ||
auto_aero_growth (Y_A-32/7)/Y_A ? 1/Y_A ? ? 1 | ||
auto_lysis ? ? ? f_XI_AUT 1-f_XI_AUT -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ | |
Joy Zhang <[email protected]> | ||
Ga-Yeong Kim <[email protected]> | ||
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. | ||
|
@@ -59,6 +61,7 @@ def __init__(self): | |
|
||
#%% | ||
from ._aeration import * | ||
from ._aerobic_digestion_addon import * | ||
from ._asm1 import * | ||
from ._asm2d import * | ||
from ._adm1 import * | ||
|
@@ -67,21 +70,25 @@ def __init__(self): | |
from ._decay import * | ||
from ._kinetic_reaction import * | ||
from ._pm2 import * | ||
from ._pm2asm2d import * | ||
|
||
from . import ( | ||
_aeration, | ||
_aerobic_digestion_addon, | ||
_asm1, | ||
_asm2d, | ||
_adm1, | ||
_adm1_p_extension, | ||
# _madm1, | ||
_decay, | ||
_kinetic_reaction, | ||
_pm2 | ||
_pm2, | ||
_pm2asm2d, | ||
) | ||
|
||
__all__ = ( | ||
*_aeration.__all__, | ||
*_aerobic_digestion_addon.__all__, | ||
*_asm1.__all__, | ||
*_asm2d.__all__, | ||
*_adm1.__all__, | ||
|
@@ -90,4 +97,5 @@ def __init__(self): | |
*_decay.__all__, | ||
*_kinetic_reaction.__all__, | ||
*_pm2.__all__, | ||
) | ||
*_pm2asm2d.__all__, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# -*- coding: utf-8 -*- | ||
''' | ||
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems | ||
This module is developed by: | ||
Joy Zhang <[email protected]> | ||
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. | ||
''' | ||
import numpy as np | ||
from qsdsan import Process | ||
from thermosteam import settings | ||
_load_components = settings.get_default_chemicals | ||
|
||
__all__ = ('ASM_AeDigAddOn',) | ||
|
||
class ASM_AeDigAddOn(Process): | ||
''' | ||
Creates a `Process` object representing the degradation of particulate | ||
inert organic materials that typically occur in an aerobic digester. | ||
Stoichiometry is determined by rules of element conservation in corresponding | ||
activated sludge models. | ||
Parameters | ||
---------- | ||
k_dig : float, optional | ||
The 1st-order degradation rate constant, in d^(-1). The default is 0.04. | ||
See Also | ||
-------- | ||
:class:`qsdsan.processes.ASM1` | ||
:class:`qsdsan.processes.ASM2d` | ||
:class:`qsdsan.processes.mASM2d` | ||
Examples | ||
-------- | ||
>>> import qsdsan.processes as pc | ||
>>> cmps_asm1 = pc.create_asm1_cmps() | ||
>>> dig_asm1 = pc.ASM_AeDigAddOn('dig_asm1') | ||
>>> dig_asm1.show() | ||
Process: dig_asm1 | ||
[stoichiometry] X_I: -1 | ||
X_S: 1 | ||
S_NH: 0.06 | ||
S_ALK: 0.0514 | ||
[reference] X_I | ||
[rate equation] X_I*k_dig | ||
[parameters] k_dig: 0.04 | ||
[dynamic parameters] | ||
>>> cmps_masm2d = pc.create_masm2d_cmps(set_thermo=False) | ||
>>> dig_masm2d = pc.ASM_AeDigAddOn('dig_masm2d', components=cmps_masm2d) | ||
>>> dig_masm2d.show() | ||
Process: dig_masm2d | ||
[stoichiometry] S_NH4: 0.0265 | ||
S_PO4: 0.0009 | ||
S_IC: 0.0433 | ||
X_I: -1 | ||
X_S: 1 | ||
[reference] X_I | ||
[rate equation] X_I*k_dig | ||
[parameters] k_dig: 0.04 | ||
[dynamic parameters] | ||
''' | ||
|
||
def __init__(self, ID, k_dig=0.04, components=None): | ||
cmps = _load_components(components) | ||
rxn = 'X_I -> X_S' | ||
consrv = [] | ||
if 'S_ALK' in cmps.IDs: | ||
consrv.append('charge') | ||
rxn += ' + [?]S_ALK' | ||
elif 'S_IC' in cmps.IDs: | ||
consrv.append('C') | ||
rxn += ' + [?]S_IC' | ||
|
||
if 'S_NH' in cmps.IDs: | ||
consrv.append('N') | ||
rxn += ' + [?]S_NH' | ||
elif 'S_NH4' in cmps.IDs: | ||
consrv.append('N') | ||
rxn += ' + [?]S_NH4' | ||
|
||
if 'S_PO4' in cmps.IDs: | ||
consrv.append('P') | ||
rxn += ' +[?]S_PO4' | ||
|
||
super().__init__(ID=ID, reaction=rxn, | ||
rate_equation='k_dig*X_I', | ||
ref_component='X_I', | ||
components=cmps, | ||
conserved_for=consrv, | ||
parameters=('k_dig',)) | ||
self.k_dig=k_dig | ||
self._stoichiometry = np.asarray(self._stoichiometry, dtype=float) | ||
|
||
@property | ||
def k_dig(self): | ||
'''[float] Degradation rate constant, in d^(-1).''' | ||
return self._k | ||
@k_dig.setter | ||
def k_dig(self, k): | ||
self._k = k | ||
self.set_parameters(k_dig=k) |
Oops, something went wrong.