idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.77k stars 1.05k forks source link

Create GeochemistrySpeciesSwapper #14949

Closed WilkAndy closed 3 years ago

WilkAndy commented 4 years ago

Reason

Swapping species in and out of the basis occurs frequently in geochemical simulations. At the start of the simulation, the modeller swaps things in and out in order to define appropriate initial conditions and constraints. During simulation, the program swaps things in and out in order to let mineral precipitate, remove minerals with zero saturation, and for other numerical reasons. Hence, we need something that can perform these basis swaps.

Design

Take a MinimalGeochmicalDatabase (see #14948) and perform the swap. Bethke describes how to do this. Basically, the inverse of a certain square matrix is applied to the stoichiometries and equilibrium constants and bulk masses.

Impact

Enable basis swaps in geochemistry simulations. I've actually already done this and am just waiting for #14948 and #14911 to be done. Tagging @cpgr

WilkAndy commented 3 years ago

Done by above