Convert recent changes to new caching method.



git-svn-id: https://cantera.googlecode.com/svn/cantera/trunk@2823 02a645c2-efd0-11dd-984d-ab748d24aa7e
HMWSoln caching fixes.

Forgot to update the cached state number in a few places in 
my last commit.

Also uncovered a potential bug with m_A_Debye. m_A_Debye is only
set by A_Debye_TP() but is used by s_updatePitzer_lnMolalityActCoeff()
which could end up using an un-updated value for m_A_Debye through the
call chain:

setState_TP() -> calcDensity() -> getPartialMolarVolumes() ->
  s_update_lnMolalityActCoeff() -> s_updatePitzer_lnMolalityActCoeff()

I changed both s_updatePitzer_lnMolalityActCoeff() and s_NBS_CLM_lnMolalityActCoeff()
to call A_Debye_TP() rather than using m_A_Debye directly to ensure that they
are always using an up to date value.




git-svn-id: https://cantera.googlecode.com/svn/cantera/trunk@2824 02a645c2-efd0-11dd-984d-ab748d24aa7e
Some HMWSoln optimizations.

Mostly replacing some repeated divisions with 1
division and then multiplication by the inverse.
Saved ~10% on test problem of interest.



git-svn-id: https://cantera.googlecode.com/svn/cantera/trunk@2825 02a645c2-efd0-11dd-984d-ab748d24aa7e
Add validate() functions to CachedValue.

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.



git-svn-id: https://cantera.googlecode.com/svn/cantera/trunk@2826 02a645c2-efd0-11dd-984d-ab748d24aa7e