-
Notifications
You must be signed in to change notification settings - Fork 84
Make MCAS compatible with MVC #1691
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
base: main
Are you sure you want to change the base?
Conversation
… reducing lb on pressure in MCAS to 1e3 which allowed evaporator to pass initialization; costing also needed adjustment in scaling)
| self.pressure = Var( | ||
| initialize=101325, | ||
| bounds=(1e5, None), | ||
| bounds=(1e3, 50000000), |
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.
most important change- reducing the lower bound on pressure in MCAS! Otherwise, the evaporator cannot initialize and will remain infeasible, due to the equality constraints equating brine pressure and vapor pressure to saturation pressure.
|
|
||
| def default_energy_balance_type(self): | ||
| return EnergyBalanceType.none | ||
| return EnergyBalanceType.enthalpyTotal |
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.
another critical change for compatibility with heatexchanger. Potentially can set the energybalancetype directly in HX, but chose to update MCAS.
…reST substitution; unblock Read the Docs build
| Set ion mass fractions to achieve target TDS and electroneutrality for any ionic composition. | ||
| Algorithm: | ||
| 1. Separate ions into cations (charge > 0) and anions (charge < 0) |
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.
MCAS already does this separation.
| Algorithm: | ||
| 1. Separate ions into cations (charge > 0) and anions (charge < 0) | ||
| 2. Distribute TDS equally among all ions initially |
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.
MCAS also has a total_dissolved_solids property method that isn't error-proof (i.e., there are some known issues), but it should calculate TDS based on ions in the set.
| m.fs.costing.base_currency = pyo.units.USD_2020 | ||
|
|
||
|
|
||
| def set_electroneutral_ion_fractions(m, tds=0.1): |
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.
@tristantc unsure why we need this. It could be that there is an exceptional case here. If not, I would think that MCAS can already handle this itself without the need for an additional helper function such as this
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.
Thanks for bringing that up @adam-a-a! I'm already aware of the total_dissolved_solids [mg/L] variable and assert_electroneutrality method used to figure out ion concentrations from a given TDS in MCAS. I just included the helper function to ensure the feed TDS is 0.1 kg/kg and electroneutral for specific ions, but it's not actually required; I only added it to help reproduce the results. Anyway, I'm happy to try those out instead.
Fixes/Resolves:
Summary/Motivation:
Enabling compatibility between MCAS and MVC would eliminate need for translators and could potentially facilitate saturation index predictions later on.
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: