Commit graph

4203 commits

Author SHA1 Message Date
Ray Speth
fdc13afb9f [1D] save/restore now includes the temperature fixed point
This partially addresses Issue 90.
2012-12-18 00:12:41 +00:00
Ray Speth
833ca13dc1 [1D/Python] Set pressure when restoring solution from XML file
This partially addresses Issue 90.
2012-12-18 00:11:24 +00:00
Ray Speth
1e91bd59af [1D/Cython] Set pressure when restoring solution from XML file
This partially addresses Issue 90.
2012-12-18 00:10:48 +00:00
Ray Speth
14426bfc86 [1D] Added loglevel argument to control output from save and restore
Passing loglevel=0 to Sim1D::save or Sim1D::restore will suppress all output
from these functions. The default loglevel maintains the normal level of output.
2012-12-18 00:09:29 +00:00
Ray Speth
b4218203d2 [Cython] Added tests for the 1D simulation interface 2012-12-18 00:08:08 +00:00
Ray Speth
f6c19b7456 [1D] Fixed pruning-related logging to respect the current log level 2012-12-18 00:07:46 +00:00
Ray Speth
09126726f0 [1D] Removed some spurious printing from Sim1D::setFixedTemperature 2012-12-18 00:07:26 +00:00
Ray Speth
e150fb4c45 [Cython] Added examples that use the new API for the 1D flame solver 2012-12-18 00:06:36 +00:00
Ray Speth
9601895b98 [Cython] Fixed problems with unicode strings in Python 2 2012-12-18 00:04:54 +00:00
Ray Speth
b277818347 [Cython] Added infrastructure for installing examples
This includes automatic conversion of the samples from Python 3 syntax to Python
2 syntax when building the Python 2 version of the module and the "3to2" script
is available.
2012-12-18 00:03:03 +00:00
Ray Speth
306ac961c0 [Cython] Implemented specializations of Sim1D for standard flame types
FreeFlame, BurnerFlame, and CounterflowDiffusionFlame
2012-12-18 00:01:28 +00:00
Ray Speth
fb933d5c89 [Cython] Implemented methods of class Domain1D and Sim1D 2012-12-18 00:00:01 +00:00
Ray Speth
49803de297 [Cython] Added declarations for 1D simulation components 2012-12-17 23:59:48 +00:00
Ray Speth
da92fed07c [Reactor] Fixed uninitialized variable 'm_dist' in FlowReactor 2012-12-17 23:59:43 +00:00
Ray Speth
ee2697b4b8 Fixed a compiler error caused by ambiguous call to sqrt 2012-12-17 23:59:40 +00:00
Victor Brunini
95e66cd5ff Get rid of static variables in member functions. 2012-12-17 16:14:14 +00:00
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