Repository navigation
fix: count every proton carrier in the legacy nitric planner - #511
Merged
Merged
Conversation
The alkalinity sum left out the Ca, Mg and Na phosphate complexes, NH3 and H3PO4. The reference fixture's nitric acid limit goes from 12 % to 0.2 %.
|
📖 1 file modified Preview · build overview · Flahax · built Dec. 5, 2026, 11:35 a.m. UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #511 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 155 155
Lines 18417 18421 +4
Branches 3723 3723
=========================================
+ Hits 18417 18421 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_alkalinity, which onlyplan_legacy_phreeqc_nitricuses, summed part of the protons the reduced model holds.The complex amounts are recomputed from the result's activities and the module's formation constants. The result record and the public nitric planner (MINTEQ model) are unchanged.
Closes #507
Closes #510
Evidence
PHREEQC 3.8.6, nitric acid in mol/kgw, solution of the reference fixture. The ammonium row adds 1 mmol/kgw ammonium and chloride and uses
Amm.dat; the others usephreeqc.dat. These doses were found by iterating aREACTIONon HNO3.Remaining limit
At pH 3 the dose stays 2.25 % (4.9e-5) below PHREEQC. The reduced model has no HSO4-, of which PHREEQC holds 5.3e-5 at that pH. The legacy model also keeps total sodium as free Na+ while forming NaHPO4-.
Checked against earlier work
Merge Danger
Door: two-way
Blast Radius: narrow. Doses from
plan_legacy_phreeqc_nitricrise, by about 11 % in the reference case.