-
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
ADM1/ASM2d Translator Update #1435
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1435 +/- ##
=======================================
Coverage 93.66% 93.67%
=======================================
Files 286 286
Lines 30697 30756 +59
=======================================
+ Hits 28753 28810 +57
- Misses 1944 1946 +2 ☔ View full report in Codecov by Sentry. |
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 have a few comments/questions on this.
|
||
|
||
"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 comment
The 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 comment
The 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 Sac_AD1
in the code). This translator only has 2 steps (whereas the other translator has 5).
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.
A little bit confused here, e.g., I see you set X_{PP,1} = 0
and then there are some conversion equations like S_IP
will add X_{PP,1}
, but it is set as 0, so what is the purpose for this conversion? Add 0 does not seem to have any impacts of the outcome. and where does X_PP
convert to?
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 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 comment
The 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 comment
The 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 comment
The 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 comment
The 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 comment
The 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 comment
The 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
...p/examples/flowsheets/case_studies/full_water_resource_recovery_facility/BSM2_P_extension.py
Outdated
Show resolved
Hide resolved
...p/examples/flowsheets/case_studies/full_water_resource_recovery_facility/BSM2_P_extension.py
Outdated
Show resolved
Hide resolved
...p/examples/flowsheets/case_studies/full_water_resource_recovery_facility/BSM2_P_extension.py
Outdated
Show resolved
Hide resolved
...p/examples/flowsheets/case_studies/full_water_resource_recovery_facility/BSM2_P_extension.py
Outdated
Show resolved
Hide resolved
...p/examples/flowsheets/case_studies/full_water_resource_recovery_facility/BSM2_P_extension.py
Outdated
Show resolved
Hide resolved
watertap/unit_models/translators/tests/test_translator_adm1_asm2d.py
Outdated
Show resolved
Hide resolved
watertap/unit_models/translators/tests/test_translator_adm1_asm2d.py
Outdated
Show resolved
Hide resolved
…olly/watertap into new_adm1_asm2d_interface
…olly/watertap into new_adm1_asm2d_interface
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.
Still work to do, but at least we have this passing checks without costing!
@luohezhiming let's merge this through once all checks pass and I will continue troubleshooting on PR #1467 while you work on modified ADM1 flowsheet |
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.
The BSM2_electroNP.py needs
to be deleted!
Summary/Motivation:
Correctly builds the translator block based on c-code from Flores-Alsina
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: