Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
7d35890
add
luohezhiming Mar 16, 2023
4766c52
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 16, 2023
ef81bae
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 22, 2023
168bbaf
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 27, 2023
a09b4e9
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 30, 2023
44a22e8
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 31, 2023
1c1a135
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 5, 2023
401f997
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 10, 2023
258f6fe
delete redundant files
luohezhiming Apr 11, 2023
2c994c3
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 17, 2023
5b6baed
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 21, 2023
0afa551
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 24, 2023
479fb6d
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 28, 2023
b393ed0
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 9, 2023
708ad0a
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 12, 2023
5a69761
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 17, 2023
112415a
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 19, 2023
93737c0
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 25, 2023
3162e34
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 26, 2023
637b32d
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 29, 2023
ea4e066
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 5, 2023
84a2900
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 7, 2023
17bc5e3
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 12, 2023
f816483
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 13, 2023
fea68e3
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 14, 2023
c19fba5
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 20, 2023
0754d21
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 22, 2023
9dcece1
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 22, 2023
a5325c9
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 27, 2023
c4bc3ef
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 5, 2023
bb8ca41
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 7, 2023
5afdc55
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 11, 2023
35ecf79
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 12, 2023
fb2a100
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 17, 2023
40b4de5
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 19, 2023
72f6f25
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 21, 2023
ece1d2f
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Aug 2, 2023
a861a5b
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Aug 7, 2023
d58a9a7
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Aug 9, 2023
4968282
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Aug 19, 2023
acfd9f6
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Aug 23, 2023
a97fbe3
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Aug 24, 2023
2fc2425
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Aug 25, 2023
581dec0
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Sep 4, 2023
3202970
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Sep 20, 2023
625e610
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Sep 25, 2023
2a37aca
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Oct 2, 2023
1fa9316
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Oct 3, 2023
74811ea
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Oct 16, 2023
a89268c
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Oct 16, 2023
09cf01e
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Oct 19, 2023
4070fa1
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Oct 20, 2023
0d6fe1a
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Oct 23, 2023
0f09c3c
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 6, 2023
5f82e05
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 9, 2023
025f9b6
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 13, 2023
af92e14
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 15, 2023
c61fc6d
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 16, 2023
87fbfaf
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 17, 2023
cc20cf2
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 22, 2023
20a0b7b
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 22, 2023
7e4224f
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 27, 2023
e48e352
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 30, 2023
2e0c474
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Dec 6, 2023
88c873d
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Dec 7, 2023
d75ea4e
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Dec 14, 2023
4cc24eb
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Dec 15, 2023
64eb819
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Dec 30, 2023
3b03877
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jan 2, 2024
9757884
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jan 5, 2024
cc171a6
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jan 12, 2024
fbdfae9
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jan 19, 2024
799e3b0
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jan 25, 2024
324685e
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jan 30, 2024
4158c7e
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Feb 2, 2024
5f8b7d1
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Feb 5, 2024
17d268c
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Feb 7, 2024
383a9d8
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Feb 7, 2024
9a05662
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Feb 28, 2024
dd00a3f
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Feb 28, 2024
8175c28
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Feb 28, 2024
252b899
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Feb 29, 2024
9de729a
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 4, 2024
349b52c
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 4, 2024
b0e7287
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 12, 2024
74abee6
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 21, 2024
dc73edf
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 25, 2024
8fd87d2
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 25, 2024
50703b1
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 26, 2024
2e44849
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 1, 2024
4bc5fe6
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 4, 2024
fa9c6df
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 12, 2024
1c09fe1
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 24, 2024
aed90ee
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 26, 2024
98a5258
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 29, 2024
b2e24bf
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 3, 2024
46053da
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 9, 2024
47ab6de
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 13, 2024
97f6b5b
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 28, 2024
6750049
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 5, 2024
8f709ff
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 6, 2024
a0e2e25
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 6, 2024
5a56f34
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 14, 2024
7e631e2
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 20, 2024
5ab832a
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 24, 2024
735b8a7
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 27, 2024
90e6a4e
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 28, 2024
5385f9f
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 1, 2024
9bd6313
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 16, 2024
9ff6789
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 22, 2024
3c29568
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jul 28, 2024
2e16921
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Aug 19, 2024
c515d2d
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Aug 22, 2024
da9d7ed
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Sep 4, 2024
0ac5716
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Sep 6, 2024
03424f1
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Sep 9, 2024
7a52494
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Oct 7, 2024
12ed69d
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Oct 26, 2024
6d5aa53
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 21, 2024
2b431d1
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Nov 25, 2024
3b184c3
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 5, 2025
17b72e4
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Mar 19, 2025
64bb52d
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Apr 7, 2025
585e38f
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming May 30, 2025
d7c1d78
first draft of alternative activated sludge process (reactors only)
adam-a-a Jun 9, 2025
0752d35
make COD_to_SS a param on ASM1 for consistency
adam-a-a Jun 9, 2025
8bd13db
tinkering with scaling
adam-a-a Jun 9, 2025
f9048ec
ASM3 development
luohezhiming Jun 10, 2025
cb4c637
Completed reaction package and properties package
luohezhiming Jun 11, 2025
3df8224
add test file
luohezhiming Jun 12, 2025
0368330
add test file
luohezhiming Jun 12, 2025
bb34640
Reaction and properties test pass
luohezhiming Jun 16, 2025
220d0c6
revise test
luohezhiming Jun 16, 2025
d5135cc
code linting
luohezhiming Jun 16, 2025
d8fa554
fix tests; switch cstr import to watertap cstr which includes hrt; ch…
adam-a-a Jun 16, 2025
5aa6f63
add metrics
Jun 25, 2025
957f997
delete BOD5
luohezhiming Jun 25, 2025
ebd1400
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 25, 2025
c28fb2d
Merge branch 'main' into asm3
luohezhiming Jun 25, 2025
d9f8d76
add metrics and test
luohezhiming Jun 25, 2025
5f70926
Merge branch 'main' into n2o_asp_flowsheet
adam-a-a Jun 25, 2025
1ddde96
Merge remote-tracking branch 'chenyu/asm3' into n2o_asp_flowsheet
adam-a-a Jun 25, 2025
11c1762
rename file after adding asm3 compatibility
adam-a-a Jun 26, 2025
6ff8190
revise kinetic equation for R5
luohezhiming Jun 30, 2025
d4a0a95
Merge branch 'main' of https://github.com/watertap-org/watertap
luohezhiming Jun 30, 2025
86d6b24
Merge branch 'main' into asm3
luohezhiming Jun 30, 2025
6b95b8d
start test file
adam-a-a Jun 30, 2025
3e22ae9
Merge branch 'asm3' into n2o_asp_flowsheet
adam-a-a Jun 30, 2025
f5bd9e9
add some testing, update seq decomp to direct instead of wegstein, ru…
adam-a-a Jul 1, 2025
52b13e3
attempting to validate [wip]
adam-a-a Jul 3, 2025
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
452 changes: 452 additions & 0 deletions watertap/flowsheets/activated_sludge/UConn_WRRF.py

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions watertap/flowsheets/activated_sludge/tests/test_UConn_WRRF.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#################################################################################
# WaterTAP Copyright (c) 2020-2024, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory,
# National Renewable Energy Laboratory, and National Energy Technology
# Laboratory (subject to receipt of any required approvals from the U.S. Dept.
# of Energy). All rights reserved.
#
# Please see the files COPYRIGHT.md and LICENSE.md for full copyright and license
# information, respectively. These files are also available online at the URL
# "https://github.com/watertap-org/watertap/"
#################################################################################
"""
Tests for UConn WRRF flowsheet example.

"""

__author__ = "Adam Atia"

import pytest

from pyomo.environ import assert_optimal_termination, value
from pyomo.util.check_units import assert_units_consistent

from idaes.core.util.model_statistics import degrees_of_freedom

from watertap.flowsheets.activated_sludge.UConn_WRRF import (
build_flowsheet,
set_operating_conditions,
scale_flowsheet,
initialize_flowsheet,
solve_flowsheet,
)
from watertap.flowsheets.activated_sludge.UConn_WRRF import ASMModel


class TestUConnFlowsheetASM3:
@pytest.fixture(scope="class")
def model(self):
m = build_flowsheet(asm_model=ASMModel.asm3)

set_operating_conditions(m, asm_model=ASMModel.asm3)
scale_flowsheet(m)

initialize_flowsheet(m)

scale_flowsheet(m)

# res = solve_flowsheet(m)

# m.results = res

return m

@pytest.mark.integration
def test_structure(self, model):
assert_units_consistent(model)
assert degrees_of_freedom(model) == 0

@pytest.mark.integration
def test_solve(self, model):
res = solve_flowsheet(model)
assert_optimal_termination(res)

@pytest.mark.integration
def test_results(self, model):
comps = model.fs.props.solute_set
model.fs.Treated.display()

# Treated water
assert value(model.fs.Treated.flow_vol[0]) == pytest.approx(
1.06747685185185, rel=1e-4
)
assert value(model.fs.Treated.temperature[0]) == pytest.approx(288.15, rel=1e-4)
assert value(model.fs.Treated.pressure[0]) == pytest.approx(101325, rel=1e-4)
assert value(model.fs.Treated.conc_mass_comp[0, "S_I"]) == pytest.approx(
30e-3, rel=1e-5
)
assert value(model.fs.Treated.conc_mass_comp[0, "S_N2"]) == pytest.approx(
0.02888, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "S_NH4"]) == pytest.approx(
0.001519, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "S_NOX"]) == pytest.approx(
0.007174, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "S_O"]) == pytest.approx(
0.00099, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "S_S"]) == pytest.approx(
0.00016, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "X_A"]) == pytest.approx(
0.13165, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "X_H"]) == pytest.approx(
1.632358, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "X_I"]) == pytest.approx(
1.46378, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "X_S"]) == pytest.approx(
0.209026, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "X_S"]) == pytest.approx(
0.209026, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "X_STO"]) == pytest.approx(
0.304689, rel=1e-2
)
assert value(model.fs.Treated.conc_mass_comp[0, "X_TSS"]) == pytest.approx(
3.02503, rel=1e-3
)

assert value(model.fs.Treated.alkalinity[0]) == pytest.approx(0.00495, rel=1e-2)
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def build(self):
domain=pyo.PositiveReals,
doc="Mass fraction of N per COD in particulates, i_xp",
)
self.COD_to_SS = pyo.Var(
self.COD_to_SS = pyo.Param(
initialize=0.75,
units=pyo.units.dimensionless,
domain=pyo.PositiveReals,
Expand Down Expand Up @@ -534,6 +534,10 @@ def define_state_vars(self):

def define_display_vars(self):
return {
"TSS": self.TSS,
"COD": self.COD,
"BOD5": self.BOD5,
"TKN": self.TKN,
"Volumetric Flowrate": self.flow_vol,
"Molar Alkalinity": self.alkalinity,
"Mass Concentration": self.conc_mass_comp,
Expand Down
Loading
Loading