Commit graph

410 commits

Author SHA1 Message Date
Ray Speth
19e3a09980 Allow '~/' as alias for user's home directory when importing cti/xml 2014-07-10 22:33:20 +00:00
Ray Speth
d5870c4e4b [Python] Allow Func1 to accept nearly-scalar types
This includes lists, tuples, and numpy arrays with a single element
2014-06-20 18:45:22 +00:00
Ray Speth
8bee138553 [Kinetics] Add access to reactant and product strings
In C++, these are the reactantString() and productString() methods.  In Python,
these are the 'reactants' and 'products' properties.

Resolves Issue 110.
2014-06-20 18:45:17 +00:00
Ray Speth
a470502932 [Transport] Replace transport_log.xml with regular text logging
Write plain text to the common Cantera logger to be more consistent with the
verbose/debug logging from other parts of Cantera. This simplifies several of
the transport initialization functions, and eliminates the need for class
XML_Writer.
2014-06-20 18:44:59 +00:00
Ray Speth
7064fd1964 [Cython/Examples] Add reactor example with ODEs implemented in Python 2014-06-20 18:43:47 +00:00
Ray Speth
fc9ba22772 [Cython] Add methods for setting unnormalized mass/mole fractions 2014-06-20 18:43:42 +00:00
Ray Speth
a33eca6684 [Python/Samples] Add Peridic CSTR example to Python module
Translated from the Matlab sample
2014-06-16 22:01:54 +00:00
Ray Speth
fd0db67172 [Matlab/Samples] Move reactor ODE functions into samples directory
These functions are used by some of the examples, and show how custom
reactor-like models can be implemented in Matlab. They are useful mostly as a
basis for user modifications.
2014-06-16 22:00:41 +00:00
Ray Speth
b4826c9b9c [Matlab/Reactor] Use 'nonorm' when setting mass fractions 2014-06-16 22:00:30 +00:00
Ray Speth
8b5ca80303 [Reactor] Implement reactor network reinitialization
Adds ReactorNet::reinitialize, which skips all one-time initialization and
re-uses the same CVODES integrator. The Reactor::syncState() method is
introduced for applying new initial conditions for individual Reactor objects.

This approach increases efficiency when solving many similar problems with short
integration times, for example when being used as the chemistry term integrator
in an operator-split CFD code.
2014-06-10 16:23:03 +00:00
Ray Speth
2558ec222d [Test] Use 'assertIn' and 'assertNotIn' where possible 2014-06-10 16:21:01 +00:00
Ray Speth
7f83a49e07 [Test] Fix some incorrect assertions 2014-06-10 16:20:53 +00:00
Ray Speth
baa787f7ac [Test] Use context handler form for 'assertRaises' 2014-06-10 16:20:31 +00:00
Ray Speth
be9882a765 [ck2cti] Import the resulting mechanism to complete validation
This relaxes the need to perform redundant validation in ck2cti.
2014-06-06 00:18:18 +00:00
Ray Speth
c29ae666c0 [CTI] Allow non-integer atomicity
This allows specification of lumped species with average compositions,
such as C10.6H21.8.
2014-06-06 00:18:13 +00:00
Ray Speth
a583949457 [Reactor] ReactorNet::addReactor takes a reference instead of a pointer
This reflects how the function is usually used. The old signature is now
deprecated, as is the extra argument for transfering "ownership" to the
ReactorNet object.
2014-06-06 00:17:41 +00:00
Ray Speth
ea3f74eb27 [Thermo] 'report' only prints species with non-trivial mole fractions
The threshold for printing species is a new, optional parameter to the
'report' function. If any species are excluded, the total number of
minor species and their aggregate mass and mole fraction are printed.
2014-06-03 16:54:15 +00:00
Ray Speth
0e9ca0fc4b [Reactor] Eliminate tracking of Reservoirs by ReactorNet
Since Reservoirs don't have any equations to solve, there is no reason to add
them to a ReactorNet.
2014-06-03 16:52:00 +00:00
Ray Speth
3e3557e756 [Test] Add more tests of the VCS equilibrium solver
These tests are based on the 'plasma_equilibrium.py' example, and include
a fairly large number of phases, some of which are only present for certain
temperature ranges.
2014-05-27 02:54:02 +00:00
Ray Speth
217b396ec5 [Python] Fix to conversion of samples from Python 3 to Python 2
Some calls to the print function weren't being converted to print statements
correctly by 3to2, so now we use the alternative fix, which is to use the
backported print function.

Fixes Issue 216.
2014-05-23 22:46:59 +00:00
Ray Speth
2df0396879 [ck2cti] Relax formatting requirement for Chebyshev coefficients.
Allow coefficient data to begin on the same line as the declaration of the
order of the polynomial in each dimension.

Fixes Issue 219.
2014-05-07 21:57:34 +00:00
Ray Speth
d6a3ea4aa7 [ck2cti] Allow stoichiometric coefficients ending in decimal points
Fixes Issue 220.
2014-05-07 21:57:22 +00:00
Ray Speth
c621d5f9db [SCons] Fix dependency resolution for some Python files 2014-05-07 21:56:57 +00:00
Ray Speth
9cddf5aaed Add test to check that error messages from ctml_writer are propagated 2014-05-06 14:39:54 +00:00
Ray Speth
5cb1c787ad [CTI] Allow omitting third body in Chebyshev reaction equations 2014-05-06 14:39:01 +00:00
Ray Speth
87bea8ae30 [CTI] Relax formatting requirements for third bodies in reaction strings
Allow 'A + B (+M)' in addition to 'A + B (+ M)'
2014-05-06 14:38:50 +00:00
Steven DeCaluwe
710393308d Editing Pitzer's acentric factor initialization 2014-04-25 11:49:34 +00:00
Steven DeCaluwe
06a88b70eb Added gas-phse kinetics to RedlichKwongMFTP class 2014-04-25 11:49:32 +00:00
Ray Speth
f8ff70ed38 [ck2cti] Make 'PCHEB' and 'TCHEB' keywords case insensitive
Fixes Issue 213.
2014-04-08 19:39:16 +00:00
Ray Speth
53820ed4a3 [Test] Remove remnants of the old Python test suite 2014-04-08 16:27:19 +00:00
Ray Speth
051381d862 [Python] Allow setting composition of sliced Solution objects
The following syntax:

    >>> phase['H2','O2'].X = [1.0, 0.5]

Is equivalent to:

    >>> phase.X = 'H2:1.0, O2:0.5'
2014-04-08 16:26:47 +00:00
Ray Speth
d19f975940 [Python] Allow setting composition using a dict
The following syntax makes it easier to set the composition programmatically,
e.g. inside a for loop:

    phase.Y = {'H2':0.1, 'O2':0.4, 'AR':0.5}
2014-04-08 16:26:34 +00:00
Ray Speth
43546f870f fpValueCheck detects (invalid) decimal ponts in exponents 2014-04-02 15:26:31 +00:00
Ray Speth
4a6dd84f81 [Thermo] Check composition strings for invalid float literals 2014-04-02 15:26:20 +00:00
Ray Speth
50344cb34f [ck2cti] Improve error messages associated with missing input files 2014-03-27 01:29:50 +00:00
Ray Speth
9e8ae80d2d [ctml_writer] Direct error/debug messages to stderr
Since stdout may be used for writing the actual output file, direct all error
and debug messages to stderr, so that they can be shown to the user when
ctml_writer is invoked via ct2ctml_string.
2014-03-27 01:29:39 +00:00
Ray Speth
5b77bbb719 [1D] Add bounds checks to setRefineCriteria 2014-03-24 21:38:22 +00:00
Ray Speth
18c756b499 [1D/Cython] Add flame speed sensitivity analysis example 2014-03-24 04:03:49 +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
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
c5eb2f57dd [Python] Make Cantera objects explicitly non-picklable and uncopyable.
Attempting to copy or pickle Cantera objects with an underlying C++ object
previously led to unexpected errors. These operations will not raise excptions
indicating the unimplemented feature.

Resolves Issue 205.
2014-03-04 17:39:21 +00:00
Ray Speth
6e72f8930f [SCons] Fix Cython module compilation with MinGW 2014-02-24 03:25:30 +00:00
Ray Speth
3e073aae27 [SCons] Force relink of Python extension when necessary 2014-02-21 19:07:58 +00:00
Ray Speth
aad284cce7 [SCons] Fix library linking issues under Cygwin 2014-02-20 03:01:01 +00:00
Bryan W. Weber
3de3842e3c [MixMaster] Fix variable ambiguity in DataFrame.py.
Fix file not closed bug in importCSV. Import from XML is broken due
to missing XML module.
2014-02-19 22:45:00 +00:00
Ray Speth
771ff96e86 [MixMaster] Fixes to use Cython function names
DataFrame.importCSV and dataFrame.importData were still using function names
from the old Python module.
2014-02-14 16:40:58 +00:00
Ray Speth
377d3877f7 [MixMaster] Fix usage of numpy.zeros and numpy.ones 2014-02-14 16:40:54 +00:00
Ray Speth
03be898300 [ck2cti] Skip non-ASCII characters in input files 2014-02-06 22:58:53 +00:00