Commit graph

4935 commits

Author SHA1 Message Date
Ray Speth
150a7845f8 [Numerics] Simplify solving DenseMatrix with multiple RHS 2014-03-24 04:02:41 +00:00
Ray Speth
e2dc48e45e Remove unnecessary includes of ctlapack.h 2014-03-24 04:02:34 +00:00
Ray Speth
5b6e52b5d1 [Transport] Abstract use of LAPACK in MultiTransport 2014-03-24 04:02:29 +00:00
Ray Speth
4d1622ee96 [Kinetics] Eliminate unnecessary variable solveSP::m_JacCol 2014-03-24 04:02:23 +00:00
Ray Speth
44c53a6f27 [Kinetics] Abstract use of LAPACK in solveSP and solveProb 2014-03-24 04:02:18 +00:00
Ray Speth
8933203a20 [Numerics] Fix invalid dereference in SquareMatrix::factor
The work array hasn't always been allocated, so taking its address isn't
necessarily valid. Also, dlange doesn't use the work array in the '1' norm
case anyway.
2014-03-24 04:02:12 +00:00
Ray Speth
4e72cf0334 [Numerics] BandMatrix and SquareMatrix support solving multiple RHS 2014-03-24 04:02:06 +00:00
Victor Brunini
a641992960 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.
2014-03-19 00:14:18 +00:00
Victor Brunini
935a20fc87 Some HMWSoln optimizations.
Mostly replacing some repeated divisions with 1
division and then multiplication by the inverse.
Saved ~10% on test problem of interest.
2014-03-18 23:29:09 +00:00
Victor Brunini
4c4836fd18 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.
2014-03-18 21:05:10 +00:00
Victor Brunini
a704df09d8 Convert recent changes to new caching method. 2014-03-18 18:52:29 +00:00
Ray Speth
a92d0ef03e [Test] Fix platform-dependent output in test-IAPWSPres 2014-03-18 01:42:38 +00:00
Ray Speth
6b6ccfaf7f [SCons] Allow 'clean' to be specified along with other targets 2014-03-18 01:42:34 +00:00
Ray Speth
7556b828f9 Introduce a more general method of caching results
The ValueCache class is intended to standardize the method for implementing
value caching in Cantera, and to reduce the need to introduce additional member
variables to store cached variables and the thermodynamic state at which the
cached values were computed.

The initial usage is to replace the use of the m_tlast variable in IdealGasPhase
as an example.
2014-03-18 00:48:38 +00:00
Victor Brunini
2b92ad5684 WIP on additional caching.
I'll convert this over to the new caching framework once
Ray adds it.
2014-03-17 16:03:22 +00:00
Ray Speth
3eba9641ab [SCons] Continue running test suite if Python tests crash
If the Python test suite crashes, it won't save a results file, but we can still
run the rest of the tests and report this specific failure.
2014-03-17 02:05:17 +00:00
Ray Speth
d501189ce9 [SCons] Allow boost_thread_lib to specify multiple libraries 2014-03-17 02:05:13 +00:00
Ray Speth
338a54f101 [SCons] Simplify implementation of changes in r2810
Use the correct platform-independent path separator instead of assuming that it
is ':'.

Determine the PYTHONPATH variable in a single place for each Python version.
2014-03-17 02:05:09 +00:00
Harry Moffat
26750d9af0 Reblessed two tests whose results slightly changed. 2014-03-16 03:00:54 +00:00
Harry Moffat
eb1fc02ba7 Modified License statement slightly to comply with copywrite assertion paperwork. 2014-03-16 02:58:48 +00:00
Harry Moffat
e032e9e56b Took out a print statement that caused crashes on some systems that don't define PYTHONPATH
Thanks Ray for pointing this out.
2014-03-16 02:52:55 +00:00
Harry Moffat
39651964a7 Added back Statmech and PecosTransport.
Rarefied gas dynamics is an import application area for Sandia, and
    it represents a potentially important development direction for Cantera.
    These classes provide inroads into that area.
2014-03-15 02:57:00 +00:00
Harry Moffat
3d5aa42e77 Fixed the LD_LIBRARY_PATH and PYTHONPATH specifications for scons's test suite on multiuser linux boxes.
The user's environmental variables are now passed down to the tests. Previously they had been ignored.
All of the python tests (minimal and full) had been failing for over a year or so for any installations which actually use the
LD_LIBRARY_PATH and PYTHONPATH environmental variables, which pretty much consists of all multiuser linux
machines.
2014-03-14 23:56:55 +00:00
Victor Brunini
b0ecf96cb6 Trying out a cleaner way knowing when expensive state functions need to be recomputed. 2014-03-13 23:50:31 +00:00
Ray Speth
89eab1bb48 [Thermo] Remove redundant implementations of logStandardConc
For the cases where logStandardConc just calls standardConcentration,
rely on the default implementation in class ThermoPhase.
2014-03-13 21:35:49 +00:00
Ray Speth
d0b3ad3d4b [SCons] Remove deprecated 'legacy_headers' option 2014-03-13 21:35:44 +00:00
Ray Speth
6266986d7b [SCons] Add specific targets for building the docs
Documentation can be built independently of the code by using the 'scons sphinx'
and 'scons doxygen' commands, as an alternative to using the options
'sphinx_docs=y' and 'doxygen_docs=y' to 'scons build'.
2014-03-13 21:35:39 +00:00
Ray Speth
e09c6ca304 Update compilation instructions 2014-03-13 21:35:32 +00:00
Ray Speth
f46f755057 [SCons] Remove unnecessary include directories 2014-03-13 21:35:24 +00:00
Ray Speth
2fb9ff630d Remove abandoned StatMech and PecosTransport classes 2014-03-13 21:35:11 +00:00
Victor Brunini
48ec4dc65c HMWSoln::s_update_lnMolalityActCoeff() performance improvement.
Only do the expensive update if state has changed.
2014-03-13 18:35:00 +00:00
Victor Brunini
e62ce054ce Style changes to be consistent with the rest of Cantera.
Thanks for the code review.
2014-03-13 16:49:10 +00:00
Ray Speth
df908229b1 [ctml_writer] Fix handling of units in some fields
When using Python 3, using -1 as the dummy value for density and site_density
causes probems, because the (ordered) comparison between a density specified
with units (as a tuple) and 0 is not allowed. Instead, use None as the
placeholder value.
2014-03-13 02:19:28 +00:00
Ray Speth
755164397d [ctml_writer] Improve error reporting
Print a more useful traceback for cases where exceptions are raised in ctml_writer.
2014-03-13 02:19:23 +00:00
Ray Speth
4458933420 Fix alignment of ThermoPhase::report output on Windows
Windows uses 3 digits in the exponent, for which there wasn't enough
space being allocated in the columns for the specific properties.
2014-03-13 02:19:19 +00:00
Ray Speth
b65a27e513 [SCons] Extract common default compiler flags 2014-03-13 02:19:15 +00:00
Ray Speth
94301d22ba [Scons] Use compiler-independent method for handling NDEBUG 2014-03-13 02:19:12 +00:00
Ray Speth
0ba2294af0 [SCons] Remove unnecessary compiler flags
These flags all correspond to default compiler behavior
2014-03-13 02:19:08 +00:00
Ray Speth
9b37d7d961 [SCons] Fix default compiler options with non-default compiler paths
Try to identify the compiler based on a substring match rather than the
exact string, which will still work when the full path to the compiler
is given, or a version-tagged binary is used.
2014-03-13 02:19:05 +00:00
Ray Speth
62177ebc4d [SCons] Improve detection of MinGW as the default compiler 2014-03-13 02:19:01 +00:00
Victor Brunini
584abf0d10 Performance improvements for HMWSoln and MaskellSolidSolnPhase.
HMWSoln: avoid recomputing lambdas if ionic strength hasn't changed.

MaskellSolidSolnPhase: Avoid recomputing activity coefficients if
r and T haven't changed.
2014-03-12 20:37:04 +00:00
Ray Speth
ec6b65513b [Python] Add multiprocessing example 2014-03-08 21:47:14 +00:00
Ray Speth
98c480c7c7 [Python] Fix docstring of Sim1D.restore
Resolves Issue 210.
2014-03-08 21:47:09 +00:00
Ray Speth
6a51eb88dc [Thermo] Move modifyOneHf298SS and m_tlast to ThermoPhase
This eliminates many duplicate implementations of this function and
declarations of this variable.
2014-03-08 21:46:58 +00:00
Victor Brunini
ee94266939 MaskellSolidSolnPhase: throw in unimplemented functions. 2014-03-07 17:21:14 +00:00
Victor Brunini
1565bad198 MaskellSolidPhaseSoln thermo updates.
Fix sign error in chemical potentials and update
activity coefficients accordingly.

Correct implementation of getActivityConcentrations()

Additional unit tests.
2014-03-07 17:14:13 +00:00
Victor Brunini
0981391ac4 Implement and test MaskellSolidSolnPhase::getActivityCoefficients(). 2014-03-07 00:53:33 +00:00
Victor Brunini
7abb459bbe Implement MaskellSolidSolnPhase::standardConcentrations() and getActivityConcentrations() 2014-03-06 22:30:19 +00:00
Victor Brunini
5898bf025f Implement MaskellSolidSolnPhase::getPartialMolarVolumes()
User VPStandardStateVP as base class and just return
the standard state molar volumes.
2014-03-06 20:23:23 +00:00
Harry Moffat
b328e396b0 screwed up and didn't check in a complete fix 2014-03-06 17:37:41 +00:00