Skip to content

Fix aerobic polishing oxygen deficit handling (#240)#242

Merged
yoelcortes merged 5 commits into
masterfrom
qsdsan
May 17, 2026
Merged

Fix aerobic polishing oxygen deficit handling (#240)#242
yoelcortes merged 5 commits into
masterfrom
qsdsan

Conversation

@yalinli2
Copy link
Copy Markdown
Member

@yalinli2 yalinli2 commented May 15, 2026

@yoelcortes
See issue #240 for details, with these implementations, the original codes should run (i.e., users don't need to lock gases at gas phase).

@yoelcortes
Copy link
Copy Markdown
Member

yoelcortes commented May 17, 2026

@yalinli2,

Thanks for the updates! I added a few more assertions to account for mass and atomic balances. It seems like the mass balance error is not negligible (about 0.6% more comes out than what comes in). Could you have a look to see where might this issue come from?

Also, the atomic balance is a slightly off. If the unit is not meant to account for the atomic balance (understandably because of the bulk sludge component), please feel free to remove the atomic balance test.

You can use "pull origin qsdsan" to update your local repo with my changes.

Thanks!

Consumed O2 was being re-added to air_out after already being accounted
for in combustion products, causing ~0.6% mass balance error. Remove the
erroneous air_out O2 line and drop the atomic balance assertion (elemental
imbalance is inherent to the bulk WWTsludge approximation).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yalinli2
Copy link
Copy Markdown
Member Author

@yoelcortes the bug should be fixed now, O2 was double-counted, I also removed the atomic balance check since it wasn't expected to be balanced.

Copy link
Copy Markdown
Member

@yoelcortes yoelcortes left a comment

Choose a reason for hiding this comment

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

Everything looks good now! Thanks!

@yoelcortes yoelcortes merged commit ae6e3d9 into master May 17, 2026
0 of 2 checks passed
@yalinli2 yalinli2 deleted the qsdsan branch May 18, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants