Eliminate several member variables which shadow variables of the
VPStandardState class, and actually contained the same information
calculated a different way.
To both check and update the cached state values. Reduces
a lot of code duplication in the use of CachedValues.
I'd like to make state1, state2, and stateNum private so
that they can only be accessed with one of the validate functions,
and also add some asserts to the validate functions that do not
use all of the state variables to ensure that the unused ones are
set to their default values to prevent the case where the wrong
validate() function is called and incorrectly determines that the
cached state is valid.
First pass at making the state variables private caused a test failure
for test_problems/statmech. The m_spthermo->update() call in
IdealGasPhase::_updateThermo() throws an exception for this test right
now that gets caught in equilibrate(). When using validate() the cached
state variable is updated before the m_spthermo->update() call and subsequently
it thinks that the thermo does not need to be updated, whereas when
cached.state1 is being set after the m_spthermo->update() call it does not get
set. The current blessed output for that test is just the text of the exception
that gets caught, so I suspect the test may not work as is.
HMWSoln: avoid recomputing lambdas if ionic strength hasn't changed.
MaskellSolidSolnPhase: Avoid recomputing activity coefficients if
r and T haven't changed.
Fix sign error in chemical potentials and update
activity coefficients accordingly.
Correct implementation of getActivityConcentrations()
Additional unit tests.
Based on Maskell, Shaw, and Tye, Electrochimica Acta 28(2) 225-230 1983.
Includes unit tests checking calculation of the chemical potential values
and parsing of the mixing enthalpy parameter from an XML file.