Commit graph

4187 commits

Author SHA1 Message Date
Harry Moffat
ea25de7fe7 Continuing transfering LiquidTransport changes, doing bugfixes, and
qualifying against our testsuite.
2012-12-15 00:49:14 +00:00
Ray Speth
55dec034ed Merge branch '2.0' into 'trunk'
Conflicts:
	README
	SConstruct
	configure.ac
	doc/sphinx/conf.py
2012-12-13 22:58:38 +00:00
Ray Speth
5b423847f2 [1D] Fixed calculation of diffusion flux due to Soret effect
Resolves Issue 132.
2012-12-13 22:46:10 +00:00
Ray Speth
c4e62b72ed [1D] Resize StFlow::m_dthermal after grid refinement
Resolves Issue 133.
2012-12-13 22:46:05 +00:00
Victor Brunini
bd653e357f Revert change to LiquidTransport. 2012-12-13 22:16:50 +00:00
Victor Brunini
4770bdd9d6 Small performance improvement, transform seems to be slightly slower
than just looping over the array.
2012-12-13 22:16:16 +00:00
Victor Brunini
a4ea58f7cc Change ThermoPhase::setStateTPX and setStateTPY functions to call
setStateTP instead of setTemperature and setPressure. Main motivation
is that the IonsFromNeutralVPSSTP child class has setTemperature and
setPressure functions that call setStateTP so this reduces duplicate
work in that case.
2012-12-13 22:16:00 +00:00
Victor Brunini
749f988e52 Convert LiquidTransport to just store a pointer to the external
gradient (T, X, V) values that it uses to compute fluxes. These
are never changed by the LiquidTransport object so there is no
reason to have them stored locally rather than just holding a pointer
to the data.
2012-12-13 22:15:35 +00:00
Victor Brunini
2eba1ee7c8 PDSS_IonsFromNeutral does not own the neutralMoleculePhase_ pointer
and the state of the neutralMoleculePhase_ is updated by the
VPSSIonsFromNeutral phase object that the PDSS_IonsFromNeutral
species object belongs to. Remove neutralMoleculePhase_->setState
calls from PDSS_IonsFromNeutral to avoid duplicate work, and make
it a const * to reflect that.
2012-12-13 22:15:14 +00:00
Victor Brunini
d4d1093957 Performance improvements focused on Stefan-Maxwell liquid transport
model for molten salts.

Summary:
- Division is expensive, replace repeated division with multiplication
  by stored 1/x.
- New and delete are expensive, make working vectors in some functions
  static so that they are not repeatedly instantiated and deleted.
- Reorder a few loops to reduce computation and hopefully cache misses.
2012-12-13 22:14:36 +00:00
Victor Brunini
4f41718e5b Make all ThermoPhase setState functions virtual. 2012-12-13 22:14:02 +00:00
Ray Speth
180d5c4813 [SCons] Fixed generation of library list in cantera.pc
Now includes cvode, sundials, ctlapack, etc. as necessary depending on the SCons
options specified.
2012-12-12 19:16:02 +00:00
Ray Speth
53891d0b23 [SCons] Include libexecstream in pkg-config libraries 2012-12-07 15:02:55 +00:00
Ray Speth
2805db17e9 [Python] Added interface to "setGridMin" in relevant 1D classes 2012-12-06 17:31:49 +00:00
Ray Speth
b4f34045a8 [1D] Added a minimum grid spacing parameter 2012-12-06 17:31:44 +00:00
Ray Speth
6ddb55e020 [1D] Fixed a case where the Newton solver could get stuck
Sometimes, while trying to solve the steady-state problem, the Newton solver
would get stuck in a loop where it couldn't find a suitable damping ratio even
after re-revaluating the Jacobian, causing it to get stuck in an loop where it
would keep re-evaluating the Jacobian at the same point (i.e. without having
made a successful damped step).

This change detects this condition and stops the Newton solver so that the 1D
solver can advance the solution by timestepping before trying to solve the
steady-state problem again.
2012-12-06 17:31:39 +00:00
Ray Speth
347029d06a [1D] Added loglevel for saving residual components
At loglevel 8, the residual after each Newton step, set of time steps, or grid
refinement is saved to 'debug_sim1D.xml'.
2012-12-06 17:31:35 +00:00
Ray Speth
d236358ec6 [1D] Fixed oscillations in grid refinement when pruning is enabled
Points which are needed to satisfy the 'ratio' requirement are not removed when
pruning. Previously, it was possible for the solver to get stuck in a loop where
the same points were added and removed after successive grid refinements.
2012-12-06 17:31:31 +00:00
Ray Speth
351423bcda [1D] Added a new log level for saving intermediate solutions
Running Sim1D::solve with loglevel set to 7 or higher will now save the solution
after each attempted steady-state solution, after timestepping, and after
regridding to the file 'debug_sim1d.xml'. This can be useful for diagnosing
convergence issues with some problems.
2012-12-04 20:28:59 +00:00
Ray Speth
2735802eb9 [1D] Updated error checking in Sim1D get/set methods 2012-12-04 20:28:53 +00:00
Ray Speth
ecb930e9f7 [1D] Added a nSpecies() method to Bdry1D 2012-12-04 20:28:43 +00:00
Ray Speth
54e4b17aa5 [Matlab] Corrected error messages generated by setState_SP 2012-11-30 22:50:47 +00:00
Harry Moffat
c6f7abbf2f Fixed a serious error in InterfaceKinetics that had crept into this branch.
Started upgrade/update of equilibrium solver
       - Fixed numerical jacobian calculation of the ln activity coefficients.
2012-11-29 02:18:05 +00:00
Harry Moffat
64d252fdbf Rolled back some of the changes that Victor made that actually
changed the S-M formula.
2012-11-26 21:37:11 +00:00
Victor Brunini
985b1f07a8 Correctly size grad_lnAC so that we don't write past the end of it
for 2D and 3D problems.

Fix the creation of the Stefan-Maxwell matrix coefficients.
2012-11-26 20:20:52 +00:00
Victor Brunini
c3233c1355 Update TransportFactory to allow the specification of the number of
dimensions in the problem and default it to 1. At present this is
only passed through to the LiquidTransport constructor.

Remove LiquidTransport member m_nDim since the base Transport class
already stores m_nDim.

Don't set m_nDim to 1 in LiquidTransport constructor, it is set by
the Transport constructor.
2012-11-26 20:19:57 +00:00
Ray Speth
5c086f77fe Bump version for 2.0.1 maintenance release 2012-11-18 02:14:22 +00:00
Ray Speth
76a24eb9ce [1D] Create initial guess before showSolution() 2012-11-14 21:07:24 +00:00
Ray Speth
6546a6b22c Made output of 1D solver more compact at loglevel 1 2012-11-14 21:07:21 +00:00
Ray Speth
0da6fb4d36 Fix Py_Logger to raise instances of Exception instead of strings
Raising string exceptions was removed in Python 2.6
2012-11-14 21:07:18 +00:00
Ray Speth
76b245e154 Python logger now flushes stdout after every call to writelog 2012-11-14 21:07:16 +00:00
Ray Speth
7ed2a02953 StFlow::_getInitialSoln now sets the solution to a valid thermodynamic state
This fixes errors that occured when the "showSolution" method was called before
explicitly setting the initial solution profile.
2012-11-14 21:07:13 +00:00
Ray Speth
e6999d1ac8 Removed duplicate clib/Python interface to class Bdry1D 2012-11-14 21:07:10 +00:00
Ray Speth
49ff2c4dbf Fix to ignore duplicate third body efficiencies in ohn.cti
Cherry-picked from 2.0 maintenance branch (r1911)
2012-11-14 21:07:07 +00:00
Ray Speth
04fb86b1ea Added a new SCons configuration variable 'warning_flags'
This allows use of more extensive warning settings for the code that's actually
part of Cantera without generating excessive warnings on code automatically
generated code (e.g. f2c) or code that isn't part of Cantera proper (e.g. gtest,
libexecstream).
2012-11-14 21:07:03 +00:00
Ray Speth
9fdb345fdd Updated .gitignore for test binaries 2012-11-14 21:07:01 +00:00
Ray Speth
8c8ef2626a Removed broken / unused input files 2012-11-14 21:06:58 +00:00
Victor Brunini
7d8a61baf1 Clean up function prototypes to avoid 'a is hidden by b' warnings
where the subclass prototype had an int and the super had a size_t
for a virtual function of the same name.
2012-11-14 00:04:05 +00:00
Victor Brunini
28171eeece Update the definition of getSpeciesFluxesES to use all size_t
instead of int to match the definition for the base Transport class.
Prior to this LiquidTransport::getSpeciesFluxesES was not overriding
the virtual Transport::getSpeciesFluxesES because the prototypes
differed.
2012-11-13 21:59:11 +00:00
Harry Moffat
79756fff7e Added files to the ignore list. 2012-11-07 23:59:08 +00:00
Harry Moffat
08a41f191c Added back constructPhaseFile() and constructPhaseXML().
All molten salt problems were broken and some brine problems were broken.
2012-11-07 23:51:30 +00:00
Harry Moffat
6e7b14c468 Added a verbose option. 2012-11-07 23:48:55 +00:00
Harry Moffat
a0b96b6fe9 Started taking out return statements. They are only used in functions. 2012-11-07 23:44:40 +00:00
Harry Moffat
83391db4fe Added back Cantera.h
Note in the near future, we'll require that all Cantera code include this file so that the environment may be set up correctly.
2012-11-07 23:41:58 +00:00
Harry Moffat
23e792f1a1 Added a CANTERA_INSTALL_ROOT Makefile variable. 2012-11-07 23:30:25 +00:00
Harry Moffat
27671cf299 Added back in getNamedStringValue() definition. Somehow it had gotten erased, causing multiple problems to fail. 2012-11-07 23:29:08 +00:00
Victor Brunini
7c70568bb3 Clean up compiler warnings. 2012-11-07 21:08:56 +00:00
Ray Speth
ba7725fb5b Fixed a problem with the VCS equilibrium solver at constant HP or UP
A sign error when limiting the temperature step caused the solver to fail if
the initial temperature was higher than sqrt(Tlow*Thigh).

Cherry-picked from trunk (r1883).
2012-11-05 19:26:11 +00:00
Ray Speth
353fb38b11 Fixed correspondence of reactor type string names to integer constants
Cherry-picked from trunk (r1869).
2012-11-05 19:26:07 +00:00
Ray Speth
2e233d0542 Fixed handling of explicit reaction orders for some reactions
For reactions with unity reactant stoichiometric coefficients, explicit values
for the forward reaction order were being ignored while setting up the
StoichManager.

Cherry-picked from trunk (r1802).
2012-11-05 19:26:04 +00:00