Skip to content

Conversation

@agarciadiego
Copy link
Contributor

@agarciadiego agarciadiego commented Oct 24, 2024

Addresses Issue:

Lack of prediction from previous precipitation data

Summary/Motivation:

Precipitation requires function to calculate precipitation based on acid dosage

Changes proposed in this PR:

-Adds isotherm form calculation for oxalate precipitation based on acid dosage
-Data based on Visual Minteq

Reviewer's checklist / merge requirements:

  • The head branch (i.e. the "source" of the changes) is not the main branch on the PR author's fork
  • Documentation
  • Tests
  • Diagnostic tests for models

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.md 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.

@agarciadiego agarciadiego self-assigned this Oct 24, 2024
@agarciadiego agarciadiego added Priority:High High Priority Issue or PR enhancement New feature or request labels Oct 24, 2024
@agarciadiego agarciadiego mentioned this pull request Oct 24, 2024
4 tasks
@codecov
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

❌ Patch coverage is 96.22642% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.20%. Comparing base (c4e54b3) to head (f340965).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/prommis/precipitate/precipitator.py 88.31% 9 Missing ⚠️
src/prommis/precipitate/precipitate_reactions.py 92.00% 4 Missing ⚠️
src/prommis/precipitate/tests/test_precipitator.py 99.01% 2 Missing ⚠️
src/prommis/uky/uky_flowsheet.py 95.83% 2 Missing ⚠️
src/prommis/leaching/leach_flowsheet_dynamic.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #99      +/-   ##
==========================================
- Coverage   97.24%   97.20%   -0.05%     
==========================================
  Files          93       94       +1     
  Lines       12581    12865     +284     
==========================================
+ Hits        12234    12505     +271     
- Misses        347      360      +13     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@andrewlee94 andrewlee94 left a comment

Choose a reason for hiding this comment

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

A few minor suggestions - I will not formally request changes just in case this is not ready by the time I leave so as not to hold things up with messing around to override my request.

)

self.acid_flow = Var(
units=units.dimensionless,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like it really should have dimensions.

Also, how reliably can be define the upper bound for this (which probably depends on the units)?


# parameter based on pH 1.5
# TODO add surrogate model/equation
self.E_D = Param(
Copy link
Collaborator

Choose a reason for hiding this comment

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

A more descriptive name and/or a doc string would be good here as I do not really know what I am looking at at the moment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seconding this point


# parameter based on pH 1.5
# TODO add surrogate model/equation
self.N_D = Param(
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@MarcusHolly
Copy link
Contributor

Seems like this PR still needs to address Andrew's comments as well as resolving some of the flow_mol_comp[Ca(C2O4)] variables being outside of their bounds.

@ksbeattie
Copy link
Contributor

@agarciadiego, any news on this?

@bpaul4 bpaul4 self-requested a review August 11, 2025 15:09
Copy link
Contributor

@MarcusHolly MarcusHolly left a comment

Choose a reason for hiding this comment

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

A few more very minor comments

Comment on lines +176 to +177
dt.report_structural_issues()
dt.display_overconstrained_set()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can remove these now

def test_structural_issues(self, SolEx_frame):
model = SolEx_frame
dt = DiagnosticsToolbox(model)
dt.report_structural_issues()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can remove this now

Comment on lines +261 to +263
print("Testing Results")
# scaled_model.fs.precipitator.aqueous_outlet.display()
scaled_model.fs.precipitator.precipitate_outlet.display()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can remove this (I left it there by accident)


solve_system(m)

dt.assert_no_numerical_warnings()
Copy link
Contributor

Choose a reason for hiding this comment

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

This can probably be added back in

@ksbeattie ksbeattie assigned bwang355 and unassigned agarciadiego Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Priority:High High Priority Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants