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

ASM1/ADM1 Translator Documentation #1000

Merged
merged 5 commits into from
Apr 13, 2023

Conversation

MarcusHolly
Copy link
Contributor

@MarcusHolly MarcusHolly commented Apr 11, 2023

Fixes/Resolves:

Bullet point in master issue #934

Changes proposed in this PR:

  • Adds documentation for ASM1/ADM1 translator block
  • Minor corrections to ADM1/ASM1 translator block documentation
  • Minor corrections to doc strings in ASM1/ADM1 translator unit model file

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@MarcusHolly MarcusHolly added documentation Improvements or additions to documentation Priority:Normal Normal Priority Issue or PR labels Apr 11, 2023
@MarcusHolly MarcusHolly self-assigned this Apr 11, 2023
@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.81%. Comparing base (7838694) to head (6c4ecde).
Report is 339 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1000   +/-   ##
=======================================
  Coverage   95.81%   95.81%           
=======================================
  Files         294      294           
  Lines       28427    28427           
=======================================
  Hits        27237    27237           
  Misses       1190     1190           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MarcusHolly MarcusHolly marked this pull request as ready for review April 11, 2023 15:05

"Nitrogen fraction in particulate products", ":math:`i_{xe}`", "i_xe", 0.06, ":math:`\text{dimensionless}`"
"Nitrogen fraction in biomass", ":math:`i_{xb}`", "i_xb", 0.08, ":math:`\text{dimensionless}`"
"Anaerobic degradable fraction of X_I and X_P", ":math:`f_{xI}`", "f_xI", 0.05, ":math:`\text{dimensionless}`"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should either (1) include links to the components tables for ASM1 and ADM1 for people to refer to follow this, or (2) the components tables for both ASM1 and ADM1 could be included directly to more easily follow the acronyms.

Option (2) would be ideal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, it would be good to do both: reference ASM1 and ADM1 property model documentation while also adding a single components section with tables for ASM1 and ADM1 components and descriptions (or two sections, i.e., ASM1 Components and ADM1 Components)

S_nd and S_s Mapping Equations
------------------------------

.. figure:: ../../../_static/unit_models/translators/mapping_step_a.jpg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to reference any figures taken from the literature. Also, we should include the relevant reference(s) towards the end of the documentation from which the formulation of this translator block (Copp Interface if I'm not mistaken) originated from.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you did the latter!

[1] Copp J. and Jeppsson, U., Rosen, C., 2006.
Towards an ASM1 - ADM1 State Variable Interface for Plant-Wide Wastewater Treatment Modeling.
Proceedings of the Water Environment Federation, 2003, pp 498-510.
https://www.accesswater.org/publications/-290550/towards-an-asm1--ndash--adm1-state-variable-interface-for-plant-wide-wastewater-treatment-modeling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link doesn't work for me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to nitpick, but the resolution on the figures is a little low.

Copy link
Contributor

@adam-a-a adam-a-a Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me take that back. I just went through readthedocs and it looks fine. When you click on the image to get a magnified view, it looks even better. One exception though for this figure: the dashed box was slightly cut off, so I would just replace with a snapshot of the full dashed box.

Copy link
Contributor

@adam-a-a adam-a-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice. I have a couple of requested changes.

@adam-a-a adam-a-a requested a review from yalinli2 April 12, 2023 02:28
Copy link
Member

@yalinli2 yalinli2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an example system using these translators? Would be cool if the user can run the example, can also help debugging.

But other than this and the one comment on S_co2, I don't have additional comments, thank you!

"Total anion equivalents concentration, S_an", ":math:`S_{an}`", "S_an"
"Carbon dioxide, S_co2", ":math:`S_{co2}`", "S_co2"

**NOTE: S_h2 and S_ch4 have vapor phase and liquid phase, S_co2 only has vapor phase, and the other components only have liquid phase**
Copy link
Member

@yalinli2 yalinli2 Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adam-a-a I'm wondering where this comment is from? Do you have another component for dissolved CO2? If S_h2 and S_ch4 can have liquid phase, I'd expect S_co2 to have liquid phase as well as it's more dissoluble in the water

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have an explicit component for dissolved/liquid-phase CO2. Perhaps @adam-a-a or @agarciadiego can elaborate more on the rationale behind this comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also asked the same question either on this or a previous PR, but based on the response I recall, the answer was our model only accounts for CO2 in gas phase on not the dissolved CO2 in liquid. I am not clear on how closely our model follows the literature on this specific aspect in terms of ASM1 model implementation, despite the fact that we know in reality there would be dissolved CO2. @agarciadiego - can you provide some insight since you worked on this part of ADM1?

@MarcusHolly
Copy link
Contributor Author

MarcusHolly commented Apr 12, 2023

@yalinli2 There are currently 2 use cases (that I know of) where this translator block is being used. The first is simply the test file for the unit model in isolation (https://github.com/watertap-org/watertap/blob/main/watertap/unit_models/translators/tests/test_translator_asm1_adm1.py) and the second is a flowsheet that consists of an ASM1/ADM1 translator block, an anaerobic digestor, and an ADM1/ASM1 translator block, but the PR is currently still a work in progress (#982)

@adam-a-a
Copy link
Contributor

@yalinli2 There are currently 2 use cases (that I know of) where this translator block is being used. The first is simply the test file for the unit model in isolation (https://github.com/watertap-org/watertap/blob/main/watertap/unit_models/translators/tests/test_translator_asm1_adm1.py) and the second is a flowsheet that consists of an ASM1/ADM1 translator block, an anaerobic digestor, and an ADM1/ASM1 translator block, but the PR is currently still a work in progress (#982)

Just to add to that, that draft PR (#982) also includes the activated sludge process (with secondary clarifier modeled as simple separator, not Takacs model yet) before the ASM1/ADM1 translator block.

@yalinli2
Copy link
Member

@MarcusHolly @adam-a-a sounds great on the user case, #1002 on BSM2 would be a very useful user example/testing case

Copy link
Contributor

@adam-a-a adam-a-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM- the only outstanding issue was referenced (#1004) for future discussion and could be resolved in a subsequent PR if needed.

@adam-a-a adam-a-a merged commit 8a58894 into watertap-org:main Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants