Skip to content

Conversation

@adam-a-a
Copy link
Contributor

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:

  • first get MCAS with only TDS as solute to work with MVC flowsheet
  • [TODO] test with more than one solute
  • [TODO] add tests

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.

… 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),
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

@ksbeattie ksbeattie added Priority:Normal Normal Priority Issue or PR PrOMMiS labels Nov 20, 2025
@adam-a-a adam-a-a requested a review from tristantc December 6, 2025 04:07
@adam-a-a adam-a-a marked this pull request as ready for review December 6, 2025 05:53
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)
Copy link
Contributor Author

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
Copy link
Contributor Author

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):
Copy link
Contributor Author

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

Copy link
Contributor

@tristantc tristantc Jan 13, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority:Normal Normal Priority Issue or PR PrOMMiS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants