feat: Change molarity concentration to molality concentration - #3996
Open
frankfeifan wants to merge 13 commits into
Open
feat: Change molarity concentration to molality concentration#3996frankfeifan wants to merge 13 commits into
frankfeifan wants to merge 13 commits into
Conversation
frankfeifan
requested review from
MelReyCG,
corbett5 and
wrtobin
as code owners
March 16, 2026 20:16
dkachuma
approved these changes
Apr 6, 2026
…lityConcentration
…lityConcentration
…lityConcentration
frankfeifan
requested review from
jafranc,
jhuang2601 and
joshua-white
as code owners
September 1, 2026 16:43
… it in GEOS rather than HPCReact for now
1 task
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.
This PR changes convention of the concentration fed into
HPCReactfrom molarity [mol/m3 of solution] or [mol/L of solution] to molality [mol/kg of solvent] using a factor calledsolventMassPerSolutionVolume(notsolventDensityanymore) to be consistent with convention.This is a preparatory step for introducing the activity model. So now,
HPCReactis treated as a strictly molality-based library, and every conversion to a volumetric basis happens on the GEOS side through a single factor.Specific changes include:
Switched the concentration passed to HPCReact from molarity to molality, converting back at every caller: accumulation, advective and diffusive flux, Dirichlet and source terms, and their thermal counterparts.
Introduced
solventMassPerSolutionVolume[kg/m3] as an optional input on the reactive fluid model (default 1000) to serve as that conversion factor. For now, it is prescribed and kept constant, but ideally, we want to make it a function of P, T, and chemical composition. Specific implementation of methods and where these updates will be launched (GEOS or HPCReact) needs more discussions and deserves another PR.Sourced the
solventMassPerSolutionVolumefrom the solver's single reactive fluid model rather than a per-subregion scan, and turned the previously silent single-fluid-model assumption into an explicit input error, ensuring a single fluid model defined across all regions for a uniform dof layout.Restored the finite-difference Jacobian test to
dt = 1.0, since the reduction to 0.01 was a workaround for the inflated reaction term.Rebaseline
Note: No
HPCReactchange is required, as the conversion factor lives in GEOS now tentatively.