-
Notifications
You must be signed in to change notification settings - Fork 61
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
ADM1/ASM2d Translator Update #1435
Changes from 18 commits
af1dc9a
8318db2
c0b8329
b1273c4
df81af7
6b6a448
66a7c44
07ff096
8133b7a
906fb13
4953299
f5ee78f
49ce16c
5731370
22c3091
98978a0
4159a92
22fd6a9
321b16e
a205a7a
87ccc2f
7150b66
b7b2c17
d637ff4
33b52e3
9125cda
4617c92
c7b9d56
a95b8e8
07ffba0
9901f3d
0aaac45
b42f408
7d31abb
0e93eb2
59dec65
047b8c8
e80d531
dfc95ca
9c9655e
814c527
4e3bc98
7b7aba8
bf0bd1b
d240381
b64fba3
65794b6
0e157dd
5674852
05de86b
fa128e1
46872d3
5214c59
81a0233
f898cb6
f8471ae
c9eb9d2
1e6e114
7ca83c3
656fb38
b469c9b
230a4d3
ffed59c
3a1be89
3ea1f3c
c719fbe
46071a5
c6700b5
9bc5840
b3cd2bf
95a6f9b
f8476c2
cbbfe6f
bb95f8d
cc3f243
b63ce95
4dc04b3
4e8d9ed
0729d39
cc61553
a7bdd21
77bd768
c06fe0f
3313322
b18c7f2
53baefd
88955db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,6 @@ The translator degrees of freedom are the inlet feed state variables: | |
* pressure | ||
* volumetric flowrate | ||
* solute compositions | ||
* cations | ||
* anions | ||
|
||
Ports | ||
----- | ||
|
@@ -47,17 +45,26 @@ Sets | |
"Inlet/outlet", ":math:`x`", "['in', 'out']" | ||
"Phases", ":math:`p`", "['Liq']" | ||
"Inlet Components", ":math:`j_{in}`", "['H2O', 'S_su', 'S_aa', 'S_fa', 'S_va', 'S_bu', 'S_pro', 'S_ac', 'S_h2', 'S_ch4', 'S_IC', 'S_IN', 'S_IP', 'S_I', 'X_ch', 'X_pr', 'X_li', 'X_su', 'X_aa', 'X_fa', 'X_c4', 'X_pro', 'X_ac', 'X_h2', 'X_I', 'X_PHA', 'X_PP', 'X_PAO', 'S_K', 'S_Mg']" | ||
"Ion", ":math:`j_{in}`", "['S_cat', 'S_an'] \ :sup:`1`" | ||
"Outlet Components", ":math:`j_{out}`", "['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']" | ||
"Readily Biodegradable COD", ":math:`r1`", "['S_su', 'S_aa', 'S_fa']" | ||
"Readily Biodegradable COD", ":math:`r2`", "['S_va', 'S_bu', 'S_pro', 'S_ac']" | ||
"Slowly Biodegradable COD", ":math:`s`", "['X_ch', 'X_pr', 'X_li']" | ||
"Unchanged Components", ":math:`u`", "['S_I', 'X_I', 'X_PP', 'X_PHA', 'S_K', 'S_Mg', 'S_IC']" | ||
"Zero Flow Components", ":math:`z`", "['S_N2', 'S_NO3', 'S_O2', 'X_AUT', 'X_H', 'X_PAO']" | ||
"Ion", ":math:`j_{in}`", "['S_cat', 'S_an'] \ :sup:`1`" | ||
"Zero Flow Components", ":math:`z`", "['S_O2', 'S_N2', 'S_NO3', 'X_H', 'X_PAO', 'X_PP', 'X_PHA', 'X_AUT']" | ||
|
||
**Notes** | ||
:sup:`1` "Ion" is a subset of "Inlet Components" and uses the same symbol j_in. | ||
|
||
Parameters | ||
---------- | ||
|
||
.. csv-table:: | ||
:header: "Description", "Symbol", "Parameter Name", "Value", "Units" | ||
|
||
"Soluble inerts from composites", ":math:`f_{sI, xc}`", "f_sI_xc", 0, ":math:`\text{dimensionless}`" | ||
"Particulate inerts from composites", ":math:`f_{xI, xc}`", "f_xI_xc", 0.1, ":math:`\text{dimensionless}`" | ||
"Carbohydrates from composites", ":math:`f_{ch, xc}`", "f_ch_xc", 0.275, ":math:`\text{dimensionless}`" | ||
"Proteins from composites", ":math:`f_{pr, xc}`", "f_pr_xc", 0.275, ":math:`\text{dimensionless}`" | ||
"Lipids from composites", ":math:`f_{li, xc}`", "f_li_xc", 0.35, ":math:`\text{dimensionless}`" | ||
"Phosphorus content of X_ch", ":math:`P_{ch}`", "P_ch", 0, ":math:`\text{dimensionless}`" | ||
|
||
.. _Translator_ADM1_ASM2d_equations: | ||
|
||
Equations and Relationships | ||
|
@@ -69,15 +76,35 @@ Equations and Relationships | |
"Volumetric flow equality", ":math:`F_{out} = F_{in}`" | ||
"Temperature balance", ":math:`T_{out} = T_{in}`" | ||
"Pressure balance", ":math:`P_{out} = P_{in}`" | ||
"Fermentable substrate conversion", ":math:`S_{F, out} = Σ_{r1} C_{r1, in}`" | ||
"Acetic acid conversion", ":math:`S_{A, out} = Σ_{r2} C_{r2, in}`" | ||
"Unchanged component conversions", ":math:`C_{u, out} = C_{u, in}`" | ||
"Ammonium conversion", ":math:`S_{NH4, out} = S_{IN, in}`" | ||
"Phosphate conversion", ":math:`S_{PO4, out} = S_{IP, in}`" | ||
"Biodegradable particulate organics conversion", ":math:`X_{S, out} = Σ_{s} C_{s, in}`" | ||
"Zero-flow component conversions", ":math:`C_{z, out} = 0`" | ||
|
||
|
||
"Biomass concentration", ":math:`bio = X_{su, in} + X_{aa, in} + X_{fa, in} + X_{c4, in} + X_{pro, in} + X_{ac, in} + X_{h2, in} + X_{PAO, in}`" | ||
"S_ac concentration", ":math:`S_{ac, 1} = S_{ac, in} + X_{PHA, in}`" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are the 1 and 2 subscripts meant to represent (e.g., S_{ac, 1} or S_{ac, 2})? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes - the 1 and 2 subscripts correspond to the concentration of the given component at steps 1 and 2 (named like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A little bit confused here, e.g., I see you set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have done that just to be explicit, and the c-code also leaves in such terms even when they are set equal to 0. I wanted to avoid somebody cross-checking our code with the c-code and wondering why a term is missing from an expression There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. X_PP is converted into S_Mg, S_K, and S_IP There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that is correct. It has no effect since it's zero. But is it possible that in the future we want to change X_PP from 0 to something else? If so, I think it's worth keeping this zero term here in the documentation and in the code itself. It's also just the most accurate representation of these equations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adam-a-a hope you could also join the talk, I am confused because I believe X_PP should be important components of the system, right now, it seems no matter the initial value of X_PP is, it will directly set to 0 and no actual conversion happens to the system. Same conditions to X_PHA and X_PAO There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh... yea there's a mistake here. S_{IP, 1} should be X_{PP, in) + ... and not S_{IP, in) + ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great catch @luohezhiming. This may or may not screw up the flowsheet again, but I'll test it out now... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will do a line-by-line review of the new translator file after this, which I just haven't had the time to do yet |
||
"S_IC concentration", ":math:`S_{IC, 1} = (bio * Ci[X_{su}] * 12) - (bio * f_{sI, xc} * Ci[S_{I}] * 12) - (bio * f_{ch, xc} * Ci[X_{ch}] * 12) - (bio * f_{pr, xc} * Ci[X_{pr}] * 12) - (bio * f_{li, xc} * Ci[X_{li}] * 12) - (bio * f_{xI, xc} * Ci[X_{I}] * 12) + (X_{PHA, in} * Ci[X_{PHA}] * 12) - (X_{PHA, in} * Ci[S_{ac}] * 12)`" | ||
"S_IN concentration", ":math:`S_{IN, 1} = (bio * Ci[X_{su}] * 14) - (bio * f_{sI, xc} * Ni[S_{I}] * 14) - (bio * f_{pr, xc} * Ni[X_{pr}] * 14) - (bio * f_{xI, xc} * Ci[X_{I}] * 14)`" | ||
"S_I concentration", ":math:`S_{I, 1} = S_{I, in} + (f_{sI, xc} * bio)`" | ||
"X_ch concentration", ":math:`X_{ch, 1} = X_{ch, in} + (f_{ch, xc} * bio)`" | ||
"X_pr concentration", ":math:`X_{pr, 1} = X_{pr, in} + (f_{pr, xc} * bio)`" | ||
"X_li concentration", ":math:`X_{li, 1} = X_{li, in} + (f_{li, xc} * bio)`" | ||
"X_I concentration", ":math:`S_{I, 1} = X_{I, in} + (f_{xI, xc} * bio)`" | ||
"S_IP concentration", ":math:`S_{IP, 1} = S_{IP, in} + (bio * Pi[X_{su}] * 31) - (bio * f_{sI, xc} * Pi[S_{I}] * 31) - (bio * f_{ch, xc} * P_ch) - (bio * f_{li, xc} * Pi[X_{li}] * 31) - (bio * f_{xI, xc} * Pi[X_{I}] * 31)`" | ||
"X_PHA concentration", ":math:`X_{PHA, 1} = 0`" | ||
"X_PP concentration", ":math:`X_{PP, 1} = 0`" | ||
"X_PAO concentration", ":math:`X_{PAO, 1} = 0`" | ||
"S_IC concentration", ":math:`S_{IC, 2} = (X_{ch, 1} * Ci[X_{ch}] * 12) + (X_{pr, 1} * Ci[X_{pr}] * 12) + (X_{li, 1} * Ci[X_{li}] * 12) - i_{CXS} * (X_{ch, 1} + X_{pr, 1} + X_{li, 1}) + (S_{su, in} * Ci[S_{su}] * 12) + (S_{aa, in} * Ci[S_{aa}] * 12) + (S_{fa, in} * Ci[S_{fa}] * 12) - i_{CSF} * (S_{su, in} + S_{aa, in} + S_{fa, in}) + (S_{va, in} * Ci[S_{va}] * 12) + (S_{bu, in} * Ci[S_{bu}] * 12) + (S_{pro, in} * Ci[S_{pro}] * 12) + (S_{AC, 1} * Ci[S_{ac}] * 12) - i_{CSA} * (S_{va, in} + S_{bu, in} + S_{pro, in} + S_{ac, 1})`" | ||
"S_IN concentration", ":math:`S_{IN, 2} = (X_{pr, 1} * Ni[X_{pr}] * 14) - i_{NXS} * (X_{ch, 1} + X_{pr, 1} + X_{li, 1}) + (S_{aa, in} * Ni[S_{aa}] * 14) - i_{NSF} * (S_{su, in} + S_{fa, in} + S_{va, in})`" | ||
"S_IP concentration", ":math:`S_{IP, 2} = X_{PP, 1} + (X_{ch, 1} * P_ch) + (X_{li, 1} * Ni[X_{li}] * 14) - i_{PXS} * (X_{ch, 1} + X_{pr, 1} + X_{li, 1}) - i_{PSF} * (S_{su, in} + S_{fa, in} + S_{va, in})`" | ||
"S_K concentration", ":math:`S_{K, 2} = S_{K, in} + X_{PP, 1}`" | ||
"S_Mg concentration", ":math:`S_{Mg, 2} = S_{Mg, in} + X_{PP, 1}`" | ||
"S_F concentration", ":math:`S_{F, out} = S_{su, in} + S_{aa, in} + S_{fa, in}`" | ||
"S_A concentration", ":math:`S_{A, out} = S_{va, in} + S_{bu, in} + S_{pro, in} + S_{ac, 1}`" | ||
"S_I concentration", ":math:`S_{I, out} = S_{I, 1}`" | ||
"S_NH4 concentration", ":math:`S_{NH4, out} = S_{IN, in} + S_{IN, 1} + S_{IN, 2}`" | ||
"S_PO4 concentration", ":math:`S_{PO4, out} = S_{IP, in} + S_{IP, 1} + S_{IP, 2}`" | ||
"S_IC concentration", ":math:`S_{IC, out} = S_{IC, in} + S_{IC, 1} + S_{IC, 2}`" | ||
"X_I concentration", ":math:`X_{I, out} = X_{I, 1}`" | ||
"X_S concentration", ":math:`X_{S, out} = X_{ch, 1} + X_{pr, 1} + X_{li, 1}`" | ||
"S_K concentration", ":math:`S_{K, out} = S_{K, 2}`" | ||
"S_Mg concentration", ":math:`S_{Mg, out} = S_{Mg, 2}`" | ||
|
||
Classes | ||
------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to rename
bio
asX_{bio}
for consistency