Commit graph

860 commits

Author SHA1 Message Date
bangshiuh
1be8374342 [1D] delete unnecessary constrain and improve the code structure 2017-09-22 18:47:18 -04:00
Ray Speth
e78aac7b70 [Examples] Clean up NonIdealShockTube example
Eliminate pandas dependency and simplify some Matplotlib usage
2017-09-18 20:26:11 -04:00
Steven DeCaluwe
2a601c148f [Examples] Add NonIdealShockTube
Import NonIdealShockTube example from Jupyter notebook

Clean up some of the code in the aforementioned file, adding better/more
descriptive commenting, add additional analysis to compare ideal gas and real
gas implementations of the n-dodecane mechanism, and add documentation for RK
constant calculation
2017-09-18 20:26:11 -04:00
g3bk47
acbd65d192 Add test for set_equivalence_ratio with sulfur 2017-09-13 10:42:34 -04:00
g3bk47
48eaedbbb4 Modify set_equivalence_ratio to support sulfur combustion
Modify set_equivalence_ratio to support sulfur combustion
2017-09-13 10:42:34 -04:00
Ray Speth
89bca5fcd1 [ck2cti] Convert surface species with specific site occupancies
Entries in the species list like "C3H6(S)/2/" are now correctly identified as a
species named "C3H6(S)" which occupies 2 surface sites.

Fixes #444
2017-08-22 00:29:35 -04:00
Ray Speth
9c3b500ec8 [ck2cti] Provide better line number in reaction-related error messages 2017-08-22 00:10:19 -04:00
Ray Speth
4b5a37a336 [ck2cti] Improve error message when failing to parse a reaction
Show the original reaction expression rather than the one where all
recognized tokens have already been replaced.
2017-08-22 00:06:22 -04:00
Ray Speth
08726b0904 [Test/Equil] Make some tests specific to the VCS solver
These tests are expected to succeed with the VCS solver. Errors that occur in
these tests should be reported as such, rather than ending up with the unrelated
errors that would be expected from the "gibbs" solver.
2017-08-21 21:29:09 -04:00
Bryan W. Weber
c88ddce0d6 [Test/1D] Test getRefineCriteria 2017-08-09 18:46:47 -04:00
Bryan W. Weber
4b44c66182 [1D/Cython] Adds Python interface to getRefineCriteria 2017-08-09 18:46:47 -04:00
Ray Speth
8a4142d4bc [Python] Raise exception when setting composition with empty array 2017-08-07 15:39:13 -04:00
Ray Speth
4c489c175d [Kinetics] Fix duplicate reaction check to handle unchanged species 2017-08-02 16:46:24 -04:00
Ray Speth
8d953a9424 [Python] Make Python module compatible with Cython 0.26
Cython 0.26 unexpectedly removed automatic conversions of C++ containers to
Python containers. Explicit casting provides the old behavior.

Fixes #465
2017-07-30 14:28:18 -04:00
Ray Speth
6bfd82e0be [Thermo] Remove unused "vacancy species" from LatticePhase 2017-07-17 23:41:44 -04:00
Ray Speth
a5b0bdf695 [Python] Make activity coefficients and activities accessible 2017-07-17 23:41:44 -04:00
Ray Speth
44b24ca873 [ctml_writer] Fix handling of third body names containing parentheses
Replace the heuristic used to remove the third body terms from the
reactant and product lists to handle species names that include
parentheses.
2017-07-12 09:16:24 -04:00
Ray Speth
6d591b82ef [ck2cti] Fix reactions with pathologically named third bodies
This changes the order in which tokens are identified to be strictly
descending in length, so that third bodies are identified correctly
even when the third body expression could potentially be interpreted
as containing a standalone species name.
2017-07-12 09:16:24 -04:00
Richard West
55a8910686 A failing unit test for chemkin files with weird names in PDep rates.
Reactions of the type
 A (+B) <=> C (+B)
ought to work, as long as they are provided a pressure-dependent rate
expression. This commit adds three examples to the test file. The first
works OK, the second two cause problems.

(For what it's worth, this currently crashes the official chemkin.
 Or at least the parentheses do; I've not tested the plus.
 Ansys have created a defect record and say they will fix the issue.)
2017-07-12 09:16:24 -04:00
Bryan W. Weber
35ac1acfa8 Clarify Valve coefficient vs function 2017-07-11 18:26:55 -04:00
Bryan W. Weber
fec6c34ed8 Remove more references to importPhase in Matlab docs 2017-07-11 18:26:55 -04:00
Bryan W. Weber
05809bb027 Fix small typos in docs 2017-07-11 18:26:55 -04:00
Bryan W. Weber
6bf74d179b
Handle bad representations of geometry flags
If geometry flags are specified rather that can't be cast to integers,
intercept the ValueError raised by Python and raise a more sensible
exception.

Fixes #446
2017-06-14 17:39:52 -04:00
Ray Speth
c092484f4d [Matlab] Deprecate npflame_init in favor of CounterFlowDiffusionFlame 2017-06-10 16:44:50 -04:00
KyleLinevitchJr
43bd96b5ba [Matlab] Make counterflow diffusion flame simulation more general
The CounterFlowDiffusionFlame (CFDF) code is able to perform more general cases
of npflame_init for multiple species fuel and oxidizer streams. The
stoichiometric mixture fraction in the CFDF code uses the Bilger definition of
mixture fraction, using the conservation of elements C, H, and O. This method is
used in the python module, but not the MATLAB npflame_init function.

Also, the CFDF code uses the fuel stream density to calculate the fuel stream
velocity and the oxidizer stream density to calculate the oxidizer stream
velocity, where as the npflame_init code uses the fuel density for both velocity
calculations.

The elementMassFraction code is a MATLAB version of the python function:
elemental_mass_fraction, which is needed to run the CFDF code.

Update the diffflame.m example to use the more general CFDF function since the
input parameters are different than the npflame_init function. This example is
the same as the diffusion_flame.py sample in the Python module.
2017-06-10 16:44:50 -04:00
bangshiuh
1057d20731 [1D] Fix IonFlow docstrings and simplify testIonFlame 2017-05-16 13:55:40 -04:00
bangshiuh
e2f718c65b [1D/Python] Add IonFlow to Python interface, with example and test 2017-05-16 13:55:40 -04:00
Jeff Santner
2a38b0a765 Allow user to set flame location
A very small change that allows the user to set the initial location of the flame. The original hard-coded values for "locs" are retained as the default, but the user can now modify locs.
2017-05-12 22:57:29 -04:00
Ray Speth
52dbe8c007 [1D] Correct handling of boundary conditions when energy equation is disabled 2017-03-29 18:46:30 -04:00
Steven DeCaluwe
51f419fbad Enabling charge-transfer/electrochemical surface reactions
The previous formulation will only consider a rection as electrochemical
if a beta value is supplied for that reaction *and* the reaction is an
'edge_reaction.'  This is problematic for two reasons: (1) many/most
charge-transfer reactions of interest occur at two-phase boundaries (see,
for example, Li-ion batteries and PEM fuel cells), not the three-phase-
boundary-like edges (which are most relevant for SOFCs).  (2) determining
whether a reaction is electrochemical or not should not rely at all upon
user input - the program itself should check to see whether charge is
transferred between phases, and the appropriate steps should be taken
during rate-of-progress calcuations.

This commit addresses the former issue.  Currently, if a charge-transfer
reaction is written as a surface_reaction, the code does not apply the
voltage correction to the forward rate.  By default, then, the entire
voltage correction is applied to the reverse reaction, which is the same
as setting beta = 0; not a good 'default' behavior (beta = 0.5 is a more
appropriate default).  With this change, surface reactions can now be
supplied with a beta value in cti or xml formats, and will be recognized
as a charge transfer reaction.

Longer term, it would be better to change the constructor routines such
that charge transfer is automatically detected and handled, rather than
relying upon user-specified flags.
2017-02-25 19:13:38 -05:00
Ray Speth
a02753ae79 [Test/ck2cti] Test pdep reactions with custom units 2017-02-20 19:14:12 -05:00
Richard West
7b7aea2038 Preserve units in PLOG entries in ck2cti
When converting chemkin into cti using ck2cti, the units were not preserved
in PLOG (pdep_arrhenius) reactions. Now they are.
2017-02-20 19:02:36 -05:00
Ray Speth
70e10632d4 [SCons] Fix implicit dependencies on 'build' step
The 'install' and 'test' targets had some undeclared dependencies on the 'build'
target, such that running 'scons install' or 'scons test' without having first
run 'scons build' would result in incomplete installation or test failures,
respectively.

Fixes #432.
2017-02-17 11:51:12 -05:00
Ray Speth
0249ce89b8 [Test] Add tests for 'OneWayFlow' and 'scale' reaction path options 2017-02-12 22:32:39 -05:00
Ray Speth
092e00744b [Kinetics] Add test that reaction path fluxes are correct 2017-02-12 22:32:39 -05:00
Ray Speth
7673f7cb52 Remove code deprecated in Cantera 2.3.0 2017-02-12 19:22:33 -05:00
Ray Speth
ed8de04e5b [Python] Fix setting mass/mole fractions for single-species phases 2017-01-31 17:41:50 -05:00
Ray Speth
6a52908d85 [Python/1D] Make current solution residuals accessible 2017-01-31 16:58:24 -05:00
Bryan W. Weber
c982f50421
[Matlab/Doc] Fix docs for enthalpies_RT function 2017-01-25 07:41:43 -05:00
Ray Speth
0fd2f7c4d0 [Kinetics] Check for unmatched duplicate reactions
Reactions which are marked as duplicates but have no matching reactions are
considered errors.

Fixes #389
2017-01-23 14:34:18 -05:00
Ray Speth
7979a2b52a Add Matlab function for checking git commit 2017-01-23 14:33:31 -05:00
Ray Speth
8e89bbb8d2 Add methods for accessing the git commit used when compiling 2017-01-20 22:43:56 -05:00
Ray Speth
886d7b7cdc Move MixMaster into a separate Python module and Git repository
MixMaster has been moved to https://github.com/Cantera/mixmaster
2017-01-20 16:16:32 -05:00
Ray Speth
4b974219b5 [SCons] Fix installation location for Debian Python packages 2017-01-12 20:23:58 -05:00
Bryan W. Weber
983b2cc015 [Matlab/Doc] Fix typos in docs for some ThermoPhase getters
These actually return scalars, although the docstrings
said they returned vectors
2017-01-03 21:57:06 -05:00
Santosh Shanbhogue
3593fad14a Fix ct2ctml when string passed as 'source' argument
Make ct2ctml create a temp cti file for a large source argument

Fixes #416
2016-12-29 22:06:27 -05:00
EmilAtz
1e08d7499c Deprecation of MatLab importPhase function
Addition of comments in importPhase to warn for function deprecation.
2016-12-21 15:39:54 -05:00
Ray Speth
2284bc9186 [Transport] Fix transport geometry flag check for charged species
Electrons should not be counted when determining the number of atoms in a
molecule and the corresponding allowable molecular geometries.
2016-12-17 19:09:37 -05:00
Bryan W. Weber
2024d0f08a [SCons] Fix calling 3to2 on Windows with conda 3to2 package
Fixes #408
2016-12-09 20:13:22 -05:00
Santosh Shanbhogue
d1df40af87 Separate transport data from comments in parseTransportData 2016-12-09 19:59:52 -05:00