Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New process models and units for WRRF plant-wide simulations #124

Merged
merged 466 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
466 commits
Select commit Hold shift + click to select a range
712544f
Added 'PrimaryClarifierBSM2'
RaiSaumitra Oct 4, 2023
59f62c9
Updated check in PC
RaiSaumitra Oct 4, 2023
4ec5df0
Updated clarifier design and cost estimates
RaiSaumitra Oct 5, 2023
ae1f913
Updated SC design
RaiSaumitra Oct 9, 2023
ad1af10
Added concrete slab to clarifiers
RaiSaumitra Oct 12, 2023
2126e58
Updated thickener (MOP-8)
RaiSaumitra Oct 12, 2023
7b4afd0
Merge branch 'main' into metro
yalinli2 Oct 14, 2023
c3cc0be
remove not useful file
yalinli2 Oct 14, 2023
cb8a746
fix bugs
yalinli2 Oct 14, 2023
8235506
Merge branch 'beta' of https://github.com/QSD-Group/QSDsan into metro
yalinli2 Oct 14, 2023
5e51dc6
Merge branch 'beta' of https://github.com/QSD-Group/QSDsan into metro
yalinli2 Oct 15, 2023
ba98dc7
fix typo
yalinli2 Oct 15, 2023
729da06
fix typo
yalinli2 Oct 15, 2023
a6c7a24
Added citation for PC_BSM2
RaiSaumitra Oct 16, 2023
3b0d097
Updated thickener based on MOP-8
RaiSaumitra Oct 16, 2023
b8fbe17
Merge branch 'metro' of https://github.com/QSD-Group/QSDsan into metro
RaiSaumitra Oct 16, 2023
8415ce0
blank comment
RaiSaumitra Oct 16, 2023
ed22bcf
fix typos
yalinli2 Oct 17, 2023
38b82a7
Merge branch 'metro' of https://github.com/QSD-Group/QSDsan into metro
yalinli2 Oct 17, 2023
7695a1e
Merge branch 'metro' of https://github.com/QSD-Group/QSDsan into metro
RaiSaumitra Oct 18, 2023
88dd407
Added BM factors to centrifuge
RaiSaumitra Oct 25, 2023
08b4ae1
Design and cost of centrifuge
RaiSaumitra Oct 25, 2023
d57a78d
Design and cost of tanks
RaiSaumitra Oct 30, 2023
787a4a5
Design and cost of ASP
RaiSaumitra Oct 31, 2023
f699ac5
Added blower and pipe design
RaiSaumitra Oct 31, 2023
b132edd
Included pump design to treatment chain
RaiSaumitra Nov 1, 2023
4731a1c
Added cost and documentation for treatment chain
RaiSaumitra Nov 1, 2023
042dfe1
Minor adjustments in treatment chain
RaiSaumitra Nov 1, 2023
7f4dee0
Debugging changes
RaiSaumitra Nov 1, 2023
363c452
Edits to debug the pumping cost in Treatment chain
RaiSaumitra Nov 3, 2023
a2ca350
Minor edit
RaiSaumitra Nov 3, 2023
42507c8
Merge branch 'main' of https://github.com/QSD-Group/QSDsan into metro
yalinli2 Nov 12, 2023
9a439ce
workaround to prevent negatives/better error prompting
yalinli2 Nov 12, 2023
4a59887
very minor typo fix
yalinli2 Nov 13, 2023
7764343
Merge branch 'dev' into metro
joyxyz1994 Nov 14, 2023
349bcec
Merge branch 'dev' into metro
joyxyz1994 Nov 15, 2023
105eb63
Revert "Merge branch 'main' of https://github.com/QSD-Group/QSDsan in…
RaiSaumitra Nov 15, 2023
15a61f9
Revert "workaround to prevent negatives/better error prompting"
RaiSaumitra Nov 15, 2023
6e329a1
Revert "Revert "Merge branch 'main' of https://github.com/QSD-Group/Q…
RaiSaumitra Nov 15, 2023
cccb4eb
consolidate thickener parameter update
joyxyz1994 Nov 15, 2023
a88287e
debug CSTR design
joyxyz1994 Nov 15, 2023
29eff84
Merge branch 'metro' of https://github.com/QSD-Group/QSDsan into metro
joyxyz1994 Nov 15, 2023
82832fd
debug thickener
joyxyz1994 Nov 15, 2023
52cb8c4
Update _clarifier.py
joyxyz1994 Nov 15, 2023
c948da4
Discarding scraper
RaiSaumitra Dec 6, 2023
5479df5
Removed scraper, edited capital of centrifuge
RaiSaumitra Dec 6, 2023
c2d5da0
Scaling centrifuge motor power
RaiSaumitra Dec 6, 2023
6ee1c36
Coded function to compile pumping power demand in WRRF
RaiSaumitra Dec 7, 2023
093ed31
Scaling motor power linearly
RaiSaumitra Dec 11, 2023
b2498bd
Change in default total static head
RaiSaumitra Dec 18, 2023
90f3585
Corrected logic flow, and modified ANSI dictionary
RaiSaumitra Dec 19, 2023
fe70818
Update documentation (select_pipe)
RaiSaumitra Dec 19, 2023
61de934
Added thermo to wastestream
RaiSaumitra Jan 3, 2024
9ffb606
Added thermo to pump
RaiSaumitra Jan 3, 2024
9a6977e
Changing default value
RaiSaumitra Jan 3, 2024
e11e3f6
Added authorship
RaiSaumitra Jan 3, 2024
9374411
Added thermo to pumps in thickeners
RaiSaumitra Jan 4, 2024
c08375b
Function to determine GHG emission in secondary treatment
RaiSaumitra Jan 11, 2024
7043390
Revert "Function to determine GHG emission in secondary treatment"
RaiSaumitra Jan 11, 2024
682f55c
Function to determine GHG emission in secondary treatment
RaiSaumitra Jan 11, 2024
41aed57
Function to determine GHG emission during discharge
RaiSaumitra Jan 11, 2024
8b03d62
More flexible GHG emission functions
RaiSaumitra Jan 13, 2024
95e2032
Function to calculate CO2 emissions due to electricity consumption
RaiSaumitra Jan 13, 2024
8c88799
Added function to quantify GHG emission from sludge disposal
RaiSaumitra Jan 24, 2024
5ae2b18
updated sludge disposal GHG function
RaiSaumitra Jan 29, 2024
feb9f99
Added GHG function
RaiSaumitra Jan 31, 2024
c670163
Merge branch 'main' into metro
RaiSaumitra Jan 31, 2024
b4f8ff3
Optimized the code that calculates GHG emission from sludge disposal
RaiSaumitra Jan 31, 2024
491bb3b
Updated secondary treatment GHG
RaiSaumitra Jan 31, 2024
a2d949d
Updated GHG emission function
RaiSaumitra Feb 1, 2024
68da59c
Quantifying operational costs
RaiSaumitra Feb 1, 2024
026cc11
Updated wwt_design functions
RaiSaumitra Feb 1, 2024
d648db5
Updated estimated range of sludge disposal costs
RaiSaumitra Feb 4, 2024
2c5fb7e
Updated GHG emissions from electricity
RaiSaumitra Feb 4, 2024
62e7311
Updated sludge management costs
RaiSaumitra Feb 5, 2024
0800ffd
Accounted for methane emission from leftover sludge
RaiSaumitra Feb 5, 2024
603bff9
Satisfy mass balance
RaiSaumitra Feb 13, 2024
3bb7e52
Updated junction from bsm2
RaiSaumitra Feb 16, 2024
49aa0b4
Null
RaiSaumitra Feb 16, 2024
8dd776c
Updated cost estimates due to unit
RaiSaumitra Feb 16, 2024
ace59ab
Facilitating uncertainty analysis
RaiSaumitra Feb 19, 2024
18259f9
Corrected typos in documentation
RaiSaumitra Feb 20, 2024
098018e
Adding file with initial conditions
RaiSaumitra Feb 22, 2024
5ce9fa5
Revert "Adding file with initial conditions"
RaiSaumitra Feb 22, 2024
029ceaa
ASM2d-ADM1
RaiSaumitra Mar 19, 2024
3579c8b
Charge balance in junction
RaiSaumitra Mar 19, 2024
f559493
ASM2d-ADM1
RaiSaumitra Mar 19, 2024
6e8caaf
ADM1-ASM2d junction
RaiSaumitra Mar 20, 2024
2d83249
Update junction
RaiSaumitra Mar 21, 2024
2760d7f
ASM2d-mADM1 interface
RaiSaumitra Mar 21, 2024
759cf6a
Checks for N/P in PAO
RaiSaumitra Mar 21, 2024
49bfcb9
Understanding charge balance
RaiSaumitra Mar 21, 2024
38c567c
Changes to validate ASM2d-mADM1
RaiSaumitra Mar 21, 2024
010d5d2
ASM2dtomADM1
RaiSaumitra Mar 21, 2024
7531b13
Added mADM1 junction class
RaiSaumitra Mar 21, 2024
656bf80
mADM1 junction
RaiSaumitra Mar 21, 2024
47a78bb
TN balance check: ASM2d-mADM1
RaiSaumitra Mar 22, 2024
896c7ed
Update in mADM1 process
RaiSaumitra Mar 22, 2024
db5bad8
Updated mADM1-ASM2d junction
RaiSaumitra Mar 26, 2024
8e5a7b0
Step 1 (mADM1-ASM2d)
RaiSaumitra Mar 26, 2024
b01ea4b
Step 1: mADM1-ASM2d
RaiSaumitra Mar 26, 2024
49d8745
Step 1 (b) mADM1-ASM2d
RaiSaumitra Mar 26, 2024
601df97
mADM1-ASM2d interface
RaiSaumitra Mar 26, 2024
cc417d6
Mapped soluble substrates: mADM1-ASM2d
RaiSaumitra Mar 26, 2024
ced062b
mADM1-ASM2d: Mapping of soluble inert
RaiSaumitra Mar 27, 2024
94b7936
Charge balance: mADM1-ASM2d
RaiSaumitra Mar 27, 2024
6e3e99b
Minor debugging
RaiSaumitra Mar 27, 2024
0a1540a
Important debugging changes
RaiSaumitra Mar 27, 2024
984a1b9
mADM1-ASM2d interface
RaiSaumitra Mar 27, 2024
f11a41a
N balance: mADM1-ASM2d
RaiSaumitra Mar 27, 2024
5d91439
Editing unnecessary part
RaiSaumitra Mar 27, 2024
afbab65
Update pKa used to calculate delta of S_IP
RaiSaumitra Mar 27, 2024
30eb0cb
Removed unnecessary edits
RaiSaumitra Mar 27, 2024
f5ac2ad
Updated constant: mADM1
RaiSaumitra Mar 28, 2024
da5a12e
Modified Ks
RaiSaumitra Mar 29, 2024
9ee94cf
Minor edit
RaiSaumitra Apr 3, 2024
8addf41
Changed Step 2 (ASM2d-mADM1)
RaiSaumitra Apr 9, 2024
7f90521
Step 5: mapping of X_I
RaiSaumitra Apr 9, 2024
fcca157
Revert "Step 5: mapping of X_I"
RaiSaumitra Apr 9, 2024
e74b1c0
Mapping XI
RaiSaumitra Apr 9, 2024
326fb0d
Mapping SI
RaiSaumitra Apr 9, 2024
c2e7467
Substrate inhibition ADM1
RaiSaumitra Apr 9, 2024
b692141
Correcting stoichiometry
RaiSaumitra Apr 10, 2024
63c25db
Minor rewriting
RaiSaumitra Apr 10, 2024
23b5abd
Defined stoichiometry
RaiSaumitra Apr 10, 2024
40b9a2c
Conserving C, N, and P
RaiSaumitra Apr 10, 2024
e155857
Rate eqn in process description
RaiSaumitra Apr 11, 2024
ef4d7b8
mini code cleanup for BSM2 primary clarifier
yalinli2 Apr 15, 2024
70456d4
update `get_SRT` util func to deal with no biomass waste
yalinli2 Apr 15, 2024
4ffba69
Merge branch 'main' into metro
yalinli2 Apr 15, 2024
1001c57
Merge branch 'main' of https://github.com/QSD-Group/QSDsan into metro…
yalinli2 Apr 15, 2024
c305118
made PrimaryClarifierBSM2 dynamic w/ ODEs
joyxyz1994 Apr 17, 2024
2f97d21
Removing rate equations
RaiSaumitra Apr 17, 2024
dc04664
Merge branch 'metro' of https://github.com/QSD-Group/QSDsan into metro
RaiSaumitra Apr 17, 2024
bfb6a60
Merge pull request #121 from QSD-Group/metro-bsm2
yalinli2 Apr 18, 2024
6cac36a
Merge branch 'dev' into metro-bsm2
joyxyz1994 Apr 18, 2024
7cdb3de
Update _anaerobic_reactor.py
joyxyz1994 Apr 18, 2024
0fb746a
Merge branch 'main' of https://github.com/QSD-Group/QSDsan into metro
yalinli2 Apr 19, 2024
03599d3
temporarily disable BSM2 primary clarifier doctest
yalinli2 Apr 19, 2024
20dfe18
Merge branch 'metro-bsm2' of https://github.com/QSD-Group/QSDsan into…
yalinli2 Apr 19, 2024
adac018
consolidate CSTR ODEs & minor speed-up
joyxyz1994 Apr 22, 2024
0e7abff
allow redefine WasteStream pH
joyxyz1994 Apr 23, 2024
1c474a4
updates downstream pH during dynamic simulation
joyxyz1994 Apr 23, 2024
6f5a518
minor bug fix
joyxyz1994 Apr 23, 2024
121c3c1
Update _clarifier.py
joyxyz1994 Apr 23, 2024
fea7d31
minor bug fix
joyxyz1994 Apr 23, 2024
f316d8a
maintain pH during SanUnit init
joyxyz1994 Apr 23, 2024
9af9b06
update thickener_factor in _run iterations
joyxyz1994 Apr 24, 2024
76260c4
add S_h2 algebraic solver
joyxyz1994 Apr 24, 2024
9fb8659
enable DEA solving with AnaerobicCSTR
joyxyz1994 Apr 25, 2024
61cd5ec
minor bug fix
joyxyz1994 Apr 26, 2024
ceaf71d
Merge branch 'metro-bsm2' into dev
joyxyz1994 May 9, 2024
e8b92ae
minor typo fix
joyxyz1994 May 9, 2024
35333be
merged changes from `metro-bsm2` & resolve bug
joyxyz1994 May 9, 2024
58accdf
fix failed tests
joyxyz1994 May 9, 2024
013b59e
enable dynamic `IdealClarifier`
joyxyz1994 May 10, 2024
1ac9fe6
clean up `PrimaryClarifier`
joyxyz1994 May 10, 2024
8e27f89
clean up `ADM1_p_extension`
joyxyz1994 May 10, 2024
2dc3ed8
debug `ASM2dtomADM1`
joyxyz1994 May 14, 2024
17158f6
debug `mADM1toASM2d`
joyxyz1994 May 14, 2024
8d9070b
fix typo
joyxyz1994 May 14, 2024
76af338
minor bug fix
joyxyz1994 May 14, 2024
bbccb55
A1 algorithm made separate subclasses
joyxyz1994 May 17, 2024
b46e51c
restore older versions of mADM1-ASM2d interfaces
joyxyz1994 May 17, 2024
dfa1cae
Update _junction.py
joyxyz1994 May 20, 2024
c2ca9a9
Update _junction.py
joyxyz1994 May 20, 2024
22224ec
Update _junction.py
joyxyz1994 May 20, 2024
e8c35a4
fix tkn balance
joyxyz1994 May 21, 2024
26a323b
fix bug in `IdealClarifier` and update doctest
joyxyz1994 May 21, 2024
70fc6e5
Delete _junction_copy.py
joyxyz1994 May 21, 2024
715e379
PFR checkpoint
joyxyz1994 May 29, 2024
5562ef4
update `PFR`
joyxyz1994 May 30, 2024
2e12c9a
Delete _pfr.py
joyxyz1994 May 30, 2024
5bcc76c
update state headers for `PFR`, `AnaerobicCSTR`
joyxyz1994 May 30, 2024
07bc737
minor bug fix
joyxyz1994 May 30, 2024
7c24331
fix kLa setting in `PFR`
joyxyz1994 May 30, 2024
bef8afd
minor fix of doctest
joyxyz1994 May 30, 2024
57954af
fix mADM1-ASM2d charge balances
joyxyz1994 May 31, 2024
8262234
debug algebraic dissolved H2 solver
joyxyz1994 Jun 3, 2024
12f5622
default AnaerobicCSTR back to ODE for h2
joyxyz1994 Jun 3, 2024
95b33b2
add modified ASM2d
joyxyz1994 Jun 5, 2024
71901c0
Update _asm2d.py
joyxyz1994 Jun 5, 2024
4802c5e
fix adm1p components
joyxyz1994 Jun 5, 2024
cf204c8
fix `mASM2d`
joyxyz1994 Jun 6, 2024
cdbcb17
add new property
joyxyz1994 Jun 7, 2024
f9a9efb
mASM2d rate function
joyxyz1994 Jun 11, 2024
a4a4ac6
ADM1p compatible with modified ASM2d
joyxyz1994 Jun 12, 2024
386b758
temporary removal of ADM1p doctest
joyxyz1994 Jun 12, 2024
25ed34f
enable Processes initiation with data frame
joyxyz1994 Jun 13, 2024
d5316d9
consolidate common functions in process models
joyxyz1994 Jun 13, 2024
cea2a3c
debug `ADM1p`
joyxyz1994 Jun 13, 2024
2bd8487
`mASM2d`-`ADM1p` interface models
joyxyz1994 Jun 14, 2024
8c7ec7c
rename A1 interface models
joyxyz1994 Jun 14, 2024
081bf14
debug ADM1p interface
joyxyz1994 Jun 14, 2024
48372d2
minor update to adm1 pH solvers
joyxyz1994 Jun 14, 2024
5069456
minor bug fix
joyxyz1994 Jun 17, 2024
2815f3c
base gas stripping kLa on aeration kLa
joyxyz1994 Jun 18, 2024
8934171
debug gas stripping algorithm
joyxyz1994 Jun 19, 2024
b4a4118
try alternative mmp kinetics
joyxyz1994 Jun 24, 2024
9a4da99
consistency
joyxyz1994 Jun 25, 2024
abc0145
Ca conservation in `mASM2d` and `ADM1p`
joyxyz1994 Jun 25, 2024
d41a08c
consistent MMP model between ASM and ADM
joyxyz1994 Jun 25, 2024
e12c69d
checkpoint
joyxyz1994 Jun 27, 2024
88d4069
checkpoint
joyxyz1994 Jun 27, 2024
4801ca1
debug electron acceptor COD
joyxyz1994 Jul 10, 2024
3551072
debug ASM2d stoichiometry
joyxyz1994 Jul 10, 2024
f44d0ff
temporary disable mmp
joyxyz1994 Jul 12, 2024
c785da2
fix minor bug
joyxyz1994 Jul 12, 2024
d54b975
fix tests
joyxyz1994 Jul 15, 2024
9c9db81
minor bug fix
joyxyz1994 Jul 18, 2024
c71c506
debug mASM2d
joyxyz1994 Jul 18, 2024
0014758
more fail-proof modeling of aeration in CSTR
joyxyz1994 Jul 23, 2024
c6da4a2
set pH & minor fix to `PFR`
joyxyz1994 Jul 26, 2024
112b7df
allow to set `maximum_nonsettleable_solids` in Takacs clarifier
joyxyz1994 Jul 29, 2024
fbfb59a
enable general pH control in `AnaerobicCSTR`
joyxyz1994 Jul 29, 2024
8b926bd
enable general pH control for AS process in `mASM2d`
joyxyz1994 Jul 29, 2024
72e69dd
debug `AnaerobicCSTR` pH control
joyxyz1994 Jul 30, 2024
bc976c0
more fail-proof mmp rate functions
joyxyz1994 Jul 31, 2024
8745801
added default initial headspace gas concentrations
joyxyz1994 Jul 31, 2024
85f1200
minor update
joyxyz1994 Aug 2, 2024
a669658
more fail-proof rate functions
joyxyz1994 Aug 13, 2024
f0809e2
minor bug fix
joyxyz1994 Aug 13, 2024
15c596e
Merge branch 'main' into dev
joyxyz1994 Aug 13, 2024
dcef80a
minor bug fix
joyxyz1994 Aug 13, 2024
16f9fe1
improve stability
joyxyz1994 Aug 13, 2024
7a59ddb
Create build-dev.yml
joyxyz1994 Aug 14, 2024
3da83c7
name fix
joyxyz1994 Aug 14, 2024
ff1271f
clean up ASM2d-ADM1 interfaces
joyxyz1994 Aug 14, 2024
0b1eeda
clean up ASM2d-mADM1 interfaces
joyxyz1994 Aug 14, 2024
a92e72f
debug ideal clarifier
joyxyz1994 Aug 17, 2024
72d98d9
consistency in `ADM1p`
joyxyz1994 Aug 26, 2024
08f883c
consume S_F, X_S if S_A gets negative in interface
joyxyz1994 Aug 28, 2024
1d599cf
dissolve minerals in interface if S_IC/S_IN/S_IP becomes negative
joyxyz1994 Aug 28, 2024
7463023
dissolve minerals in interface if S_IC/S_NH4/S_PO4 < 0
joyxyz1994 Sep 11, 2024
785286a
fix typo
joyxyz1994 Sep 27, 2024
85982e3
clean up util functions
joyxyz1994 Sep 30, 2024
7198360
clean up `PrimaryClarifier._design()`
joyxyz1994 Oct 2, 2024
d86c7f0
Update `PrimaryClarifier._design_pump()`
joyxyz1994 Oct 2, 2024
7453eb4
clean up `PrimarycClarifier._cost()`
joyxyz1994 Oct 2, 2024
c3a6c98
minor bug fix
joyxyz1994 Oct 2, 2024
1889e10
minor bug fix
joyxyz1994 Oct 2, 2024
ba4eddf
Update _sludge_treatment.py
joyxyz1994 Oct 14, 2024
500b58b
minor bug fix
joyxyz1994 Oct 14, 2024
5e1f75b
fix bug in MMP models
joyxyz1994 Oct 15, 2024
a02354b
clean up for merge
joyxyz1994 Oct 15, 2024
bbbb965
Update _clarifier.py
joyxyz1994 Oct 15, 2024
0a56388
update with new biosteam/thermosteam
yalinli2 Oct 16, 2024
eb4520d
update for naming consistency
yalinli2 Oct 16, 2024
cd21977
update docs
yalinli2 Oct 16, 2024
ba224e1
release new version
yalinli2 Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests with a variety of Python versions, and report coverage

name: build-dev

on:
push:
branches: [dev]
pull_request:
branches: [dev]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest] if want multiple os
python-version: ["3.9", "3.10"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest nbval
pip install --no-cache-dir git+https://github.com/BioSTEAMDevelopmentGroup/thermosteam.git@qsdsan
pip install --no-cache-dir git+https://github.com/BioSTEAMDevelopmentGroup/biosteam.git@qsdsan
pip install --no-cache-dir git+https://github.com/QSD-Group/EXPOsan.git@bsm2
pip install --no-cache-dir -r requirements.txt
- name: Test with pytest
run: |
pytest
27 changes: 27 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ Change Log
This document records notable changes to `QSDsan <https://github.com/QSD-Group/QSDsan>`_. We aim to follow `Semantic Versioning <https://semver.org/>`_.


`1.4.0`_
--------
- A lot of the updates have been focused on the dynamic simulation, now the open-loop Benchmark Simulation Model No. 2 (`BSM2 <https://github.com/QSD-Group/EXPOsan/tree/main/exposan/bsm2>`_) configuration has been implemented with new process models and unit operation including

- :class:`qsdsan.processes.ADM1p`
- :class:`qsdsan.processes.ADM1_p_extension`
- :class:`qsdsan.processes.ModifiedADM1`
- :class:`qsdsan.processes.mASM2d`
- :class:`qsdsan.sanunits.IdealClarifier`
- :class:`qsdsan.sanunits.PrimaryClarifier`
- :class:`qsdsan.sanunits.PrimaryClarifierBSM2`
- :class:`qsdsan.sanunits.GasExtractionMembrane`
- :class:`qsdsan.sanunits.Thickener`
- :class:`qsdsan.sanunits.Centrifuge`
- :class:`qsdsan.sanunits.Incinerator`
- :class:`qsdsan.sanunits.BatchExperiment`
- :class:`qsdsan.sanunits.PFR`
- :class:`qsdsan.sanunits.BeltThickener`
- :class:`qsdsan.sanunits.SludgeCentrifuge`
- :class:`qsdsan.sanunits.SludgeThickener`

- New publications

- Feng et al., *Environmental Science & Technology*, on the sustainability of `hydrothermal liquefaction (HTL) <https://doi.org/10.1021/acs.est.3c07394>`_ for resource recovery from a range of wet organic wastes.


`1.3.0`_
--------
- Enhance and use QSDsan's capacity for dynamic simulation for emerging technologies and benchmark configurations (see EXPOsan METAB and PM2 (on the algae branch, still under development) modules).
Expand Down Expand Up @@ -185,6 +211,7 @@ Official release of ``QSDsan`` v1.0.0!
.. _Trimmer et al.: https://doi.org/10.1021/acs.est.0c03296

.. Commit links
.. _1.4.0: https://github.com/QSD-Group/QSDsan/releases/tag/v1.4.0
.. _1.3.0: https://github.com/QSD-Group/QSDsan/releases/tag/v1.3.0
.. _1.2.0: https://github.com/QSD-Group/QSDsan/releases/tag/v1.2.0
.. _1.1.0: https://github.com/QSD-Group/QSDsan/releases/tag/v1.1.0
Expand Down
7 changes: 7 additions & 0 deletions docs/source/api/processes/ADM1p.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Anaerobic Digestion Model No.1 with P extension (ADM1 P/Extension)
==================================================================
.. autoclass:: qsdsan.processes.ADM1_p_extension
:members:

.. autoclass:: qsdsan.processes.ADM1p
:members:
3 changes: 3 additions & 0 deletions docs/source/api/processes/ASM2d.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Activated Sludge Model No.2d (ASM2d)
====================================
.. autoclass:: qsdsan.processes.ASM2d
:members:

.. autoclass:: qsdsan.processes.mASM2d
:members:
14 changes: 12 additions & 2 deletions docs/source/api/processes/_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ List of Biological Kinetic Models
| ADM1 | `adm`_ | `Batstone`_ et al., 2002 |
| | | `Rosen and Jeppsson`_, 2006 |
+----------+------------------+-----------------------------+
| ADM1p | `bsm2`_ | `Alex`_ et al., 2008 |
+----------+------------------+-----------------------------+
| mADM1 | | |
+----------+------------------+-----------------------------+
| ASM1 | `asm`_ & `bsm1`_ | `Henze`_ et al., 2006 |
+----------+------------------+-----------------------------+
| ASM2d | `asm`_ & `bsm1`_ | `Henze`_ et al., 2006 |
+----------+------------------+-----------------------------+
| PM2 | `pm2_ecorecover`_| N/A |
| | & `pm2_batch`_ | |
| mASM2d | `bsm2`_ | `Alex`_ et al., 2008 |
+----------+------------------+-----------------------------+
| PM2 | `pm2_ecorecover`_| |
| | & `pm2_batch`_ | |
+----------+------------------+-----------------------------+


Expand All @@ -41,10 +47,12 @@ List of Other Kinetic Modules
.. _adm: https://github.com/QSD-Group/EXPOsan/tree/main/exposan/adm
.. _asm: https://github.com/QSD-Group/EXPOsan/tree/main/exposan/asm
.. _bsm1: https://github.com/QSD-Group/EXPOsan/tree/main/exposan/bsm1
.. _bsm2: https://github.com/QSD-Group/EXPOsan/tree/main/exposan/bsm2
.. _bwaise: https://github.com/QSD-Group/EXPOsan/tree/main/exposan/bwaise
.. _pm2_batch: https://github.com/QSD-Group/EXPOsan/tree/main/exposan/pm2_batch
.. _pm2_ecorecover: https://github.com/QSD-Group/EXPOsan/tree/main/exposan/pm2_ecorecover

.. _Alex: http://iwa-mia.org/wp-content/uploads/2022/09/TR3_BSM_TG_Tech_Report_no_3_BSM2_General_Description.pdf
.. _Batstone: https://iwaponline.com/ebooks/book/152/Anaerobic-Digestion-Model-No-1-ADM1
.. _EPA design manual: https://nepis.epa.gov/Exe/ZyPURL.cgi?Dockey=3000464S.TXT
.. _Henze: https://iwaponline.com/ebooks/book/96/
Expand All @@ -59,9 +67,11 @@ Links to docs
:maxdepth: 1

ADM1
ADM1p
Aeration
ASM1
ASM2d
Decay
KineticReaction
mADM1
PM2
4 changes: 4 additions & 0 deletions docs/source/api/processes/mADM1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Modified Anaerobic Digestion Model No.1 (MADM1)
===============================================
.. autoclass:: qsdsan.processes.ModifiedADM1
:members:
4 changes: 4 additions & 0 deletions docs/source/api/sanunits/MembraneGasExtraction.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Membrane Gas Extraction
=======================
.. automodule:: qsdsan.sanunits._membrane_gas_extraction
:members:
3 changes: 3 additions & 0 deletions docs/source/api/sanunits/_index.csv
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ Lagoon,No,No,Completed
LiquidTreatmentBed,No,No,Completed
LumpedCost,No,No,Completed
MembraneDistillation,No,No,Completed
MembraneGasExtraction,No,No,Completed
MixTank,No,No,Completed
Mixer,Yes,Yes,Completed
MURT (multi-unit reinvented toilet),No,No,Completed
PFR (plug flow reactor),Yes,No,Under development
PhaseChanger,No,Yes,Completed
PitLatrine,No,No,Completed
PolishingFilter,No,No,Completed
PrimaryClarifier,Yes,No,Completed
Pump,Yes,No,Completed
Reactor,No,No,Completed
ReversedSplitter,No,Yes,Completed
Expand Down
4 changes: 3 additions & 1 deletion docs/source/api/sanunits/_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ Individual Unit Operations
Lagoon
membrane_bioreactor
MembraneDistillation
MembraneGasExtraction
non_reactive
PolishingFilter
pumping
Reactor
Screening
Sedimentation
SepticTank
sludge_thickening
SludgePasteurization
sludge_thickening
sludge_treatment
suspended_growth_bioreactor
tank
toilet
Expand Down
4 changes: 4 additions & 0 deletions docs/source/api/sanunits/sludge_treatment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Sludge Treatment
================
.. automodule:: qsdsan.sanunits._sludge_treatment
:members:
2 changes: 2 additions & 0 deletions qsdsan/_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ def i_NOD(self, i):
if i == None:
if self.degradability in ('Readily', 'Slowly') or self.formula in ('H3N', 'NH4', 'NH3', 'NH4+', 'H4N+'):
i = self.i_N * molecular_weight({'O':4}) / molecular_weight({'N':1})
elif self.formula == 'N2':
i = self.i_N * molecular_weight({'O':5}) / molecular_weight({'N':2})
elif self.formula in ('NO2-', 'HNO2'):
i = self.i_N * molecular_weight({'O':1}) / molecular_weight({'N':1})
else:
Expand Down
8 changes: 5 additions & 3 deletions qsdsan/_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ def extend(self, components):
def compile(self, skip_checks=False):
'''Cast as a :class:`CompiledComponents` object.'''
components = tuple(self)
tmo._chemicals.prepare(components, skip_checks)
setattr(self, '__class__', CompiledComponents)
try: self._compile(components, skip_checks)

try: self._compile(components)
except Exception as error:
setattr(self, '__class__', Components)
setattr(self, '__dict__', {i.ID: i for i in components})
Expand Down Expand Up @@ -614,11 +616,11 @@ def compile(self, skip_checks=False):
pass


def _compile(self, components, skip_checks=False):
def _compile(self, components):
dct = self.__dict__
tuple_ = tuple # this speeds up the code
components = tuple_(dct.values())
CompiledChemicals._compile(self, components, skip_checks)
CompiledChemicals._compile(self, components)
for component in components:
missing_properties = component.get_missing_properties(_key_component_properties)
if not missing_properties: continue
Expand Down
18 changes: 12 additions & 6 deletions qsdsan/_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ def _rate_eq2func(self):
def f(state_arr, params={}):
states = dict(zip(var_kw, state_arr))
return lamb(**states, **params)

self.kinetics(function=f, parameters=self.parameters)

def _normalize_stoichiometry(self, new_ref):
Expand Down Expand Up @@ -975,13 +976,14 @@ def __repr__(self):
_default_data = None

@classmethod
def load_from_file(cls, path='', components=None,
def load_from_file(cls, path='', components=None, data=None,
conserved_for=('COD', 'N', 'P', 'charge'), parameters=(),
use_default_data=False, store_data=False, compile=True,
**compile_kwargs):
"""
Create :class:`CompiledProcesses` object from a table of process IDs, stoichiometric
coefficients, and rate equations stored in a .tsv, .csv, or Excel file.
coefficients, and rate equations stored in a .tsv, .csv, or Excel file, or as
a `DataFrame`.

Parameters
----------
Expand All @@ -990,6 +992,8 @@ def load_from_file(cls, path='', components=None,
components : :class:`CompiledComponents`, optional
Components corresponding to the columns in the stoichiometry matrix,
to all components set in the system (i.e., through :func:`set_thermo`).
data : :class:`pandas.DataFrame`, optional
Data frame of the Petersen matrix.
conserved_for : tuple[str], optional
Materials subject to conservation rules, must have corresponding 'i\_'
attributes for the components. Applied to all processes.
Expand Down Expand Up @@ -1022,16 +1026,18 @@ def load_from_file(cls, path='', components=None,
"""
if use_default_data and cls._default_data is not None:
data = cls._default_data
elif path:
data = load_data(path=path, index_col=0, na_values=0)
else:
data = load_data(path=path, index_col=None, na_values=0)

if data is None: return None
cmps = _load_components(components)

cmp_IDs = [i for i in data.columns if i in cmps.IDs]
data.dropna(how='all', subset=cmp_IDs, inplace=True)
new = cls(())
for i, proc in data.iterrows():
ID = proc[0]
ID = i
stoichio = proc[cmp_IDs]
if data.columns[-1] in cmp_IDs: rate_eq = None
else:
Expand Down Expand Up @@ -1223,7 +1229,7 @@ def f():
stoichio_arr = self.stoichiometry.to_numpy(dtype=float)
except TypeError:
isa = isinstance
undefined = [k for k, v in dct_vals if not isa(v, (float, int))]
undefined = [k for k, v in dct_vals.items() if not isa(v, (float, int))]
raise TypeError(f'Undefined static parameters: {undefined}')
self.__dict__['_stoichio_lambdified'] = lambda : stoichio_arr

Expand Down
5 changes: 3 additions & 2 deletions qsdsan/_sanunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def __init__(self, ID='', ins=None, outs=(), thermo=None, init_with='WasteStream

if not kwargs.get('skip_property_package_check'):
self._assert_compatible_property_package()

self._utility_cost = None

##### qsdsan-specific #####
Expand Down Expand Up @@ -274,7 +274,8 @@ def _convert_stream(self, strm_inputs, streams, init_with, ins_or_outs):
elif v == 'ss':
converted.append(SanStream.from_stream(stream=s))
else:
converted.append(WasteStream.from_stream(stream=s))
if isa(s, WasteStream): converted.append(s)
else: converted.append(WasteStream.from_stream(stream=s))

diff = len(converted) + len(missing) - len(streams)
if diff != 0:
Expand Down
Loading
Loading