compdyn / partmc

Particle-resolved stochastic atmospheric aerosol model
http://lagrange.mechse.illinois.edu/partmc/
GNU General Public License v2.0
28 stars 16 forks source link

Figure out a good way to include activity calculations in Jacobian contributions from condensed-phase and partitioning reactions #78

Closed mattldawson closed 5 years ago

mattldawson commented 5 years ago

Should we switch to a DAE solver and add activity coefficients to the state?

Or just have functions on the activity sub-modules that can be called to return a row of Jac contributions for a particular species' activity coefficient?

mattldawson commented 5 years ago

Three matrices are now used during Jacobian calculations. Two are the full size of the model state (including activity coefficient, constant/PSSA species, etc.) One of these is used by reactions, and the other by sub models. These are then combined into the final Jacobian that is the size of the solver state (only including solver variables). This allows sub model contributions to be included in the final Jacobian, and doesn't require any recoding of the reaction functions. This has been applied to ZSR aerosol water calculations, and will be applied to UNIFAC and PD-FiTE calculations in separate issues