Compare commits

...

409 commits

Author SHA1 Message Date
Bryan W. Weber
ba330a797e Create FUNDING.yml
Links to NumFOCUS donate page
2019-11-23 13:15:21 -05:00
Ingmar Schoegl
e320ec785e [Examples] add version info to ic_engines.py 2019-11-18 18:07:09 -05:00
Ingmar Schoegl
088c52fff2 [ck2cti] fix surface reactions with explicit reverse rate 2019-11-18 17:53:59 -05:00
Ingmar Schoegl
719cb3d2b7 [Data] remove zero T2 value from TROE 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
197c69a476 [YAML] preserve zero in Troe T2 input 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
5bc81bf397 Finalize cleanup of warning messages 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
334a496267 [YAML] read exact Troe/SRI parameters 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
456bc32f23 [Transport] reformat warnings 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
72082d026a [Equil] reformat warnings 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
7d72cc9baa [Thermo] reformat warnings 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
f67d9113db [Kinetics] issue warning for zero T2 Troe coefficient 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
2fdbce42b2 [OneD] reformat warnings 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
f5f7227e79 [Thermo] reformat NasaPoly2::validate warning 2019-11-10 22:56:20 -05:00
Ingmar Schoegl
1cc87f4372 [Base] introduce warn_user 2019-11-10 22:56:20 -05:00
Ray Speth
02c433b9a2 [Doc/Input] Document phase-level setting for Motz-Wise in YAML files 2019-11-09 11:53:16 -05:00
Ray Speth
d4f9717c1c [Input] Fix handling of global Motz-Wise flag in cti2yaml 2019-11-09 11:53:16 -05:00
Bryan W. Weber
efb246d73a [cti2yaml] Add failing test of Motz-Wise option
The global Motz-Wise option is not added to the phase specification
2019-11-09 11:53:16 -05:00
Ingmar Schoegl
21de00c549 [Kinetics] update unit tests to probe falloff type 2019-11-08 15:18:26 -05:00
Ingmar Schoegl
e2bfba328c [Kinetics] deprecate magic numbers for falloff reactions 2019-11-08 15:18:26 -05:00
Ingmar Schoegl
58063b498a [Kinetics] deprecate magic number types in RxnRates.h 2019-11-08 15:18:26 -05:00
Ingmar Schoegl
91c7bf14d7 [Base] finalize introduction of Solution object in C++ layer 2019-11-08 15:12:36 -05:00
Ingmar Schoegl
cf315f7c5e [oneD] change thermo type passed to StFlow constructor
- allow for 'ThermoPhase`, and cast to 'IdealGasPhase' internally
2019-11-08 15:12:36 -05:00
Ingmar Schoegl
2a9554c134 [Base] consolidate shared_ptr access in Solution 2019-11-08 15:12:36 -05:00
Ingmar Schoegl
58fc8f770c Replace doublereal by double 2019-11-08 15:12:36 -05:00
Ingmar Schoegl
d730b4c5e8 Deprecate (previously) used convenience wrapper classes
- IdealGasMix.h and Interface.h
2019-11-08 15:12:36 -05:00
Ingmar Schoegl
eda3b2fbfb Deprecate (previously) unused convenience wrapper classes
- Edge.h, IncompressibleSolid.h and Metal.h
2019-11-08 15:12:36 -05:00
Ingmar Schoegl
9f6cba3c33 [samples] replace convenience wrapper classes by C++ Solution 2019-11-08 15:12:36 -05:00
Ingmar Schoegl
a0350925a7 [test_problems] replace convenience wrapper classes by C++ Solution
- Remove dependence on IdealGasMix.h
2019-11-08 15:12:36 -05:00
Ingmar Schoegl
40ae5b5fb5 [Base] implement initialization of C++ Solution from input files
- implement constructor that loads ThermoPhase, Kinetics, and Transport
from input files (wrapping factory class methods)
- logic for selection of transport manager follows Python object
- add convenience methods to type-cast frequently used classes
2019-11-08 15:12:36 -05:00
Ingmar Schoegl
43d02e95e3 [Scons] prevent installation to source directory 2019-11-07 10:35:53 -05:00
Ray Speth
ce47733c42 [Test] Fix coverage consistency issue in getMixDiffCoeffsMole 2019-11-02 15:43:05 -04:00
Ray Speth
6dbcd94029 [Doc] Fix alphabetization of thermo and species thermo models 2019-11-02 10:42:35 -04:00
Ray Speth
71ba021467 Add sticking coefficients to CTI API docs 2019-11-02 10:42:35 -04:00
CyberDrudge
65f7b16f01 Implemented function to list data files
Update function to list data files

Follow Style Guidelines

Add doc for listing files
2019-11-01 22:18:59 -04:00
Ray Speth
a5b28ba799 [Input] Fix conversion of Ion transport in cti2yaml 2019-11-01 22:16:45 -04:00
Ray Speth
bddb339198 [Input] Fix handling of skip_undeclared_third_bodies in cti2yaml 2019-11-01 22:16:45 -04:00
Bryan W. Weber
69393e9307 [cti2yaml] Add failing ch4_ion test 2019-11-01 22:16:45 -04:00
Ingmar Schoegl
eb02fa9726 Update issue templates
Fixes #698. Further:
- Add SUPPORT.md
- Move community help files to .github folder
2019-11-01 22:16:06 -04:00
Ingmar Schoegl
54c12fc59c [Thermo] add support for concentration string in findIsomers 2019-10-29 21:26:57 -04:00
Ingmar Schoegl
4f42164443 [Thermo] add unit tests for add_species_alias and find_isomers 2019-10-29 21:26:57 -04:00
Ingmar Schoegl
3ef99f966c [Thermo] add functions findIsomer/addSpeciesAlias 2019-10-29 21:26:57 -04:00
Ingmar Schoegl
a85396ef11 [Input/Scons] make gri30 consistent with latest online version
Updated version keeps input and thermo separate, which requires minor
changes in the build scripts.
2019-10-29 21:00:36 -04:00
Ingmar Schoegl
1e01054bf5 [Thermo] eliminate SolutionArray._extra_arrays 2019-10-25 15:06:31 -04:00
Ingmar Schoegl
cd67962004 [Thermo] add ability to sort SolutionArray objects 2019-10-25 15:06:31 -04:00
Steven DeCaluwe
f02ca90e2c Updating citation info for li ion battery example. 2019-10-24 22:16:52 -04:00
Ingmar Schoegl
76901b7f50 [ReactorNet] improve handling of max_time_step
* implement ReactorNet::maxTimeStep to allow for external queries
* implement getter/setter for property ReactorNet.max_time_step
* deprecate ReactorNet.set_max_time_step
2019-10-24 20:31:54 -04:00
Ingmar Schoegl
3b7eb0dc8d [Scons] use consistent phase names (CTI/XML vs YAML) 2019-10-23 21:39:53 -04:00
Ray Speth
a221c632f4 [Test] Add tests for ck2yaml 2019-10-23 13:54:59 -04:00
Ray Speth
5cca4f22df [Input] Preserve comment after last reaction in ck2yaml 2019-10-23 13:54:59 -04:00
Ray Speth
8665eda3c1 [Input] Fix error message for unrecognized section in ck2yaml 2019-10-23 13:54:59 -04:00
Ray Speth
a085bc1f43 [Input] Check that all species have thermo before writing YAML file 2019-10-23 13:54:59 -04:00
Ray Speth
6c8adf47b3 [Input] Normalize YAML reaction equation for Chebyshev reactions
Fix the reaction equation to always include the (+M). Previously, if the (+M)
was omitted, an invalid reaction string was generated.
2019-10-23 13:54:59 -04:00
Ingmar Schoegl
ee41824b1e [SpeciesThermo] address review comments 2019-10-23 13:53:56 -04:00
Ingmar Schoegl
650db397b2 [SpeciesThermo] load piecewise-Gibbs from YAML 2019-10-23 13:53:56 -04:00
Ingmar Schoegl
d43774e721 [SpeciesThermo] enable cython constructors for Nasa9PolyMultiTempRegion
Further:
* Add unit tests for ShomatePoly2 and Mu0Poly
2019-10-23 13:53:56 -04:00
Ingmar Schoegl
cb0e1f1509 [SpeciesThermo] add unit tests 2019-10-23 13:53:56 -04:00
Ingmar Schoegl
cf8d2efa09 [SpeciesThermo] assign nCoeffs in C++ layer 2019-10-23 13:53:56 -04:00
Ingmar Schoegl
5ab15e15ce [SpeciesThermo] add initial Cython classes
- n_coeffs remains to be addressed (needed: number of zones)
2019-10-23 13:53:56 -04:00
Ingmar Schoegl
dc66407cf2 [Thermo] address code review comments 2019-10-23 13:45:29 -04:00
Ingmar Schoegl
63da219947 [Thermo] deprecate name/id support in Phase::speciesIndex 2019-10-23 13:45:29 -04:00
Ingmar Schoegl
7c08e17f08 [Thermo] deprecate Phase::id and Phase::setID
* Merge usage of 'id' and 'name' in the context of Phase objects
* Raise deprecation warnings for Phase::id and Phase::setID
2019-10-23 13:45:29 -04:00
Ingmar Schoegl
6e5d45273a [Thermo] replace 'phase_id' by 'name'
* 'name' corresponds to the YAML entry
* rename Solution keyword 'phaseid' to 'name' (instead of 'phase_id')
* rename ck2yaml argument '--id' to '--name' (instead of '--phase-id')
* ensure that C++ Phase::m_id is always the same as Phase::m_name
2019-10-23 13:45:29 -04:00
Ingmar Schoegl
5928d63746 [Thermo] address discussion and review comments
* rename C++ object to 'Solution' (from 'SolutionBase')
* remove 'phaseID' from 'Solution' ('id' remains assigned to 'Phase')
* remove 'type' from C++ object (no polymorphism anticipated)
* assign 'name' to 'Solution' (link back from 'Phase' until deprecated)
* clarify 'phase' as 'phase_id' in Python interface
* address various feedback in review comments
2019-10-23 13:45:29 -04:00
Ingmar Schoegl
b5e4f25454 [Input] rename --id to --phase in ck2yaml options
The option --phase is consistent with the resulting yaml entry in 'phases'.
The --id option is still supported, with a warning being issued.
2019-10-23 13:45:29 -04:00
Ingmar Schoegl
3bf09fbd7f [Base] rename Base.h/.cpp to SolutionBase.h/.cpp 2019-10-23 13:45:29 -04:00
Ingmar Schoegl
af04f97d0e [Base] use FutureWarning for deprecated keywords 2019-10-23 13:45:29 -04:00
Ingmar Schoegl
fef352b9d5 [Base] update docstrings for Solution and Interface objects
* Reflects changes to `phase` and `adjacent` keyword
2019-10-23 13:45:29 -04:00
Ingmar Schoegl
d8e09a9550 [Base] clarify keyword arguments of _SolutionBase initializers
* Replace `phaseid` by `phase`
* Replace `phases` by `adjacent`
* Add deprecation warnings and update unit tests
2019-10-23 13:45:29 -04:00
Ingmar Schoegl
dbac2fc79c [Base] replace Solution property ID by phase in Python
* Clarifies the meaning of ID
* Creates a PEP8 compliant attribute that does not conflict with
a built-in function name that is also consistent with the YAML entry.
* Change associated member function names in C++ SolutionBase
* Deprecate `ID` in Python (to be removed after Cantera 2.5)
2019-10-23 13:45:29 -04:00
Ingmar Schoegl
b926a31faf [Base] break out thermo/kinetics manager types to Python 2019-10-23 13:45:29 -04:00
Ingmar Schoegl
f71954ac96 [Base] associate phase ID with SolutionBase object 2019-10-23 13:45:29 -04:00
Ingmar Schoegl
b5137d40a3 [Base] remove redundant unique_name attribute
* Resolve conflation of gas.ID and gas.name in unit tests
* Also fixes #691
2019-10-23 13:45:29 -04:00
Ingmar Schoegl
799ef81518 [Base] link managers back to SolutionBase 2019-10-23 13:45:29 -04:00
Ingmar Schoegl
486e2ba9b8 [Base] add unit test probing methods of C++ SolutionBase 2019-10-23 13:45:29 -04:00
Ingmar Schoegl
afd36b1c1e [Base] create SolutionBase object in C++
* Add Base.h/Base.cpp with definition of SolutionBase
* Link C++ object into Cython interface
* Add unique_name and type attributes to Cython _SolutionBase
2019-10-23 13:45:29 -04:00
Ray Speth
c149c4ed73 [CI] Copy doc archive to cantera.org
In order to generate links to pages in the development docs, the
cantera-website build process needs a local copy of the current dev docs,
which this provides in a format which can be easily downloaded.
2019-10-14 10:22:37 -04:00
Bryan W. Weber
55fe2233b1 [Thermo/YAML] Rename water-IAPWS95 to liquid-water-IAPWS95
The water-IAPWS95 instantiates either WaterSSTP or PDSS_water objects,
both of which are intended for liquid phases only. Clarify the phase
name to liquid-water-IAPWS95 to allow a future phase that could
represent the full liquid<->vapor phase space.
2019-10-06 16:45:21 -04:00
Ingmar Schoegl
fe7be79552 [Thermo] improve error messages
Incorporate reviewer suggestions for error messages (user feedback) in
PureFluid.TPX setter and SolutionArray.restore_data
2019-10-02 22:16:55 -04:00
Ingmar Schoegl
074fd2cd74 [Thermo] adopt review comments for SolutionBase.restore_data 2019-10-02 22:16:55 -04:00
Ingmar Schoegl
2b61d3ad4a [Thermo] add read_hdf and update docstrings 2019-10-02 22:16:55 -04:00
Ingmar Schoegl
213612bd33 [Thermo] recreation of SolutionArray objects from stored data
This commit implements new methods for SolutionArray:
* `restore_data` can restore data previously exported by `collect_data`
* `read_csv` restores data previously saved by `write_csv`
* unit tests are added for SolutionArray's based on ThermoPhase and PureFluid
2019-10-02 22:16:55 -04:00
Ingmar Schoegl
378c6da18b [Thermo] add setter TPX to PureFluid
* setter for `PureFluid.TPX` property is added to allow for automatic
restoration of consistent thermodynamic data
* alternative to 'TP', 'TX' or 'PX' which may not uniquely describe
a valid thermodynamic state
* add unit test
2019-10-02 22:16:55 -04:00
Ray Speth
69f33a8631 [Input] Check that Chebyshev coefficient matrix is rectangular 2019-09-27 17:11:18 -04:00
Ray Speth
ecce98c1dc [Kinetics] Fix Chebyshev rate evaluation with only 1 point in T or P 2019-09-27 17:11:18 -04:00
Ray Speth
b44f189569 [Thermo] Avoid NaN in entropy with small negative mass fractions
Avoid NaN results in entropy_mole calculations when there are small negative
mass fractions. Consistent with the approach used elsewhere,
e.g. IdealGasPhase::getPartialMolarEntropies.
2019-09-24 17:38:15 -04:00
Paul
c4aff04418 Updated URL in references to Cantera's license. 2019-09-23 22:02:33 -04:00
Ingmar Schoegl
9ce255302e Implement faster fallback for non-canonical/lowercase name lookup 2019-09-23 21:53:06 -04:00
Ingmar Schoegl
5e692e893a Isolate lowercase fallback in speciesIndex 2019-09-23 21:53:06 -04:00
Ingmar Schoegl
717635d3e6 Add case-sensitive/lowercase logic to Phase::species
Further:
* revert unit tests to previous species definitions (some case mis-matches)
* remove non-essential comments
* opt to maintain case-sensitive species maps with lowercase as fallback
2019-09-23 21:53:06 -04:00
Ingmar Schoegl
76dd997692 [Thermo] update unit tests to handle case sensitive species names 2019-09-23 21:53:06 -04:00
Ingmar Schoegl
2231141e32 [Thermo] add flag that makes species names case sensitive
* store species information with case sensitive names
* retain lookup for non-case sensitive species names, e.g. Phase::speciesIndex
* implement flag that enforces case sensitive species names as a member
variable of Phase
* add exception handling for species that are not uniquely defined unless case
sensitive (e.g. Cs and CS in nasa.cti if cs is specified and case sensitivity
is not enforced)
* deprecate Phase::species(std::string&)
2019-09-23 21:53:06 -04:00
Ingmar Schoegl
e0fe5eed59 [Thermo] fix compiler warning for RedlichKwongMFTP 2019-09-23 21:53:06 -04:00
Ray Speth
265a1860cc [1D] Disable free flame domain width check when auto=False
Solving with auto=True and then solving with auto=False would leave the domain
width check in place, but without the logic for automatically increasing the
domain width, resulting in unexpected solver failures.
2019-08-13 12:48:45 -04:00
Ingmar Schoegl
7ac09108c9 Update .gitignore 2019-08-13 11:33:40 -04:00
Ingmar Schoegl
eff23b6f82 Update ic_engine example using new cantera capabilities 2019-08-13 11:33:40 -04:00
Ingmar Schoegl
eea04255fd [Thermo] add write_hdf to SolutionArray objects
* The commit implements saving of data extracted from SolutionArrays
 to HDF containers using pandas infrastructure.
 * Two methods are introduced: `write_hdf` and `to_pandas`.
 * Both methods only work if the pandas module can be imported; an
 exception is raised only if the method is called without a working
 pandas installation.
2019-08-13 11:32:51 -04:00
band-a-prend
5184ebccba Fix "catching polymorphic type" GCC 8 warnings
The "catching polymorphic type" warnings appear during compilation with GCC 8:

src/base/global.cpp: In function ‘void Cantera::setLogger(Cantera::Logger*)’:
src/base/global.cpp:28:19: warning: catching polymorphic type ‘class std::bad_alloc’ by value [-Wcatch-value=]
     } catch (std::bad_alloc) {
                   ^~~~~~~~~

src/equil/vcs_MultiPhaseEquil.cpp: In member function ‘int Cantera::vcs_MultiPhaseEquil::equilibrate_HP(doublereal, int, double, double, int, int, doublereal, int, int)’:
src/equil/vcs_MultiPhaseEquil.cpp:228:31: warning: catching polymorphic type ‘class Cantera::CanteraError’ by value [-Wcatch-value=]
         } catch (CanteraError err) {
                               ^~~

src/equil/vcs_MultiPhaseEquil.cpp: In member function ‘int Cantera::vcs_MultiPhaseEquil::equilibrate_SP(doublereal, double, double, int, int, doublereal, int, int)’:
src/equil/vcs_MultiPhaseEquil.cpp:354:31: warning: catching polymorphic type ‘class Cantera::CanteraError’ by value [-Wcatch-value=]
         } catch (CanteraError err) {
                               ^~~

This commit fix this warnings via caught by reference.
2019-08-10 15:07:44 -04:00
band-a-prend
1606ce1565 Remove m_iter variable and deprecate setIterator function
Remove m_iter variable and deprecate setIterator function
because only Newton (CV_NEWTON) iteration method is used.
2019-08-09 18:08:47 -04:00
band-a-prend
6a8d7f7de3 Fix building Cantera against Sundials 4.x library
The changelog of Sundials 4.0.0 states:

"With the introduction of SUNNonlinSol modules, the input parameter iter
to CVodeCreate has been removed along with the function CVodeSetIterType
and the constants CV_NEWTON and CV_FUNCTIONAL.
Similarly, the ITMETH parameter has been removed from the Fortran interface
function FCVMALLOC. Instead of specifying the nonlinear iteration type
when creating the CVODE(S) memory structure, CVODE(S) uses
the SUNNONLINSOL_NEWTON module implementation of a Newton iteration by default."

so the appropreate conditional changes are added to control
the code execution via CT_SUNDIALS_VERSION preprocessor variable
to omit the parameters of Sundials solver that are no longer required.
2019-08-09 18:08:47 -04:00
band-a-prend
3b948e17d4 Simple fix for Sundials 3.2 compatibility
The Sundials 3.1 and 3.2 are compatible with each other
so this patch just allows to pass check for the installed Sundials 3.2
2019-08-09 18:08:47 -04:00
Ingmar Schoegl
97356a48df Add set_equivalence_ratio to SolutionArray objects 2019-08-09 17:39:10 -04:00
Ray Speth
27f30c6a2d Use more precise atomic masses for deuterium and tritium 2019-08-09 15:15:30 -04:00
Bryan W. Weber
fc01d7f3de Make format of atomic weights struct consistent
In the atomic weights struct in Elements.cpp, ensure that there is no
space before the closing brace of an element and that there is one
space between the longest element name and a 3-digit weight.
2019-08-09 15:15:30 -04:00
Bryan W. Weber
ded50547f9 Update test results changed by constants and elements
Update reference values and blessed files in regression tests.
2019-08-09 15:15:30 -04:00
Bryan W. Weber
b5a7575bc0 [Doc] Fix element function exception documentation
For several elements-related functions, the documentation listed
incorrect or incomplete exceptions that could be thrown from that
function.
2019-08-09 15:15:30 -04:00
Ray Speth
a7363e4b54 Update mass of electron "element" to 2018 CODATA value 2019-08-09 15:15:30 -04:00
Ray Speth
7461c3c960 Fix data for thallium in elements.xml
The entry for element with atomic number 81 incorrectly had the atomic symbol
and standard entropy for titanium.
2019-08-09 15:15:30 -04:00
Bryan W. Weber
dc96fb5fe8 Update atomic weights with 2018 IUPAC/CIAAW data
Use data from the periodic table at
http://www.ciaaw.org/atomic-weights.htm and
https://iupac.org/wp-content/uploads/2018/12/IUPAC_Periodic_Table-01Dec18.pdf
Elements without any atomic weight in either table do not have a stable
isotope. These are deleted from elements.xml and have their atomic
weight set to -1.0 in Elements.cpp. Add elements after plutonium that
were not previously listed. None of these elements have stable
isotopes.

These elements are retained/added so their symbols, names, and atomic
numbers can still be retrieved and the mapping of atomic number to
index - 1 in the struct is maintained.

Modify the element weight lookup functions to throw errors when an
element with no weight is requested (i.e., the weight is -1.0 in the
struct).
2019-08-09 15:15:30 -04:00
Bryan W. Weber
541fddb15e Rearrange the physical constants 2019-08-09 15:15:30 -04:00
Bryan W. Weber
3e6e57edbf Change all doublereal in ct_defs to double 2019-08-09 15:15:30 -04:00
Bryan W. Weber
3e4842be9e Update physical constants with CODATA 2018 values
These values include the redefinition of the kilogram. The data were
released on 20 May, 2019.
2019-08-09 15:15:30 -04:00
Ingmar Schoegl
bbdc790257 Address error C2512 when compiling with Visual Studio
Using a default value, VS2019 (VC 14.1) complains about a missing default constructor for UnitSystem.
2019-08-05 21:56:25 -04:00
Ingmar Schoegl
bc8b4be654 [Reactor] clarify FlowDevice interface
* differentiated Valve::setValveCoeff from PressureController::setPressureCoeff
 and introduced MassFlowController::setMassFlowCoeff for consistency.
 * introduced FlowDevice::setTimeFunction and FlowDevice::setPressureFunction to
 differentiate time-dependent and pressure-dependent functions.
 * introduced arbitrary pressure dependence for PressureController
 * deprecated FlowDevice::setFunction which is replaced by time and pressure
 specific functions.
 * introduced properties Valve.valve_coeff / PressureController.pressure_coeff /
 MassFlowController.mass_flow_coeff in Cython interface and deprecated
 Valve.set_pressure_coeff / PressureController.set_pressure_coeff
 * deprecated corresponding function calls in clib interface
 * deprecate FlowDevice.setParameters (which was only used by MATLAB interface)
2019-08-05 17:01:05 -04:00
agarwalrounak
7523022d71 Update diamond.cti and diamond_cvd.py
Replace data/inputs/diamond.cti with test_problems version that has
more information. This results in a change in the default pressure and
mole fractions of the gas phase, which in turn changes the result of
one of the regression tests. This is fixed by setting the composition
and pressure of the gas phase in the test to their original values. The
default state from the CTI file matches from the paper.

In addition, there was a difference in the reversibility of reaction u
between the files. Since the thermo for C(d) specifies that the
reaction is irreversible, this is the sense of the reaction that is
chosen.

Include plotting in the diamond_cvd.py and use open properly.
2019-08-05 14:09:03 -04:00
Bryan W. Weber
bfa5a66ed3 [SCons] Remove fmt from linking
We use the header-only version of fmt now, so no need to link to the
compiled library.
2019-08-01 18:10:00 -04:00
Bryan W. Weber
c0f019407e [SCons] Link to yaml-cpp when using system libs
Similar to the system_sundials option, libyaml-cpp must be added to the
linker line when the system libraries are used.
2019-08-01 18:10:00 -04:00
Sebastian Pinnau
dda89663ea [SCons] Add yaml-cpp to shared libraries if building with system yaml-cpp
If building Cantera with system_yamlcpp=y the yaml-cpp library needs to be
specified in the linker flags.

Fixes #668
2019-08-01 18:10:00 -04:00
Kyle Niemeyer
6852087ff5 Fixed typo in ctml_writer.py
"explcit" -> "explicit"
2019-08-01 15:56:45 -04:00
band-a-prend
582eb42b2f cantera: Fix passing 'python_prefix' variable into installation path
The '${python_prefix}' substring for installation prefix path
was accepted as mapping key for '.format()' function resulting in
a 'KeyError' failure of 'cantera/interfaces/cython/SConscript' script
in case of `env[libdirname] == 'lib64'`.

Moreover the early applied pull request[1] didn't take into account
the additional setting of installation prefix path in the cases
when 'libdirname' takes values different from 'lib64'.

This patch resolves both those issues.

[1]: https://github.com/Cantera/cantera/pull/661
2019-08-01 15:53:20 -04:00
Ingmar Schoegl
d263566670 [Reactor] Deprecating magic numbers.
* add deprecation warning for int ReactorBase::type() (to be changed after Cantera 2.5)
 * introduce temporary std::string ReactorBase::typeStr() (to be renamed after Cantera 2.5)
 * deprecate all functions using the old call and introduce associated temporary functions
2019-08-01 15:37:48 -04:00
Ingmar Schoegl
77295b2103 Update AUTHORS list 2019-08-01 15:37:48 -04:00
Bryan W. Weber
296e2912e5 [Test] Update to not use deprecated PureFluid.h
Update test_problems for rankine and pureFluid to avoid using the
deprecated PureFluid.h convenience wrapper classes. Update the
rankine.cpp test problem to match the rankine.cpp sample. Switch
both test_problems updated here to use writelog instead of
printf/cout.
2019-07-30 13:24:11 -04:00
Bryan W. Weber
ed59ae9516 [Samples] Update to not use PureFluid wrapper
Update rankine.cpp sample to avoid using the deprecated PureFluid wrapper
classes. Update the small changes in the blessed output.
2019-07-30 13:24:11 -04:00
Bryan W. Weber
386c215b3b [Thermo] Deprecate PureFluid, use PureFluidPhase instead
The convenience wrapper PureFluid class can be replaced by
PureFluidPhase::initThermoFile or other methods of creating ThermoPhase
instances.
2019-07-30 13:24:11 -04:00
Ray Speth
409227cd05 [CI] Make test errors show up as CI failures for macOS builds 2019-07-30 13:24:11 -04:00
Bryan W. Weber
5f08b362aa
[CTI/YAML] Check convert arguments in cti2yaml
Check that one, and only one, of the filename/text arguments are
specified.
2019-06-29 17:02:41 -04:00
Bryan W. Weber
27438751ce
[CTI/YAML] Change cti2yaml to use pathlib
cti2yaml converts input and output file names to pathlib.Path objects.
This makes it easier to manage paths for test data files
2019-06-29 17:02:41 -04:00
Bryan W. Weber
8d57424188
[Test] Write converted test files to the work dir
The previous behavior was to write the test files to the current working
directory
2019-06-29 17:02:41 -04:00
Bryan W. Weber
2e54811549
[Test] Remove relative directory for data files
The relative directory wasn't the same for the installed Cython
interface
2019-06-29 17:02:41 -04:00
Bryan W. Weber
1e2a9f23a3
[Test] Avoid using path in source tree in tests
The relative path that is eliminated here relied on being in the source
directory structure, breaking tests of the installed Cython interface
2019-06-29 17:02:41 -04:00
Bryan W. Weber
a4ad2f5d66
[Cython/Test] Install test subdirs in Cython interface
The tests now include subdirectories with data files, so those should be
installed with the rest of the data files
2019-06-29 17:02:41 -04:00
band-a-prend
674c37ce3c cantera: Sconstruct 'libdirname' env PathVariable
Some distributions (e.g. Fedora/RHEL) use 'lib64' instead of 'lib'
on 64-bit systems or could use some other library directory name
instead of 'lib' depends on architecture and profile
(e.g. Gentoo 'libx32' on x32 profile).
If user didn't set 'libdirname' configuration variable then
set it to default value 'lib'

This commit is related to early closed issue:
https://github.com/Cantera/cantera/issues/318
2019-06-28 15:25:41 -04:00
Ray Speth
c840142bff Bump version to 2.5.0a3 2019-06-27 18:29:21 -04:00
Steven DeCaluwe
2d2004da7e Exposing getDeltaEnthalpies to Matlab interface.
The general intent here was to enable calculating reaction enthalpies in the
Matlab toolbox, as part of the li-ion battery simulations in PR #563.

This required several changes:

- Create getDeltaEnthalpies.m in Matlab toolbox/@Kinetics, as well as similar
methods for Gibbs free energy and entropy of reaction
- Add kin_getDelta to kineticsmethods.cpp.
- Add getPartialMolarEnthalpies to metalPhase class (it returns all zeros).

Note that similar methods are not enabled for the corresponding
'Standard State' methods, for the time being.  Mainly because it is
difficult for me to envision a significant use case, but also because of
some lingering confusion between 'standard' and 'reference' states in
Cantera's codebase.
2019-06-27 18:03:07 -04:00
bryanwweber
8502d18ff7 Initialize m_units in AnyMap default constructor
Without this initialization, VS2017 (VC 14.1) complains there is a missing default constructor for UnitSystem.
2019-06-27 16:00:01 -04:00
bryanwweber
946ed901a0 Bump yaml-cpp submodule commit
For VS2017, we need fixes from jbeder/yaml-cpp#597 to compile the submodule
2019-06-27 16:00:01 -04:00
Ray Speth
a247d0f4eb [Reactor] Use correct phase state after mass flow rate evaluation
A user-defined mass flow rate function can modify the ThermoPhase object used by
a reactor, for example if it depends on calculating some property of a different
reactor. To make sure that the reactor governing equations are evaluated
correctly, the ThermoPhase state needs to be set after all user-defined
functions have been called.
2019-06-27 10:47:05 -04:00
Ray Speth
edcc9c59fd [Input] Fix CTI to YAML conversion of phases with no elements 2019-06-26 20:20:23 -04:00
Steven DeCaluwe
67087f874d Updating matlab Li ion battery sample.
Corrected one typo (stray mid-line comment symbol) and converted
hard-coded faraday constant to the corresponding Matlab toolbox function
(added with PR #640).
2019-06-26 20:20:23 -04:00
wbessler
cceb12b01b Further improved Li-ion battery example
MATLAB example: better comments, faster calculation, consistent signs; CTI file: thermally-activated kinetics
2019-06-26 20:20:23 -04:00
wbessler
bc6dd4ddc0 Improved lithium-ion battery cti file and Matlab example
Extended and clarified comments, corrected density data, improved functionality
2019-06-26 20:20:23 -04:00
Ingmar Schoegl
ae792dde00 implemented limited advance step 2019-06-26 13:48:01 -04:00
Ingmar Schoegl
bbab606a20 take care of uninitialized value warning during compilation 2019-06-26 13:48:01 -04:00
Bryan W. Weber
360ac9b79e Copy editing for YAML docs
Improve consistency of formatting. Eliminate duplicate hyperlink targets
by making them anonymous links.
2019-06-25 23:31:23 -04:00
Ray Speth
dced8fbcad [Test] Make testing of deprecated methods possible
Fatal deprecation warnings are useful for identifying inadvertent use of
deprecated features. However, we still want to retain tests of deprecated
features until those features are removed.
2019-06-25 22:30:59 -04:00
Ray Speth
df5a3ae08f [Test] Fix inadvertent reset of "fatal deprecation warnings" flag
Calling appdelete() to erase the input file cache also resets the value of
Application::m_fatal_deprecation_warnings to false.
2019-06-25 22:30:59 -04:00
Ray Speth
a573b32770 [CI] Move Ubuntu builds from 14.04 (Trusty) to 16.04 (Xenial) 2019-06-25 22:30:59 -04:00
Ray Speth
2e8b860ccd [Input] Check for reactions with multiple sets of parameters 2019-06-25 22:30:59 -04:00
Ray Speth
d705ff760a [Input] Fix Species.listFromYaml when reading from a subsection 2019-06-25 22:30:59 -04:00
Ray Speth
674701b0c2 [Samples] Fix include path for compiling C++ samples with 'scons samples' 2019-06-25 22:30:59 -04:00
Ray Speth
f2f05e5ed1 [CI] Use Miniconda instead of Homebrew for macOS dependencies
Installation of Homebrew packages fails when the brew version in the Travis
image gets too far out of date, but updating Homebrew as part of the CI builds
takes ages and frequently fails. The best solution seems to be to just not use
it in the first place.
2019-06-25 22:30:59 -04:00
Ray Speth
165f11dfca [Input] Add information about conversion to generated YAML input files 2019-06-25 22:30:59 -04:00
Ray Speth
44c5094bb2 [Input] Implement 'skip-undeclared-third-bodies' option in YAML format 2019-06-25 22:30:59 -04:00
Ray Speth
a7aa6e721a Create YAML versions of input files as part of build process 2019-06-25 22:30:59 -04:00
Ray Speth
baacc563b8 [Input] Add cti2yaml for converting CTI files to the new YAML format 2019-06-25 22:30:59 -04:00
Ray Speth
b77f368ead [Input] Instantiate BinarySolutionTabulatedThermo from YAML 2019-06-25 22:30:59 -04:00
Ray Speth
53faf54ceb [Thermo] Add ThermoPhase.standardConcentrationUnits method
This method returns the units of the concentration-like terms appearing
in rate expressions, and are needed in order to convert rate constants
from user-specified input units to Cantera's MKS+kmol system.
2019-06-25 22:30:59 -04:00
Ray Speth
0b04881b8d [Input] Handle "declared-species" option for adding reactions from YAML 2019-06-25 22:30:59 -04:00
Ray Speth
69371e5751 [Python] Implement Reaction constructors from YAML files/strings 2019-06-25 22:30:59 -04:00
Ray Speth
8037497dd3 [Python] Implement Species constructors from YAML files/strings 2019-06-25 22:30:59 -04:00
Ray Speth
040ffe4711 [Doc] Add comments to AnyMap and AnyValue classes 2019-06-25 22:30:59 -04:00
Ray Speth
891a4e74d3 Make YAML generated by ck2yaml prettier 2019-06-25 22:30:59 -04:00
Ray Speth
8eb52a7afb [Input] Create ElectrochemicalReaction objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
d66abc5234 [Doc] Add API documentation for the YAML input format 2019-06-25 22:30:59 -04:00
Ray Speth
672b55a72f Add AnyValue::getMapWhere function 2019-06-25 22:30:59 -04:00
Ray Speth
d77a5979a8 [Input] Provide context for more errors in YAML processing 2019-06-25 22:30:59 -04:00
Ray Speth
b1273301cc [Input] Create Metal objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
088e0031fd [Input] Create LatticePhase and LatticeSolidPhase from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
f1937bfada [Input] Create IdealSolidSolnPhase objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
3011374ff6 [Input] Create ConstDensityThermo objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
ecc1cf0db2 [Input] Create PureFluid objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
9e98aef969 [Input] Create RedlichKwongMFTP objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
0d1196bd46 [Input] Create InterfaceKinetics and InterfaceReaction objects from YAML 2019-06-25 22:30:59 -04:00
Ray Speth
b0209bdf37 [Input] Store additional reaction data in 'input' map 2019-06-25 22:30:59 -04:00
Ray Speth
26bd71af53 [Input] Create Surface and Edge phases from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
9ffab53a17 [Fortran] Add functions for constructing objects based on filenames
Bypass reading and manipulation of XML files in Fortran, so that XML, CTI,
and YAML input files can all be used.
2019-06-25 22:30:59 -04:00
Ray Speth
901ec2f12c [Matlab] Construct objects directly from input file names
Bypass reading and manipulation of XML files within Matlab, so that XML, CTI,
and YAML input files can all be used.
2019-06-25 22:30:59 -04:00
Ray Speth
6a8c378846 [clib] Add functions for creating objects directly from input files
These methods work with YAML, CTI, and XML input files.
2019-06-25 22:30:59 -04:00
Ray Speth
fd088889cd [Transport] Add tests based on YAML input files 2019-06-25 22:30:59 -04:00
Ray Speth
338a38b87c [Input] Store additional species transport data in TransportData object 2019-06-25 22:30:59 -04:00
Ray Speth
48a32ae8bf [Thermo] Enable creation of ThermoPhase objects from YAML file names 2019-06-25 22:30:59 -04:00
Ray Speth
580b75b2d2 [Input] Add new aliases for transport models
These names are consistent with the style used in YAML input files
2019-06-25 22:30:59 -04:00
Ray Speth
45d5099979 Create PDSS_HKFT objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
3028c14a10 Improve setting of default energy and pressure units
Only treat activation energies as a special case, rather than all molar
energies. Units of activation energy can be set either explicitly or by setting
units for energy and quantity. Only the case where activation energies are given
as temperatures needs to be specified explicitly.

Allow setting of default energy units, which allows calories to be used.

Also add dyn/cm^2 as an option for pressure units.
2019-06-25 22:30:59 -04:00
Ray Speth
56612115f3 [Input] Create HMWSoln objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
7d964dae47 [Input] Create MaskellSolidSoln objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
d8a1337933 [Input] Create RedlichKister objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
4f30f1156d [Input] Fix reference pressure on constant cp thermo created from YAML
Also make 298.15 the default reference temperature
2019-06-25 22:30:59 -04:00
Ray Speth
72d345619f [Input] Create PDSS_SSVol objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
1e8b8b538c [Input] Create IdealGasVPSS and PDSS_IdealGas objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
a3024d7699 [Input] Create IonsFromNeutral objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
8b47274765 [Input] Create DebyeHuckel and PDSS_Water objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
07aadbce6c [Test] Add more checks to DebyeHuckel.fromScratch
Change species molar volumes to match DH_NaCl_bdotak.xml
2019-06-25 22:30:59 -04:00
Ray Speth
fb1054a259 Fix AnyMap compilation issues with some compilers
Some versions of G++ complained about being unable to decide between the const
and non-const functions. Rewriting without the use of the deprecated
std::mem_fun is the simplest fix.
2019-06-25 22:30:59 -04:00
Ray Speth
e7c6495ec7 [Input] Create IdealMolalSoln objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
1bdbf2a010 [Input] Create Margules and PDSS_ConstVol objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
89838c3ffb [Input] Use YAML 'equation-of-state' field to create PDSS objects 2019-06-25 22:30:59 -04:00
Ray Speth
6dac1b0409 [Input] Allow mapping for Arrhenius parameters, and use this as the default
Pressure-dependent Arrhenius reactions now use a list of mappings instead
of a more complicated nested list structure.
2019-06-25 22:30:59 -04:00
Ray Speth
fdfbc58a1e [Input] Search current directory for referenced YAML input files 2019-06-25 22:30:59 -04:00
Ray Speth
2c58dd78c6 [Input] Create FixedChemPot objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
d7734e3f19 [Input] Allow "=" as a delimiter for reversible reactions in YAML 2019-06-25 22:30:59 -04:00
Ray Speth
cae5c498ca [Input] Create WaterSSTP objects from YAML definitions 2019-06-25 22:30:59 -04:00
Ray Speth
98a9566fc4 [Input] Create StoichSubstance objects from YAML definitions
The (fixed) density is now read from the species definition, rather than the
phase definition.
2019-06-25 22:30:59 -04:00
Ray Speth
a5bf674419 [Input] Cache parsed YAML files to speed up repeated reads 2019-06-25 22:30:59 -04:00
Ray Speth
40c403c07d Add ability to instantiate Transport objects from YAML files 2019-06-25 22:30:59 -04:00
Ray Speth
6d6f34bee3 [Input] Read species Transport data from YAML / AnyMap 2019-06-25 22:30:59 -04:00
Ray Speth
96124f8455 [Input] Store phase definition parameters in the ThermoPhase object 2019-06-25 22:30:59 -04:00
Ray Speth
59b0f64e26 [Python] Add ability to instantiate objects from YAML files 2019-06-25 22:30:59 -04:00
Ray Speth
8a0eed3be5 [Python] Use shared_ptr for C++ objects owned by Solution 2019-06-25 22:30:59 -04:00
Ray Speth
be4d9cbc55 [Input] Add ck2yaml script for converting Chemkin files to YAML 2019-06-25 22:30:59 -04:00
Ray Speth
f0dc990764 Create a complete Kinetics object from a YAML input file 2019-06-25 22:30:59 -04:00
Ray Speth
f4d45f8a85 Create a complete ThermoPhase object from a YAML input file 2019-06-25 22:30:59 -04:00
Ray Speth
c8b737035d [Thermo] Add method for setting the state using an AnyMap
Analogous to ThermoPhase::setStateFromXML, but more flexible
2019-06-25 22:30:59 -04:00
Ray Speth
3251a3533e Add AnyMap::erase method 2019-06-25 22:30:59 -04:00
Ray Speth
0264c66f79 Add const version of AnyMap operator[]
Reduces the need to use the at() function
2019-06-25 22:30:59 -04:00
Ray Speth
7d3488a973 Add AnyMap.keys_str function 2019-06-25 22:30:59 -04:00
Ray Speth
afd5d82280 [Input] Provide context lines in YAML parsing error messages 2019-06-25 22:30:59 -04:00
Ray Speth
a32e32b7d7 Remove AnyMap traversal using "/" as a path delimiter
This feature was unused, and interfered with the use of "/" as a delimiter
for YAML keys indicating keys in other input files.
2019-06-25 22:30:59 -04:00
Ray Speth
e28c9add21 Add variants of AnyValue.asMap for accessing lists of maps 2019-06-25 22:30:59 -04:00
Ray Speth
71bf44d11f [Input] Parse YAML entries for Species objects 2019-06-25 22:30:59 -04:00
Ray Speth
84fa231ea2 [Input] Read local 'units' definitions in reaction and thermo entries
Move 'convert' functions that work with missing keys to AnyMap class.
2019-06-25 22:30:59 -04:00
Ray Speth
6e3053dd1c Add function for setting default units from a std::map
This is the form that will be used when reading units from a YAML
input file.
2019-06-25 22:30:59 -04:00
Ray Speth
4c5040e829 [Input] Parse YAML entries for piecewise Gibbs (Mu0Poly) species thermo 2019-06-25 22:30:59 -04:00
Ray Speth
f0bb0d2262 Make AnyMap iterable 2019-06-25 22:30:59 -04:00
Ray Speth
86c73dad20 [Input] Parse YAML entries for constant cp species thermo 2019-06-25 22:30:59 -04:00
Ray Speth
74eec731f1 Add a version of UnitSystem.convert that handles default values 2019-06-25 22:30:59 -04:00
Ray Speth
7211f08891 [Input] Parse YAML entries for NASA 9-coefficient polynomials 2019-06-25 22:30:59 -04:00
Ray Speth
7ff6e8fac2 [Input] Parse YAML entries for Shomate polynomials 2019-06-25 22:30:59 -04:00
Ray Speth
2b41486850 [Input] Parse YAML entries for NASA 7-coefficient polynomials 2019-06-25 22:30:59 -04:00
Ray Speth
3eaa32dea3 [Thermo] Make SpeciesThermoInterpType objects default constructible
Also provide setters for all all parameters which were set by the
constructor.
2019-06-25 22:30:59 -04:00
Ray Speth
aef101fee7 [Input] Parse YAML entries for Chebyshev reactions 2019-06-25 22:30:59 -04:00
Ray Speth
7a97ff9917 Add optional length check when converting AnyValue to vector 2019-06-25 22:30:59 -04:00
Ray Speth
24d1e86440 Improve "missing key" error message for AnyMap 2019-06-25 22:30:59 -04:00
Ray Speth
b54ea8bd82 [Input] Parse YAML entries for Plog reactions 2019-06-25 22:30:59 -04:00
Ray Speth
d476ad8e59 Use Boost to demangle type names in AnyValue casting errors 2019-06-25 22:30:59 -04:00
Ray Speth
cb31c297cf [Input] Parse YAML entries for falloff and chemically activated reactions 2019-06-25 22:30:59 -04:00
Ray Speth
8b502d4065 [Input] Parse YAML entries for three body reactions 2019-06-25 22:30:59 -04:00
Ray Speth
0220e11ef9 Allow conversion from long int to double in AnyValue.asMap 2019-06-25 22:30:59 -04:00
Ray Speth
de80f06887 [Input] Parse YAML entries for elementary reactions 2019-06-25 22:30:59 -04:00
Ray Speth
224c46ebbb Add functions for converting units from AnyValue instances 2019-06-25 22:30:59 -04:00
Ray Speth
65121becac Add special handling of activation energies to class Units 2019-06-25 22:30:59 -04:00
Ray Speth
da097631e3 UnitSystem class supports default source units for conversions 2019-06-25 22:30:59 -04:00
Ray Speth
c9b7de3b70 Add support for metric prefixes to class Units 2019-06-25 22:30:59 -04:00
Ray Speth
b8cb2c30f8 Add 'Units' class for doing conversions with dimensionality checks
Introduces a new, more natural notation for writing unit strings,
for use in YAML input files. Unlike 'toSI', conversions are checked for
dimensional consistency.
2019-06-25 22:30:59 -04:00
Ray Speth
ea88d4f9fb Add "get" functions to AnyMap
Simplify the common use case of checking for a key and using a default
value when it is missing.
2019-06-25 22:30:59 -04:00
Ray Speth
530adbb931 Add automatic conversions to vector<AnyValue> 2019-06-25 22:30:59 -04:00
Ray Speth
e5bd0b136f Allow AnyValue to convert implicitly from long int to double 2019-06-25 22:30:59 -04:00
Ray Speth
00f6b88fa4 [Input] Implement construction of AnyMap from YAML string/file 2019-06-25 22:30:59 -04:00
Ray Speth
e85e0e2108 Fix constness of some AnyMap functions 2019-06-25 22:30:59 -04:00
Ray Speth
ed24198e63 Add option to compile yaml-cpp or use system library 2019-06-25 22:30:59 -04:00
Ray Speth
4bd1ca1cde Add yaml-cpp submodule 2019-06-25 22:30:59 -04:00
Ray Speth
56cb190a64 Fix units of site density in sofc.cti 2019-06-25 22:30:59 -04:00
Bryan W. Weber
444ef91e0f Build the samples on the CI services
Requires libomp on macOS from homebrew. OpenMP with Visual C/C++ requires
the loop index to be a signed type (from OpenMP < 3.0).
2019-06-17 10:29:20 -04:00
Bryan W. Weber
142f533229 Correct flag and libs for OpenMP on macOS
Apple's clang on macOS requires the libomp to link. Apple symlinks gcc
to clang, so it can't be detected as clang by executable name
2019-06-17 10:29:20 -04:00
Bryan W. Weber
3588be16f3 CMake use Accelerate even if OpenMP is also used
For samples, make sure that OpenMP and Accelerate are not exclusive
options on macOS
2019-06-17 10:29:20 -04:00
Bryan W. Weber
007ecf0c7c Include boost_inc_dir when building the samples 2019-06-17 10:29:20 -04:00
Bryan W. Weber
857bb0a769 Include Func1.h in zerodim.h
zerodim.h used to have Func1.h included indirectly, so make it explicit.
2019-06-17 10:29:20 -04:00
Bryan W. Weber
9a5c2708e5 Replace the compiler variables during conda build
The build compilers should not be specified into the sample templates
2019-06-13 14:36:54 -04:00
Bryan W. Weber
265032da8f Remove build-system specific env vars on macOS
The isysroot and mmacosx-min-version flags are needed to build the
Cantera library, but not to actually use it on macOS. They should be
removed because users don't need these and should use the SDK installed
with XCode.
2019-06-13 14:36:54 -04:00
Steven DeCaluwe
ba8ac1d519 Mark ConstDensityThermo for deprecation.
The thermophase ConstDensityThermo instantiates a class with
constant density_mass  Such a model is of dubious physical
validity/applicability and has minimal foreseeable use cases.
This commit marks it for deprecation, and adds a message in
ctml_writer.py (where the model has the misleading alias
'incompressible_solid') refering the interested user to consider
appropriate alternate thermophase classes 'lattice' or
'IdealSolidSoln.'
2019-06-12 17:54:48 -04:00
Steven DeCaluwe
fb3dee36c5 Removing references to incompressible_solid in sofc.cti
Removes references to incompressible_solid phase in the codebase.
This phase type references ConstDensityThermo phase, which is a
non-physical model and is to be deprecated, with Cantera 2.5. In
order to enable deprecation, the following changes are hereby made:

- Changes oxide_bulk phase type from incompressible_solid to lattice in sofc.cti
- Changes test_convert.py so that it interrogates the density_mole of the bulk_oxide, rather than density_mass
2019-06-12 17:54:48 -04:00
Steven DeCaluwe
813d5064ae Enabling Lattice thermo phase via cti interface. 2019-06-12 17:54:48 -04:00
Steven DeCaluwe
0ed2b38594 Adding faradayconstant.m to Matlab toolbox 2019-06-08 17:33:30 -04:00
Thanasis Mattas
6a42e5942e rearranging methods to aid src reading 2019-06-08 17:25:55 -04:00
Thanasis Mattas
ea3bb0af90 Some documentation corrections at xml.h 2019-06-08 17:25:55 -04:00
Ingmar Schoegl
5d62f3bacc added factories for FlowDevice and Wall objects 2019-05-28 19:21:28 -04:00
Ingmar Schoegl
751afa3c2b addresses issue #615 2019-05-09 22:21:35 -04:00
CyberDrudge
fbe4ce5c1b Remove Unnecessary comments 2019-05-09 12:22:44 -04:00
Ingmar Schoegl
f078f53f39 Enable additional states / equations in onedim 2019-04-17 00:06:26 -04:00
Nick
848a3bf0e3 Add InterfaceKinetics.advance_coverages integrator options to the cython interface, and test 2019-04-10 22:14:27 -04:00
Nick
d2cb02f254 add integrator parameters to the InterfaceKinetics::advanceCoverages & ImplicitSurfChem constructor to allow users to modfiy 2019-04-10 22:14:27 -04:00
Bryan W. Weber
654e582bc0
Add NumFOCUS donation link to README
Also update some URLs to HTTPS
2019-03-20 09:28:59 -04:00
Bryan W. Weber
d25637d0ea
Update NumFOCUS donation link in docs sidebar 2019-03-20 09:15:39 -04:00
g3bk47
471041a27a Additional check for Troe coefficients being zero
This will prevent floating point exceptions (sometimes enabled by third-party
codes) in case c[1] or c[2] are zero but will not change the current behaviour
if c[1] and c[2] are not zero.
2019-03-18 14:39:50 -04:00
Bryan W. Weber
4026c17915 Add /usr/local/include to cmake incdirs
By default, CMake uses the system SDK on macOS as the system root by
setting the isysroot flag to clang. This setting removes /usr/local from
the include search path.
2019-03-15 14:44:43 -04:00
Bryan W. Weber
cb008a95d7 Add the Accelerate framework to the CMake builds of the samples 2019-03-15 14:44:43 -04:00
Ray Speth
337f33baad [CI] Use Travis Homebrew addon instead of manual brew commands
This should reduce the time needed to set up the build environment and avoid
build failures associated with errors while updating irrelevant homebrew
packages.
2019-03-14 14:08:54 -04:00
Ray Speth
968dc24925 [Python] Fix compatibility with Cython < 0.27
After setting the "language_level" directive (6c0866ef), nested comprehension
expressions erroneously triggered an error message from the Cython compiler
saying "local variable 's' referenced before assignment". While the problem has
been fixed in Cython 0.27 and newer, this commit restores compatibility with
older Cython versions as well.
2019-03-14 14:03:51 -04:00
Ray Speth
5e226535de Fix regression in compatibility with Sundials 2.4.0
Regression was introduced in 9c50f752 when adding compatibility with
Sundials 3.x.

Fixes #613
2019-03-14 14:03:51 -04:00
Bryan W. Weber
6c0866efb8 Add Cython language_level directive to _cantera.pyx
This fixes the warnings generated by recent versions of Cython that
the language_level will be changed in the future. By setting this
directive, all the code in the .pyx files should be written in
Python 3 syntax. This required several changes to the import
syntax in the files to fix relative vs. absolute imports
2019-03-11 17:00:13 -04:00
Ray Speth
d6d91f4d98 [Thermo] Fix updating state of PDSS_IonsFromNeutral objects
Setting T and P now updates the state of the underlying "neutral
molecule phase".

Also removed the unimplemented setState_TR method.
2019-03-06 19:50:16 -05:00
Ray Speth
bdc81684b1 [Thermo] Fix BinarySolutionTabulatedThermo initial mole fraction thermo
The value of m_xlast should only be set to a valid value by _updateThermo,
after it has calculated values for the tabulated enthalpy and entropy.
2019-03-06 19:48:45 -05:00
Ray Speth
aceb896f62 [Thermo] Fix BinarySolutionTabulatedThermo updates when only T changes
In the case where temperature changes but the mole fractions are the same, we
still need to apply the enthalpy and entropy offsets to the tabulated species.
2019-03-06 19:48:45 -05:00
Ray Speth
47005a5008 [Thermo] Fix overriding of IdealSolidSolnPhase::_updateThermo
Since IdealSolidSolnPhase::_updateThermo wasn't a virtual method, and
the signatures didn't match (const vs non-const), calls to this method
from IdealSolidSolnPhase weren't being overridden by
BinarySolutionTabulatedThermo::_updateThermo as expected.
2019-03-06 19:48:45 -05:00
Ray Speth
1f70f7751c Move sofc.cti from examples to main data directory 2019-03-05 16:09:55 -05:00
Ray Speth
ec7f779434 [Input] Include more significant digits for Redlich-Kwong coefficients
ctml_writer was severely truncating Redlich-Kwong coefficients when converting
from CTI to XML formats, keeping only 5 significant digints in the "a"
coefficients and two decimal digits in the "b" coefficients, which is less than
what is used even in the example CTI files. The use of the "%f" format also
meant that the precision depended on input units.
2019-03-05 16:09:55 -05:00
Ray Speth
6c82b61c3d [Kinetics] Always use temperature of "reacting" phase
This is always the lowest-dimensional phase, e.g. surface or edge for
heterogeneous systems.
2019-03-05 15:03:48 -05:00
Ray Speth
5601ee9067 [Python] Add 'kinetics_species_name' and 'kinetics_species_names' 2019-03-05 15:03:48 -05:00
Ray Speth
5ad656e342 [ck2cti] Fix Chebyshev rate constant when using local quantity units
Since the leading Chebyshev coefficient has effective units like
log(cm^3/kmol), it needs to be converted directly to the default units of
the CTI file.

Analogous to the fix for PLOG reactions in #435.
2019-02-28 22:37:38 -05:00
Ray Speth
540777c32b [ck2cti] Fix handling of reaction units settings not on last line
Fixes a regression introduced in d56b6205fa.
2019-02-25 11:06:12 -05:00
Ray Speth
0fdbe24aaf Provide error message after failure to create large Sundials matrix
If Sundials tries to create an excessively large matrix, it returns a null
pointer. To avoid a subsequent segfault, throw an exception which makes the
cause of the error clear.

WIP: Better error message for too-large Sundials matrix

TEMP: fixup for cvodes error messages
2019-02-25 11:06:12 -05:00
Ray Speth
90d2ec41ca [Thermo] Eliminate redundant coefficient storage in ShomatePoly2 2019-02-25 11:06:12 -05:00
Ray Speth
8bcb62f727 Fix GRI3.0 transport coefficients
The old (C++) ck2cti program unnecessarily rounded some species transport
coefficients. This updates the coefficients in the input files derived from GRI
3.0, and updates the test comparisons for affected tests.
2019-02-25 11:05:40 -05:00
Ray Speth
8689809d9e Remove unused XML input files
The XML versions of these files that are actually installed/used are the ones
generated during the build process from their CTI equivalents.
2019-02-25 11:05:40 -05:00
Ray Speth
ce9a17dd92 Bump version to 2.5.0a2 2019-02-25 09:14:33 -05:00
Bryan W. Weber
7691d7f9d3
Remove execute bits from test data files 2019-02-22 09:17:20 -05:00
Ray Speth
b8367d6fe8 [Thermo] Eliminate redundant coefficient storage in NasaPoly2 2019-02-21 11:21:03 -05:00
Ray Speth
50997a1651 [Python] Fix documentation of Reaction.listFromCti 2019-02-20 22:50:43 -05:00
Ray Speth
77b467929c [Thermo] Fix calculation of initial density of IdealSolidSolnPhase
The density of IdealSolidSolnPhase and BinarySolutionTabulatedThermo objects was
not being computed as part of construction, causing code that interacted with
them using setState/restoreState, such as the 'Solution' constructors in Matlab
and Python, to fail.
2019-02-20 21:39:22 -05:00
Ray Speth
7cf58af69e [Thermo] Always initialize BinarySolutionTabulatedThermo member variables 2019-02-20 21:39:22 -05:00
Steven DeCaluwe
f0c797c482 Updates to samples/matlab/lithium_ion_battery.m
Added some context and higher level functionality  to
lithium_ion_battery.m sample, such that it now uses some of the
already-present functionality to calculate and plot the open
circuit voltage for a lithium ion battery for a range of active
material compositions.
2019-02-20 21:39:22 -05:00
Steven DeCaluwe
e4789d7102 Fixing BinarySolutionTabulatedThermo::_updateThermo
Previously, BinarySolutionTabulatedThermo::_updateThermo created a new
`speciesThermoInterpType` intance every time the thermo was updated,
storing the tabulated thermo lookups as the reference state thermo.

This has now been changed such that the reference state is used only
to represent the temperature effects on the thermo, with the tabulated
terms added to this reference state.  This should be a more efficient
implementation.
2019-02-20 21:39:22 -05:00
Steven DeCaluwe
84b4147a99 Fixing return type of BinarySolutionTabulatedThermo::interp
The function `BinarySolutionTabulatedThermo::interp` now returns type
`std::pair<double, double>`, rather than `static double`
2019-02-20 21:39:22 -05:00
Steven DeCaluwe
8169c26271 Updates to ctml_writer.py associated with BinarySolutionTabulatedThermo class.
-Removes option to read tabulated thermo from an external csv file (this is now
handled from within cti or xml).
-Renames `rateCoeff` keyword to the more appropriate `rate_coeff_type`, and fixing
keyword order so that this new keyword is listed last.
-Removes `else` statement from `if isinstance(self._standardState, standardState)
-Removes unused `_pure` attribute from `IdealSolidSolution` and
`BinarySolutionTabulatedThermo`
-Changes default on `tabulated_species` keyword to `None`.
-Removing superfluous `standardState:_build` from ctml_writer.py
- Removes unnecessary conc_dim() definition in `table` class.
- Removes unnecessary units defintion for mole fractions in `table` class.
- Improves grammar in error message for case when thermo table is
not provided for `tabulated_species`.
2019-02-20 21:39:22 -05:00
Steven DeCaluwe
11271d90b2 Fixing unit conversion of tabulated data in BinarySolutionTabulatedThermo
Previously the model imported the tabulated data assuming it was given
in J, mol, K units, and ignoring any user input in the cti file, w/r/t
units.  This fixes that, by amending the `getFloatArray` calls in
thermo/BinarySolutionTabulatedThermo.cpp
2019-02-20 21:39:22 -05:00
Steven DeCaluwe
366d1942ef Updating keyword order in ctml_writer.py species::__init__
The keyword `standardState` was added to species::__init__ in
ctml_writer.py.  This moves this keyword entry to the end of the
list of keywords, so that species instances of the class do not
need to reorder their keyword order.
2019-02-20 21:39:22 -05:00
Steven DeCaluwe
05fdd356f2 Updates to BinarySolutionTabulatedThermo and test file.
-Fixes small typo id incclude/cantera/base/utilities.h docstring
-Removes `m_formGC` from BinarySolutionTabulatedThermo class, and
instead utilizes version and functionality inherited from parent
class `IdealSolidSolnPhase`.
-Moves samples/matlab/lithium_ion_battery/lithium_ion_battery.cti
to data/inputs/lithium_ion_battery.cti
-Fixes typo in test/data/BinarySolutionTabulatedThermo.cti
-Updates expected_result values in several test cases in
test/thermo/BinarySolutionTabulatedThermo_Test.cpp
2019-02-20 21:39:22 -05:00
Steven DeCaluwe
ae555fb063 Add description for BinarySolidSolutionTabulatedThermo class 2019-02-20 21:39:22 -05:00
Steven DeCaluwe
3c9bbc4ec9 Fix IdealMolalSolution::standardConcentration
Standard concentrations in the IdealMolalSolution phase depend on
a user-specified m_formGC parameter, where m_formGC=0 results in a
standard concentration of 1.0, m_formGC = 1 is supposed to result in
a standard concentration for species k  equal to 1 divided by the
molar volume of species k, and m_formGC = 2 is supposed to result in
a standard concentration equal to 1 divided by the molar volume of the
solvent species (which is species 0).

Current behavior is that m_formGC = 1 and m_formGC = 2 *both* result
in a standard concentration of 1 divided by molar vlume of the solvent.

This commit fixes how this is handled, cleans up the switch statement
(the three cases were written somewhat inconsistently), and throws
an error if m_formGC is set < 0 or > 2.
2019-02-20 21:39:22 -05:00
Manik Mayur
b8d5eb405a Add MATLAB example files for BinarySolutionTabulatedThermo class 2019-02-20 21:39:22 -05:00
Jamie
a7449c6cc8 Add tests for BinarySolutionTabulatedThermo class 2019-02-20 21:39:22 -05:00
Manik Mayur
224ef720e6 Add BinarySolutionTabulatedThermo class 2019-02-20 21:39:22 -05:00
Ray Speth
d04fd8cc39 [ck2cti] Show name of species with undefined elements in error message 2019-02-18 18:39:15 -05:00
CyberDrudge
aa9721dbe9
Use Cantera Error in leftover examples
Update diffusion_flame_batch.py and diffusion_flame_extinction.py
to use CanteraError where appropriate. Define a new
FlameExtinguished exception to distinguish between extinction and
other failures. This allows things like OSErrors to still be
raised to the user while dealing with exceptions we can handle.
Closes #569.
2019-02-18 13:38:50 -05:00
CyberDrudge
9d4c0eda03
Fix typo in Matlab documentation for cp_mass
Fixes #590
2019-02-17 08:12:53 -05:00
lavdwall
cb5620996c Add solvePseudoSteadyStateProblem() in cython interface 2019-02-11 13:46:48 -05:00
Ray Speth
e3424d8ed4 [ck2cti] Fix over-zealous detection of section 'end' labels 2019-02-04 18:49:45 -05:00
Ray Speth
33e198f7e5 [Thermo] Generalize check for missing Redlich-Kwong coefficients
A check in the "updateAB" function will be executed regardless of how the phase
is instantiated.
2019-02-04 18:49:45 -05:00
Ray Speth
f385f48190 [CI] Change Codecov to use Linux build instead of macOS
Something changed such that the macOS Travis builds are no long able to upload
coverage data to Codecov. However, uploading from the Linux builds instead seems
to work fine.
2019-02-04 18:49:45 -05:00
Ray Speth
ebb93cb5a2 [Thermo] Fix setting of temperature-dependent Redlich-Kwong parameters
Using negative values to indicate unspecified parameters doesn't work, since
either constant in "a = a0 + a1*T" can be negative and still produce a positive
value for "a". Instead, NaN can be used for this purpose.
2019-02-04 18:49:34 -05:00
Ray Speth
3ff5d87b81 [Doc] Fix descriptions and units of coverage dependency parameters 2019-02-04 16:38:40 -05:00
Ray Speth
46b7cf180a [SCons] Make dependency on copying Eigen headers explicit
SCons seems to miss this dependency sometimes, resulting in confusing failures
while trying to compile DenseMatrix.cpp.
2019-02-04 16:38:40 -05:00
Ray Speth
dc09040274 [Samples] Fix compilation of Blasius BVP sample with 'scons samples' 2019-02-04 16:38:40 -05:00
Ray Speth
1ec9ce2c01 [1D/samples] Fix C++ flame speed example
Fixes a regression introduced in 6f45b241.
2019-02-04 16:38:40 -05:00
Ray Speth
35be561d99 [Matlab] Eliminate unnecessary copy-constructor-like option 2019-02-04 16:38:40 -05:00
Ray Speth
9f5dfbdb12 Document units of Margules interaction parameters 2019-02-04 16:38:40 -05:00
CyberDrudge
d9b95b2efb
[Examples] Fix refinement check in ic_engine.py
The previous refinement check didn't work because the loop never
reached n2 == 4. Replace is checks with == checks.
2019-02-01 17:03:31 -05:00
CyberDrudge
05eaa0a5e4
[Examples] Use CanteraError in ic_engine.py
Related to #569, swap catching bare Exception for the
more specific CanteraError
2019-02-01 17:03:21 -05:00
Ray Speth
4b3bb8f8fc [Thermo] Fix incorrect documentation in the PDSS class
PDSS objects do not interact with the MultiSpeciesThermo object for a phase,
but at most a single SpeciesThermoInterpType object.
2019-01-23 16:43:44 -05:00
Ray Speth
27c64b76f8 [Thermo] VPStandardStateTP does not use reference thermo objects
Since VPStandardStateTP and derived classes do not use the reference state
thermodynamic properties in the m_spthermo object, we can just install
placeholder objects there, and eliminate the wrapper clas STITbyPDSS.
2019-01-23 16:43:44 -05:00
Ray Speth
311ae76510 [Thermo] Allow species without thermo data
In some models, SpeciesThermoInterpType objects on individual species are not
used. Instead of requiring the specification of placeholder thermo data, this
allows the base SpeciesThermoInterpType class to be used, which will throw an
exception if it is inadvertently used.
2019-01-23 16:43:44 -05:00
Ray Speth
af56138e14 [Thermo] Clean up implementation of MaskellSolidSolnPhase
Eliminate several member variables which shadow variables of the
VPStandardState class, and actually contained the same information
calculated a different way.
2019-01-23 16:43:44 -05:00
Ray Speth
4d5cd502a2 [Input] Improve error message for Chemkin files with unrecognized sections 2019-01-10 15:17:33 -05:00
Ray Speth
cbe763836e [Input] Fix file name in error message for errors in surface mechanisms 2019-01-10 15:17:33 -05:00
Ray Speth
1bb081d769 [CI] Pin to SCons 3.0.1 to prevent AppVeyor from skipping tests
With SCons 3.0.3 on AppVeyor, the 'scons test' command exits immediately without
any output.
2019-01-10 15:17:33 -05:00
Ray Speth
a347ad36c4 [Input] Fix handling of skipped species in NASA9 input files
Fixes #582
2019-01-10 15:17:33 -05:00
Ray Speth
d56b6205fa [Input] Improve detection of invalid lines in reaction entries
Previously, lines which did not contain a reaction equation or a known keyword
and did not contain any slashes would be silently skipped. This caused reactions
mistakenly written using '->' as the arrow to be ignored without warning.

Fixes #583
2019-01-10 15:17:33 -05:00
Ray Speth
b633544477 [Python/1D] Retain user-specified products in counterflow premixed flame
When using the 'auto' solver option, user-provided arguments to
set_initial_guess were not being saved for subsequent calls to set_initial_guess
within Sim1D.solve, causing the solution to always be for equilibrated products.
2019-01-09 11:44:03 -05:00
arghdos
e3230801c9 Expose getting/setting of max-steps to python interface & test 2019-01-07 22:33:03 -05:00
Ray Speth
19577abfbe Deprecate rarely-used vector functions 2018-12-14 11:27:24 -05:00
Ray Speth
6a859215f8 Replace timesConstant with C++11 lambda 2018-12-14 11:27:24 -05:00
Ray Speth
6f45b241b5 Remove code deprecated in Cantera 2.4 2018-12-14 11:27:24 -05:00
Steven DeCaluwe
0257c4868e Adding test suite coverage for critcal property lookups in RedlichKwongMFTP 2018-12-11 11:08:47 -05:00
Steven DeCaluwe
68a89d0322 Adding critProperties database for RedlichKwongMFTP
Adds capability for RedlichKwongMFTP to read a database of critical properties
for Tc and Pc of common species, so that users do not need to input pureFluidParameters
for every single species, thereby reducing burden during creation of new cti files.

For any species where pureFluidParameters are not provided by the user, function
getCoeffs scans the database looking for matches.  Any unmatched species will throw
an error.  Currently only scans by species name string, and is only intended for
common species with well-known critical properties.

Current operation is quite slow if the table is consulted for a large number of
species.  In the future, should also implement the capability to write the updated
pureFluidParameters back into the xml file, so the user only has to perform the lookup
once.
2018-12-11 11:08:47 -05:00
Ray Speth
27d9b6413a [CTML] Remove parsing of vestigial "allow_discontinuous_thermo" option 2018-12-02 23:54:52 -05:00
Ray Speth
442433ad37 [Doc] Note that setting blas_lapack_libs does not make Eigen optional 2018-12-02 23:54:52 -05:00
Ray Speth
9aa507a098 [Kinetics] Make some member functions const 2018-12-02 23:54:04 -05:00
Ray Speth
84535483f9 Check for additional invalid string-to-double conversions 2018-12-02 23:54:04 -05:00
decaluwe
3e9b0e0c07 Updating include/cantera/RedlichKwongMFTP.h to reflect new tests.
Text in the header file previously commented that the RedlichKwongMFTP
thermo class had no test suite coverage and was at risk for deprecation.
As this is no longer the case, this PR removes that language.
2018-12-01 00:00:18 -05:00
Bryan W. Weber
1b5f0f4fe9 Update AUTHORS list with authors from all Cantera organization repos 2018-11-30 23:58:32 -05:00
Nick
9f3dc70949 [SCons] Use RPATH for linking shared libraries
Prevents issues with missing shared libraries at runtime on non-Windows
systems. Can be disabled by setting the SCons flag 'use_rpath_linkage=n'.
2018-11-30 23:52:36 -05:00
Nick Curtis
c93bddf9a0
Fix #578 2018-11-29 20:31:49 -05:00
Steven C. DeCaluwe
ded7c674e6
Fixing my name
Capital C, y'all...
2018-11-16 15:01:48 -07:00
Ray Speth
b2acc43a81 [ck2cti] Improve error messages for unparsable transport entries
Print the full transport line to aid in identifying the problem
2018-11-14 10:39:35 -05:00
Ray Speth
4f4a2bd071 [ck2cti] Improve error messages for invalid reaction entries
Print the full text of the problematic reaction entry

Print the underlying exception message ahead of the traceback
2018-11-11 23:12:02 -05:00
Ray Speth
c1d721dc94 [Python/Doc] Fix specified units of Boundary1D.mdot 2018-11-11 23:11:41 -05:00
Ray Speth
600580ead4 [Samples] Install build scripts for Blasius BVP example 2018-11-11 22:17:20 -05:00
Ray Speth
c26db356e3 [Samples] Remove unused methods of class BoundaryValueProblem 2018-11-11 22:17:20 -05:00
Ray Speth
b9a5913af0 [Samples] Fix Blasius example to work after removal of Domain1D::residual 2018-11-11 22:17:20 -05:00
Ray Speth
22efbe25dc [1D] rdt is automatically set appropriately during Jacobian evaluation 2018-11-11 22:17:20 -05:00
Ray Speth
8c213da932 [1D] Fix grid refinement for classes not derived from StFlow
This includes user-developed flow classes, as well as the BoundaryValueProblem
class used in the 'blasius' example.
2018-11-11 22:17:20 -05:00
Ray Speth
ca8700fdd4 Expand '~' as user homedir shortcut when adding data directories
This matches the behavior used when searching for specific input files.
2018-11-11 22:17:20 -05:00
Ray Speth
4fe58661e1 Consider forward slash as directory separator when expanding homedir 2018-11-11 22:17:20 -05:00
Ray Speth
c988f57e01 [Transport] Remove unused constants from WaterTransport.h 2018-11-11 22:17:20 -05:00
Ray Speth
1acb00bc99 [Transport] Remove unused private members of WaterTransport 2018-11-11 22:17:20 -05:00
Ray Speth
680af58950 [CI] Fix a problem with Homebrew on Travis
See travis-ci/travis-ci#8826 for details.
2018-11-07 19:50:37 -05:00
bangshiuh
acd75e20fe [Transport] Add IonGasTransport::electricalConductivity 2018-11-07 16:11:23 -05:00
bangshiuh
7986046bdd [Python/Transport] Make mobilities accessible via Python interface
Also add test_mobility and test_update_temperature to TestIonTransport
2018-11-07 16:11:23 -05:00
bangshiuh
8e7e27ad62 [Transport] fix temperature update in IonGasTransport::getMobilities 2018-11-07 16:11:23 -05:00
bangshiuh
87b042a231 add test for O2- mix. diff. 2018-10-09 16:33:40 -04:00
bangshiuh
7f13f4d832 add O2/O2- collision data to deal with resonant charge transfer effect 2018-10-09 16:33:40 -04:00
Bryan W. Weber
e0d3509597
Update CONTRIBUTING.md
Fix link to NumPy dev guidelines and Python 2/3 support
2018-10-09 16:11:34 -04:00
Bryan W. Weber
d7292b3345
[CI/Doc] Install sphinxcontrib-katex from the master branch on GitHub 2018-09-30 20:57:11 -04:00
Bryan W. Weber
d143e8e1f0
[Doc] Fix documentation header to match main site 2018-09-30 20:19:57 -04:00
Bryan W. Weber
7e56bbaafe
[SCons] Add documentation location to post-install message 2018-09-30 20:15:43 -04:00
band-a-prend
72d2fc4f8c
[SCons/Doc] Fix too long time offline render of Sphinx Docs pages
Add asynchronous ('async', 'media' and conditional 'defer' attributes) loading of remote javascript
and css files within Cantera 2.4.0 Sphinx Documentation to avoid too long render of pages
in case of offline usage of documentation.
2018-09-29 23:21:50 +03:00
band-a-prend
59eabbe454
[SCons/Doc] Fix installation of Sphinx docs
Fix installation of Cantera Sphinx Documentation
via similar way as it was done for Doxygen documentation
https://github.com/Cantera/cantera/commit/8f2468d
2018-09-26 02:18:32 +03:00
Ray Speth
7142a7b0c4 [SCons] Do checks for full and minimal Python modules simultaneously 2018-09-19 17:59:59 -04:00
Ray Speth
09ee87068a [Python/Test] Use assertRaisesRegex to make tests more specific 2018-09-19 17:59:59 -04:00
Ray Speth
0f1da269fc [SCons] Simplify handling of PYTHONPATH in the test suite 2018-09-19 17:59:59 -04:00
Ray Speth
d01992c79c [Python] Remove workarounds for Python 3.2 compatibility 2018-09-19 17:59:59 -04:00
Ray Speth
9279e0828e [SCons] Expand environment variables and ~/ when used in cantera.conf 2018-09-19 17:59:59 -04:00
Ray Speth
4de4aa3f65 Fix some warnings when using ctml_writer with Python 3 2018-09-19 17:59:59 -04:00
Ray Speth
43565c90f5 [SCons] Allow specifying non-absolute paths for 'python_cmd'
This allows e.g. 'python_cmd=python3' without needing to know what
directory that actually comes from.
2018-09-19 17:59:59 -04:00
Ray Speth
dd7c97cb1d [Python] Remove legacy code that provided Python 2.7 support
This removes Python 2.7 support from the "full" Python module. The
"minimal" Python module (the ctml_writer and ck2cti scripts) and the
SCons build system still support Python 2.7.

Remove 'from __future__' imports, specification of base class
'object', and arguments to 'super()'.

Make use of 'str' being the unicode string type.

Eliminate special cases which require checking the version.

Fix some deprecation warnings issued by legacy capabilities.
2018-09-19 17:59:59 -04:00
Ray Speth
0707caaee6 [SCons] Check for a supported version of Python 2018-09-19 17:59:59 -04:00
Ray Speth
d2a1bf1e6a [CI] Use updated upstream packages to build docs
The issues which forced the use of patched versions of these packages
have been resolved.
2018-09-19 17:59:59 -04:00
Ray Speth
33591282f5 [SCons] Use Cython from the targeted copy of Python
Use the Cython module from the Python installation specified by
'python_cmd', rather than the Python installation that is running
SCons. This allows complilation of Cantera for Python versions that
aren't supported by SCons (e.g. Python 3.4).
2018-09-19 17:59:59 -04:00
Ray Speth
d6da006e3e [SCons] Only build the Python package for Python 3.x 2018-09-19 17:59:59 -04:00
Ray Speth
dcb7f34b4a [SCons] Remove non-functional python_array_home option
This option has been broken since before Cantera 2.3.0, so must have
been unused.
2018-09-19 17:59:59 -04:00
Ray Speth
e2cfb7f505 [CI] Use Python 3 exclusively for Travis and Appveyor builds 2018-09-19 17:59:59 -04:00
Ray Speth
9df98d6ac1 [SCons] show any unexpected output from command to check numpy version 2018-09-19 17:59:59 -04:00
g3bk47
1166c74127 add std:: to "inner_product" and "accumulate"
This only works because the "dot" function is always called with std::vector<T>::iterator as input so that "argument dependent lookup" introduces the std namespace to the function. If the dot function is called like this "dot(v.data(), v.data()+v.size(), v.data())", where "v" is a std::vector and the input are plain pointers, the compiler will not find "inner_product". The same is true for the use of "accumulate".
2018-09-14 13:56:48 -04:00
Ray Speth
b0b66d7211 [Python] Make transport properties accessible with the Water() function 2018-09-07 23:24:23 -04:00
Ray Speth
0ade0acf18 [Transport] Relax requirements of thermo model for WaterTransport
The ThermoPhase object used by the WaterTransport model can be any
reasonably-accurate equation of state for water.
2018-09-07 23:24:23 -04:00
Ray Speth
426c2bc56e [Transport] Move calculations into WaterTransport class
Calculating viscosity and thermal conductivity in the WaterProps class
was just an unnecessary level of indirection.
2018-09-07 23:24:23 -04:00
Ray Speth
ff4958a720 [Transport] Migrate wtWater test to GTest test suite 2018-09-07 23:24:23 -04:00
Ray Speth
b0deb41708 [Transport] Make WaterTransport constructible using newTransportMgr
This makes it possible to specify the WaterTransport model in XML input files,
and to use the model from Python and Matlab.

Resolves #289
2018-09-07 23:24:23 -04:00
Ray Speth
d9f9f69fc3 [SCons/Test] Regression tests also look for input files in test/data
This allows the elimination of a number of duplicate input files.
2018-09-07 23:24:23 -04:00
Ray Speth
f46df83841 [Thermo] Make WaterSSTP constructible using newPhase
This makes it possible to create a WaterSSTP phase using an XML input file, and
use this model from Python and Matlab.
2018-09-07 23:24:23 -04:00
Ray Speth
ef40d4418d [Doc] Fix some Doxygen warnings 2018-08-28 16:45:49 -04:00
Ray Speth
b7f3ab561b Fix compiler warnings issued by Visual Studio 2015 2018-08-28 16:45:49 -04:00
Ray Speth
fc7c85f8d1 [clib] Fix some size_t related compiler warnings 2018-08-28 16:45:49 -04:00
Ray Speth
719dbcc650 Fix warnings about Cabinet::s_storage
Recent versions of clang++ warn that instantiation of a templated variable is
required at a certain point where no definition is available. Declaring such a
definition to be available is fine with older versions of clang++ as well, but
causes linker errors with g++, so this change is only applied when using
clang++.
2018-08-28 16:45:49 -04:00
Ray Speth
833d79aeb6 Fix compiler warning about declaration of BandMatrix::PivData 2018-08-28 16:45:49 -04:00
Ray Speth
51263193de Bump version to 2.5.0a1 2018-08-28 16:45:49 -04:00
Ray Speth
e4362d37e7 [Kinetics] Check for non-existent species in reaction orders
When the nonreactant_orders option was enabled, specifying reactant orders for
species which were not present in the phase previously resulted in out-of-bounds
memory access.
2018-08-28 16:40:43 -04:00
Ray Speth
c4e89ac5da [Doc] Fix another error in SRI reaction docstring 2018-08-27 20:27:04 -04:00
g3bk47
a1f9a178e0 Correct doxygen string for SRI reactions
Should be "T^e" instead of "exp(\frac{-e}{T})" according to CHEMKIN theory guide and actual code in https://github.com/Cantera/cantera/blob/master/src/kinetics/Falloff.cpp#L101 .
2018-08-27 20:15:35 -04:00
664 changed files with 31414 additions and 47060 deletions

2
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,2 @@
github: [numfocus]
custom: ['https://numfocus.org/donate-to-cantera']

42
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,42 @@
---
name: Bug report
about: Report reproducible software issues so we can improve
title: ''
labels: ''
assignees: ''
---
Please fill in the following information to report a problem with Cantera.
If you have a question about using Cantera, please post it on our
[Google Users' Group](https://groups.google.com/forum/#!forum/cantera-users).
**System information**
- Cantera version: [e.g. 2.4]
- OS: [e.g. Windows 10]
- Python/MATLAB version:
**Expected behavior**
A clear and concise description of what you expected to happen.
**Actual behavior**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Open '...'
2. Run '....'
3. See error '....'
**Attachments**
If applicable, attach scripts and/or input files to help explain your problem.
Please do *not* attach screenshots of code or terminal output.
**Additional context**
Add any other context about the problem here.

View file

@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest a new feature to enhance Cantera's capabilities
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe**
A clear and concise description of the problem you're trying to solve.
**Describe the desired solution**
A clear and concise description of a new feature and its application. For
example, "It would be great if Cantera could..."
**Describe alternatives you have considered**
A clear and concise description of any alternative solutions or features you
have considered.
**Additional context**
Add any other context about the feature request here.

17
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,17 @@
Thanks for contributing code! Please include a description of your change and
check your PR against the list below (for further questions, refer to the
[contributing guide](https://github.com/Cantera/cantera/blob/master/CONTRIBUTING.md)).
- [ ] There is a clear use-case for this code change
- [ ] The commit message has a short title & references relevant issues
- [ ] Build passes (`scons build` & `scons test`) and unit tests address code coverage
**Please fill in the issue number this pull request is fixing**
Fixes #
**Changes proposed in this pull request**
-
-
-

38
.github/SUPPORT.md vendored Normal file
View file

@ -0,0 +1,38 @@
# How to get support
> This project has a [Code of Conduct](https://github.com/Cantera/cantera/blob/master/CODE_OF_CONDUCT.md).
> By interacting with this repository, organisation, or community you agree to
> abide by its terms.
For **help**, **support** and **questions** please create a post on the
**[Cantera Users' Group](https://groups.google.com/group/cantera-users)**.
Any discussion of Cantera functionality such as how to use certain function
calls, syntax problems, input files, etc. should be directed to the Users' Group.
Further, the **[Cantera Gitter Chat](https://gitter.im/Cantera/Lobby)** is an
infrequently monitored chat room that can be used to discuss tangentially-related
topics such as how to model the underlying physics of a problem, share cool
applications that you have developed, etc.
Please **_do not_** raise an issue on GitHub unless it is a bug report or a
feature request. Issues that do not fall into these categories will be closed.
If you're not sure, please make a post on the
[Users' Group](https://groups.google.com/group/cantera-users) and someone will
be able to help you out.
## Documentation
The [documentation](https://cantera.org/documentation)
offers a number of starting points:
- [Python tutorial](https://cantera.org/tutorials/python-tutorial.html)
- [Application Examples in Python (Jupyter)](https://github.com/Cantera/cantera-jupyter#cantera-jupyter)
- [A guide to Cantera's input file format](https://cantera.org/tutorials/input-files.html)
- [Information about the Cantera community](https://cantera.org/community.html)
Documentation for the [development version of
Cantera](https://cantera.org/documentation/dev-docs.html) is also available.
## Contributions
See [`CONTRIBUTING.md`](https://github.com/Cantera/cantera/blob/master/CONTRIBUTING.md) on how to contribute.

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
doc/ctdeploy_key
*~
*#
*.o
*.so
*.os

3
.gitmodules vendored
View file

@ -10,3 +10,6 @@
[submodule "ext/eigen"]
path = ext/eigen
url = https://github.com/eigenteam/eigen-git-mirror
[submodule "ext/yaml-cpp"]
path = ext/yaml-cpp
url = https://github.com/jbeder/yaml-cpp.git

View file

@ -1,18 +1,17 @@
language: cpp
sudo: false
dist: trusty
dist: xenial
os:
- linux
- osx
addons:
apt:
packages:
- python-dev
- python-numpy
- python-pip
- python3-pip
- python3-dev
- python3-numpy
- python3-setuptools
- scons
- gfortran
- libsundials-serial-dev
- liblapack-dev
@ -31,31 +30,35 @@ env:
before_script: |
echo TRAVIS_OS_NAME: $TRAVIS_OS_NAME
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update > /dev/null
brew upgrade python # Installs Python 3
brew install python@2 # Installs Python 2
brew install scons # Install SCons which *should* use Python 3
pip3 install numpy cython # Install numpy and Cython for Python 3
pip2 install numpy 3to2 # Install numpy and 3to2 for Python 2
brew install boost
export CONDA_ARCH="${TRAVIS_OS_NAME}_${BUILD_ARCH}"
curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda
source $HOME/miniconda/etc/profile.d/conda.sh && conda activate
conda config --set always_yes yes --set changeps1 no
conda install -q numpy cython scons boost ruamel_yaml
conda install -q -c conda-forge openmp
else
pip2 install --user --install-option="--no-cython-compile" cython
pip2 install --user 3to2
pip3 install --user --upgrade pip
pip3 install --user --upgrade setuptools wheel
pip3 install --user cython
pip3 install --user ruamel.yaml==0.15.94 # Need a version compatible with Python 3.4
# Install packages for the documentation
pip2 install --user sphinx sphinxcontrib-matlabdomain
# These two packages have specific bug fixes from these branches
pip2 install --user https://github.com/Cantera/doxylink/archive/fix_relative_path_source_14.tar.gz
pip2 install --user https://github.com/bryanwweber/sphinxcontrib-katex/archive/fix-options-bug.tar.gz
pip3 install --user sphinx sphinxcontrib-matlabdomain sphinxcontrib-doxylink
pip3 install --user https://github.com/hagenw/sphinxcontrib-katex/archive/master.tar.gz
fi
rm -f cantera.conf
script: |
set -e
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
set -e
scons build -j2 VERBOSE=y python2_package=full python3_package=full python3_cmd=/usr/bin/python3 blas_lapack_libs=lapack,blas optimize=n coverage=y
scons build -j2 python_cmd=/usr/bin/python3 VERBOSE=y python_package=full blas_lapack_libs=lapack,blas optimize=n coverage=y
scons test
scons build sphinx_docs=y doxygen_docs=y
scons samples
scons build sphinx_docs=y doxygen_docs=y sphinx_cmd="/usr/bin/python3 `which sphinx-build`"
if [[ "${TRAVIS_PULL_REQUEST}" == "false" ]] && [[ "${TRAVIS_BRANCH}" == "master" ]] && [[ "${TRAVIS_REPO_SLUG}" == "Cantera/cantera" ]]; then
cd build
find docs -type f | grep -v /xml/ | grep -v .map$ | grep -v .md5$ | tar cjvf docs/dev-docs.tar.bz2 --files-from - >/dev/null
cd -
openssl aes-256-cbc -k "${ctdeploy_pass}" -in ./doc/ctdeploy_key.enc -out ./doc/ctdeploy_key -d
chmod 0600 ./doc/ctdeploy_key
RSYNC_OPTIONS=(
@ -77,10 +80,11 @@ script: |
echo "Skipping documentation upload from source other than Cantera/cantera:master"
fi
else
python3 `which scons` build -j2 VERBOSE=y python2_package=full python3_package=full python2_cmd=/usr/local/opt/python@2/bin/python2 blas_lapack_libs=lapack,blas optimize=n coverage=y
python3 `which scons` test
scons build -j2 python_cmd=python3 VERBOSE=y python_package=full blas_lapack_libs=lapack,blas optimize=n coverage=y extra_inc_dirs=$CONDA_PREFIX/include extra_lib_dirs=$CONDA_PREFIX/lib
scons test
scons samples
fi
after_success: |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
bash <(curl -s https://codecov.io/bash)
fi

27
AUTHORS
View file

@ -4,17 +4,42 @@ partial, alphabetical list of developers and contributors to Cantera over the
years. If you've been left off, please report the omission on the Github issue
tracker.
Emil Atz
Philip Berndt
Wolfgang Bessler, Offenburg University of Applied Science
Tilman Bremer
Victor Brunini, Sandia National Laboratory
Bang-Shiuh Chen, Purdue University
Steven Decaluwe, Colorado School of Mines
Ryan Crisanti
Nicholas Curtis
Steven DeCaluwe, Colorado School of Mines
Vishesh Devgan
Thomas Fiala, Technische Universität München
David Fronczek
@g3bk47
Matteo Giani
Dave Goodwin, California Institute of Technology
John Hewson, Sandia National Laboratory
Trevor Hickey
Yuanjie Jiang
Jon Kristofer
Kyle Linevitch, Jr.
Christopher Leuth
Nicholas Malaya, University of Texas at Austin
Thanasis Mattas, Aristotle University of Thessaloniki
Evan McCorkle
Ivan Mitrichev, Mendeleev University of Chemical Technology of Russia
Harry Moffat, Sandia National Laboratory
Christopher Neal
Kyle Niemeyer, Oregon State University
Paul Northrop
Andreas Rücker
Jeff Santner
Satyam Saxena
Ingmar Schoegl, Louisiana State University
Santosh Shanbhogue, Massachusetts Institute of Technology
David Sondak
Raymond Speth, Massachusetts Institute of Technology
Sergey Torokhov
Bryan Weber, University of Connecticut
Armin Wehrfritz

View file

@ -20,9 +20,9 @@
followed by a blank line and a more detailed summary, if any)
* Make related changes in a single commit, and unrelated changes in separate
commits
* Make sure that your commits do not include any undesired files, e.g. files
* Make sure that your commits do not include any undesired files, e.g., files
produced as part of the build process or other temporary files.
* Use Git's history-rewriting features (i.e. `git rebase -i`; see
* Use Git's history-rewriting features (i.e., `git rebase -i`; see
https://help.github.com/articles/about-git-rebase/) to organize your commits
and squash "fixup" commits and reversions.
* Do not merge your branch with `master`. If needed, you should rebase your branch
@ -33,7 +33,8 @@
integration tests run using Travis and AppVeyor and resolve any issues that
arise.
* Additional discussion of good Git & Github workflow is provided at
http://matplotlib.org/devel/gitwash/development_workflow.html and https://docs.scipy.org/doc/numpy-dev/dev/index.html
http://matplotlib.org/devel/gitwash/development_workflow.html and
https://docs.scipy.org/doc/numpy-1.15.0/dev/gitwash/development_workflow.html
* Cantera is licensed under a [BSD
license](https://github.com/Cantera/cantera/blob/master/License.txt) which
allows others to freely modify the code, and if your Pull Request is accepted,
@ -52,8 +53,9 @@
* Write comments to explain non-obvious operations
## C++
* All classes, member variables, and methods should have Doxygen-style comments
(e.g. comment lines starting with `//!` or comment blocks starting with `/*!`)
(e.g., comment lines starting with `//!` or comment blocks starting with `/*!`)
* Avoid defining non-trivial functions in header files
* Header files should include an 'include guard'
* Protected and private member variable names are generally prefixed with
@ -73,7 +75,7 @@
avoid unnecessary increases in compilation time. Boost should not be added
to the public interface unless its existence and use is optional. This keeps
the number of dependencies low for users of Cantera. In these cases,
CANTERA_API_NO_BOOST should be used to conditionally remove Boost dependencies.
`CANTERA_API_NO_BOOST` should be used to conditionally remove Boost dependencies.
* While Cantera does not specifically follow these rules, the following style
guides are useful references for possible style choices and the rationales behind them.
* The Google C++ Style Guide: https://google.github.io/styleguide/cppguide.html
@ -85,7 +87,7 @@
## Python
* Style generally follows PEP8 (https://www.python.org/dev/peps/pep-0008/)
* Code in .py files needs to be written to work with both Python 2
and Python 3. Code in Cython files (.pyx or .pxd) should automatically work with both.
* Code in the Python examples should be written for Python 3. Python 2 versions
are automatically generated as part of the build process
* Code in `.py` and `.pyx` files needs to be written to work with Python 3
* The minimum Python version that Cantera supports is Python 3.4, so code should only use features added in Python 3.4 or earlier
* Code in `ctml_writer.py` and `ck2cti.py` needs to be written to work with both Python 2 and Python 3
* Code in the Python examples should be written for Python 3

View file

@ -1,14 +0,0 @@
### Cantera version
### Operating System
### Python/MATLAB version
### Expected Behavior
### Actual Behavior
### Steps to reproduce
1.
2.
3.

View file

@ -1,8 +0,0 @@
Please fill in the issue number this pull request is fixing:
Fixes #
Changes proposed in this pull request:
-
-
-

View file

@ -9,8 +9,8 @@ What is Cantera?
================
Cantera is an open-source collection of object-oriented software tools for
problems involving chemical kinetics, thermodynamics, and transport
processes. Among other things, it can be used to:
problems involving chemical kinetics, thermodynamics, and transport processes.
Among other things, it can be used to:
* Evaluate thermodynamic and transport properties of mixtures
* Compute chemical equilibrium
@ -25,28 +25,27 @@ Cantera can be used from Python and Matlab, or in applications written in C++
and Fortran 90. A number of `examples of Cantera's capabilities
<https://github.com/Cantera/cantera-jupyter>`_ are available in the form of
Jupyter notebooks. These examples can be tried interactively, in the cloud by
using the following Binder link:
using the following MyBinder link:
.. image:: http://mybinder.org/badge.svg
:target: http://mybinder.org:/repo/cantera/cantera-jupyter
.. image:: https://mybinder.org/badge.svg
:target: https://mybinder.org/repo/cantera/cantera-jupyter
Installation
============
`Installation instructions for the current release of Cantera
<https://cantera.org/install/index.html>`_ are available from
the main `Cantera documentation site
<https://cantera.org>`_. Installers are
provided for Windows (MSI packages), macOS (through Homebrew), and
Ubuntu. Anaconda packages containing the Cantera Python module are also
available for Windows, macOS, and Linux.
<https://cantera.org/install/index.html>`_ are available from the main `Cantera
documentation site <https://cantera.org>`_. Installers are provided for Windows
(MSI packages), macOS (through Homebrew), and Ubuntu. Anaconda packages
containing the Cantera Python module are also available for Windows, macOS, and
Linux.
.. image:: https://anaconda.org/cantera/cantera/badges/installer/conda.svg
:target: https://anaconda.org/Cantera/cantera
For other platforms, or for users wishing to install a development version of
Cantera, `compilation instructions
<https://cantera.org/install/index.html>`_ are also available.
Cantera, `compilation instructions <https://cantera.org/install/index.html>`_
are also available.
Documentation
=============
@ -71,7 +70,7 @@ Code of Conduct
.. image:: https://img.shields.io/badge/code%20of%20conduct-contributor%20covenant-green.svg?style=flat-square
:alt: conduct
:target: http://contributor-covenant.org/version/1/4/
:target: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
In order to have a more open and welcoming community, Cantera adheres to a
`code of conduct <CODE_OF_CONDUCT.md>`_ adapted from the `Contributor Covenent
@ -79,19 +78,19 @@ code of conduct <https://contributor-covenant.org/>`_.
Please adhere to this code of conduct in any interactions you have in the
Cantera community. It is strictly enforced on all official Cantera
repositories, websites, users' group, and other resources.
If you encounter someone violating these terms, please
`contact the code of conduct team <mailto:conduct@cantera.org>`_
(`@speth <https://github.com/speth>`_,
`@bryanwweber <https://github.com/bryanwweber>`_, and
`@kyleniemeyer <https://github.com/kyleniemeyer>`_)
and we will address it as soon as possible.
repositories, websites, users' group, and other resources. If you encounter
someone violating these terms, please `contact the code of conduct team
<mailto:conduct@cantera.org>`_ (`@speth <https://github.com/speth>`_,
`@bryanwweber <https://github.com/bryanwweber>`_, and `@kyleniemeyer
<https://github.com/kyleniemeyer>`_) and we will address it as soon as
possible.
Development Site
================
The current stable version is 2.4.0. The `latest Cantera source code <https://github.com/Cantera/cantera>`_, the
`issue tracker <https://github.com/Cantera/cantera/issues>`_ for bugs and
The current development version is 2.5.0a3. The current stable version is
2.4.0. The `latest Cantera source code <https://github.com/Cantera/cantera>`_,
the `issue tracker <https://github.com/Cantera/cantera/issues>`_ for bugs and
enhancement requests, `downloads of Cantera releases and binary installers
<https://github.com/Cantera/cantera/releases>`_ , and the `Cantera wiki
<https://github.com/Cantera/cantera/wiki>`_ can all be found on Github.
@ -99,25 +98,33 @@ enhancement requests, `downloads of Cantera releases and binary installers
Users' Group
============
The `Cantera Users' Group <http://groups.google.com/group/cantera-users>`_ is a
The `Cantera Users' Group <https://groups.google.com/group/cantera-users>`_ is a
message board / mailing list for discussions amongst Cantera users.
Cantera Gitter Chat
============
===================
.. image:: https://badges.gitter.im/org.png
:target: https://gitter.im/Cantera/Lobby
The `Cantera Gitter Chat <https://gitter.im/Cantera/Lobby>`_ is a public chat client that is linked to users' Github account. The developers do not closely monitor the discussion, so *any* discussion at all of Cantera functionality such as how to use certain function calls, syntax problems, input files, etc. should be directed the User's Group. All conversations in the Gitter room will be covered under the Cantera Code of Conduct, so please be nice.
The `Cantera Gitter Chat <https://gitter.im/Cantera/Lobby>`_ is a public chat
client that is linked to users' Github account. The developers do not closely
monitor the discussion, so *any* discussion at all of Cantera functionality
such as how to use certain function calls, syntax problems, input files, etc.
should be directed the User's Group. All conversations in the Gitter room will
be covered under the Cantera Code of Conduct, so please be nice.
The chat room is a place to strengthen and develop the Cantera community, discuss tangentially-related topics such as how to model the underlying physics of a problem , share cool applications youve developed, etc.
The chat room is a place to strengthen and develop the Cantera community,
discuss tangentially-related topics such as how to model the underlying physics
of a problem , share cool applications youve developed, etc.
Summary:
“How do I perform this Cantera function call?” --> User's Group
"What do I do with the variables that a Cantera function call returns?” --> Chat
"What do I do with the variables that a Cantera function call returns?” -->
Chat
Continuous Integration Status
@ -134,19 +141,16 @@ Windows x64 Appveyor |appveyor|
NumFOCUS
========
Cantera is a fiscally-sponsored project of NumFOCUS, a non-profit dedicated to
supporting the open source scientific computing community.
Cantera is a fiscally-sponsored project of `NumFOCUS <https://numfocus.org>`__,
a non-profit dedicated to supporting the open source scientific computing
community. Please consider `making a donation
<https://numfocus.salsalabs.org/donate-to-cantera/index.html>`__ to support the
development of Cantera through NumFOCUS.
.. image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
:target: https://numfocus.org
:target: https://numfocus.salsalabs.org/donate-to-cantera/index.html
:alt: Powered by NumFOCUS
.. |cantera| image:: https://cantera.org/assets/img/cantera-logo.png
:target: https://cantera.org
:alt: cantera logo

View file

@ -65,10 +65,8 @@ if 'clean' in COMMAND_LINE_TARGETS:
removeDirectory('include/cantera/ext')
removeFile('interfaces/cython/cantera/_cantera.cpp')
removeFile('interfaces/cython/cantera/_cantera.h')
removeFile('interfaces/cython/setup2.py')
removeFile('interfaces/cython/setup3.py')
removeFile('interfaces/python_minimal/setup2.py')
removeFile('interfaces/python_minimal/setup3.py')
removeFile('interfaces/cython/setup.py')
removeFile('interfaces/python_minimal/setup.py')
removeFile('config.log')
removeDirectory('doc/sphinx/matlab/examples')
removeFile('doc/sphinx/matlab/examples.rst')
@ -80,6 +78,7 @@ if 'clean' in COMMAND_LINE_TARGETS:
for name in os.listdir('interfaces/cython/cantera/data/'):
if name != '__init__.py':
removeFile('interfaces/cython/cantera/data/' + name)
removeDirectory('interfaces/cython/cantera/test/data/test_subdir')
for name in os.listdir('interfaces/cython/cantera/test/data/'):
if name != '__init__.py':
removeFile('interfaces/cython/cantera/test/data/' + name)
@ -113,7 +112,7 @@ if 'clean' in COMMAND_LINE_TARGETS:
if 'test-clean' in COMMAND_LINE_TARGETS:
removeDirectory('build/test')
removeDirectory('test/work')
removeDirectory('build/python_minimal')
removeDirectory('build/python_local')
# ******************************************************
# *** Set system-dependent defaults for some options ***
@ -255,7 +254,15 @@ defaults.noDebugLinkFlags = ''
defaults.warningFlags = '-Wall'
defaults.buildPch = False
env['pch_flags'] = []
env['openmp_flag'] = '-fopenmp' # used to generate sample build scripts
env['openmp_flag'] = ['-fopenmp'] # used to generate sample build scripts
env['using_apple_clang'] = False
# Check if this is actually Apple's clang on macOS
if env['OS'] == 'Darwin':
result = subprocess.check_output([env.subst('$CC'), '--version']).decode('utf-8')
if 'clang' in result.lower() and result.startswith('Apple LLVM'):
env['using_apple_clang'] = True
env['openmp_flag'].insert(0, '-Xpreprocessor')
if 'gcc' in env.subst('$CC') or 'gnu-cc' in env.subst('$CC'):
defaults.optimizeCcFlags += ' -Wno-inline'
@ -278,13 +285,13 @@ elif env['CC'] == 'cl': # Visual Studio
defaults.warningFlags = '/W3'
defaults.buildPch = True
env['pch_flags'] = ['/FIpch/system.h']
env['openmp_flag'] = '/openmp'
env['openmp_flag'] = ['/openmp']
elif 'icc' in env.subst('$CC'):
defaults.cxxFlags = '-std=c++0x'
defaults.ccFlags = '-vec-report0 -diag-disable 1478'
defaults.warningFlags = '-Wcheck'
env['openmp_flag'] = '-openmp'
env['openmp_flag'] = ['-openmp']
elif 'clang' in env.subst('$CC'):
defaults.ccFlags = '-fcolor-diagnostics'
@ -327,6 +334,14 @@ config_options = [
'prefix',
'Set this to the directory where Cantera should be installed.',
defaults.prefix, PathVariable.PathAccept),
PathVariable(
'libdirname',
"""Set this to the directory where Cantera libraries should be installed.
Some distributions (e.g. Fedora/RHEL) use 'lib64' instead of 'lib' on 64-bit systems
or could use some other library directory name instead of 'lib' depends
on architecture and profile (e.g. Gentoo 'libx32' on x32 profile).
If user didn't set 'libdirname' configuration variable set it to default value 'lib'""",
'lib', PathVariable.PathAccept),
EnumVariable(
'python_package',
"""If you plan to work in Python, then you need the ``full`` Cantera Python
@ -345,15 +360,10 @@ config_options = [
"""Cantera needs to know where to find the Python interpreter. If
PYTHON_CMD is not set, then the configuration process will use the
same Python interpreter being used by SCons.""",
sys.executable),
PathVariable(
'python_array_home',
"""If NumPy was installed using the '--home' option, set this to the home
directory for NumPy for Python 2.""",
'', PathVariable.PathAccept),
sys.executable, PathVariable.PathAccept),
PathVariable(
'python_prefix',
"""Use this option if you want to install the Cantera Python 2 package to
"""Use this option if you want to install the Cantera Python package to
an alternate location. On Unix-like systems, the default is the same
as the 'prefix' option. If the 'python_prefix' option is set to
the empty string or the 'prefix' option is not set, then the package
@ -361,65 +371,22 @@ config_options = [
To install to the current user's 'site-packages' directory, use
'python_prefix=USER'.""",
defaults.python_prefix, PathVariable.PathAccept),
EnumVariable(
'python2_package',
"""Controls whether or not the Python 2 module will be built. By
default, the module will be built if the Python 2 interpreter
and the required dependencies (NumPy for Python 2 and Cython
for the version of Python for which SCons is installed) can be
found.""",
'default', ('full', 'minimal', 'y', 'n', 'none', 'default')),
PathVariable(
'python2_cmd',
"""The path to the Python 2 interpreter. The default is
'python2'; if this executable cannot be found, this
value must be specified to build the Python 2 module.""",
'python2', PathVariable.PathAccept),
PathVariable(
'python2_array_home',
"""If NumPy was installed using the '--home' option, set this to the home
directory for NumPy for Python 2.""",
'', PathVariable.PathAccept),
PathVariable(
'python2_prefix',
"""Use this option if you want to install the Cantera Python 2 package to
an alternate location. On Unix-like systems, the default is the same
as the 'prefix' option. If the 'python_prefix' option is set to
the empty string or the 'prefix' option is not set, then the package
will be installed to the system default 'site-packages' directory.
To install to the current user's 'site-packages' directory, use
'python2_prefix=USER'.""",
defaults.python_prefix, PathVariable.PathAccept),
EnumVariable(
'python3_package',
"""Controls whether or not the Python 3 module will be built. By
default, the module will be built if the Python 3 interpreter
and the required dependencies (NumPy for Python 3 and Cython
for the version of Python for which SCons is installed) can be
found.""",
"""Deprecated synonym for the 'python_package' option. Will be overridden
if 'python_package' is set.""",
'default', ('full', 'minimal', 'y', 'n', 'none', 'default')),
PathVariable(
'python3_cmd',
"""The path to the Python 3 interpreter. The default is
'python3'; if this executable cannot be found, this
value must be specified to build the Python 3 module.""",
'python3', PathVariable.PathAccept),
PathVariable(
'python3_array_home',
"""If NumPy was installed using the '--home' option, set this to the home
directory for NumPy for Python 3.""",
'', PathVariable.PathAccept),
"""Deprecated synonym for the 'python_cmd' option. Will be overridden
if 'python_cmd' is set.""",
sys.executable, PathVariable.PathAccept),
PathVariable(
'python3_prefix',
"""Use this option if you want to install the Cantera Python 3 package to
an alternate location. On Unix-like systems, the default is the same
as the 'prefix' option. If the 'python_prefix' option is set to
the empty string or the 'prefix' option is not set, then the package
will be installed to the system default 'site-packages' directory.
To install to the current user's 'site-packages' directory, use
'python3_prefix=USER'.""",
"""Deprecated synonym for the 'python_prefix' option. Will be overridden
if 'python_prefix' is set.""",
defaults.python_prefix, PathVariable.PathAccept),
EnumVariable(
EnumVariable(
'matlab_toolbox',
"""This variable controls whether the MATLAB toolbox will be built. If
set to 'y', you will also need to set the value of the 'matlab_path'
@ -482,6 +449,14 @@ config_options = [
('y'), from a Git submodule ('n'), or to decide automatically
('default').""",
'default', ('default', 'y', 'n')),
EnumVariable(
'system_yamlcpp',
"""Select whether to use the yaml-cpp library from a system installation
('y'), from a Git submodule ('n'), or to decide automatically
('default'). If yaml-cpp is not installed directly into system
include and library directories, then you will need to add those
directories to 'extra_inc_dirs' and 'extra_lib_dirs'.""",
'default', ('default', 'y', 'n')),
EnumVariable(
'system_sundials',
"""Select whether to use SUNDIALS from a system installation ('y'), from
@ -509,7 +484,8 @@ config_options = [
Cantera will use Eigen for linear algebra support. To use BLAS
and LAPACK, set 'blas_lapack_libs' to the the list of libraries
that should be passed to the linker, separated by commas, e.g.,
"lapack,blas" or "lapack,f77blas,cblas,atlas".""",
"lapack,blas" or "lapack,f77blas,cblas,atlas". Eigen is required
whether or not BLAS/LAPACK are used.""",
''),
PathVariable(
'blas_lapack_dir',
@ -655,11 +631,16 @@ config_options = [
BoolVariable(
'versioned_shared_library',
"""If enabled, create a versioned shared library, with symlinks to the
more generic library name, e.g. 'libcantera_shared.so.2.4.0' as the
more generic library name, e.g. 'libcantera_shared.so.2.5.0' as the
actual library and 'libcantera_shared.so' and 'libcantera_shared.so.2'
as symlinks.
""",
defaults.versionedSharedLibrary),
BoolVariable(
'use_rpath_linkage',
"""If enabled, link to all shared libraries using 'rpath', i.e., a fixed
run-time search path for dynamic library loading.""",
True),
EnumVariable(
'layout',
"""The layout of the directory structure. 'standard' installs files to
@ -669,13 +650,23 @@ config_options = [
files in the subdirectory defined by 'prefix'. This layout is best
with a prefix like '/opt/cantera'. 'debian' installs to the stage
directory in a layout used for generating Debian packages.""",
defaults.fsLayout, ('standard','compact','debian')),
defaults.fsLayout, ('standard','compact','debian'))
]
opts.AddVariables(*config_options)
opts.Update(env)
opts.Save('cantera.conf', env)
# Expand ~/ and environment variables used in cantera.conf (variables used on
# the command line will be expanded by the shell)
for option in opts.keys():
original = env[option]
if isinstance(original, str):
modified = os.path.expandvars(os.path.expanduser(env[option]))
if original != modified:
print('INFO: Expanding {!r} to {!r}'.format(original, modified))
env[option] = modified
if 'help' in COMMAND_LINE_TARGETS:
### Print help about configuration options and exit.
print("""
@ -717,7 +708,7 @@ for arg in ARGUMENTS:
sys.exit(1)
# Require a StrictVersion-compatible version
env['cantera_version'] = "2.4.0"
env['cantera_version'] = "2.5.0a3"
ctversion = StrictVersion(env['cantera_version'])
# For use where pre-release tags are not permitted (MSI, sonames)
env['cantera_pure_version'] = '.'.join(str(x) for x in ctversion.version)
@ -738,6 +729,11 @@ print()
# *** Configure system-specific properties ***
# ********************************************
# Prevent setting prefix for Cantera installation to source directory
if os.path.abspath(env['prefix']) == Dir('.').abspath:
print('ERROR: cannot install Cantera into source directory.')
exit(1)
# Copy in external environment variables
if env['env_vars'] == 'all':
env['ENV'].update(os.environ)
@ -762,6 +758,9 @@ env['extra_lib_dirs'] = [d for d in env['extra_lib_dirs'].split(':') if d]
env.Append(CPPPATH=env['extra_inc_dirs'],
LIBPATH=env['extra_lib_dirs'])
if env['use_rpath_linkage']:
env.Append(RPATH=env['extra_lib_dirs'])
if env['CC'] == 'cl':
# embed manifest file
env['LINKCOM'] = [env['LINKCOM'],
@ -774,6 +773,8 @@ if env['boost_inc_dir']:
if env['blas_lapack_dir']:
env.Append(LIBPATH=[env['blas_lapack_dir']])
if env['use_rpath_linkage']:
env.Append(RPATH=env['blas_lapack_dir'])
if env['system_sundials'] in ('y','default'):
if env['sundials_include']:
@ -782,6 +783,8 @@ if env['system_sundials'] in ('y','default'):
if env['sundials_libdir']:
env.Append(LIBPATH=[env['sundials_libdir']])
env['system_sundials'] = 'y'
if env['use_rpath_linkage']:
env.Append(RPATH=env['sundials_libdir'])
# BLAS / LAPACK configuration
if env['blas_lapack_libs'] != '':
@ -927,6 +930,33 @@ elif env['system_googletest'] == 'y':
elif env['system_googletest'] == 'n':
env['googletest'] = 'submodule'
# Check for yaml-cpp library and checkout submodule if needed
if env['system_yamlcpp'] in ('y', 'default'):
if conf.CheckCXXHeader('yaml-cpp/yaml.h', '""'):
env['system_yamlcpp'] = True
print("""INFO: Using system installation of yaml-cpp library.""")
elif env['system_yamlcpp'] == 'y':
config_error('Expected system installation of yaml-cpp library, but it '
'could not be found.')
if env['system_yamlcpp'] in ('n', 'default'):
env['system_yamlcpp'] = False
print("""INFO: Using private installation of yaml-cpp library.""")
if not os.path.exists('ext/yaml-cpp/include/yaml-cpp/yaml.h'):
if not os.path.exists('.git'):
config_error('yaml-cpp is missing. Install source in ext/yaml-cpp.')
try:
code = subprocess.call(['git', 'submodule', 'update', '--init',
'--recursive', 'ext/yaml-cpp'])
except Exception:
code = -1
if code:
config_error('yaml-cpp submodule checkout failed.\n'
'Try manually checking out the submodule with:\n\n'
' git submodule update --init --recursive ext/yaml-cpp\n')
# Check for googletest and checkout submodule if needed
if env['googletest'] in ('system', 'default'):
has_gtest = conf.CheckCXXHeader('gtest/gtest.h', '""')
@ -998,6 +1028,8 @@ print('INFO: Found Eigen version {}'.format(env['EIGEN_LIB_VERSION']))
env['HAS_GLIBCXX'] = conf.CheckDeclaration('__GLIBCXX__', '#include <iostream>', 'C++')
env['HAS_LIBCPP'] = conf.CheckDeclaration('_LIBCPP_VERSION', '#include <iostream>', 'C++')
env['HAS_CLANG'] = conf.CheckDeclaration('__clang__', '', 'C++')
boost_version_source = get_expression_value(['<boost/version.hpp>'], 'BOOST_LIB_VERSION')
retcode, boost_lib_version = conf.TryRun(boost_version_source, '.cpp')
env['BOOST_LIB_VERSION'] = '.'.join(boost_lib_version.strip().split('_'))
@ -1005,26 +1037,35 @@ print('INFO: Found Boost version {0}'.format(env['BOOST_LIB_VERSION']))
if not env['BOOST_LIB_VERSION']:
config_error("Boost could not be found. Install Boost headers or set"
" 'boost_inc_dir' to point to the boost headers.")
# demangle is availble in Boost 1.55 or newer
env['has_demangle'] = conf.CheckDeclaration("boost::core::demangle",
'#include <boost/core/demangle.hpp>', 'C++')
import SCons.Conftest, SCons.SConf
context = SCons.SConf.CheckContext(conf)
ret = SCons.Conftest.CheckLib(context,
['sundials_cvodes'],
header='#include "cvodes/cvodes.h"',
language='C++',
call='CVodeCreate(CV_BDF, CV_NEWTON);',
autoadd=False,
extra_libs=env['blas_lapack_libs'])
if ret:
# Check initially for Sundials<=3.2 and then for Sundials>=4.0
for cvode_call in ['CVodeCreate(CV_BDF, CV_NEWTON);','CVodeCreate(CV_BDF);']:
ret = SCons.Conftest.CheckLib(context,
['sundials_cvodes'],
header='#include "cvodes/cvodes.h"',
language='C++',
call=cvode_call,
autoadd=False,
extra_libs=env['blas_lapack_libs'])
# CheckLib returns False to indicate success
if not ret:
if env['system_sundials'] == 'default':
env['system_sundials'] = 'y'
break
# Execute if the cycle ends without 'break'
else:
if env['system_sundials'] == 'default':
env['system_sundials'] = 'n'
elif env['system_sundials'] == 'y':
config_error('Expected system installation of Sundials, but it could '
'not be found.')
elif env['system_sundials'] == 'default':
env['system_sundials'] = 'y'
# Checkout Sundials submodule if needed
if (env['system_sundials'] == 'n' and
@ -1061,7 +1102,7 @@ if env['system_sundials'] == 'y':
# Ignore the minor version, e.g. 2.4.x -> 2.4
env['sundials_version'] = '.'.join(sundials_version.split('.')[:2])
if env['sundials_version'] not in ('2.4','2.5','2.6','2.7','3.0','3.1'):
if env['sundials_version'] not in ('2.4','2.5','2.6','2.7','3.0','3.1','3.2','4.0','4.1'):
print("""ERROR: Sundials version %r is not supported.""" % env['sundials_version'])
sys.exit(1)
print("""INFO: Using system installation of Sundials version %s.""" % sundials_version)
@ -1158,16 +1199,23 @@ if env['VERBOSE']:
env['python_cmd_esc'] = quoted(env['python_cmd'])
# Python Package Settings
python_min_version = LooseVersion('3.3')
cython_min_version = LooseVersion('0.23')
numpy_min_test_version = LooseVersion('1.8.1')
# If both python2_package and python3_package are set to something
# other than the default ignore the python_package option
if all([env['python{}_package'.format(p)] != 'default' for p in ['2', '3']]):
if env['python_package'] != 'default':
print("WARNING: Both version-specific pythonX_package options are set. Ignoring "
"non-version specific python_package options")
env['python_package'] = 'none'
# Handle the version-specific Python package options
python_options = (('package', 'default'),
('cmd', sys.executable),
('prefix', defaults.python_prefix))
for option, default in python_options:
if env['python3_' + option] != default:
print("WARNING: Option 'python3_{0}' is deprecated."
" Use 'python_{0}' instead.".format(option))
if env['python_' + option] == default:
env['python_' + option] = env['python3_' + option]
else:
print("WARNING: Ignoring option 'python3_{0}'"
" because 'python_{0}' was also set.".format(option))
if env['python_package'] == 'new':
print("WARNING: The 'new' option for the Python package is "
@ -1176,257 +1224,109 @@ if env['python_package'] == 'new':
env['python_package'] = 'full' # Allow 'new' as a synonym for 'full'
elif env['python_package'] == 'y':
env['python_package'] = 'full' # Allow 'y' as a synonym for 'full'
elif env['python_package'] in ['none', 'n']:
if env['python2_package'] == 'default':
env['python2_package'] = 'none'
if env['python3_package'] == 'default':
env['python3_package'] = 'none'
elif env['python_package'] == 'n':
env['python_package'] = 'none' # Allow 'n' as a synonym for 'none'
for py_pkg in ['python2_package', 'python3_package']:
if env[py_pkg] == 'y':
env[py_pkg] = 'full' # Allow 'y' as a synonym for 'full'
elif env[py_pkg] == 'n':
env[py_pkg] = 'none' # Allow 'n' as a synonym for 'none'
env['install_python_action'] = ''
env['python_module_loc'] = ''
if env['python_package'] in ('full', 'minimal', 'default'):
# If the non-specific python_package option is not none, check
# the version of the Python package we want to build using
# python_cmd
script = '\n'.join(["from __future__ import print_function",
"import sys",
"print('{v.major}.{v.minor}'.format(v=sys.version_info))"])
try:
env['python_version'] = getCommandOutput(env['python_cmd'], '-c', script)
except (OSError, subprocess.CalledProcessError) as err:
if env['python_package'] in ['full', 'minimal']:
print('ERROR: Problem checking for Python:')
print(err)
sys.exit(1)
else:
print('WARNING: Problem checking for Python:')
print(err)
print('Continuing with default parameters.')
else:
major = env['python_version'][0]
py_pkg = 'python{}_package'.format(major)
if env[py_pkg] != 'default':
if env['python_package'] != 'default':
# If python_package is default don't print a warning. If python_package has been
# set, warn the user that we're ignoring that option.
print("WARNING: The python{v}_package option has been set to {option}. All "
"non-version-specific Python options (including python_cmd) have been "
"ignored.".format(v=major, option=env[py_pkg]))
else: # pythonX_package is 'default'
# This dictionary has the default values for the Python related variables
default_py_vars = {'python{}_array_home': '', 'python{}_cmd': 'python{}'.format(major),
'python{}_prefix': '$prefix'}
env[py_pkg] = env['python_package']
# Check whether any Python related variables are different from the default
for key, value in default_py_vars.items():
if env[key.format(major)] != value:
print("WARNING: The value for {0} has been set and will be used instead "
"of {1}".format(key.format(major), key.format('')))
else:
env[key.format(major)] = env[key.format('')]
del env['python_version']
# Make sure everything gets converted to properly versioned variables by deleting
# these so they don't get used accidentally
del env['python_package']
del env['python_array_home']
del env['python_cmd']
del env['python_prefix']
require_python = any([env['python{}_package'.format(p)] == 'full' for p in ['2', '3']])
want_python = any([env['python{}_package'.format(p)] == 'default' for p in ['2', '3']])
if require_python or want_python:
# Check for Cython:
try:
import Cython
cython_version = LooseVersion(Cython.__version__)
assert cython_version >= cython_min_version
except ImportError:
message = "Cython could not be imported by the Python interpreter running SCons."
have_cython = False
except AssertionError:
message = ("Cython is an incompatible version: "
"Found {0} but {1} or newer is required.".format(cython_version,
cython_min_version))
have_cython = False
else:
have_cython = True
finally:
if not have_cython:
if require_python:
print('ERROR: ' + message)
sys.exit(1)
elif want_python:
print('WARNING: ' + message)
for py_pkg in ['python{}_package'.format(p) for p in ['2', '3']]:
if env[py_pkg] == 'default':
env[py_pkg] = 'minimal-default'
else:
print('INFO: Using Cython version {0}.'.format(cython_version))
def configure_minimal_python(py_ver):
# Test to see if we can run Python if the minimal interface is to be built
warn_no_python = False
if env['python_package'] != 'none':
# Test to see if we can import numpy and Cython
script = textwrap.dedent("""\
from __future__ import print_function
import sys
print('{v.major}.{v.minor}'.format(v=sys.version_info))
""")
try:
info = getCommandOutput(env['python{}_cmd'.format(py_ver)], '-c', script)
except OSError as err:
if env['VERBOSE']:
print('Error checking for Python {}:'.format(py_ver))
print(err)
warn_no_python = True
except subprocess.CalledProcessError as err:
if env['VERBOSE']:
print('Error checking for Python {}:'.format(py_ver))
print(err, err.output)
warn_no_python = True
else:
(env['python{}_version'.format(py_ver)],) = info.splitlines()[-1:]
if warn_no_python:
if 'default' in env['python{}_package'.format(py_ver)]:
print('WARNING: Not building the minimal Python {py_ver} package because the Python '
'{py_ver} interpreter {interp!r} could not be '
'found.'.format(py_ver=py_ver, interp=env['python{}_cmd'.format(py_ver)]))
env['python{}_package'.format(py_ver)] = 'none'
else:
print('ERROR: Could not execute the Python {py_ver} interpreter {interp!r}.'.format(
py_ver=py_ver, interp=env['python{}_cmd'.format(py_ver)]
))
sys.exit(1)
else:
print('INFO: Building the minimal Python package for Python {0}'.format(env['python{}_version'.format(py_ver)]))
env['python{}_package'.format(py_ver)] = 'minimal'
def configure_full_python(py_ver):
# Test to see if we can import numpy
warn_no_python = False
script = textwrap.dedent("""\
from __future__ import print_function
import sys
print('{v.major}.{v.minor}'.format(v=sys.version_info))
err = ''
try:
import numpy
print(numpy.__version__)
except ImportError:
except ImportError as np_err:
print('0.0.0')
err += str(np_err) + '\\n'
try:
import Cython
print(Cython.__version__)
except ImportError as cython_err:
print('0.0.0')
err += str(cython_err) + '\\n'
if err:
print(err)
""")
if env['python{}_array_home'.format(py_ver)]:
script = "sys.path.append({})\n".format(env['python{}_array_home'.format(py_ver)]) + script
try:
info = getCommandOutput(env['python{}_cmd'.format(py_ver)], '-c', script)
info = getCommandOutput(env['python_cmd'], '-c', script).splitlines()
except OSError as err:
if env['VERBOSE']:
print('Error checking for Python {}:'.format(py_ver))
print('Error checking for Python:')
print(err)
warn_no_python = True
except subprocess.CalledProcessError as err:
if env['VERBOSE']:
print('Error checking for Python {}:'.format(py_ver))
print('Error checking for Python:')
print(err, err.output)
warn_no_python = True
else:
(env['python{}_version'.format(py_ver)], numpy_version) = info.splitlines()[-2:]
numpy_version = LooseVersion(numpy_version)
if numpy_version == LooseVersion('0.0.0'):
print("NumPy for Python {0} not found.".format(env['python{}_version'.format(py_ver)]))
warn_no_python = True
elif numpy_version < numpy_min_test_version:
print("WARNING: The installed version of Numpy for Python {0} is not tested and "
"support is not guaranteed. Found {1} but {2} or newer is preferred".format(
env['python{}_version'.format(py_ver)], numpy_version, numpy_min_test_version))
else:
print('INFO: Using NumPy version {0} for Python {1}.'.format(
numpy_version, env['python{}_version'.format(py_ver)]))
warn_no_python = False
python_version = LooseVersion(info[0])
numpy_version = LooseVersion(info[1])
cython_version = LooseVersion(info[2])
if warn_no_python:
if env['python{}_package'.format(py_ver)] == 'default':
print('WARNING: Not building the full Python {py_ver} package because the Python '
'{py_ver} interpreter {interp!r} could not be found or a required dependency '
'(e.g. numpy) was not found.'.format(py_ver=py_ver, interp=env['python{}_cmd'.format(py_ver)]))
env['python{}_package'.format(py_ver)] = 'minimal-default'
if env['python_package'] == 'default':
print('WARNING: Not building the Python package because the Python '
'interpreter {!r} could not be found'.format(env['python_cmd']))
env['python_package'] = 'none'
else:
print('ERROR: Could not execute the Python {py_ver} interpreter {interp!r} or a required '
'dependency (e.g. numpy) could not be found.'.format(py_ver=py_ver, interp=env['python{}_cmd'.format(py_ver)]))
print('ERROR: Could not execute the Python interpreter {!r}'.format(
env['python_cmd']))
sys.exit(1)
elif env['python_package'] == 'minimal':
print('INFO: Building the minimal Python package for Python {}'.format(python_version))
else:
print('INFO: Building the full Python package for Python {0}'.format(env['python{}_version'.format(py_ver)]))
env['python{}_package'.format(py_ver)] = 'full'
warn_no_full_package = False
if len(info) > 3:
print("WARNING: Unexpected output while checking Python / Numpy / Cython versions:")
print('| ' + '\n| '.join(info[3:]))
for py_ver in [2, 3]:
env['install_python{}_action'.format(py_ver)] = ''
if env['python{}_package'.format(py_ver)] in ['full', 'default']:
configure_full_python(py_ver)
elif env['python{}_package'.format(py_ver)] == 'minimal':
configure_minimal_python(py_ver)
env['python{}_module_loc'.format(py_ver)] = ''
else:
env['python{}_module_loc'.format(py_ver)] = ''
if python_version < python_min_version:
print("WARNING: Python version is incompatible with the full Python module: "
"Found {0} but {1} or newer is required".format(
python_version, python_min_version))
warn_no_full_package = True
# If we're building the full Python interface for one version of Python,
# we probably don't want the minimal interface of the other version
if env['python2_package'] == 'minimal-default' and env['python3_package'] == 'full':
env['python2_package'] = 'none'
elif env['python3_package'] == 'minimal-default' and env['python2_package'] == 'full':
env['python3_package'] = 'none'
if numpy_version == LooseVersion('0.0.0'):
print("NumPy not found.")
warn_no_full_package = True
elif numpy_version < numpy_min_test_version:
print("WARNING: The installed version of Numpy is not tested and "
"support is not guaranteed. Found {0} but {1} or newer is preferred".format(
numpy_version, numpy_min_test_version))
else:
print('INFO: Using NumPy version {0}.'.format(numpy_version))
# 'minimal-default' means that something was wrong with Python or NumPy
# such that the full interface for that version of Python can't be built
# and the pythonX_package option wasn't supplied by the user. Check to see
# if the minimal package should be built
if env['python2_package'] == 'minimal-default':
configure_minimal_python(2)
if env['python3_package'] == 'minimal-default':
configure_minimal_python(3)
if cython_version == LooseVersion('0.0.0'):
print("Cython not found.")
warn_no_full_package = True
elif cython_version < cython_min_version:
print("WARNING: Cython is an incompatible version: "
"Found {0} but {1} or newer is required.".format(
cython_version, cython_min_version))
warn_no_full_package = True
else:
print('INFO: Using Cython version {0}.'.format(cython_version))
for py_ver in [2, 3]:
if env['python{}_package'.format(py_ver)] != 'none':
# The directory within the source tree which will contain the Python module
env['pythonpath_build{}'.format(py_ver)] = Dir('build/python{}'.format(py_ver)).abspath
if 'PYTHONPATH' in env['ENV']:
env['pythonpath_build{}'.format(py_ver)] += os.path.pathsep + env['ENV']['PYTHONPATH']
# Check for 3to2. See http://pypi.python.org/pypi/3to2
# Only needed for Python 2 package
if env['python2_package'] == 'full':
script = textwrap.dedent("""\
from lib3to2.main import main
print(main('lib3to2.fixes', ['-l']))
""")
try:
ret = getCommandOutput(env['python2_cmd'], '-c', script)
except (OSError, subprocess.CalledProcessError) as err:
if env['VERBOSE']:
print('Error checking for 3to2:')
print(err)
ret = ''
if 'print' in ret:
env['python_convert_examples'] = True
else:
env['python_convert_examples'] = False
print("WARNING: Couldn't find the 3to2 package. "
"Python 2 examples will not work correctly.")
else:
env['python_convert_examples'] = False
if warn_no_full_package:
if env['python_package'] == 'default':
print('WARNING: Unable to build the full Python package because compatible '
'versions of Python, Numpy, and Cython could not be found.')
print('INFO: Building the minimal Python package for Python {}'.format(python_version))
env['python_package'] = 'minimal'
else:
print('ERROR: Unable to build the full Python package because compatible '
'versions of Python, Numpy, and Cython could not be found.')
sys.exit(1)
else:
print('INFO: Building the full Python package for Python {0}'.format(python_version))
env['python_package'] = 'full'
# Matlab Toolbox settings
if env['matlab_path'] != '' and env['matlab_toolbox'] == 'default':
@ -1465,12 +1365,6 @@ if env['matlab_toolbox'] == 'y':
# *** Set additional configuration variables ***
# **********************************************
# Some distributions (e.g. Fedora/RHEL) use 'lib64' instead of 'lib' on 64-bit systems
if any(name.startswith('/usr/lib64/python') for name in sys.path):
env['libdirname'] = 'lib64'
else:
env['libdirname'] = 'lib'
# On Debian-based systems, need to special-case installation to
# /usr/local because of dist-packages vs site-packages
env['debian'] = any(name.endswith('dist-packages') for name in sys.path)
@ -1518,12 +1412,11 @@ addInstallActions = ('install' in COMMAND_LINE_TARGETS or
if env['stage_dir']:
instRoot = pjoin(os.getcwd(), env['stage_dir'],
stripDrive(env['prefix']).strip('/\\'))
for k in ('python2_prefix', 'python3_prefix'):
if env[k]:
env[k] = pjoin(os.getcwd(), env['stage_dir'],
stripDrive(env[k]).strip('/\\'))
else:
env[k] = pjoin(os.getcwd(), env['stage_dir'])
if env['python_prefix']:
env['python_prefix'] = pjoin(os.getcwd(), env['stage_dir'],
stripDrive(env['python_prefix']).strip('/\\'))
else:
env['python_prefix'] = pjoin(os.getcwd(), env['stage_dir'])
else:
instRoot = env['prefix']
@ -1544,8 +1437,7 @@ if env['layout'] == 'debian':
env['libdirname'], 'cantera', 'matlab', 'toolbox')
env['inst_python_bindir'] = pjoin(base, 'cantera-python', 'usr', 'bin')
env['python2_prefix'] = pjoin(base, 'cantera-python')
env['python3_prefix'] = pjoin(base, 'cantera-python3')
env['python_prefix'] = pjoin(base, 'cantera-python3')
else:
env['inst_libdir'] = pjoin(instRoot, env['libdirname'])
env['inst_bindir'] = pjoin(instRoot, 'bin')
@ -1586,7 +1478,9 @@ def cdefine(definevar, configvar, comp=True, value=1):
# Need to test all of these to see what platform.system() returns
configh['SOLARIS'] = 1 if env['OS'] == 'Solaris' else None
configh['DARWIN'] = 1 if env['OS'] == 'Darwin' else None
cdefine('NEEDS_GENERIC_TEMPL_STATIC_DECL', 'OS', 'Solaris')
if env['OS'] == 'Solaris' or env['HAS_CLANG']:
configh['NEEDS_GENERIC_TEMPL_STATIC_DECL'] = 1
configh['CT_SUNDIALS_VERSION'] = env['sundials_version'].replace('.','')
@ -1602,6 +1496,8 @@ cdefine('LAPACK_NAMES_LOWERCASE', 'lapack_names', 'lower')
cdefine('CT_USE_LAPACK', 'use_lapack')
cdefine('CT_USE_SYSTEM_EIGEN', 'system_eigen')
cdefine('CT_USE_SYSTEM_FMT', 'system_fmt')
cdefine('CT_USE_SYSTEM_YAMLCPP', 'system_yamlcpp')
cdefine('CT_USE_DEMANGLE', 'has_demangle')
config_h_build = env.Command('build/src/config.h.build',
'include/cantera/base/config.h.in',
@ -1667,20 +1563,58 @@ for cti in mglob(env, 'data/inputs', 'cti'):
build(env.Command('build/data/%s' % outName, cti.path,
'$python_cmd_esc interfaces/cython/cantera/ctml_writer.py $SOURCE $TARGET'))
# Copy input files which are not present as cti:
# Copy XML input files which are not present as cti:
for xml in mglob(env, 'data/inputs', 'xml'):
dest = pjoin('build','data',xml.name)
if xml.name not in convertedInputFiles:
build(env.Command(dest, xml.path, Copy('$TARGET', '$SOURCE')))
# Convert input files from Chemkin format to YAML
ck_sources = [
dict(output='gri30.yaml', input='data/inputs/gri30.inp',
thermo='data/thermo/gri30_thermo.dat',
transport='data/transport/gri30_tran.dat',
phase='gri30'),
dict(output='air.yaml', input='data/inputs/air.inp',
transport='data/transport/gri30_tran.dat',
phase='air'),
dict(output='airNASA9.yaml', input='data/inputs/airNASA9.inp',
thermo='data/thermo/airDataNASA9.dat',
phase='airNASA9'),
dict(output='h2o2.yaml', input='data/inputs/h2o2.inp',
transport='data/transport/gri30_tran.dat',
phase='ohmech'),
dict(output='silane.yaml', input='data/inputs/silane.inp')
]
for mech in ck_sources:
convertedInputFiles.add(mech['output'])
cmd = ('$python_cmd_esc interfaces/cython/cantera/ck2yaml.py'
' --quiet --no-validate --input=$SOURCE --output=$TARGET')
if 'thermo' in mech:
cmd += ' --thermo=' + mech['thermo']
if 'transport' in mech:
cmd += ' --transport=' + mech['transport']
if 'phase' in mech:
cmd += ' --name=' + mech['phase']
b = build(env.Command('build/data/{}'.format(mech['output']), mech['input'], cmd))
env.Depends(b, 'interfaces/cython/cantera/ck2yaml.py')
# preprocess input files (cti -> yaml)
for cti in mglob(env, 'data/inputs', 'cti'):
outName = os.path.splitext(cti.name)[0] + '.yaml'
if outName not in convertedInputFiles:
b = build(env.Command('build/data/{}'.format(outName), cti.path,
'$python_cmd_esc interfaces/cython/cantera/cti2yaml.py $SOURCE $TARGET'))
env.Depends(b, 'interfaces/cython/cantera/cti2yaml.py')
if addInstallActions:
# Put headers in place
headerBase = 'include/cantera'
install(env.RecursiveInstall, '$inst_incdir', 'include/cantera')
# Data files
install('$inst_datadir', mglob(env, 'build/data', 'cti', 'xml'))
install('$inst_datadir', mglob(env, 'build/data', 'cti', 'xml', 'yaml'))
### List of libraries needed to link to Cantera ###
@ -1704,6 +1638,10 @@ else:
linkLibs.extend(env['sundials_libs'])
linkSharedLibs.extend(env['sundials_libs'])
if env['system_yamlcpp']:
linkLibs.append('yaml-cpp')
linkSharedLibs.append('yaml-cpp')
# Add LAPACK and BLAS to the link line
if env['blas_lapack_libs']:
linkLibs.extend(env['blas_lapack_libs'])
@ -1730,10 +1668,9 @@ if env['f90_interface'] == 'y':
VariantDir('build/src', 'src', duplicate=0)
SConscript('build/src/SConscript')
if env['python3_package'] == 'full' or env['python2_package'] == 'full':
if env['python_package'] == 'full':
SConscript('interfaces/cython/SConscript')
if env['python3_package'] == 'minimal' or env['python2_package'] == 'minimal':
elif env['python_package'] == 'minimal':
SConscript('interfaces/python_minimal/SConscript')
if env['CC'] != 'cl':
@ -1804,17 +1741,15 @@ def postInstallMessage(target, source, env):
samples {ct_sampledir!s}
data files {ct_datadir!s}""".format(**env_dict))
if env['python2_package'] == 'full':
env['python2_example_loc'] = pjoin(env['python2_module_loc'], 'cantera', 'examples')
if env['sphinx_docs'] or env['doxygen_docs']:
install_message += indent(textwrap.dedent("""
Python 2 package (cantera) {python2_module_loc!s}
Python 2 samples {python2_example_loc!s}""".format(**env_dict)), ' ')
HTML documentation {inst_docdir!s}""".format(**env_dict)), ' ')
if env['python3_package'] == 'full':
env['python3_example_loc'] = pjoin(env['python3_module_loc'], 'cantera', 'examples')
if env['python_package'] == 'full':
env['python_example_loc'] = pjoin(env['python_module_loc'], 'cantera', 'examples')
install_message += indent(textwrap.dedent("""
Python 3 package (cantera) {python3_module_loc!s}
Python 3 samples {python3_example_loc!s}""".format(**env_dict)), ' ')
Python package (cantera) {python_module_loc!s}
Python samples {python_example_loc!s}""".format(**env_dict)), ' ')
if env['matlab_toolbox'] == 'y':
env['matlab_sample_loc'] = pjoin(env['ct_sampledir'], 'matlab')
@ -1866,26 +1801,22 @@ def getParentDirs(path, top=True):
# Files installed by SCons
allfiles = FindInstalledFiles()
# Files installed by the Python installer(s)
pyFiles = ['build/python2-installed-files.txt',
'build/python3-installed-files.txt']
# Files installed by the Python installer
if os.path.exists('build/python-installed-files.txt'):
with open('build/python-installed-files.txt', 'r') as f:
file_list = f.readlines()
for filename in pyFiles:
if os.path.exists(filename):
with open(filename, 'r') as f:
file_list = f.readlines()
install_base = os.path.dirname(file_list[0].strip())
if os.path.exists(install_base):
not_listed_files = [s for s in os.listdir(install_base) if not any(s in j for j in file_list)]
for f in not_listed_files:
f = pjoin(install_base, f)
if not os.path.isdir(f) and os.path.exists(f):
allfiles.append(File(f))
for f in file_list:
f = f.strip()
install_base = os.path.dirname(file_list[0].strip())
if os.path.exists(install_base):
not_listed_files = [s for s in os.listdir(install_base) if not any(s in j for j in file_list)]
for f in not_listed_files:
f = pjoin(install_base, f)
if not os.path.isdir(f) and os.path.exists(f):
allfiles.append(File(f))
for f in file_list:
f = f.strip()
if not os.path.isdir(f) and os.path.exists(f):
allfiles.append(File(f))
# After removing files (which SCons keeps track of),
# remove any empty directories (which SCons doesn't track)
@ -1938,13 +1869,13 @@ if any(target.startswith('test') for target in COMMAND_LINE_TARGETS):
env['testNames'] = []
env['test_results'] = env.Command('test_results', [], testResults.printReport)
if env['python2_package'] == 'none' and env['python3_package'] == 'none':
if env['python_package'] == 'none':
# copy scripts from the full Cython module
test_py_int = env.Command('#build/python_minimal/cantera/__init__.py',
test_py_int = env.Command('#build/python_local/cantera/__init__.py',
'#interfaces/python_minimal/cantera/__init__.py',
Copy('$TARGET', '$SOURCE'))
for script in ['ctml_writer', 'ck2cti']:
s = env.Command('#build/python_minimal/cantera/{}.py'.format(script),
s = env.Command('#build/python_local/cantera/{}.py'.format(script),
'#interfaces/cython/cantera/{}.py'.format(script),
Copy('$TARGET', '$SOURCE'))
env.Depends(test_py_int, s)
@ -1952,6 +1883,11 @@ if any(target.startswith('test') for target in COMMAND_LINE_TARGETS):
env.Depends(env['test_results'], test_py_int)
env['python_cmd'] = sys.executable
env.PrependENVPath('PYTHONPATH', Dir('build/python_local').abspath)
else:
env.PrependENVPath('PYTHONPATH', Dir('build/python').abspath)
env['ENV']['PYTHON_CMD'] = env.subst('$python_cmd')
# Tests written using the gtest framework, the Python unittest module,
# or the Matlab xunit package.

View file

@ -1,23 +1,22 @@
version: 1.0.{build}
install:
- ps: |
C:\Python27-x64\python.exe -m pip install --no-cache-dir --upgrade pip
C:\Python27-x64\python.exe -m pip install --upgrade setuptools
C:\Python27-x64\python.exe -m pip install --upgrade --no-warn-script-location wheel
C:\Python27-x64\Scripts\pip.exe install scons
C:\Python27-x64\Scripts\pip.exe install --no-cache-dir --no-warn-script-location numpy
C:\Python27-x64\Scripts\pip.exe install --no-warn-script-location cython
C:\Python27-x64\Scripts\pip.exe install 3to2
C:\Python27-x64\Scripts\pip.exe install pypiwin32
C:\Python35-x64\python.exe -m pip install --no-cache-dir --upgrade pip
C:\Python35-x64\Scripts\pip.exe install --no-cache-dir --no-warn-script-location numpy
C:\Python37-x64\python.exe -m pip install --no-cache-dir --upgrade pip
C:\Python37-x64\python.exe -m pip install --upgrade setuptools
C:\Python37-x64\python.exe -m pip install --upgrade --no-warn-script-location wheel
C:\Python37-x64\Scripts\pip.exe install scons==3.0.1
C:\Python37-x64\Scripts\pip.exe install --no-cache-dir --no-warn-script-location numpy
C:\Python37-x64\Scripts\pip.exe install --no-warn-script-location cython
C:\Python37-x64\Scripts\pip.exe install pypiwin32
C:\Python37-x64\Scripts\pip.exe install ruamel.yaml
build_script:
- cmd: C:\Python27-x64\Scripts\scons build -j2 boost_inc_dir=C:\Libraries\boost_1_62_0 debug=n VERBOSE=y python3_cmd=C:\Python35-x64\python.exe
- cmd: C:\Python37-x64\Scripts\scons build -j2 boost_inc_dir=C:\Libraries\boost_1_62_0 debug=n VERBOSE=y python_package=full
- cmd: C:\Python37-x64\Scripts\scons samples
test_script:
- ps: |
C:\Python27-x64\Scripts\scons test
C:\Python37-x64\Scripts\scons test
$sconsstatus = $lastexitcode
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test\work\gtest-general.xml))

View file

@ -4,6 +4,41 @@ END
SPECIES
O O2 N NO NO2 N2O N2 AR
END
THERMO ALL
300.000 1000.000 5000.000
O L 1/90O 1 00 00 00G 200.000 3500.000 1000.000 1
2.56942078E+00-8.59741137E-05 4.19484589E-08-1.00177799E-11 1.22833691E-15 2
2.92175791E+04 4.78433864E+00 3.16826710E+00-3.27931884E-03 6.64306396E-06 3
-6.12806624E-09 2.11265971E-12 2.91222592E+04 2.05193346E+00 4
O2 TPIS89O 2 00 00 00G 200.000 3500.000 1000.000 1
3.28253784E+00 1.48308754E-03-7.57966669E-07 2.09470555E-10-2.16717794E-14 2
-1.08845772E+03 5.45323129E+00 3.78245636E+00-2.99673416E-03 9.84730201E-06 3
-9.68129509E-09 3.24372837E-12-1.06394356E+03 3.65767573E+00 4
N L 6/88N 1 0 0 0G 200.000 6000.000 1000.000 1
0.24159429E+01 0.17489065E-03-0.11902369E-06 0.30226245E-10-0.20360982E-14 2
0.56133773E+05 0.46496096E+01 0.25000000E+01 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00 0.56104637E+05 0.41939087E+01 4
NO RUS 78N 1O 1 0 0G 200.000 6000.000 1000.000 1
0.32606056E+01 0.11911043E-02-0.42917048E-06 0.69457669E-10-0.40336099E-14 2
0.99209746E+04 0.63693027E+01 0.42184763E+01-0.46389760E-02 0.11041022E-04 3
-0.93361354E-08 0.28035770E-11 0.98446230E+04 0.22808464E+01 4
NO2 L 7/88N 1O 2 0 0G 200.000 6000.000 1000.000 1
0.48847542E+01 0.21723956E-02-0.82806906E-06 0.15747510E-09-0.10510895E-13 2
0.23164983E+04-0.11741695E+00 0.39440312E+01-0.15854290E-02 0.16657812E-04 3
-0.20475426E-07 0.78350564E-11 0.28966179E+04 0.63119917E+01 4
N2O L 7/88N 2O 1 0 0G 200.000 6000.000 1000.000 1
0.48230729E+01 0.26270251E-02-0.95850874E-06 0.16000712E-09-0.97752303E-14 2
0.80734048E+04-0.22017207E+01 0.22571502E+01 0.11304728E-01-0.13671319E-04 3
0.96819806E-08-0.29307182E-11 0.87417744E+04 0.10757992E+02 4
N2 121286N 2 G 300.000 5000.000 1000.000 1
0.02926640E+02 0.14879768E-02-0.05684760E-05 0.10097038E-09-0.06753351E-13 2
-0.09227977E+04 0.05980528E+02 0.03298677E+02 0.14082404E-02-0.03963222E-04 3
0.05641515E-07-0.02444854E-10-0.10208999E+04 0.03950372E+02 4
AR 120186AR 1 G 300.000 5000.000 1000.000 1
0.02500000E+02 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 2
-0.07453750E+04 0.04366000E+02 0.02500000E+02 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00-0.07453750E+04 0.04366000E+02 4
END
REACTIONS
2O+M<=>O2+M 1.200E+17 -1.000 .00
AR/.83/

View file

@ -1,317 +0,0 @@
<?xml version="1.0"?>
<ctml>
<validate reactions="yes" species="yes"/>
<!-- phase airNASA9 -->
<phase dim="3" id="airNASA9">
<elementArray datasrc="elements.xml">O N E </elementArray>
<speciesArray datasrc="#species_data">
N2 O2 NO N O N2+ O2+ NO+ N+ O+
e- </speciesArray>
<reactionArray datasrc="#reaction_data"/>
<state>
<temperature units="K">300.0</temperature>
<pressure units="Pa">101325.0</pressure>
</state>
<thermo model="IdealGas"/>
<kinetics model="GasKinetics"/>
<transport model="None"/>
</phase>
<!-- species definitions -->
<speciesData id="species_data">
<!-- species N2 -->
<species name="N2">
<atomArray>N:2 </atomArray>
<note>Ref-Elm. Gurvich,1978 pt1 p280 pt2 p207. </note>
<thermo>
<NASA9 Tmax="1000.0" Tmin="200.0" P0="100000.0">
<floatArray name="coeffs" size="9">
2.210371497E+04, -3.818461820E+02, 6.082738360E+00, -8.530914410E-03,
1.384646189E-05, -9.625793620E-09, 2.519705809E-12, 7.108460860E+02,
-1.076003744E+01</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
5.877124060E+05, -2.239249073E+03, 6.066949220E+00, -6.139685500E-04,
1.491806679E-07, -1.923105485E-11, 1.061954386E-15, 1.283210415E+04,
-1.586640027E+01</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
8.310139160E+08, -6.420733540E+05, 2.020264635E+02, -3.065092046E-02,
2.486903333E-06, -9.705954110E-11, 1.437538881E-15, 4.938707040E+06,
-1.672099740E+03</floatArray>
</NASA9>
</thermo>
</species>
<!-- species O2 -->
<species name="O2">
<atomArray>O:2 </atomArray>
<note>Ref-Elm. Gurvich,1989 pt1 p94 pt2 p9. </note>
<thermo>
<NASA9 Tmax="1000.0" Tmin="200.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-3.425563420E+04, 4.847000970E+02, 1.119010961E+00, 4.293889240E-03,
-6.836300520E-07, -2.023372700E-09, 1.039040018E-12, -3.391454870E+03,
1.849699470E+01</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-1.037939022E+06, 2.344830282E+03, 1.819732036E+00, 1.267847582E-03,
-2.188067988E-07, 2.053719572E-11, -8.193467050E-16, -1.689010929E+04,
1.738716506E+01</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
4.975294300E+08, -2.866106874E+05, 6.690352250E+01, -6.169959020E-03,
3.016396027E-07, -7.421416600E-12, 7.278175770E-17, 2.293554027E+06,
-5.530621610E+02</floatArray>
</NASA9>
</thermo>
</species>
<!-- species NO -->
<species name="NO">
<atomArray>O:1 N:1 </atomArray>
<note>Gurvich,1978,1989 pt1 p326 pt2 p203. </note>
<thermo>
<NASA9 Tmax="1000.0" Tmin="200.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-1.143916503E+04, 1.536467592E+02, 3.431468730E+00, -2.668592368E-03,
8.481399120E-06, -7.685111050E-09, 2.386797655E-12, 9.098214410E+03,
6.728725490E+00</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
2.239018716E+05, -1.289651623E+03, 5.433936030E+00, -3.656034900E-04,
9.880966450E-08, -1.416076856E-11, 9.380184620E-16, 1.750317656E+04,
-8.501669090E+00</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-9.575303540E+08, 5.912434480E+05, -1.384566826E+02, 1.694339403E-02,
-1.007351096E-06, 2.912584076E-11, -3.295109350E-16, -4.677501240E+06,
1.242081216E+03</floatArray>
</NASA9>
</thermo>
</species>
<!-- species N -->
<species name="N">
<atomArray>N:1 </atomArray>
<note>Hf:Cox,1989. Moore,1975. Gordon,1999. </note>
<thermo>
<NASA9 Tmax="1000.0" Tmin="200.0" P0="100000.0">
<floatArray name="coeffs" size="9">
0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00,
0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 5.610463780E+04,
4.193905036E+00</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
8.876501380E+04, -1.071231500E+02, 2.362188287E+00, 2.916720081E-04,
-1.729515100E-07, 4.012657880E-11, -2.677227571E-15, 5.697351330E+04,
4.865231506E+00</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
5.475181050E+08, -3.107574980E+05, 6.916782740E+01, -6.847988130E-03,
3.827572400E-07, -1.098367709E-11, 1.277986024E-16, 2.550585618E+06,
-5.848769753E+02</floatArray>
</NASA9>
</thermo>
</species>
<!-- species O -->
<species name="O">
<atomArray>O:1 </atomArray>
<note>D0(O2):Brix,1954. Moore,1976. Gordon,1999. </note>
<thermo>
<NASA9 Tmax="1000.0" Tmin="200.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-7.953611300E+03, 1.607177787E+02, 1.966226438E+00, 1.013670310E-03,
-1.110415423E-06, 6.517507500E-10, -1.584779251E-13, 2.840362437E+04,
8.404241820E+00</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
2.619020262E+05, -7.298722030E+02, 3.317177270E+00, -4.281334360E-04,
1.036104594E-07, -9.438304330E-12, 2.725038297E-16, 3.392428060E+04,
-6.679585350E-01</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
1.779004264E+08, -1.082328257E+05, 2.810778365E+01, -2.975232262E-03,
1.854997534E-07, -5.796231540E-12, 7.191720164E-17, 8.890942630E+05,
-2.181728151E+02</floatArray>
</NASA9>
</thermo>
</species>
<!-- species N2+ -->
<species name="N2+">
<atomArray>E:-1 N:2 </atomArray>
<note>Gurvich,1989 pt1 p323 pt2 p200. </note>
<charge>1</charge>
<thermo>
<NASA9 Tmax="1000.0" Tmin="298.14999999999998" P0="100000.0">
<floatArray name="coeffs" size="9">
-3.474047470E+04, 2.696222703E+02, 3.164916370E+00, -2.132239781E-03,
6.730476400E-06, -5.637304970E-09, 1.621756000E-12, 1.790004424E+05,
6.832974166E+00</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-2.845599002E+06, 7.058893030E+03, -2.884886385E+00, 3.068677059E-03,
-4.361652310E-07, 2.102514545E-11, 5.411996470E-16, 1.340388483E+05,
5.090897022E+01</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-3.712829770E+08, 3.139287234E+05, -9.603518050E+01, 1.571193286E-02,
-1.175065525E-06, 4.144441230E-11, -5.621893090E-16, -2.217361867E+06,
8.436270947E+02</floatArray>
</NASA9>
</thermo>
</species>
<!-- species O2+ -->
<species name="O2+">
<atomArray>E:-1 O:2 </atomArray>
<note>Gurvich,1989 pt1 p98 pt2 p11. </note>
<charge>1</charge>
<thermo>
<NASA9 Tmax="1000.0" Tmin="298.14999999999998" P0="100000.0">
<floatArray name="coeffs" size="9">
-8.607205450E+04, 1.051875934E+03, -5.432380470E-01, 6.571166540E-03,
-3.274263750E-06, 5.940645340E-11, 3.238784790E-13, 1.345544668E+05,
2.902709750E+01</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
7.384654880E+04, -8.459559540E+02, 4.985164160E+00, -1.611010890E-04,
6.427083990E-08, -1.504939874E-11, 1.578465409E-15, 1.446321044E+05,
-5.811230650E+00</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-1.562125524E+09, 1.161406778E+06, -3.302504720E+02, 4.710937520E-02,
-3.354461380E-06, 1.167968599E-10, -1.589754791E-15, -8.857866270E+06,
2.852035602E+03</floatArray>
</NASA9>
</thermo>
</species>
<!-- species NO+ -->
<species name="NO+">
<atomArray>E:-1 O:1 N:1 </atomArray>
<note>Cp,S,IP(NO): Gurvich,1989 pt1 p330 pt2 p205. </note>
<charge>1</charge>
<thermo>
<NASA9 Tmax="1000.0" Tmin="298.14999999999998" P0="100000.0">
<floatArray name="coeffs" size="9">
1.398106635E+03, -1.590446941E+02, 5.122895400E+00, -6.394388620E-03,
1.123918342E-05, -7.988581260E-09, 2.107383677E-12, 1.187495132E+05,
-4.398433810E+00</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
6.069876900E+05, -2.278395427E+03, 6.080324670E+00, -6.066847580E-04,
1.432002611E-07, -1.747990522E-11, 8.935014060E-16, 1.322709615E+05,
-1.519880037E+01</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
2.676400347E+09, -1.832948690E+06, 5.099249390E+02, -7.113819280E-02,
5.317659880E-06, -1.963208212E-10, 2.805268230E-15, 1.443308939E+07,
-4.324044462E+03</floatArray>
</NASA9>
</thermo>
</species>
<!-- species N+ -->
<species name="N+">
<atomArray>E:-1 N:1 </atomArray>
<note>Moore,1975. Gordon,1999. </note>
<charge>1</charge>
<thermo>
<NASA9 Tmax="1000.0" Tmin="298.14999999999998" P0="100000.0">
<floatArray name="coeffs" size="9">
5.237079210E+03, 2.299958315E+00, 2.487488821E+00, 2.737490756E-05,
-3.134447576E-08, 1.850111332E-11, -4.447350984E-15, 2.256284738E+05,
5.076830786E+00</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
2.904970374E+05, -8.557908610E+02, 3.477389290E+00, -5.288267190E-04,
1.352350307E-07, -1.389834122E-11, 5.046166279E-16, 2.310809984E+05,
-1.994146545E+00</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
1.646092148E+07, -1.113165218E+04, 4.976986640E+00, -2.005393583E-04,
1.022481356E-08, -2.691430863E-13, 3.539931593E-18, 3.136284696E+05,
-1.706646380E+01</floatArray>
</NASA9>
</thermo>
</species>
<!-- species O+ -->
<species name="O+">
<atomArray>E:-1 O:1 </atomArray>
<note>Martin,W.C.,1993. Gordon,1999. </note>
<charge>1</charge>
<thermo>
<NASA9 Tmax="1000.0" Tmin="298.14999999999998" P0="100000.0">
<floatArray name="coeffs" size="9">
0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00,
0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 1.879352842E+05,
4.393376760E+00</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-2.166513208E+05, 6.665456150E+02, 1.702064364E+00, 4.714992810E-04,
-1.427131823E-07, 2.016595903E-11, -9.107157762E-16, 1.837191966E+05,
1.005690382E+01</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
-2.143835383E+08, 1.469518523E+05, -3.680864540E+01, 5.036164540E-03,
-3.087873854E-07, 9.186834870E-12, -1.074163268E-16, -9.614208960E+05,
3.426193080E+02</floatArray>
</NASA9>
</thermo>
</species>
<!-- species e- -->
<species name="e-">
<atomArray>E:1 </atomArray>
<note>Ref-Species. Chase,1998 3/82. </note>
<charge>-1</charge>
<thermo>
<NASA9 Tmax="1000.0" Tmin="298.14999999999998" P0="100000.0">
<floatArray name="coeffs" size="9">
0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00,
0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02,
-1.172081224E+01</floatArray>
</NASA9>
<NASA9 Tmax="6000.0" Tmin="1000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00,
0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02,
-1.172081224E+01</floatArray>
</NASA9>
<NASA9 Tmax="20000.0" Tmin="6000.0" P0="100000.0">
<floatArray name="coeffs" size="9">
0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00,
0.000000000E+00, 0.000000000E+00, 0.000000000E+00, -7.453750000E+02,
-1.172081224E+01</floatArray>
</NASA9>
</thermo>
</species>
</speciesData>
<reactionData id="reaction_data"/>
</ctml>

File diff suppressed because it is too large Load diff

View file

@ -1,96 +1,107 @@
# simplified version of Harris and Goodwin diamond (100) growth
# mechanism, J. Phys. Chem., 1993.
# Trough mechanism from 'S. J. Harris and D. G. Goodwin, 'Growth on
# the reconstructed diamond (100) surface, 'J. Phys. Chem. vol. 97,
# 23-28 (1993). reactions a - t are taken directly from Table II,
# with thermochemistry from Table IV. Reaction u is added here.
units(length = 'cm', quantity = 'mol', act_energy = 'kcal/mol')
#------------- the gas -------------------------------------
ideal_gas(name = 'gas',
elements = 'H C',
species = 'gri30: H H2 CH3 CH4',
initial_state = state(temperature = 1200.0,
pressure = 1.0e3,
mole_fractions = 'H:0.002, H2:1, CH4:0.01, CH3:0.0002'))
initial_state = state(
temperature = 1200.0,
pressure = 20.0 * OneAtm / 760.0,
mole_fractions = 'H:0.002, H2:0.988, CH3:0.0002, CH4:0.01',
)
)
#------------- bulk diamond -------------------------------------
stoichiometric_solid(name = 'diamond',
elements = 'C',
density = (3.52, 'g/cm3'),
species = 'C(d)')
elements = 'C',
density = (3.52, 'g/cm3'),
species = 'C(d)')
species(name = 'C(d)',
atoms = 'C:1') # no thermo needed (reaction is irreversible)
#------------- the diamond surface -------------------------------------
ideal_interface(name = 'diamond_100',
elements = 'H C',
species = 'c6HH c6H* c6*H c6** c6HM c6HM* c6*M c6B ',
reactions = 'all',
phases = 'gas diamond',
site_density = (3.0e-9, 'mol/cm2'),
site_density = (3.0E-9, 'mol/cm2'),
initial_state = state(temperature = 1200.0,
coverages = 'c6H*:0.1, c6HH:0.9'))
species(name = 'C(d)',
atoms = 'C:1',
thermo = const_cp() )
# an empty surface site
species(name = 'c6H*',
atoms = 'H:1',
thermo = const_cp(h0 = (51.7, 'kcal/mol'), s0 = (19.5, 'cal/mol/K') ) )
thermo = const_cp(h0 = (51.7, 'kcal/mol'),
s0 = (19.5, 'cal/mol/K')))
species(name = 'c6*H',
atoms = 'H:1',
thermo = const_cp(h0 = (46.1, 'kcal/mol'), s0 = (19.9, 'cal/mol/K') ) )
thermo = const_cp(h0 = (46.1, 'kcal/mol'),
s0 = (19.9, 'cal/mol/K')))
# a hydrogen-terminated site
species(name = 'c6HH',
atoms = 'H:2',
thermo = const_cp(t0 = 1200.0, h0 = (11.4, 'kcal/mol'),
s0 = (21.0, 'cal/mol/K'))
)
thermo = const_cp(h0 = (11.4, 'kcal/mol'),
s0 = (21.0, 'cal/mol/K')))
species(name = 'c6HM',
atoms = 'C:1 H:4',
thermo = const_cp(h0 = (26.9, 'kcal/mol'),
s0 = (40.3, 'cal/mol/K') )
)
s0 = (40.3, 'cal/mol/K')))
species(name = 'c6HM*',
atoms = 'C:1 H:3',
thermo = const_cp(h0 = (65.8, 'kcal/mol'),
s0 = (40.1, 'cal/mol/K') )
)
s0 = (40.1, 'cal/mol/K')))
species(name = 'c6*M',
atoms = 'C:1 H:3',
thermo = const_cp(h0 = (53.3, 'kcal/mol'),
s0 = (38.9, 'cal/mol/K') )
)
s0 = (38.9, 'cal/mol/K')))
species(name = 'c6**',
atoms = 'C:0',
thermo = const_cp(h0 = (90.0, 'kcal/mol'),
s0 = (18.4, 'cal/mol/K') )
)
s0 = (18.4, 'cal/mol/K')))
species(name = 'c6B',
atoms = 'H:2 C:1',
thermo = const_cp(h0 = (40.9, 'kcal/mol'),
s0 = (26.9, 'cal/mol/K') ) )
s0 = (26.9, 'cal/mol/K')))
surface_reaction('c6HH + H <=> c6H* + H2', [1.3e14, 0.0, 7.3]) # a
surface_reaction('c6H* + H <=> c6HH', [1.0e13, 0.0, 0.0]) # b
surface_reaction('c6H* + CH3 <=> c6HM', [5.0e12, 0.0, 0.0]) # c
surface_reaction('c6HM + H <=> c6*M + H2', [1.3e14, 0.0, 7.3]) # d
surface_reaction('c6*M + H <=> c6HM', [1.0e13, 0.0, 0.0]) # e
surface_reaction('c6HM + H <=> c6HM* + H2', [2.8e7, 2.0, 7.7]) # f
surface_reaction('c6HM* + H <=> c6HM', [1.0e13, 0.0, 0.0]) # g
surface_reaction('c6HM* <=> c6*M', [1.0e8, 0.0, 0.0]) # h
surface_reaction('c6HM* + H <=> c6H* + CH3', [3.0e13, 0.0, 0.0]) # i
surface_reaction('c6HM* + H <=> c6B + H2', [1.3e14, 0.0, 7.3]) # k
surface_reaction('c6*M + H <=> c6B + H2', [2.8e7, 2.0, 7.7]) # l
surface_reaction('c6HH + H <=> c6*H + H2', [1.3e14, 0.0, 7.3]) # m
surface_reaction('c6*H + H <=> c6HH', [1.0e13, 0.0, 0.0]) # n
surface_reaction('c6H* + H <=> c6** + H2', [1.3e14, 0.0, 7.3]) # o
surface_reaction('c6** + H <=> c6H*', [1.0e13, 0.0, 0.0]) # p
surface_reaction('c6*H + H <=> c6** + H2', [4.5e6, 2.0, 5.0]) # q
surface_reaction('c6** + H <=> c6*H', [1.0e13, 0.0, 0.0]) # r
surface_reaction('c6** + CH3 <=> c6*M', [5.0e12, 0.0, 0.0]) # s
surface_reaction('c6H* <=> c6*H', [1.0e8, 0.0, 0.0]) # t
surface_reaction('c6B => c6HH + C(d)', [1.0e9, 0.0, 0.0])
surface_reaction('c6HH + H <=> c6H* + H2', [1.3E14, 0.0, 7.3]) # a
surface_reaction('c6H* + H <=> c6HH', [1.0E13, 0.0, 0.0]) # b
surface_reaction('c6H* + CH3 <=> c6HM', [5.0E12, 0.0, 0.0]) # c
surface_reaction('c6HM + H <=> c6*M + H2', [1.3E14, 0.0, 7.3]) # d
surface_reaction('c6*M + H <=> c6HM', [1.0E13, 0.0, 0.0]) # e
surface_reaction('c6HM + H <=> c6HM* + H2', [2.8E7, 2.0, 7.7]) # f
surface_reaction('c6HM* + H <=> c6HM', [1.0E13, 0.0, 0.0]) # g
surface_reaction('c6HM* <=> c6*M', [1.0E8, 0.0, 0.0]) # h
surface_reaction('c6HM* + H <=> c6H* + CH3', [3.0E13, 0.0, 0.0]) # i
surface_reaction('c6HM* + H <=> c6B + H2', [1.3E14, 0.0, 7.3]) # k
surface_reaction('c6*M + H <=> c6B + H2', [2.8E7, 2.0, 7.7]) # l
surface_reaction('c6HH + H <=> c6*H + H2', [1.3E14, 0.0, 7.3]) # m
surface_reaction('c6*H + H <=> c6HH', [1.0E13, 0.0, 0.0]) # m
surface_reaction('c6H* + H <=> c6** + H2', [1.3E14, 0.0, 7.3]) # o
surface_reaction('c6** + H <=> c6H*', [1.0E13, 0.0, 0.0]) # p
surface_reaction('c6*H + H <=> c6** + H2', [4.5E6, 2.0, 5.0]) # q
surface_reaction('c6** + H <=> c6*H', [1.0E13, 0.0, 0.0]) # r
surface_reaction('c6** + CH3 <=> c6*M', [5.0E12, 0.0, 0.0]) # s
surface_reaction('c6H* <=> c6*H', [1.0E8, 0.0, 0.0]) # t
# reaction to add new carbon atom to bulk and regenerate a new site
#
surface_reaction('c6B => c6HH + C(d)', [1.0E9, 0.0, 0.0]) # u

File diff suppressed because it is too large Load diff

View file

@ -117,7 +117,7 @@ species(name = "O2",
),
transport = gas_transport(
geom = "linear",
diam = 3.46,
diam = 3.458,
well_depth = 107.40,
polar = 1.60,
rot_relax = 3.80),
@ -153,9 +153,9 @@ species(name = "H2O",
),
transport = gas_transport(
geom = "nonlinear",
diam = 2.60,
diam = 2.605,
well_depth = 572.40,
dipole = 1.84,
dipole = 1.844,
rot_relax = 4.00),
note = "L 8/89"
)
@ -172,7 +172,7 @@ species(name = "HO2",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.46,
diam = 3.458,
well_depth = 107.40,
rot_relax = 1.00),
note = "L 5/89"
@ -190,7 +190,7 @@ species(name = "H2O2",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.46,
diam = 3.458,
well_depth = 107.40,
rot_relax = 3.80),
note = "L 7/88"
@ -208,7 +208,7 @@ species(name = "C",
),
transport = gas_transport(
geom = "atom",
diam = 3.30,
diam = 3.298,
well_depth = 71.40),
note = "L11/88"
)
@ -293,7 +293,7 @@ species(name = "CH4",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.75,
diam = 3.746,
well_depth = 141.40,
polar = 2.60,
rot_relax = 13.00),
@ -331,7 +331,7 @@ species(name = "CO2",
),
transport = gas_transport(
geom = "linear",
diam = 3.76,
diam = 3.763,
well_depth = 244.00,
polar = 2.65,
rot_relax = 2.10),
@ -423,7 +423,7 @@ species(name = "CH3OH",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.63,
diam = 3.626,
well_depth = 481.80,
rot_relax = 1.00),
note = "L 8/88"
@ -495,7 +495,7 @@ species(name = "C2H4",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.97,
diam = 3.971,
well_depth = 280.80,
rot_relax = 1.50),
note = "L 1/91"
@ -513,7 +513,7 @@ species(name = "C2H5",
),
transport = gas_transport(
geom = "nonlinear",
diam = 4.30,
diam = 4.302,
well_depth = 252.30,
rot_relax = 1.50),
note = "L12/92"
@ -531,7 +531,7 @@ species(name = "C2H6",
),
transport = gas_transport(
geom = "nonlinear",
diam = 4.30,
diam = 4.302,
well_depth = 252.30,
rot_relax = 1.50),
note = "L 8/88"
@ -603,7 +603,7 @@ species(name = "N",
),
transport = gas_transport(
geom = "atom",
diam = 3.30,
diam = 3.298,
well_depth = 71.40),
note = "L 6/88"
)
@ -676,7 +676,7 @@ species(name = "NNH",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.80,
diam = 3.798,
well_depth = 71.40,
rot_relax = 1.00),
note = "T07/93"
@ -694,7 +694,7 @@ species(name = "NO",
),
transport = gas_transport(
geom = "linear",
diam = 3.62,
diam = 3.621,
well_depth = 97.53,
polar = 1.76,
rot_relax = 4.00),
@ -731,7 +731,7 @@ species(name = "N2O",
),
transport = gas_transport(
geom = "linear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "L 7/88"
@ -749,7 +749,7 @@ species(name = "HNO",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.49,
diam = 3.492,
well_depth = 116.70,
rot_relax = 1.00),
note = "And93"
@ -767,7 +767,7 @@ species(name = "CN",
),
transport = gas_transport(
geom = "linear",
diam = 3.86,
diam = 3.856,
well_depth = 75.00,
rot_relax = 1.00),
note = "HBH92"
@ -839,7 +839,7 @@ species(name = "HCNO",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "BDEA94"
@ -857,7 +857,7 @@ species(name = "HOCN",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "BDEA94"
@ -875,7 +875,7 @@ species(name = "HNCO",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "BDEA94"
@ -893,7 +893,7 @@ species(name = "NCO",
),
transport = gas_transport(
geom = "linear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "EA 93"
@ -911,7 +911,7 @@ species(name = "N2",
),
transport = gas_transport(
geom = "linear",
diam = 3.62,
diam = 3.621,
well_depth = 97.53,
polar = 1.76,
rot_relax = 4.00),
@ -947,7 +947,7 @@ species(name = "C3H7",
),
transport = gas_transport(
geom = "nonlinear",
diam = 4.98,
diam = 4.982,
well_depth = 266.80,
rot_relax = 1.00),
note = "L 9/84"
@ -965,7 +965,7 @@ species(name = "C3H8",
),
transport = gas_transport(
geom = "nonlinear",
diam = 4.98,
diam = 4.982,
well_depth = 266.80,
rot_relax = 1.00),
note = "L 4/85"
@ -2014,10 +2014,10 @@ reaction( "C2H3 + O2 <=> O + CH2CHO", [3.03000E+11, 0.29, 11])
reaction( "C2H3 + O2 <=> HO2 + C2H2", [1.33700E+06, 1.61, -384])
# Reaction 296
reaction( "O + CH3CHO <=> OH + CH2CHO", [5.84000E+12, 0, 1808])
reaction( "O + CH3CHO <=> OH + CH2CHO", [2.920000E+12, 0, 1808])
# Reaction 297
reaction( "O + CH3CHO => OH + CH3 + CO", [5.84000E+12, 0, 1808])
reaction( "O + CH3CHO => OH + CH3 + CO", [2.920000E+12, 0, 1808])
# Reaction 298
reaction( "O2 + CH3CHO => HO2 + CH3 + CO", [3.01000E+13, 0, 39150])

View file

@ -1,4 +1,4 @@
! GRI-Mech Version 3.0 3/12/99 CHEMKIN-II format
! GRI-Mech Version 3.0 7/30/99 CHEMKIN-II format
! See README30 file at anonymous FTP site unix.sri.com, directory gri;
! WorldWideWeb home page http://www.me.berkeley.edu/gri_mech/ or
! through http://www.gri.org , under 'Basic Research',
@ -15,221 +15,9 @@ NH2 NH3 NNH NO NO2 N2O HNO CN
HCN H2CN HCNN HCNO HOCN HNCO NCO N2
AR C3H7 C3H8 CH2CHO CH3CHO
END
THERMO ALL
300.000 1000.000 5000.000
O L 1/90O 1 00 00 00G 200.000 3500.000 1000.000 1
2.56942078E+00-8.59741137E-05 4.19484589E-08-1.00177799E-11 1.22833691E-15 2
2.92175791E+04 4.78433864E+00 3.16826710E+00-3.27931884E-03 6.64306396E-06 3
-6.12806624E-09 2.11265971E-12 2.91222592E+04 2.05193346E+00 4
O2 TPIS89O 2 00 00 00G 200.000 3500.000 1000.000 1
3.28253784E+00 1.48308754E-03-7.57966669E-07 2.09470555E-10-2.16717794E-14 2
-1.08845772E+03 5.45323129E+00 3.78245636E+00-2.99673416E-03 9.84730201E-06 3
-9.68129509E-09 3.24372837E-12-1.06394356E+03 3.65767573E+00 4
H L 7/88H 1 00 00 00G 200.000 3500.000 1000.000 1
2.50000001E+00-2.30842973E-11 1.61561948E-14-4.73515235E-18 4.98197357E-22 2
2.54736599E+04-4.46682914E-01 2.50000000E+00 7.05332819E-13-1.99591964E-15 3
2.30081632E-18-9.27732332E-22 2.54736599E+04-4.46682853E-01 4
H2 TPIS78H 2 00 00 00G 200.000 3500.000 1000.000 1
3.33727920E+00-4.94024731E-05 4.99456778E-07-1.79566394E-10 2.00255376E-14 2
-9.50158922E+02-3.20502331E+00 2.34433112E+00 7.98052075E-03-1.94781510E-05 3
2.01572094E-08-7.37611761E-12-9.17935173E+02 6.83010238E-01 4
OH RUS 78O 1H 1 00 00G 200.000 3500.000 1000.000 1
3.09288767E+00 5.48429716E-04 1.26505228E-07-8.79461556E-11 1.17412376E-14 2
3.85865700E+03 4.47669610E+00 3.99201543E+00-2.40131752E-03 4.61793841E-06 3
-3.88113333E-09 1.36411470E-12 3.61508056E+03-1.03925458E-01 4
H2O L 8/89H 2O 1 00 00G 200.000 3500.000 1000.000 1
3.03399249E+00 2.17691804E-03-1.64072518E-07-9.70419870E-11 1.68200992E-14 2
-3.00042971E+04 4.96677010E+00 4.19864056E+00-2.03643410E-03 6.52040211E-06 3
-5.48797062E-09 1.77197817E-12-3.02937267E+04-8.49032208E-01 4
HO2 L 5/89H 1O 2 00 00G 200.000 3500.000 1000.000 1
4.01721090E+00 2.23982013E-03-6.33658150E-07 1.14246370E-10-1.07908535E-14 2
1.11856713E+02 3.78510215E+00 4.30179801E+00-4.74912051E-03 2.11582891E-05 3
-2.42763894E-08 9.29225124E-12 2.94808040E+02 3.71666245E+00 4
H2O2 L 7/88H 2O 2 00 00G 200.000 3500.000 1000.000 1
4.16500285E+00 4.90831694E-03-1.90139225E-06 3.71185986E-10-2.87908305E-14 2
-1.78617877E+04 2.91615662E+00 4.27611269E+00-5.42822417E-04 1.67335701E-05 3
-2.15770813E-08 8.62454363E-12-1.77025821E+04 3.43505074E+00 4
C L11/88C 1 00 00 00G 200.000 3500.000 1000.000 1
2.49266888E+00 4.79889284E-05-7.24335020E-08 3.74291029E-11-4.87277893E-15 2
8.54512953E+04 4.80150373E+00 2.55423955E+00-3.21537724E-04 7.33792245E-07 3
-7.32234889E-10 2.66521446E-13 8.54438832E+04 4.53130848E+00 4
CH TPIS79C 1H 1 00 00G 200.000 3500.000 1000.000 1
2.87846473E+00 9.70913681E-04 1.44445655E-07-1.30687849E-10 1.76079383E-14 2
7.10124364E+04 5.48497999E+00 3.48981665E+00 3.23835541E-04-1.68899065E-06 3
3.16217327E-09-1.40609067E-12 7.07972934E+04 2.08401108E+00 4
CH2 L S/93C 1H 2 00 00G 200.000 3500.000 1000.000 1
2.87410113E+00 3.65639292E-03-1.40894597E-06 2.60179549E-10-1.87727567E-14 2
4.62636040E+04 6.17119324E+00 3.76267867E+00 9.68872143E-04 2.79489841E-06 3
-3.85091153E-09 1.68741719E-12 4.60040401E+04 1.56253185E+00 4
CH2(S) L S/93C 1H 2 00 00G 200.000 3500.000 1000.000 1
2.29203842E+00 4.65588637E-03-2.01191947E-06 4.17906000E-10-3.39716365E-14 2
5.09259997E+04 8.62650169E+00 4.19860411E+00-2.36661419E-03 8.23296220E-06 3
-6.68815981E-09 1.94314737E-12 5.04968163E+04-7.69118967E-01 4
CH3 L11/89C 1H 3 00 00G 200.000 3500.000 1000.000 1
2.28571772E+00 7.23990037E-03-2.98714348E-06 5.95684644E-10-4.67154394E-14 2
1.67755843E+04 8.48007179E+00 3.67359040E+00 2.01095175E-03 5.73021856E-06 3
-6.87117425E-09 2.54385734E-12 1.64449988E+04 1.60456433E+00 4
CH4 L 8/88C 1H 4 00 00G 200.000 3500.000 1000.000 1
7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2
-9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3
-4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4
CO TPIS79C 1O 1 00 00G 200.000 3500.000 1000.000 1
2.71518561E+00 2.06252743E-03-9.98825771E-07 2.30053008E-10-2.03647716E-14 2
-1.41518724E+04 7.81868772E+00 3.57953347E+00-6.10353680E-04 1.01681433E-06 3
9.07005884E-10-9.04424499E-13-1.43440860E+04 3.50840928E+00 4
CO2 L 7/88C 1O 2 00 00G 200.000 3500.000 1000.000 1
3.85746029E+00 4.41437026E-03-2.21481404E-06 5.23490188E-10-4.72084164E-14 2
-4.87591660E+04 2.27163806E+00 2.35677352E+00 8.98459677E-03-7.12356269E-06 3
2.45919022E-09-1.43699548E-13-4.83719697E+04 9.90105222E+00 4
HCO L12/89H 1C 1O 1 00G 200.000 3500.000 1000.000 1
2.77217438E+00 4.95695526E-03-2.48445613E-06 5.89161778E-10-5.33508711E-14 2
4.01191815E+03 9.79834492E+00 4.22118584E+00-3.24392532E-03 1.37799446E-05 3
-1.33144093E-08 4.33768865E-12 3.83956496E+03 3.39437243E+00 4
CH2O L 8/88H 2C 1O 1 00G 200.000 3500.000 1000.000 1
1.76069008E+00 9.20000082E-03-4.42258813E-06 1.00641212E-09-8.83855640E-14 2
-1.39958323E+04 1.36563230E+01 4.79372315E+00-9.90833369E-03 3.73220008E-05 3
-3.79285261E-08 1.31772652E-11-1.43089567E+04 6.02812900E-01 4
CH2OH GUNL93C 1H 3O 1 00G 200.000 3500.000 1000.000 1
3.69266569E+00 8.64576797E-03-3.75101120E-06 7.87234636E-10-6.48554201E-14 2
-3.24250627E+03 5.81043215E+00 3.86388918E+00 5.59672304E-03 5.93271791E-06 3
-1.04532012E-08 4.36967278E-12-3.19391367E+03 5.47302243E+00 4
CH3O 121686C 1H 3O 1 G 0300.00 3000.00 1000.000 1
0.03770799E+02 0.07871497E-01-0.02656384E-04 0.03944431E-08-0.02112616E-12 2
0.12783252E+03 0.02929575E+02 0.02106204E+02 0.07216595E-01 0.05338472E-04 3
-0.07377636E-07 0.02075610E-10 0.09786011E+04 0.13152177E+02 4
CH3OH L 8/88C 1H 4O 1 00G 200.000 3500.000 1000.000 1
1.78970791E+00 1.40938292E-02-6.36500835E-06 1.38171085E-09-1.17060220E-13 2
-2.53748747E+04 1.45023623E+01 5.71539582E+00-1.52309129E-02 6.52441155E-05 3
-7.10806889E-08 2.61352698E-11-2.56427656E+04-1.50409823E+00 4
C2H L 1/91C 2H 1 00 00G 200.000 3500.000 1000.000 1
3.16780652E+00 4.75221902E-03-1.83787077E-06 3.04190252E-10-1.77232770E-14 2
6.71210650E+04 6.63589475E+00 2.88965733E+00 1.34099611E-02-2.84769501E-05 3
2.94791045E-08-1.09331511E-11 6.68393932E+04 6.22296438E+00 4
C2H2 L 1/91C 2H 2 00 00G 200.000 3500.000 1000.000 1
4.14756964E+00 5.96166664E-03-2.37294852E-06 4.67412171E-10-3.61235213E-14 2
2.59359992E+04-1.23028121E+00 8.08681094E-01 2.33615629E-02-3.55171815E-05 3
2.80152437E-08-8.50072974E-12 2.64289807E+04 1.39397051E+01 4
C2H3 L 2/92C 2H 3 00 00G 200.000 3500.000 1000.000 1
3.01672400E+00 1.03302292E-02-4.68082349E-06 1.01763288E-09-8.62607041E-14 2
3.46128739E+04 7.78732378E+00 3.21246645E+00 1.51479162E-03 2.59209412E-05 3
-3.57657847E-08 1.47150873E-11 3.48598468E+04 8.51054025E+00 4
C2H4 L 1/91C 2H 4 00 00G 200.000 3500.000 1000.000 1
2.03611116E+00 1.46454151E-02-6.71077915E-06 1.47222923E-09-1.25706061E-13 2
4.93988614E+03 1.03053693E+01 3.95920148E+00-7.57052247E-03 5.70990292E-05 3
-6.91588753E-08 2.69884373E-11 5.08977593E+03 4.09733096E+00 4
C2H5 L12/92C 2H 5 00 00G 200.000 3500.000 1000.000 1
1.95465642E+00 1.73972722E-02-7.98206668E-06 1.75217689E-09-1.49641576E-13 2
1.28575200E+04 1.34624343E+01 4.30646568E+00-4.18658892E-03 4.97142807E-05 3
-5.99126606E-08 2.30509004E-11 1.28416265E+04 4.70720924E+00 4
C2H6 L 8/88C 2H 6 00 00G 200.000 3500.000 1000.000 1
1.07188150E+00 2.16852677E-02-1.00256067E-05 2.21412001E-09-1.90002890E-13 2
-1.14263932E+04 1.51156107E+01 4.29142492E+00-5.50154270E-03 5.99438288E-05 3
-7.08466285E-08 2.68685771E-11-1.15222055E+04 2.66682316E+00 4
CH2CO L 5/90C 2H 2O 1 00G 200.000 3500.000 1000.000 1
4.51129732E+00 9.00359745E-03-4.16939635E-06 9.23345882E-10-7.94838201E-14 2
-7.55105311E+03 6.32247205E-01 2.13583630E+00 1.81188721E-02-1.73947474E-05 3
9.34397568E-09-2.01457615E-12-7.04291804E+03 1.22156480E+01 4
HCCO SRIC91H 1C 2O 1 G 0300.00 4000.00 1000.000 1
0.56282058E+01 0.40853401E-02-0.15934547E-05 0.28626052E-09-0.19407832E-13 2
0.19327215E+05-0.39302595E+01 0.22517214E+01 0.17655021E-01-0.23729101E-04 3
0.17275759E-07-0.50664811E-11 0.20059449E+05 0.12490417E+02 4
HCCOH SRI91C 2O 1H 20 0G 300.000 5000.000 1000.000 1
0.59238291E+01 0.67923600E-02-0.25658564E-05 0.44987841E-09-0.29940101E-13 2
0.72646260E+04-0.76017742E+01 0.12423733E+01 0.31072201E-01-0.50866864E-04 3
0.43137131E-07-0.14014594E-10 0.80316143E+04 0.13874319E+02 4
H2CN 41687H 2C 1N 1 G 0300.00 4000.000 1000.000 1
0.52097030E+01 0.29692911E-02-0.28555891E-06-0.16355500E-09 0.30432589E-13 2
0.27677109E+05-0.44444780E+01 0.28516610E+01 0.56952331E-02 0.10711400E-05 3
-0.16226120E-08-0.23511081E-12 0.28637820E+05 0.89927511E+01 4
HCN GRI/98H 1C 1N 1 0G 200.000 6000.000 1000.000 1
0.38022392E+01 0.31464228E-02-0.10632185E-05 0.16619757E-09-0.97997570E-14 2
0.14407292E+05 0.15754601E+01 0.22589886E+01 0.10051170E-01-0.13351763E-04 3
0.10092349E-07-0.30089028E-11 0.14712633E+05 0.89164419E+01 4
HNO And93 H 1N 1O 1 0G 200.000 6000.000 1000.000 1
0.29792509E+01 0.34944059E-02-0.78549778E-06 0.57479594E-10-0.19335916E-15 2
0.11750582E+05 0.86063728E+01 0.45334916E+01-0.56696171E-02 0.18473207E-04 3
-0.17137094E-07 0.55454573E-11 0.11548297E+05 0.17498417E+01 4
N L 6/88N 1 0 0 0G 200.000 6000.000 1000.000 1
0.24159429E+01 0.17489065E-03-0.11902369E-06 0.30226245E-10-0.20360982E-14 2
0.56133773E+05 0.46496096E+01 0.25000000E+01 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00 0.56104637E+05 0.41939087E+01 4
NNH T07/93N 2H 1 00 00G 200.000 6000.000 1000.000 1
0.37667544E+01 0.28915082E-02-0.10416620E-05 0.16842594E-09-0.10091896E-13 2
0.28650697E+05 0.44705067E+01 0.43446927E+01-0.48497072E-02 0.20059459E-04 3
-0.21726464E-07 0.79469539E-11 0.28791973E+05 0.29779410E+01 4
N2O L 7/88N 2O 1 0 0G 200.000 6000.000 1000.000 1
0.48230729E+01 0.26270251E-02-0.95850874E-06 0.16000712E-09-0.97752303E-14 2
0.80734048E+04-0.22017207E+01 0.22571502E+01 0.11304728E-01-0.13671319E-04 3
0.96819806E-08-0.29307182E-11 0.87417744E+04 0.10757992E+02 4
NH And94 N 1H 1 0 0G 200.000 6000.000 1000.000 1
0.27836928E+01 0.13298430E-02-0.42478047E-06 0.78348501E-10-0.55044470E-14 2
0.42120848E+05 0.57407799E+01 0.34929085E+01 0.31179198E-03-0.14890484E-05 3
0.24816442E-08-0.10356967E-11 0.41880629E+05 0.18483278E+01 4
NH2 And89 N 1H 2 0 0G 200.000 6000.000 1000.000 1
0.28347421E+01 0.32073082E-02-0.93390804E-06 0.13702953E-09-0.79206144E-14 2
0.22171957E+05 0.65204163E+01 0.42040029E+01-0.21061385E-02 0.71068348E-05 3
-0.56115197E-08 0.16440717E-11 0.21885910E+05-0.14184248E+00 4
NH3 J 6/77N 1H 3 0 0G 200.000 6000.000 1000.000 1
0.26344521E+01 0.56662560E-02-0.17278676E-05 0.23867161E-09-0.12578786E-13 2
-0.65446958E+04 0.65662928E+01 0.42860274E+01-0.46605230E-02 0.21718513E-04 3
-0.22808887E-07 0.82638046E-11-0.67417285E+04-0.62537277E+00 4
NO RUS 78N 1O 1 0 0G 200.000 6000.000 1000.000 1
0.32606056E+01 0.11911043E-02-0.42917048E-06 0.69457669E-10-0.40336099E-14 2
0.99209746E+04 0.63693027E+01 0.42184763E+01-0.46389760E-02 0.11041022E-04 3
-0.93361354E-08 0.28035770E-11 0.98446230E+04 0.22808464E+01 4
NO2 L 7/88N 1O 2 0 0G 200.000 6000.000 1000.000 1
0.48847542E+01 0.21723956E-02-0.82806906E-06 0.15747510E-09-0.10510895E-13 2
0.23164983E+04-0.11741695E+00 0.39440312E+01-0.15854290E-02 0.16657812E-04 3
-0.20475426E-07 0.78350564E-11 0.28966179E+04 0.63119917E+01 4
HCNO BDEA94H 1N 1C 1O 1G 300.000 5000.000 1382.000 1
6.59860456E+00 3.02778626E-03-1.07704346E-06 1.71666528E-10-1.01439391E-14 2
1.79661339E+04-1.03306599E+01 2.64727989E+00 1.27505342E-02-1.04794236E-05 3
4.41432836E-09-7.57521466E-13 1.92990252E+04 1.07332972E+01 4
HOCN BDEA94H 1N 1C 1O 1G 300.000 5000.000 1368.000 1
5.89784885E+00 3.16789393E-03-1.11801064E-06 1.77243144E-10-1.04339177E-14 2
-3.70653331E+03-6.18167825E+00 3.78604952E+00 6.88667922E-03-3.21487864E-06 3
5.17195767E-10 1.19360788E-14-2.82698400E+03 5.63292162E+00 4
HNCO BDEA94H 1N 1C 1O 1G 300.000 5000.000 1478.000 1
6.22395134E+00 3.17864004E-03-1.09378755E-06 1.70735163E-10-9.95021955E-15 2
-1.66599344E+04-8.38224741E+00 3.63096317E+00 7.30282357E-03-2.28050003E-06 3
-6.61271298E-10 3.62235752E-13-1.55873636E+04 6.19457727E+00 4
NCO EA 93 N 1C 1O 1 0G 200.000 6000.000 1000.000 1
0.51521845E+01 0.23051761E-02-0.88033153E-06 0.14789098E-09-0.90977996E-14 2
0.14004123E+05-0.25442660E+01 0.28269308E+01 0.88051688E-02-0.83866134E-05 3
0.48016964E-08-0.13313595E-11 0.14682477E+05 0.95504646E+01 4
CN HBH92 C 1N 1 0 0G 200.000 6000.000 1000.000 1
0.37459805E+01 0.43450775E-04 0.29705984E-06-0.68651806E-10 0.44134173E-14 2
0.51536188E+05 0.27867601E+01 0.36129351E+01-0.95551327E-03 0.21442977E-05 3
-0.31516323E-09-0.46430356E-12 0.51708340E+05 0.39804995E+01 4
HCNN SRI/94C 1N 2H 10 0G 300.000 5000.000 1000.000 1
0.58946362E+01 0.39895959E-02-0.15982380E-05 0.29249395E-09-0.20094686E-13 2
0.53452941E+05-0.51030502E+01 0.25243194E+01 0.15960619E-01-0.18816354E-04 3
0.12125540E-07-0.32357378E-11 0.54261984E+05 0.11675870E+02 4
N2 121286N 2 G 300.000 5000.000 1000.000 1
0.02926640E+02 0.14879768E-02-0.05684760E-05 0.10097038E-09-0.06753351E-13 2
-0.09227977E+04 0.05980528E+02 0.03298677E+02 0.14082404E-02-0.03963222E-04 3
0.05641515E-07-0.02444854E-10-0.10208999E+04 0.03950372E+02 4
AR 120186AR 1 G 300.000 5000.000 1000.000 1
0.02500000E+02 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 2
-0.07453750E+04 0.04366000E+02 0.02500000E+02 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00-0.07453750E+04 0.04366000E+02 4
C3H8 L 4/85C 3H 8 0 0G 300.000 5000.000 1000.00 1
0.75341368E+01 0.18872239E-01-0.62718491E-05 0.91475649E-09-0.47838069E-13 2
-0.16467516E+05-0.17892349E+02 0.93355381E+00 0.26424579E-01 0.61059727E-05 3
-0.21977499E-07 0.95149253E-11-0.13958520E+05 0.19201691E+02 4
C3H7 L 9/84C 3H 7 0 0G 300.000 5000.000 1000.00 1
0.77026987E+01 0.16044203E-01-0.52833220E-05 0.76298590E-09-0.39392284E-13 2
0.82984336E+04-0.15480180E+02 0.10515518E+01 0.25991980E-01 0.23800540E-05 3
-0.19609569E-07 0.93732470E-11 0.10631863E+05 0.21122559E+02 4
CH3CHO L 8/88C 2H 4O 1 0G 200.000 6000.000 1000.00 1
0.54041108E+01 0.11723059E-01-0.42263137E-05 0.68372451E-09-0.40984863E-13 2
-0.22593122E+05-0.34807917E+01 0.47294595E+01-0.31932858E-02 0.47534921E-04 3
-0.57458611E-07 0.21931112E-10-0.21572878E+05 0.41030159E+01 4
CH2CHO SAND86O 1H 3C 2 G 300.00 5000.00 1000.00 1
0.05975670E+02 0.08130591E-01-0.02743624E-04 0.04070304E-08-0.02176017E-12 2
0.04903218E+04-0.05045251E+02 0.03409062E+02 0.10738574E-01 0.01891492E-04 3
-0.07158583E-07 0.02867385E-10 0.15214766E+04 0.09558290E+02 4
END
!THERMO
! Insert GRI-Mech thermodynamics here or use in default file
!END
REACTIONS
2O+M<=>O2+M 1.200E+17 -1.000 .00
H2/ 2.40/ H2O/15.40/ CH4/ 2.00/ CO/ 1.75/ CO2/ 3.60/ C2H6/ 3.00/ AR/ .83/
@ -616,8 +404,8 @@ CH2+CH2=>2H+C2H2 2.000E+14 .000 10989.00
CH2(S)+H2O=>H2+CH2O 6.820E+10 .250 -935.00
C2H3+O2<=>O+CH2CHO 3.030E+11 .290 11.00
C2H3+O2<=>HO2+C2H2 1.337E+06 1.610 -384.00
O+CH3CHO<=>OH+CH2CHO 5.840E+12 .000 1808.00
O+CH3CHO=>OH+CH3+CO 5.840E+12 .000 1808.00
O+CH3CHO<=>OH+CH2CHO 2.920E+12 .000 1808.00
O+CH3CHO=>OH+CH3+CO 2.920E+12 .000 1808.00
O2+CH3CHO=>HO2+CH3+CO 3.010E+13 .000 39150.00
H+CH3CHO<=>CH2CHO+H2 2.050E+09 1.160 2405.00
H+CH3CHO=>CH3+H2+CO 2.050E+09 1.160 2405.00

File diff suppressed because it is too large Load diff

View file

@ -117,7 +117,7 @@ species(name = "O2",
),
transport = gas_transport(
geom = "linear",
diam = 3.46,
diam = 3.458,
well_depth = 107.40,
polar = 1.60,
rot_relax = 3.80),
@ -153,9 +153,9 @@ species(name = "H2O",
),
transport = gas_transport(
geom = "nonlinear",
diam = 2.60,
diam = 2.605,
well_depth = 572.40,
dipole = 1.84,
dipole = 1.844,
rot_relax = 4.00),
note = "L 8/89"
)
@ -172,7 +172,7 @@ species(name = "HO2",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.46,
diam = 3.458,
well_depth = 107.40,
rot_relax = 1.00),
note = "L 5/89"
@ -190,7 +190,7 @@ species(name = "H2O2",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.46,
diam = 3.458,
well_depth = 107.40,
rot_relax = 3.80),
note = "L 7/88"
@ -208,7 +208,7 @@ species(name = "C",
),
transport = gas_transport(
geom = "atom",
diam = 3.30,
diam = 3.298,
well_depth = 71.40),
note = "L11/88"
)
@ -293,7 +293,7 @@ species(name = "CH4",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.75,
diam = 3.746,
well_depth = 141.40,
polar = 2.60,
rot_relax = 13.00),
@ -331,7 +331,7 @@ species(name = "CO2",
),
transport = gas_transport(
geom = "linear",
diam = 3.76,
diam = 3.763,
well_depth = 244.00,
polar = 2.65,
rot_relax = 2.10),
@ -423,7 +423,7 @@ species(name = "CH3OH",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.63,
diam = 3.626,
well_depth = 481.80,
rot_relax = 1.00),
note = "L 8/88"
@ -495,7 +495,7 @@ species(name = "C2H4",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.97,
diam = 3.971,
well_depth = 280.80,
rot_relax = 1.50),
note = "L 1/91"
@ -513,7 +513,7 @@ species(name = "C2H5",
),
transport = gas_transport(
geom = "nonlinear",
diam = 4.30,
diam = 4.302,
well_depth = 252.30,
rot_relax = 1.50),
note = "L12/92"
@ -531,7 +531,7 @@ species(name = "C2H6",
),
transport = gas_transport(
geom = "nonlinear",
diam = 4.30,
diam = 4.302,
well_depth = 252.30,
rot_relax = 1.50),
note = "L 8/88"
@ -603,7 +603,7 @@ species(name = "N",
),
transport = gas_transport(
geom = "atom",
diam = 3.30,
diam = 3.298,
well_depth = 71.40),
note = "L 6/88"
)
@ -676,7 +676,7 @@ species(name = "NNH",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.80,
diam = 3.798,
well_depth = 71.40,
rot_relax = 1.00),
note = "T07/93"
@ -694,7 +694,7 @@ species(name = "NO",
),
transport = gas_transport(
geom = "linear",
diam = 3.62,
diam = 3.621,
well_depth = 97.53,
polar = 1.76,
rot_relax = 4.00),
@ -731,7 +731,7 @@ species(name = "N2O",
),
transport = gas_transport(
geom = "linear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "L 7/88"
@ -749,7 +749,7 @@ species(name = "HNO",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.49,
diam = 3.492,
well_depth = 116.70,
rot_relax = 1.00),
note = "And93"
@ -767,7 +767,7 @@ species(name = "CN",
),
transport = gas_transport(
geom = "linear",
diam = 3.86,
diam = 3.856,
well_depth = 75.00,
rot_relax = 1.00),
note = "HBH92"
@ -839,7 +839,7 @@ species(name = "HCNO",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "BDEA94"
@ -857,7 +857,7 @@ species(name = "HOCN",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "BDEA94"
@ -875,7 +875,7 @@ species(name = "HNCO",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "BDEA94"
@ -893,7 +893,7 @@ species(name = "NCO",
),
transport = gas_transport(
geom = "linear",
diam = 3.83,
diam = 3.828,
well_depth = 232.40,
rot_relax = 1.00),
note = "EA 93"
@ -911,7 +911,7 @@ species(name = "N2",
),
transport = gas_transport(
geom = "linear",
diam = 3.62,
diam = 3.621,
well_depth = 97.53,
polar = 1.76,
rot_relax = 4.00),
@ -947,7 +947,7 @@ species(name = "C3H7",
),
transport = gas_transport(
geom = "nonlinear",
diam = 4.98,
diam = 4.982,
well_depth = 266.80,
rot_relax = 1.00),
note = "L 9/84"
@ -965,7 +965,7 @@ species(name = "C3H8",
),
transport = gas_transport(
geom = "nonlinear",
diam = 4.98,
diam = 4.982,
well_depth = 266.80,
rot_relax = 1.00),
note = "L 4/85"
@ -2014,10 +2014,10 @@ reaction( "C2H3 + O2 <=> O + CH2CHO", [3.03000E+11, 0.29, 11])
reaction( "C2H3 + O2 <=> HO2 + C2H2", [1.33700E+06, 1.61, -384])
# Reaction 296
reaction( "O + CH3CHO <=> OH + CH2CHO", [5.84000E+12, 0, 1808])
reaction( "O + CH3CHO <=> OH + CH2CHO", [2.920000E+12, 0, 1808])
# Reaction 297
reaction( "O + CH3CHO => OH + CH3 + CO", [5.84000E+12, 0, 1808])
reaction( "O + CH3CHO => OH + CH3 + CO", [2.920000E+12, 0, 1808])
# Reaction 298
reaction( "O2 + CH3CHO => HO2 + CH3 + CO", [3.01000E+13, 0, 39150])

View file

@ -57,7 +57,7 @@ species(name = "O2",
),
transport = gas_transport(
geom = "linear",
diam = 3.46,
diam = 3.458,
well_depth = 107.40,
polar = 1.131,
rot_relax = 3.80),
@ -76,9 +76,9 @@ species(name = "H2O",
),
transport = gas_transport(
geom = "nonlinear",
diam = 2.60,
diam = 2.605,
well_depth = 572.40,
dipole = 1.84,
dipole = 1.844,
polar = 1.053,
rot_relax = 4.00),
note = "L 8/89"
@ -96,7 +96,7 @@ species(name = "CH4",
),
transport = gas_transport(
geom = "nonlinear",
diam = 3.75,
diam = 3.746,
well_depth = 141.40,
polar = 2.60,
rot_relax = 13.00),
@ -134,7 +134,7 @@ species(name = "CO2",
),
transport = gas_transport(
geom = "linear",
diam = 3.76,
diam = 3.763,
well_depth = 244.00,
polar = 2.65,
rot_relax = 2.10),
@ -153,7 +153,7 @@ species(name = "N2",
),
transport = gas_transport(
geom = "linear",
diam = 3.62,
diam = 3.621,
well_depth = 97.53,
polar = 1.76,
rot_relax = 4.00),

View file

@ -0,0 +1,295 @@
#==============================================================================
# Cantera input file for an LCO/graphite lithium-ion battery
#
# This file includes a full set of thermodynamic and kinetic parameters of a
# lithium-ion battery, in particular:
# - Active materials: LiCoO2 (LCO) and LiC6 (graphite)
# - Organic electrolyte: EC/PC with 1M LiPF6
# - Interfaces: LCO/electrolyte and LiC6/electrolyte
# - Charge-transfer reactions at the two interfaces
#
# A MATLAB example using this file for simulating a discharge curve is
# samples/matlab/lithium_ion_battery.m
#
# Reference:
# M. Mayur, S. C. DeCaluwe, B. L. Kee, W. G. Bessler, “Modeling and simulation
# of the thermodynamics of lithium-ion battery intercalation materials in the
# open-source software Cantera,” Electrochim. Acta 323, 134797 (2019),
# https://doi.org/10.1016/j.electacta.2019.134797
#==============================================================================
#==============================================================================
# Bulk phases
#==============================================================================
#------------------------------------------------------------------------------
# Graphite (anode)
# Thermodynamic data based on half-cell measurements by K. Kumaresan et al.,
# J. Electrochem. Soc. 155, A164-A171 (2008)
#------------------------------------------------------------------------------
BinarySolutionTabulatedThermo(
name = "anode",
elements = "Li C",
species = "Li[anode] V[anode]",
standard_concentration = "unity",
tabulated_species = "Li[anode]",
tabulated_thermo = table(
moleFraction = ([5.75000E-03, 1.77591E-02, 2.97682E-02, 4.17773E-02, 5.37864E-02, 6.57954E-02, 7.78045E-02, 8.98136E-02, 1.01823E-01, 1.13832E-01,
1.25841E-01, 1.37850E-01, 1.49859E-01, 1.61868E-01, 1.73877E-01, 1.85886E-01, 1.97896E-01, 2.09904E-01, 2.21914E-01, 2.33923E-01,
2.45932E-01, 2.57941E-01, 2.69950E-01, 2.81959E-01, 2.93968E-01, 3.05977E-01, 3.17986E-01, 3.29995E-01, 3.42004E-01, 3.54014E-01,
3.66023E-01, 3.78032E-01, 3.90041E-01, 4.02050E-01, 4.14059E-01, 4.26068E-01, 4.38077E-01, 4.50086E-01, 4.62095E-01, 4.74104E-01,
4.86114E-01, 4.98123E-01, 5.10132E-01, 5.22141E-01, 5.34150E-01, 5.46159E-01, 5.58168E-01, 5.70177E-01, 5.82186E-01, 5.94195E-01,
6.06205E-01, 6.18214E-01, 6.30223E-01, 6.42232E-01, 6.54241E-01, 6.66250E-01, 6.78259E-01, 6.90268E-01, 7.02277E-01, 7.14286E-01,
7.26295E-01, 7.38305E-01, 7.50314E-01, 7.62323E-01, 7.74332E-01, 7.86341E-01, 7.98350E-01],
"1"),
enthalpy = ([-6.40692E+04, -3.78794E+04, -1.99748E+04, -1.10478E+04, -7.04973E+03, -7.13749E+03, -8.79728E+03, -9.93655E+03, -1.03060E+04, -1.00679E+04,
-9.69664E+03, -9.31556E+03, -8.90503E+03, -8.57057E+03, -8.38117E+03, -8.31928E+03, -8.31453E+03, -8.32977E+03, -8.33292E+03, -8.32931E+03,
-8.31339E+03, -8.21331E+03, -8.08920E+03, -8.00131E+03, -7.92294E+03, -7.81543E+03, -7.77498E+03, -7.79440E+03, -7.78804E+03, -7.73218E+03,
-7.69063E+03, -7.69630E+03, -7.63241E+03, -7.41910E+03, -7.06828E+03, -6.64544E+03, -6.17193E+03, -5.67055E+03, -5.14299E+03, -4.55704E+03,
-3.94568E+03, -3.35408E+03, -2.87825E+03, -2.57690E+03, -2.43468E+03, -2.33952E+03, -2.23218E+03, -2.11482E+03, -2.03976E+03, -2.01990E+03,
-2.01329E+03, -1.97991E+03, -1.92686E+03, -1.86602E+03, -1.81419E+03, -1.77693E+03, -1.74908E+03, -1.71494E+03, -1.67287E+03, -1.63685E+03,
-1.59649E+03, -1.52295E+03, -1.39033E+03, -1.11524E+03, -5.34643E+02, 3.73854E+02, 1.60442E+03],
"J/mol"),
entropy = ([3.05724E+01, 4.04307E+01, 4.75718E+01, 5.25690E+01, 5.10953E+01, 4.43414E+01, 3.71575E+01, 3.23216E+01, 2.91586E+01, 2.70081E+01,
2.53501E+01, 2.40845E+01, 2.30042E+01, 2.19373E+01, 2.07212E+01, 1.93057E+01, 1.77319E+01, 1.61153E+01, 1.46399E+01, 1.34767E+01,
1.27000E+01, 1.23377E+01, 1.22815E+01, 1.23700E+01, 1.24863E+01, 1.26368E+01, 1.26925E+01, 1.26250E+01, 1.24861E+01, 1.23294E+01,
1.21865E+01, 1.20723E+01, 1.21228E+01, 1.24383E+01, 1.30288E+01, 1.37342E+01, 1.44460E+01, 1.50813E+01, 1.56180E+01, 1.62213E+01,
1.70474E+01, 1.80584E+01, 1.88377E+01, 1.92094E+01, 1.92957E+01, 1.93172E+01, 1.93033E+01, 1.92971E+01, 1.92977E+01, 1.92978E+01,
1.92980E+01, 1.92978E+01, 1.92945E+01, 1.92899E+01, 1.92877E+01, 1.92882E+01, 1.92882E+01, 1.92882E+01, 1.92882E+01, 1.92882E+01,
1.92885E+01, 1.92876E+01, 1.92837E+01, 1.92769E+01, 1.92850E+01, 1.93100E+01, 1.93514E+01],
"J/mol/K")))
#------------------------------------------------------------------------------
# Lithium cobalt oxide (cathode)
# Thermodynamic data based on half-cell measurements by K. Kumaresan et al.,
# J. Electrochem. Soc. 155, A164-A171 (2008)
#------------------------------------------------------------------------------
BinarySolutionTabulatedThermo(
name = "cathode",
elements = "Li Co O",
species = "Li[cathode] V[cathode]",
standard_concentration = "unity",
tabulated_species = "Li[cathode]",
tabulated_thermo = table(
moleFraction = ([4.59630E-01, 4.67368E-01, 4.75105E-01, 4.82843E-01, 4.90581E-01, 4.98318E-01, 5.06056E-01, 5.13794E-01, 5.21531E-01, 5.29269E-01,
5.37007E-01, 5.44744E-01, 5.52482E-01, 5.60219E-01, 5.67957E-01, 5.75695E-01, 5.83432E-01, 5.91170E-01, 5.98908E-01, 6.06645E-01,
6.14383E-01, 6.22121E-01, 6.29858E-01, 6.37596E-01, 6.45334E-01, 6.53071E-01, 6.60809E-01, 6.68547E-01, 6.76284E-01, 6.84022E-01,
6.91759E-01, 6.99497E-01, 7.07235E-01, 7.14972E-01, 7.22710E-01, 7.30448E-01, 7.38185E-01, 7.45923E-01, 7.53661E-01, 7.61398E-01,
7.69136E-01, 7.76873E-01, 7.84611E-01, 7.92349E-01, 8.00087E-01, 8.07824E-01, 8.15562E-01, 8.23299E-01, 8.31037E-01, 8.38775E-01,
8.46512E-01, 8.54250E-01, 8.61988E-01, 8.69725E-01, 8.77463E-01, 8.85201E-01, 8.92938E-01, 9.00676E-01, 9.08413E-01, 9.16151E-01,
9.23889E-01, 9.31627E-01, 9.39364E-01, 9.47102E-01, 9.54839E-01, 9.62577E-01, 9.70315E-01, 9.78052E-01, 9.85790E-01],
"1"),
enthalpy = ([-4.16188E+05, -4.14839E+05, -4.12629E+05, -4.09620E+05, -4.05334E+05, -3.99420E+05, -3.92499E+05, -3.85940E+05, -3.81474E+05, -3.80290E+05,
-3.81445E+05, -3.83295E+05, -3.85062E+05, -3.86633E+05, -3.87928E+05, -3.88837E+05, -3.89240E+05, -3.89238E+05, -3.89157E+05, -3.89174E+05,
-3.89168E+05, -3.88988E+05, -3.88675E+05, -3.88478E+05, -3.88443E+05, -3.88346E+05, -3.88083E+05, -3.87768E+05, -3.87531E+05, -3.87356E+05,
-3.87205E+05, -3.87052E+05, -3.86960E+05, -3.86957E+05, -3.86918E+05, -3.86814E+05, -3.86785E+05, -3.86957E+05, -3.87146E+05, -3.87188E+05,
-3.87239E+05, -3.87507E+05, -3.87902E+05, -3.88142E+05, -3.88316E+05, -3.88464E+05, -3.88563E+05, -3.88687E+05, -3.89000E+05, -3.89414E+05,
-3.89735E+05, -3.90005E+05, -3.90317E+05, -3.90632E+05, -3.90865E+05, -3.91100E+05, -3.91453E+05, -3.91742E+05, -3.91833E+05, -3.91858E+05,
-3.91910E+05, -3.91798E+05, -3.91470E+05, -3.91005E+05, -3.90261E+05, -3.89181E+05, -3.85506E+05, -3.73450E+05, -3.53926E+05],
"J/mol"),
entropy = ([-2.52348E+01, -2.54629E+01, -2.26068E+01, -1.68899E+01, -6.74549E+00, 9.76522E+00, 3.08711E+01, 4.98756E+01, 5.85766E+01, 5.46784E+01,
4.40727E+01, 3.30834E+01, 2.37109E+01, 1.61658E+01, 1.02408E+01, 5.75684E+00, 2.19969E+00, -6.93265E-01, -3.40166E+00, -6.03548E+00,
-8.45666E+00, -1.03459E+01, -1.18860E+01, -1.35610E+01, -1.53331E+01, -1.68255E+01, -1.81219E+01, -1.95052E+01, -2.07093E+01, -2.16274E+01,
-2.25743E+01, -2.38272E+01, -2.52029E+01, -2.65835E+01, -2.77164E+01, -2.86064E+01, -2.96044E+01, -3.09551E+01, -3.21990E+01, -3.31284E+01,
-3.40633E+01, -3.53177E+01, -3.66599E+01, -3.76439E+01, -3.85616E+01, -3.96433E+01, -4.06506E+01, -4.15566E+01, -4.27485E+01, -4.41419E+01,
-4.52082E+01, -4.61154E+01, -4.71614E+01, -4.82305E+01, -4.89739E+01, -4.96529E+01, -5.06905E+01, -5.18080E+01, -5.26580E+01, -5.32766E+01,
-5.39817E+01, -5.45468E+01, -5.48125E+01, -5.51520E+01, -5.54526E+01, -5.52961E+01, -5.50219E+01, -5.46653E+01, -5.42305E+01],
"J/mol/K")))
#------------------------------------------------------------------------------
# Carbonate based electrolyte
# Solvent: Ethylene carbonate:Propylene carbonate (1:1 v/v)
# Salt: 1M LiPF6
#------------------------------------------------------------------------------
IdealSolidSolution(
name = "electrolyte",
elements = "Li P F C H O E",
species = "C3H4O3[elyt] C4H6O3[elyt] Li+[elyt] PF6-[elyt]",
initial_state = state(mole_fractions = 'C3H4O3[elyt]:0.47901 C4H6O3[elyt]:0.37563 Li+[elyt]:0.07268 PF6-[elyt]:0.07268'),
standard_concentration = "unity")
#------------------------------------------------------------------------------
# Electron conductor
#------------------------------------------------------------------------------
metal(
name = "electron",
elements = "E",
species = "electron",
density = (1.0, 'kg/m3'), # dummy entry
initial_state = state( mole_fractions = "electron:1.0"))
#==============================================================================
# Species
#==============================================================================
#------------------------------------------------------------------------------
# Lithium intercalated in graphite, MW: 79.0070 g/mol.
# Note this species includes the carbon host matrix.
# Molar enthalpy and entropy are set to 0 because the values given in the
# BinarySolidSolutionTabulatedThermo class are used.
# Density of graphite: 2270 kg/m3 (W. M. Haynes et al, CRC Handbook of Chemistry
# and Physics, 94th edition, CRC press, Boca Raton, London, New York, 2013)
# (used to calculate species molar volume as molecular weight (MW)/density).
#------------------------------------------------------------------------------
species(
name = "Li[anode]",
atoms = "Li:1 C:6",
thermo = const_cp(h0 = (0.0, 'kJ/mol'), s0 = (0.0, 'J/mol/K')),
standardState = constantIncompressible(molarVolume = (79.0070/2.270, 'cm3/mol')))
#------------------------------------------------------------------------------
# Vacancy in graphite, MW: 72.0660 g/mol.
# Note this species includes the carbon host matrix.
# Molar enthalpy and entropy are set to 0 because this is the reference species
# for this phase.
# Density of graphite: 2270 kg/m3 (W. M. Haynes et al, CRC Handbook of Chemistry
# and Physics, 94th edition, CRC press, Boca Raton, London, New York, 2013)
# (used to calculate species molar volume as molecular weight (MW)/density).
#------------------------------------------------------------------------------
species(
name = "V[anode]",
atoms = "C:6",
thermo = const_cp(h0 = (0.0, 'kJ/mol'), s0 = (0.0, 'J/mol/K')),
standardState = constantIncompressible(molarVolume = (72.0660/2.270, 'cm3/mol')))
#------------------------------------------------------------------------------
# Lithium cobalt oxide, MW: 97.8730 g/mol.
# Note this species includes the cobalt oxide host matrix.
# Molar enthalpy and entropy are set to 0 because the values given in the
# BinarySolidSolutionTabulatedThermo class are used.
# Density of LCO: 4790 kg/m3 (E.J. Cheng et al., J. Asian Ceramic Soc. 5, 113,
# 2017) (used to calculate species molar volume as molecular weight/density).
#------------------------------------------------------------------------------
species(
name = "Li[cathode]",
atoms = "Li:1 Co:1 O:2",
thermo = const_cp(h0 = (0.0, 'kJ/mol'), s0 = (0.0, 'J/mol/K')),
standardState = constantIncompressible(molarVolume = (97.8730/4.790, 'cm3/mol')))
#------------------------------------------------------------------------------
# Vacancy in the cobalt oxide, MW: 90.9320 g/mol.
# Note this species includes the cobalt oxide host matrix.
# Molar enthalpy and entropy are set to 0 because this is the reference species
# for this phase.
# Density of LCO: 4790 kg/m3 (E.J. Cheng et al., J. Asian Ceramic Soc. 5, 113,
# 2017) (used to calculate species molar volume as molecular weight/density).
#------------------------------------------------------------------------------
species(
name = "V[cathode]",
atoms = "Co:1 O:2",
thermo = const_cp(h0 = (0.0, 'kJ/mol'), s0 = (0.0, 'J/mol/K')),
standardState = constantIncompressible(molarVolume = (90.9320/4.790, 'cm3/mol')))
#------------------------------------------------------------------------------
# Ethylene carbonate, MW: 88.0630 g/mol
# Density of electrolyte: 1260 kg/m3 (used to calculate species molar volume
# as molecular weight (MW)/density)
# Molar enthalpy and entropy set to zero (dummy entries as this species does
# not participate in chemical reactions)
#------------------------------------------------------------------------------
species(
name = "C3H4O3[elyt]",
atoms = "C:3 H:4 O:3",
thermo = const_cp(h0 =(0.0, 'J/mol'), s0 = (0.0, 'J/mol/K')),
standardState = constantIncompressible(molarVolume = (88.0630/1.260, 'cm3/mol')))
#------------------------------------------------------------------------------
# Propylene carbonate, MW: 102.0898 g/mol
# Density of electrolyte: 1260.0 kg/m3 (used to calculate species molar volume
# as molecular weight (MW)/density)
# Molar enthalpy and entropy set to zero (dummy entries as this species does
# not participate in chemical reactions)
#------------------------------------------------------------------------------
species(
name = "C4H6O3[elyt]",
atoms = "C:4 H:6 O:3",
thermo = const_cp(h0 =(0.0, 'J/mol'), s0 = (0.0, 'J/mol/K')),
standardState = constantIncompressible(molarVolume = (102.0898/1.260, 'cm3/mol')))
#------------------------------------------------------------------------------
# Lithium ion, MW: 6.940455 g/mol
# Density of electrolyte: 1260.0 kg/m3 (used to calculate species molar volume
# as molecular weight (MW)/density)
# Molar enthalpy and entropy taken from Li+(aq) from P. Atkins "Physical
# Chemistry", Wiley-VCH (2006)
#------------------------------------------------------------------------------
species(
name = "Li+[elyt]",
atoms = "Li:1 E:-1",
thermo = const_cp(h0 = (-278.49, 'kJ/mol'), s0 = (13.4, 'J/mol/K')),
standardState = constantIncompressible(molarVolume = (6.940455/1.260, 'cm3/mol')))
#------------------------------------------------------------------------------
# Hexafluorophosphate ion, MW: 144.964745 g/mol
# Density of electrolyte: 1260.0 kg/m3 (used to calculate species molar volume
# as molecular weight (MW)/density)
# Molar enthalpy and entropy set to zero (dummy entries as this species does
# not participate in chemical reactions)
#------------------------------------------------------------------------------
species(
name = "PF6-[elyt]",
atoms = "P:1 F:6 E:1",
thermo = const_cp(h0 = (0.0, 'J/mol'), s0 = (0.0, 'J/mol/K')),
standardState = constantIncompressible(molarVolume = (144.964745/1.260, 'cm3/mol')))
#------------------------------------------------------------------------------
# Electron, MW: 0.000545 g/mol
# Molar enthalpy and entropy set to zero (dummy entries because chemical
# potential is set to zero for a "metal" phase)
#------------------------------------------------------------------------------
species(
name = "electron",
atoms = "E:1",
thermo = const_cp(h0 = (0.0, 'kJ/mol'), s0 = (0.0, 'J/mol/K')))
#------------------------------------------------------------------------------
# Dummy species (needed for defining the interfaces)
#------------------------------------------------------------------------------
species(
name = "(dummy)",
atoms = "",
thermo = const_cp(h0 = (0.0, 'kJ/mol'), s0 = (0.0, 'J/mol/K')))
#==============================================================================
# Interfaces for electrochemical reactions
#==============================================================================
#------------------------------------------------------------------------------
# Graphite/electrolyte interface
# Species and site density are dummy entries (as we do not consider surface-
# adsorbed species)
#------------------------------------------------------------------------------
ideal_interface(
name = "edge_anode_electrolyte",
phases = "anode electron electrolyte",
reactions = "anode_*",
species = "(dummy)",
site_density = (1.0e-2, 'mol/cm2'))
#------------------------------------------------------------------------------
# LCO/electrolyte interface
# Species and site density are dummy entries (as we do not consider surface-
# adsorbed species)
#------------------------------------------------------------------------------
ideal_interface(
name = "edge_cathode_electrolyte",
phases = "cathode electron electrolyte",
reactions = "cathode_*",
species = "(dummy)",
site_density = (1.0e-2, 'mol/cm2'))
#==============================================================================
# Electrochemical reactions
#
# We use Butler-Volmer kinetics by setting rate_coeff_type = "exchangecurrentdensity".
# The preexponential factors and activation energies are converted from
# Guo et al., J. Electrochem. Soc. 158, A122 (2011)
#==============================================================================
# Graphite/electrolyte interface
edge_reaction("Li+[elyt] + V[anode] + electron <=> Li[anode]", [2.028e4, 0.0, (20, 'kJ/mol')], rate_coeff_type = "exchangecurrentdensity", beta = 0.5,id="anode_reaction")
# LCO/electrolyte interface
edge_reaction("Li+[elyt] + V[cathode] + electron <=> Li[cathode]", [5.629e11, 0.0, (58, 'kJ/mol')], rate_coeff_type = "exchangecurrentdensity", beta = 0.5,id="cathode_reaction")

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -108,10 +108,10 @@ species( name = "electron", atoms = "E:1",
# consider the oxygen sublattice. The only species we define are a
# lattice oxygen, and an oxygen vacancy. Again, the density is a
# required input, but is not used here, so may be set arbitrarily.
incompressible_solid(name = "oxide_bulk",
lattice(name = "oxide_bulk",
elements = "O E",
species = "Ox VO**",
density = (0.7, 'g/cm3'),
site_density = (0.0176, 'mol/cm3'),
initial_state = state( temperature = tt,
pressure = OneAtm,
mole_fractions = "Ox:0.95 VO**:0.05")

View file

@ -0,0 +1,222 @@
THERMO
300.000 1000.000 5000.000
! GRI-Mech Version 3.0 Thermodynamics released 7/30/99
! NASA Polynomial format for CHEMKIN-II
! see README file for disclaimer
O L 1/90O 1 G 200.000 3500.000 1000.000 1
2.56942078E+00-8.59741137E-05 4.19484589E-08-1.00177799E-11 1.22833691E-15 2
2.92175791E+04 4.78433864E+00 3.16826710E+00-3.27931884E-03 6.64306396E-06 3
-6.12806624E-09 2.11265971E-12 2.91222592E+04 2.05193346E+00 4
O2 TPIS89O 2 G 200.000 3500.000 1000.000 1
3.28253784E+00 1.48308754E-03-7.57966669E-07 2.09470555E-10-2.16717794E-14 2
-1.08845772E+03 5.45323129E+00 3.78245636E+00-2.99673416E-03 9.84730201E-06 3
-9.68129509E-09 3.24372837E-12-1.06394356E+03 3.65767573E+00 4
H L 7/88H 1 G 200.000 3500.000 1000.000 1
2.50000001E+00-2.30842973E-11 1.61561948E-14-4.73515235E-18 4.98197357E-22 2
2.54736599E+04-4.46682914E-01 2.50000000E+00 7.05332819E-13-1.99591964E-15 3
2.30081632E-18-9.27732332E-22 2.54736599E+04-4.46682853E-01 4
H2 TPIS78H 2 G 200.000 3500.000 1000.000 1
3.33727920E+00-4.94024731E-05 4.99456778E-07-1.79566394E-10 2.00255376E-14 2
-9.50158922E+02-3.20502331E+00 2.34433112E+00 7.98052075E-03-1.94781510E-05 3
2.01572094E-08-7.37611761E-12-9.17935173E+02 6.83010238E-01 4
OH RUS 78O 1H 1 G 200.000 3500.000 1000.000 1
3.09288767E+00 5.48429716E-04 1.26505228E-07-8.79461556E-11 1.17412376E-14 2
3.85865700E+03 4.47669610E+00 3.99201543E+00-2.40131752E-03 4.61793841E-06 3
-3.88113333E-09 1.36411470E-12 3.61508056E+03-1.03925458E-01 4
H2O L 8/89H 2O 1 G 200.000 3500.000 1000.000 1
3.03399249E+00 2.17691804E-03-1.64072518E-07-9.70419870E-11 1.68200992E-14 2
-3.00042971E+04 4.96677010E+00 4.19864056E+00-2.03643410E-03 6.52040211E-06 3
-5.48797062E-09 1.77197817E-12-3.02937267E+04-8.49032208E-01 4
HO2 L 5/89H 1O 2 G 200.000 3500.000 1000.000 1
4.01721090E+00 2.23982013E-03-6.33658150E-07 1.14246370E-10-1.07908535E-14 2
1.11856713E+02 3.78510215E+00 4.30179801E+00-4.74912051E-03 2.11582891E-05 3
-2.42763894E-08 9.29225124E-12 2.94808040E+02 3.71666245E+00 4
H2O2 L 7/88H 2O 2 G 200.000 3500.000 1000.000 1
4.16500285E+00 4.90831694E-03-1.90139225E-06 3.71185986E-10-2.87908305E-14 2
-1.78617877E+04 2.91615662E+00 4.27611269E+00-5.42822417E-04 1.67335701E-05 3
-2.15770813E-08 8.62454363E-12-1.77025821E+04 3.43505074E+00 4
C L11/88C 1 G 200.000 3500.000 1000.000 1
2.49266888E+00 4.79889284E-05-7.24335020E-08 3.74291029E-11-4.87277893E-15 2
8.54512953E+04 4.80150373E+00 2.55423955E+00-3.21537724E-04 7.33792245E-07 3
-7.32234889E-10 2.66521446E-13 8.54438832E+04 4.53130848E+00 4
CH TPIS79C 1H 1 G 200.000 3500.000 1000.000 1
2.87846473E+00 9.70913681E-04 1.44445655E-07-1.30687849E-10 1.76079383E-14 2
7.10124364E+04 5.48497999E+00 3.48981665E+00 3.23835541E-04-1.68899065E-06 3
3.16217327E-09-1.40609067E-12 7.07972934E+04 2.08401108E+00 4
CH2 L S/93C 1H 2 G 200.000 3500.000 1000.000 1
2.87410113E+00 3.65639292E-03-1.40894597E-06 2.60179549E-10-1.87727567E-14 2
4.62636040E+04 6.17119324E+00 3.76267867E+00 9.68872143E-04 2.79489841E-06 3
-3.85091153E-09 1.68741719E-12 4.60040401E+04 1.56253185E+00 4
CH2(S) L S/93C 1H 2 G 200.000 3500.000 1000.000 1
2.29203842E+00 4.65588637E-03-2.01191947E-06 4.17906000E-10-3.39716365E-14 2
5.09259997E+04 8.62650169E+00 4.19860411E+00-2.36661419E-03 8.23296220E-06 3
-6.68815981E-09 1.94314737E-12 5.04968163E+04-7.69118967E-01 4
CH3 L11/89C 1H 3 G 200.000 3500.000 1000.000 1
2.28571772E+00 7.23990037E-03-2.98714348E-06 5.95684644E-10-4.67154394E-14 2
1.67755843E+04 8.48007179E+00 3.67359040E+00 2.01095175E-03 5.73021856E-06 3
-6.87117425E-09 2.54385734E-12 1.64449988E+04 1.60456433E+00 4
CH4 L 8/88C 1H 4 G 200.000 3500.000 1000.000 1
7.48514950E-02 1.33909467E-02-5.73285809E-06 1.22292535E-09-1.01815230E-13 2
-9.46834459E+03 1.84373180E+01 5.14987613E+00-1.36709788E-02 4.91800599E-05 3
-4.84743026E-08 1.66693956E-11-1.02466476E+04-4.64130376E+00 4
CO TPIS79C 1O 1 G 200.000 3500.000 1000.000 1
2.71518561E+00 2.06252743E-03-9.98825771E-07 2.30053008E-10-2.03647716E-14 2
-1.41518724E+04 7.81868772E+00 3.57953347E+00-6.10353680E-04 1.01681433E-06 3
9.07005884E-10-9.04424499E-13-1.43440860E+04 3.50840928E+00 4
CO2 L 7/88C 1O 2 G 200.000 3500.000 1000.000 1
3.85746029E+00 4.41437026E-03-2.21481404E-06 5.23490188E-10-4.72084164E-14 2
-4.87591660E+04 2.27163806E+00 2.35677352E+00 8.98459677E-03-7.12356269E-06 3
2.45919022E-09-1.43699548E-13-4.83719697E+04 9.90105222E+00 4
HCO L12/89H 1C 1O 1 G 200.000 3500.000 1000.000 1
2.77217438E+00 4.95695526E-03-2.48445613E-06 5.89161778E-10-5.33508711E-14 2
4.01191815E+03 9.79834492E+00 4.22118584E+00-3.24392532E-03 1.37799446E-05 3
-1.33144093E-08 4.33768865E-12 3.83956496E+03 3.39437243E+00 4
CH2O L 8/88H 2C 1O 1 G 200.000 3500.000 1000.000 1
1.76069008E+00 9.20000082E-03-4.42258813E-06 1.00641212E-09-8.83855640E-14 2
-1.39958323E+04 1.36563230E+01 4.79372315E+00-9.90833369E-03 3.73220008E-05 3
-3.79285261E-08 1.31772652E-11-1.43089567E+04 6.02812900E-01 4
CH2OH GUNL93C 1H 3O 1 G 200.000 3500.000 1000.000 1
3.69266569E+00 8.64576797E-03-3.75101120E-06 7.87234636E-10-6.48554201E-14 2
-3.24250627E+03 5.81043215E+00 3.86388918E+00 5.59672304E-03 5.93271791E-06 3
-1.04532012E-08 4.36967278E-12-3.19391367E+03 5.47302243E+00 4
CH3O 121686C 1H 3O 1 G 300.00 3000.00 1000.000 1
0.03770799E+02 0.07871497E-01-0.02656384E-04 0.03944431E-08-0.02112616E-12 2
0.12783252E+03 0.02929575E+02 0.02106204E+02 0.07216595E-01 0.05338472E-04 3
-0.07377636E-07 0.02075610E-10 0.09786011E+04 0.13152177E+02 4
CH3OH L 8/88C 1H 4O 1 G 200.000 3500.000 1000.000 1
1.78970791E+00 1.40938292E-02-6.36500835E-06 1.38171085E-09-1.17060220E-13 2
-2.53748747E+04 1.45023623E+01 5.71539582E+00-1.52309129E-02 6.52441155E-05 3
-7.10806889E-08 2.61352698E-11-2.56427656E+04-1.50409823E+00 4
C2H L 1/91C 2H 1 G 200.000 3500.000 1000.000 1
3.16780652E+00 4.75221902E-03-1.83787077E-06 3.04190252E-10-1.77232770E-14 2
6.71210650E+04 6.63589475E+00 2.88965733E+00 1.34099611E-02-2.84769501E-05 3
2.94791045E-08-1.09331511E-11 6.68393932E+04 6.22296438E+00 4
C2H2 L 1/91C 2H 2 G 200.000 3500.000 1000.000 1
4.14756964E+00 5.96166664E-03-2.37294852E-06 4.67412171E-10-3.61235213E-14 2
2.59359992E+04-1.23028121E+00 8.08681094E-01 2.33615629E-02-3.55171815E-05 3
2.80152437E-08-8.50072974E-12 2.64289807E+04 1.39397051E+01 4
C2H3 L 2/92C 2H 3 G 200.000 3500.000 1000.000 1
3.01672400E+00 1.03302292E-02-4.68082349E-06 1.01763288E-09-8.62607041E-14 2
3.46128739E+04 7.78732378E+00 3.21246645E+00 1.51479162E-03 2.59209412E-05 3
-3.57657847E-08 1.47150873E-11 3.48598468E+04 8.51054025E+00 4
C2H4 L 1/91C 2H 4 G 200.000 3500.000 1000.000 1
2.03611116E+00 1.46454151E-02-6.71077915E-06 1.47222923E-09-1.25706061E-13 2
4.93988614E+03 1.03053693E+01 3.95920148E+00-7.57052247E-03 5.70990292E-05 3
-6.91588753E-08 2.69884373E-11 5.08977593E+03 4.09733096E+00 4
C2H5 L12/92C 2H 5 G 200.000 3500.000 1000.000 1
1.95465642E+00 1.73972722E-02-7.98206668E-06 1.75217689E-09-1.49641576E-13 2
1.28575200E+04 1.34624343E+01 4.30646568E+00-4.18658892E-03 4.97142807E-05 3
-5.99126606E-08 2.30509004E-11 1.28416265E+04 4.70720924E+00 4
C2H6 L 8/88C 2H 6 G 200.000 3500.000 1000.000 1
1.07188150E+00 2.16852677E-02-1.00256067E-05 2.21412001E-09-1.90002890E-13 2
-1.14263932E+04 1.51156107E+01 4.29142492E+00-5.50154270E-03 5.99438288E-05 3
-7.08466285E-08 2.68685771E-11-1.15222055E+04 2.66682316E+00 4
CH2CO L 5/90C 2H 2O 1 G 200.000 3500.000 1000.000 1
4.51129732E+00 9.00359745E-03-4.16939635E-06 9.23345882E-10-7.94838201E-14 2
-7.55105311E+03 6.32247205E-01 2.13583630E+00 1.81188721E-02-1.73947474E-05 3
9.34397568E-09-2.01457615E-12-7.04291804E+03 1.22156480E+01 4
HCCO SRIC91H 1C 2O 1 G 300.00 4000.00 1000.000 1
0.56282058E+01 0.40853401E-02-0.15934547E-05 0.28626052E-09-0.19407832E-13 2
0.19327215E+05-0.39302595E+01 0.22517214E+01 0.17655021E-01-0.23729101E-04 3
0.17275759E-07-0.50664811E-11 0.20059449E+05 0.12490417E+02 4
HCCOH SRI91C 2O 1H 2 G 300.000 5000.000 1000.000 1
0.59238291E+01 0.67923600E-02-0.25658564E-05 0.44987841E-09-0.29940101E-13 2
0.72646260E+04-0.76017742E+01 0.12423733E+01 0.31072201E-01-0.50866864E-04 3
0.43137131E-07-0.14014594E-10 0.80316143E+04 0.13874319E+02 4
H2CN 41687H 2C 1N 1 G 300.00 4000.000 1000.000 1
0.52097030E+01 0.29692911E-02-0.28555891E-06-0.16355500E-09 0.30432589E-13 2
0.27677109E+05-0.44444780E+01 0.28516610E+01 0.56952331E-02 0.10711400E-05 3
-0.16226120E-08-0.23511081E-12 0.28637820E+05 0.89927511E+01 4
HCN GRI/98H 1C 1N 1 G 200.000 6000.000 1000.000 1
0.38022392E+01 0.31464228E-02-0.10632185E-05 0.16619757E-09-0.97997570E-14 2
0.14407292E+05 0.15754601E+01 0.22589886E+01 0.10051170E-01-0.13351763E-04 3
0.10092349E-07-0.30089028E-11 0.14712633E+05 0.89164419E+01 4
HNO And93 H 1N 1O 1 G 200.000 6000.000 1000.000 1
0.29792509E+01 0.34944059E-02-0.78549778E-06 0.57479594E-10-0.19335916E-15 2
0.11750582E+05 0.86063728E+01 0.45334916E+01-0.56696171E-02 0.18473207E-04 3
-0.17137094E-07 0.55454573E-11 0.11548297E+05 0.17498417E+01 4
N L 6/88N 1 G 200.000 6000.000 1000.000 1
0.24159429E+01 0.17489065E-03-0.11902369E-06 0.30226245E-10-0.20360982E-14 2
0.56133773E+05 0.46496096E+01 0.25000000E+01 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00 0.56104637E+05 0.41939087E+01 4
NNH T07/93N 2H 1 G 200.000 6000.000 1000.000 1
0.37667544E+01 0.28915082E-02-0.10416620E-05 0.16842594E-09-0.10091896E-13 2
0.28650697E+05 0.44705067E+01 0.43446927E+01-0.48497072E-02 0.20059459E-04 3
-0.21726464E-07 0.79469539E-11 0.28791973E+05 0.29779410E+01 4
N2O L 7/88N 2O 1 G 200.000 6000.000 1000.000 1
0.48230729E+01 0.26270251E-02-0.95850874E-06 0.16000712E-09-0.97752303E-14 2
0.80734048E+04-0.22017207E+01 0.22571502E+01 0.11304728E-01-0.13671319E-04 3
0.96819806E-08-0.29307182E-11 0.87417744E+04 0.10757992E+02 4
NH And94 N 1H 1 G 200.000 6000.000 1000.000 1
0.27836928E+01 0.13298430E-02-0.42478047E-06 0.78348501E-10-0.55044470E-14 2
0.42120848E+05 0.57407799E+01 0.34929085E+01 0.31179198E-03-0.14890484E-05 3
0.24816442E-08-0.10356967E-11 0.41880629E+05 0.18483278E+01 4
NH2 And89 N 1H 2 G 200.000 6000.000 1000.000 1
0.28347421E+01 0.32073082E-02-0.93390804E-06 0.13702953E-09-0.79206144E-14 2
0.22171957E+05 0.65204163E+01 0.42040029E+01-0.21061385E-02 0.71068348E-05 3
-0.56115197E-08 0.16440717E-11 0.21885910E+05-0.14184248E+00 4
NH3 J 6/77N 1H 3 G 200.000 6000.000 1000.000 1
0.26344521E+01 0.56662560E-02-0.17278676E-05 0.23867161E-09-0.12578786E-13 2
-0.65446958E+04 0.65662928E+01 0.42860274E+01-0.46605230E-02 0.21718513E-04 3
-0.22808887E-07 0.82638046E-11-0.67417285E+04-0.62537277E+00 4
NO RUS 78N 1O 1 G 200.000 6000.000 1000.000 1
0.32606056E+01 0.11911043E-02-0.42917048E-06 0.69457669E-10-0.40336099E-14 2
0.99209746E+04 0.63693027E+01 0.42184763E+01-0.46389760E-02 0.11041022E-04 3
-0.93361354E-08 0.28035770E-11 0.98446230E+04 0.22808464E+01 4
NO2 L 7/88N 1O 2 G 200.000 6000.000 1000.000 1
0.48847542E+01 0.21723956E-02-0.82806906E-06 0.15747510E-09-0.10510895E-13 2
0.23164983E+04-0.11741695E+00 0.39440312E+01-0.15854290E-02 0.16657812E-04 3
-0.20475426E-07 0.78350564E-11 0.28966179E+04 0.63119917E+01 4
HCNO BDEA94H 1N 1C 1O 1G 300.000 5000.000 1382.000 1
6.59860456E+00 3.02778626E-03-1.07704346E-06 1.71666528E-10-1.01439391E-14 2
1.79661339E+04-1.03306599E+01 2.64727989E+00 1.27505342E-02-1.04794236E-05 3
4.41432836E-09-7.57521466E-13 1.92990252E+04 1.07332972E+01 4
HOCN BDEA94H 1N 1C 1O 1G 300.000 5000.000 1368.000 1
5.89784885E+00 3.16789393E-03-1.11801064E-06 1.77243144E-10-1.04339177E-14 2
-3.70653331E+03-6.18167825E+00 3.78604952E+00 6.88667922E-03-3.21487864E-06 3
5.17195767E-10 1.19360788E-14-2.82698400E+03 5.63292162E+00 4
HNCO BDEA94H 1N 1C 1O 1G 300.000 5000.000 1478.000 1
6.22395134E+00 3.17864004E-03-1.09378755E-06 1.70735163E-10-9.95021955E-15 2
-1.66599344E+04-8.38224741E+00 3.63096317E+00 7.30282357E-03-2.28050003E-06 3
-6.61271298E-10 3.62235752E-13-1.55873636E+04 6.19457727E+00 4
NCO EA 93 N 1C 1O 1 G 200.000 6000.000 1000.000 1
0.51521845E+01 0.23051761E-02-0.88033153E-06 0.14789098E-09-0.90977996E-14 2
0.14004123E+05-0.25442660E+01 0.28269308E+01 0.88051688E-02-0.83866134E-05 3
0.48016964E-08-0.13313595E-11 0.14682477E+05 0.95504646E+01 4
CN HBH92 C 1N 1 G 200.000 6000.000 1000.000 1
0.37459805E+01 0.43450775E-04 0.29705984E-06-0.68651806E-10 0.44134173E-14 2
0.51536188E+05 0.27867601E+01 0.36129351E+01-0.95551327E-03 0.21442977E-05 3
-0.31516323E-09-0.46430356E-12 0.51708340E+05 0.39804995E+01 4
HCNN SRI/94C 1N 2H 1 G 300.000 5000.000 1000.000 1
0.58946362E+01 0.39895959E-02-0.15982380E-05 0.29249395E-09-0.20094686E-13 2
0.53452941E+05-0.51030502E+01 0.25243194E+01 0.15960619E-01-0.18816354E-04 3
0.12125540E-07-0.32357378E-11 0.54261984E+05 0.11675870E+02 4
N2 121286N 2 G 300.000 5000.000 1000.000 1
0.02926640E+02 0.14879768E-02-0.05684760E-05 0.10097038E-09-0.06753351E-13 2
-0.09227977E+04 0.05980528E+02 0.03298677E+02 0.14082404E-02-0.03963222E-04 3
0.05641515E-07-0.02444854E-10-0.10208999E+04 0.03950372E+02 4
AR 120186AR 1 G 300.000 5000.000 1000.000 1
0.02500000E+02 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 2
-0.07453750E+04 0.04366000E+02 0.02500000E+02 0.00000000E+00 0.00000000E+00 3
0.00000000E+00 0.00000000E+00-0.07453750E+04 0.04366000E+02 4
C3H8 L 4/85C 3H 8 G 300.000 5000.000 1000.000 1
0.75341368E+01 0.18872239E-01-0.62718491E-05 0.91475649E-09-0.47838069E-13 2
-0.16467516E+05-0.17892349E+02 0.93355381E+00 0.26424579E-01 0.61059727E-05 3
-0.21977499E-07 0.95149253E-11-0.13958520E+05 0.19201691E+02 4
C3H7 L 9/84C 3H 7 G 300.000 5000.000 1000.000 1
0.77026987E+01 0.16044203E-01-0.52833220E-05 0.76298590E-09-0.39392284E-13 2
0.82984336E+04-0.15480180E+02 0.10515518E+01 0.25991980E-01 0.23800540E-05 3
-0.19609569E-07 0.93732470E-11 0.10631863E+05 0.21122559E+02 4
CH3CHO L 8/88C 2H 4O 1 G 200.000 6000.000 1000.000 1
0.54041108E+01 0.11723059E-01-0.42263137E-05 0.68372451E-09-0.40984863E-13 2
-0.22593122E+05-0.34807917E+01 0.47294595E+01-0.31932858E-02 0.47534921E-04 3
-0.57458611E-07 0.21931112E-10-0.21572878E+05 0.41030159E+01 4
CH2CHO SAND86O 1H 3C 2 G 300.000 5000.000 1000.000 1
0.05975670E+02 0.08130591E-01-0.02743624E-04 0.04070304E-08-0.02176017E-12 2
0.04903218E+04-0.05045251E+02 0.03409062E+02 0.10738574E-01 0.01891492E-04 3
-0.07158583E-07 0.02867385E-10 0.15214766E+04 0.09558290E+02 4
END

View file

@ -144,8 +144,7 @@ if localenv['sphinx_docs']:
'1D/@Domain1D': ['1D/AxiStagnFlow.m', '1D/AxisymmetricFlow.m',
'1D/Inlet.m', '1D/Outlet.m', '1D/OutletRes.m',
'1D/Surface.m', '1D/SymmPlane.m'],
'1D/@Stack': ['1D/FreeFlame.m', '1D/npflame_init.m',
'1D/CounterFlowDiffusionFlame.m'],
'1D/@Stack': ['1D/FreeFlame.m', '1D/CounterFlowDiffusionFlame.m'],
'@Interface': ['importEdge.m', 'importInterface.m'],
'@Data': ['gasconstant.m', 'oneatm.m'],
'@Utilities': ['adddir.m', 'ck2cti.m', 'cleanup.m', 'geterr.m',
@ -206,3 +205,5 @@ if localenv['sphinx_docs']:
localenv.Depends(sphinxdocs, c)
localenv.AlwaysBuild(sphinxdocs)
install(localenv.RecursiveInstall, '$inst_docdir/sphinx/html',
'#/build/docs/sphinx/html')

View file

@ -34,7 +34,7 @@ PROJECT_NAME = Cantera
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 2.4.0
PROJECT_NUMBER = 2.5.0a3
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.

View file

@ -10,20 +10,24 @@ lang="en">
{%- macro script() %}
<script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- if scriptfile.startswith("https://cdn.jsdelivr.net") %}
<script defer type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- else %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endif %}
{%- endfor %}
{%- endmacro %}
{%- macro css() %}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" media="none" onload="this.media='all'" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous" />
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- for css in css_files %}
{%- if css|attr("rel") %}
<link rel="{{ css.rel }}" href="{{ pathto(css.filename, 1) }}" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} />
<link rel="{{ css.rel }}" href="{{ pathto(css.filename, 1) }}" media="none" onload="this.media='all'" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} />
{%- else %}
<link rel="stylesheet" href="{{ pathto(css, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto(css, 1) }}" media="none" onload="this.media='all'" type="text/css" />
{%- endif %}
{%- endfor %}
{%- endmacro %}
@ -90,10 +94,10 @@ lang="en">
<a href="/install/index.html" class="nav-link">Install</a>
</li>
<li class="nav-item">
<a href="/examples/index.html" class="nav-link">Examples</a>
<a href="/tutorials/index.html" class="nav-link">Tutorials</a>
</li>
<li class="nav-item">
<a href="/about.html" class="nav-link">About</a>
<a href="/examples/index.html" class="nav-link">Examples</a>
</li>
<li class="nav-item">
<a href="/community.html" class="nav-link">Community</a>
@ -152,7 +156,7 @@ lang="en">
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha256-98vAGjEDGN79TjHkYWVD4s87rvWkdWLHPs5MC3FvFX4=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js" integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em" crossorigin="anonymous"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha256-98vAGjEDGN79TjHkYWVD4s87rvWkdWLHPs5MC3FvFX4=" crossorigin="anonymous"></script>
<script async="async" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js" integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em" crossorigin="anonymous"></script>
</body>
</html>

View file

@ -1,5 +1,5 @@
<div id="numfocus">
<h3>Donate to Cantera</h3>
<a href="https://www.flipcause.com/secure/cause_pdetails/Mjk3MjU=">
<a href="https://numfocus.salsalabs.org/donate-to-cantera/index.html">
<img src="{{pathto("_static/powered_by_NumFOCUS.png", 1) }}" border="0" alt="NumFOCUS"/></a>
</div>

View file

@ -16,10 +16,7 @@ import sys, os, re
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
if sys.version_info[0] == 3:
sys.path.insert(0, os.path.abspath('../../build/python3'))
else:
sys.path.insert(0, os.path.abspath('../../build/python2'))
sys.path.insert(0, os.path.abspath('../../build/python'))
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('./exts'))
@ -99,9 +96,6 @@ release = re.search('CANTERA_VERSION "(.*?)"', configh).group(1)
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
if sys.version_info[0] == 3:
exclude_patterns.append('python/*')
# The reST default role (used for this markup: `text`) to use for all documents.
default_role = 'py:obj'

View file

@ -80,9 +80,6 @@ Thermodynamic Properties
.. autoclass:: Shomate
:no-undoc-members:
.. autoclass:: Adsorbate
:no-undoc-members:
.. autoclass:: const_cp
:no-undoc-members:
@ -122,6 +119,9 @@ Reactions
.. autoclass:: edge_reaction
:no-undoc-members:
.. autoclass:: stick
:no-undoc-members:
Falloff Parameterizations
-------------------------

View file

@ -11,6 +11,7 @@ format.
.. toctree::
:maxdepth: 2
yaml/index
cti/classes
cython/index
matlab/index

View file

@ -0,0 +1,25 @@
.. highlight:: yaml
.. _sec-yaml-elements:
********
Elements
********
``element`` entries are needed only when defining custom elements that are not
standard chemical elements, or defining specific isotopes.
The fields of an ``element`` entry are:
``symbol``
The symbol used for the element, as used when specifying the composition of
species.
``atomic-weight``
The atomic weight of the element, in unified atomic mass units (dalton).
``atomic-number``
The atomic number of the element. Optional.
``entropy298``
The standard molar entropy of the element at 298.15 K. Optional.

View file

@ -0,0 +1,97 @@
.. highlight:: yaml
*****************
General Structure
*****************
Sections
--------
The top level of a Cantera `YAML <https://yaml.org/spec/1.2/spec.html#Introduction>`__
input file is a mapping that defines different input file sections. Each
section consists of a list of mappings that define objects of the same type,
e.g., reactions, species, phases, or elements. The ``phases`` section of an input
file contains all of the phase definitions. Multiple sections containing
reaction, species, or element definitions can be used. The specific names
``reactions``, ``species``, and ``elements`` are used as defaults when looking
for :ref:`sec-yaml-reactions`, :ref:`sec-yaml-species`, and
:ref:`sec-yaml-elements` to add to a phase. A simple input file has the
following structure::
phases:
- name: spam
thermo: ideal-gas
# Additional fields come after this
- name: green-eggs
thermo: model-name
# Additional fields come after this
species:
- name: A
# Additional fields come after this
- name: B
# Additional fields come after this
- name: C
# Additional fields come after this
reactions:
- equation: A + B <=> C + D
# Additional fields come after this
- equation: A + C <=> 2 D
# Additional fields come after this
Units
-----
While Cantera generally works internally in SI units, input values can be
provided using a number of different units.
Compound units are written using the asterisk (``*``) to indicate
multiplication, the forward slash (``/``) to indicate division, and the caret
(``^``) to indicate exponentiation. Exponents can include negative and decimal
values. Standard one-letter metric prefixes can be applied to any unit.
Supported base units are:
- Mass: ``g``
- Length: ``m``, ``micron``, ``angstrom``, ``Å``
- Time: ``s``, ``min``, ``hr``
- Temperature: ``K``, ``C``
- Current: ``A``
- Quantity: ``mol`` (gram mole), ``gmol``, ``mole``, ``kmol``, ``kgmol``, ``molec``
Supported compound units are:
- Energy: ``J``, ``cal``, ``erg``, ``eV``
- Activation Energy: ``K``, or any unit of energy per quantity (``J/kmol``,
``cal/mol``, etc.)
- Force: ``N``, ``dyn``
- Pressure: ``Pa``, ``atm``, ``bar``, ``dyn/cm^2``
- Volume: ``m^3``, ``liter``, ``L``, ``l``, ``cc``
- Other electrical units: ``ohm``, ``V``, ``coulomb``
Units can be specified on individual input values by placing them after the
value, separated by a space::
{A: 1.45e9 cm^3/kmol, b: 0.4, Ea: 21033 kJ/kmol}
or by using a ``units`` mapping::
units: {mass: g, quantity: mol, pressure: atm, activation-energy: cal/mol}
A ``units`` mapping will set the default units for all values within the same
YAML list or mapping, including any nested lists and mappings. Units not
specified by a mapping use the values from higher level mappings, or the Cantera
defaults if no ``units`` mapping specifies applicable units. If a ``units``
mapping appears in a list, it must be the first item in that list.
Default units may be set for ``mass``, ``length``, ``time``, ``temperature``,
``current``, ``quantity``, ``pressure``, ``energy``, and ``activation-energy``.
The units ``pressure`` and ``energy`` are used when these units appear
explicitly in the units that a value is being converted to within Cantera. For
example, a conversion to ``N/m^2`` will use the default units for mass, length,
and time, while a conversion to ``Pa`` will use the default units for pressure.
Conversions of activation energies implicitly include scaling by the gas
constant where necessary. Setting default units for ``energy`` and ``quantity``
will determine the default units of ``activation-energy``, which can be
overridden by explicitly giving the desired units of ``activation-energy``.

13
doc/sphinx/yaml/index.rst Normal file
View file

@ -0,0 +1,13 @@
*************************
YAML Input File Reference
*************************
.. toctree::
:maxdepth: 2
general
phases
elements
species
reactions

808
doc/sphinx/yaml/phases.rst Normal file
View file

@ -0,0 +1,808 @@
.. highlight:: yaml
*****************
Phase Definitions
*****************
A ``phase`` is a mapping that contains definitions for the elements, species,
and optionally reactions that can take place in that phase. The fields of a
``phase`` entry are:
``name``
String identifier used for the phase. Required.
``elements``
Specification for the elements present in the phase. This can be:
- Omitted, in which case the standard elements will be added as needed by
the species included in the phase.
- A list of element symbols, which can be either defined in the ``elements``
section of the file or taken from the standard elements.
- A list of single-key mappings of section names to lists of element
symbols. These sections can be in the same file as the phase definition,
or from another file if written as ``file-path/sectionname``. If a
relative path is specified, the directory containing the current file is
searched first, followed by the Cantera data path. Standard elements can
be included by referencing the fictitious section ``default``.
``species``
Specification for the species present in the phase. This can be:
- a list of species that appear in the ``species`` section of the file.
- The string ``all``, to indicate that all species in the ``species``
section should be included. This is the default if no ``species`` entry
is present.
- A list of single-key mappings of section names to either the string
``all`` or a list of species names. These sections can be in the same
file as the phase definition, or from another file if written as
``file-path/sectionname``. If a relative path is specified, the directory
containing the current file is searched first, followed by the Cantera
data path.
Species may be skipped depending on the setting of the
``skip-undeclared-elements`` option.
``skip-undeclared-elements``
If set to ``true``, do not add species that contain elements that are not
explicitly included in the phase. The default is ``false``, where the
presence of such species is considered an error.
``skip-undeclared-third-bodies``
If set to ``true``, ignore third body efficiencies for species that are not
defined in the phase. The default is ``false``, where the presence of
such third body specifications is considered an error.
``state``
A mapping specifying the thermodynamic state. See
:ref:`sec-yaml-setting-state`.
``thermo``
String specifying the phase thermodynamic model to be used. Supported model
strings are:
- :ref:`binary-solution-tabulated <sec-yaml-binary-solution-tabulated>`
- :ref:`compound-lattice <sec-yaml-compound-lattice>`
- :ref:`constant-density <sec-yaml-constant-density>`
- :ref:`Debye-Huckel <sec-yaml-Debye-Huckel>`
- :ref:`edge <sec-yaml-edge>`
- :ref:`fixed-chemical-potential <sec-yaml-fixed-chemical-potential>`
- :ref:`fixed-stoichiometry <sec-yaml-fixed-stoichiometry>`
- :ref:`HMW-electrolyte <sec-yaml-HMW-electrolyte>`
- :ref:`ideal-gas <sec-yaml-ideal-gas>`
- :ref:`ideal-gas-VPSS <sec-yaml-ideal-gas-VPSS>`
- :ref:`ideal-molal-solution <sec-yaml-ideal-molal-solution>`
- :ref:`ideal-condensed <sec-yaml-ideal-condensed>`
- :ref:`ideal-solution-VPSS <sec-yaml-ideal-solution-VPSS>`
- :ref:`ideal-surface <sec-yaml-ideal-surface>`
- :ref:`ions-from-neutral-molecule <sec-yaml-ions-from-neutral-molecule>`
- :ref:`lattice <sec-yaml-lattice>`
- :ref:`liquid-water-IAPWS95 <sec-yaml-liquid-water-IAPWS95>`
- :ref:`Margules <sec-yaml-Margules>`
- :ref:`Maskell-solid-solution <sec-yaml-Maskell-solid-solution>`
- :ref:`electron-cloud <sec-yaml-electron-cloud>`
- :ref:`pure-fluid <sec-yaml-pure-fluid>`
- :ref:`Redlich-Kister <sec-yaml-Redlich-Kister>`
- :ref:`Redlich-Kwong <sec-yaml-Redlich-Kwong>`
``kinetics``
String specifying the kinetics model to be used. Supported model strings
are:
- none
- `gas <https://cantera.org/documentation/dev/doxygen/html/de/dae/classCantera_1_1GasKinetics.html#details>`__
- `surface <https://cantera.org/documentation/dev/doxygen/html/d1/d72/classCantera_1_1InterfaceKinetics.html#details>`__
- `edge <https://cantera.org/documentation/dev/doxygen/html/d0/df0/classCantera_1_1EdgeKinetics.html#details>`__
``reactions``
Source of reactions to include in the phase, if a kinetics model has been
specified. This can be:
- The string ``all``, which indicates that all reactions from the
``reactions`` section of the file should be included. This is the default
if no ``reactions`` entry is present.
- The string ``declared-species``, which indicates that all reactions from
the ``reactions`` section involving only species present in the phase
should be included.
- The string ``none``, which indicates that no reactions should be added.
This can be used if reactions will be added programmatically after
the phase is constructed.
- A list of sections from which to include reactions. These sections can be
in the same file as the phase definition, or from another file if written
as ``file-path/sectionname``. If a relative path is specified, the
directory containing the current file is searched first, followed by the
Cantera data path.
- A list of single-key mappings of section names to rules for adding
reactions, where for each section name, that rule is either ``all`` or
``declared-species`` and is applied as described above.
``Motz-Wise``
Boolean indicating whether the Motz-Wise correction should be applied to
sticking reactions. Applicable only to interface phases. The default is
``false``. The value set at the phase level may be overridden on individual
reactions.
``transport``
String specifying the transport model to be used. Supported model strings
are:
- none
- `high-pressure <https://cantera.org/documentation/dev/doxygen/html/d9/d63/classCantera_1_1HighPressureGasTransport.html#details>`__
- `ionized-gas <https://cantera.org/documentation/dev/doxygen/html/d4/d65/classCantera_1_1IonGasTransport.html#details>`__
- `mixture-averaged <https://cantera.org/documentation/dev/doxygen/html/d9/d17/classCantera_1_1MixTransport.html#details>`__
- `mixture-averaged-CK <https://cantera.org/documentation/dev/doxygen/html/d9/d17/classCantera_1_1MixTransport.html#details>`__
- `multicomponent <https://cantera.org/documentation/dev/doxygen/html/df/d7c/classCantera_1_1MultiTransport.html#details>`__
- `multicomponent-CK <https://cantera.org/documentation/dev/doxygen/html/df/d7c/classCantera_1_1MultiTransport.html#details>`__
- `unity-Lewis-number <https://cantera.org/documentation/dev/doxygen/html/d3/dd6/classCantera_1_1UnityLewisTransport.html#details>`__
- `water <https://cantera.org/documentation/dev/doxygen/html/df/d1f/classCantera_1_1WaterTransport.html#details>`__
.. _sec-yaml-setting-state:
Setting the state
=================
The state of a ``phase`` can be set using two properties to set the
thermodynamic state, plus the composition.
The composition can be set using one of the following fields, depending on the
phase type. The composition is specified as a mapping of species names to
values. Where necessary, the values will be automatically normalized.
- ``mass-fractions`` or ``Y``
- ``mole-fractions`` or ``X``
- ``coverages``
- ``molalities`` or ``M``
The thermodynamic state can be set using the following property pairs, with some
exceptions for phases where setting that property pair is not implemented. All
properties are on a per unit mass basis where relevant:
- ``T`` and ``P``
- ``T`` and ``D``
- ``T`` and ``V``
- ``H`` and ``P``
- ``U`` and ``V``
- ``S`` and ``V``
- ``S`` and ``P``
- ``S`` and ``T``
- ``P`` and ``V``
- ``U`` and ``P``
- ``V`` and ``H``
- ``T`` and ``H``
- ``S`` and ``H``
- ``D`` and ``P``
The following synonyms are also implemented for use in any of the pairs:
- ``temperature``, ``T``
- ``pressure``, ``P``
- ``enthalpy``, ``H``
- ``entropy``, ``S``
- ``int-energy``, ``internal-energy``, ``U``
- ``specific-volume``, ``V``
- ``density``, ``D``
.. _sec-phase-thermo-models:
Phase thermodynamic models
==========================
.. _sec-yaml-binary-solution-tabulated:
``binary-solution-tabulated``
-----------------------------
A phase implementing tabulated standard state thermodynamics for one species in
a binary solution, as `described here <https://cantera.org/documentation/dev/doxygen/html/de/ddf/classCantera_1_1BinarySolutionTabulatedThermo.html#details>`__.
Includes the fields of :ref:`sec-yaml-ideal-molal-solution`, plus:
``tabulated-species``
The name of the species to which the tabulated enthalpy and entropy is
added.
``tabulated-thermo``
A mapping containing three lists of equal lengths:
``mole-fractions``
A list of mole fraction values for the tabulated species.
``enthalpy``
The extra molar enthalpy to be added to the tabulated species at these
mole fractions.
``entropy``
The extra molar entropy to be added to the tabulated species at these
mole fractions.
.. _sec-yaml-compound-lattice:
``compound-lattice``
--------------------
A phase that is comprised of a fixed additive combination of other lattice
phases, as `described here <https://cantera.org/documentation/dev/doxygen/html/de/de1/classCantera_1_1LatticeSolidPhase.html#details>`__.
Additional fields:
``composition``
A mapping of component phase names to their relative stoichiometries.
Example::
thermo: compound-lattice
composition: {Li7Si3(s): 1.0, Li7Si3-interstitial: 1.0}
.. _sec-yaml-constant-density:
``constant-density``
--------------------
An incompressible phase with constant density, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d9/de4/classCantera_1_1ConstDensityThermo.html#details>`__.
Additional fields:
``density``
The density of the phase
Example::
thermo: constant-density
density: 0.7 g/cm^3
.. _sec-yaml-Debye-Huckel:
``Debye-Huckel``
----------------
The Debye-Hückel model as
`described here <https://cantera.org/documentation/dev/doxygen/html/d8/d9a/classCantera_1_1DebyeHuckel.html#details>`__.
Additional parameters for this model are contained in the ``activity-data``
field:
``activity-data``
The activity data field contains the following fields:
``model``
One of ``dilute-limit``, ``B-dot-with-variable-a``,
``B-dot-with-common-a``, ``beta_ij``, or ``Pitzer-with-beta_ij``
``A_Debye``
The value of the Debye "A" parameter, or the string ``variable`` to use
a calculation based on the water equation of state.
``B_Debye``
The Debye "B" parameter
``max-ionic-strength``
The maximum ionic strength
``use-Helgeson-fixed-form``
Boolean, ``true`` or ``false``
``default-ionic-radius``
Ionic radius to use for species where the ionic radius has not been
specified.
``B-dot``
The value of B-dot.
``beta``
List of mappings providing values of :math:`\beta_{ij}` for different
species pairs. Each mapping contains a ``species`` key that contains a
list of two species names, and a ``beta`` key that contains the
corresponding value of :math:`\beta_{ij}`.
Example::
thermo: Debye-Huckel
activity-data:
model: beta_ij
max-ionic-strength: 3.0
use-Helgeson-fixed-form: true
default-ionic-radius: 3.042843 angstrom
beta:
- species: [H+, Cl-]
beta: 0.27
- species: [Na+, Cl-]
beta: 0.15
- species: [Na+, OH-]
beta: 0.06
.. _sec-yaml-edge:
``edge``
--------
A one-dimensional edge between two surfaces, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d9/d17/classCantera_1_1EdgePhase.html#details>`__.
Additional fields:
``site-density``
The molar density of sites per unit length along the edge
Example::
thermo: edge
site-density: 5.0e-17 mol/cm
.. _sec-yaml-fixed-chemical-potential:
``fixed-chemical-potential``
----------------------------
A phase defined by a fixed value of the chemical potential, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d6/db0/classCantera_1_1FixedChemPotSSTP.html#details>`__.
Additional fields:
``chemical-potential``
The molar chemical potential of the phase
Example::
thermo: fixed-chemical-potential
chemical-potential: -2.3e7 J/kmol
.. _sec-yaml-fixed-stoichiometry:
``fixed-stoichiometry``
-----------------------
A phase with fixed composition, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d3/d50/classCantera_1_1StoichSubstance.html#details>`__.
.. _sec-yaml-HMW-electrolyte:
``HMW-electrolyte``
-------------------
A dilute or concentrated liquid electrolyte phase that obeys the Pitzer
formulation for nonideality, as
`described here <https://cantera.org/documentation/dev/doxygen/html/de/d1d/classCantera_1_1HMWSoln.html#details>`__.
Additional parameters for this model are contained in the ``activity-data``
field:
``activity-data``
The activity data field contains the following fields:
``temperature-model``
The form of the Pitzer temperature model. One of ``constant``,
``linear`` or ``complex``.
``A_Debye``
The value of the Debye "A" parameter, or the string ``variable`` to use
a calculation based on the water equation of state.
``max-ionic-strength``
The maximum ionic strength
``interactions``
A list of mappings, where each mapping describes a binary or ternary
interaction among species. Fields of this mapping include:
``species``
A list of one to three species names
``beta0``
The :math:`\beta^{(0)}` parameters for an cation/anion interaction.
1, 2, or 5 values depending on the value of ``temperature-model``.
``beta1``
The :math:`\beta^{(1)}` parameters for an cation/anion interaction.
1, 2, or 5 values depending on the value of ``temperature-model``.
``beta2``
The :math:`\beta^{(2)}` parameters for an cation/anion interaction.
1, 2, or 5 values depending on the value of ``temperature-model``.
``Cphi``
The :math:`C^\phi` parameters for an cation/anion interaction.
1, 2, or 5 values depending on the value of ``temperature-model``.
``alpha1``
The :math:`\alpha^{(1)}` parameter for an cation/anion interaction.
``alpha2``
The :math:`\alpha^{(2)}` parameter for an cation/anion interaction.
``theta``
The :math:`\theta` parameters for a like-charged binary interaction.
1, 2, or 5 values depending on the value of ``temperature-model``.
``lambda``
The :math:`\lambda` parameters for binary interactions involving at
least one neutral species. 1, 2, or 5 values depending on the value
of ``temperature-model``.
``psi``
The :math:`\Psi` parameters for ternary interactions involving three
charged species. 1, 2, or 5 values depending on the value of
``temperature-model``.
``zeta``
The :math:`\zeta` parameters for ternary interactions involving one
neutral species. 1, 2, or 5 values depending on the value of
``temperature-model``.
``mu``
The :math:`\mu` parameters for a neutral species self-interaction.
1, 2, or 5 values depending on the value of ``temperature-model``.
``cropping-coefficients``
``ln_gamma_k_min``
Default -5.0.
``ln_gamma_k_max``
Default 15.0.
``ln_gamma_o_min``
Default -6.0.
``ln_gamma_o_max``
Default 3.0.
Example::
thermo: HMW-electrolyte
activity-data:
temperature-model: complex
A_Debye: 1.175930 kg^0.5/gmol^0.5
interactions:
- species: [Na+, Cl-]
beta0: [0.0765, 0.008946, -3.3158E-6, -777.03, -4.4706]
beta1: [0.2664, 6.1608E-5, 1.0715E-6, 0.0, 0.0]
beta2: [0.0, 0.0, 0.0, 0.0, 0.0]
Cphi: [0.00127, -4.655E-5, 0.0, 33.317, 0.09421]
alpha1: 2.0
- species: [H+, Cl-]
beta0: [0.1775]
beta1: [0.2945]
beta2: [0.0]
Cphi: [0.0008]
alpha1: 2.0
- species: [Na+, OH-]
beta0: 0.0864
beta1: 0.253
beta2: 0.0
Cphi: 0.0044
alpha1: 2.0
alpha2: 0.0
- {species: [Cl-, OH-], theta: -0.05}
- {species: [Na+, Cl-, OH-], psi: -0.006}
- {species: [Na+, H+], theta: 0.036}
- {species: [Cl-, Na+, H+], psi: [-0.004]}
.. _sec-yaml-ideal-gas:
``ideal-gas``
-------------
The ideal gas model as
`described here <https://cantera.org/documentation/dev/doxygen/html/d7/dfa/classCantera_1_1IdealGasPhase.html#details>`__.
.. _sec-yaml-ideal-gas-VPSS:
``ideal-gas-VPSS``
------------------
The ideal gas model, using variable pressure standard state methods as
`described here <https://cantera.org/documentation/dev/doxygen/html/dc/ddb/classCantera_1_1IdealSolnGasVPSS.html#details>`__.
.. _sec-yaml-ideal-molal-solution:
``ideal-molal-solution``
------------------------
A phase based on the mixing-rule assumption that all molality-based activity
coefficients are equal to one, as
`described here <https://cantera.org/documentation/dev/doxygen/html/da/d5c/classCantera_1_1IdealMolalSoln.html#details>`__.
Additional fields:
``standard-concentration-basis``
A string specifying the basis for the standard concentration. One of
``unity``, ``species-molar-volume``, or ``solvent-molar-volume``.
``cutoff``
Parameters for cutoff treatments of activity coefficients
``model``
``poly`` or ``polyExp``
``gamma_o``
gamma_o value for the cutoff process at the zero solvent point
``gamma_k``
gamma_k minimum for the cutoff process at the zero solvent point
``X_o``
value of the solute mole fraction that centers the cutoff polynomials
for the cutoff = 1 process
``c_0``
Parameter in the polyExp cutoff treatment having to do with rate of
exponential decay
``slope_f``
Parameter in the ``polyExp`` cutoff treatment
``slope_g``
Parameter in the ``polyExp`` cutoff treatment
Example::
thermo: ideal-molal-solution
standard-concentration-basis: solvent-molar-volume
cutoff:
model: polyexp
gamma_o: 0.0001
gamma_k: 10.0
X_o: 0.2
c_0: 0.05
slope_f: 0.6
slope_g: 0.0
.. _sec-yaml-ideal-condensed:
``ideal-condensed``
-------------------
A condensed phase ideal solution as
`described here <https://cantera.org/documentation/dev/doxygen/html/d3/d4c/classCantera_1_1IdealSolidSolnPhase.html#details>`__.
Additional fields:
``standard-concentration-basis``
A string specifying the basis for the standard concentration. One of
``unity``, ``species-molar-volume``, or ``solvent-molar-volume``.
.. _sec-yaml-ideal-solution-VPSS:
``ideal-solution-VPSS``
-----------------------
An ideal solution model using variable pressure standard state methods as
`described here <https://cantera.org/documentation/dev/doxygen/html/dc/ddb/classCantera_1_1IdealSolnGasVPSS.html#details>`__.
Additional fields:
``standard-concentration-basis``
A string specifying the basis for the standard concentration. One of
``unity``, ``species-molar-volume``, or ``solvent-molar-volume``.
.. _sec-yaml-ideal-surface:
``ideal-surface``
-----------------
An ideal surface phase, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d2/d95/classCantera_1_1SurfPhase.html#details>`__.
Additional fields:
``site-density``
The molar density of surface sites
.. _sec-yaml-ions-from-neutral-molecule:
``ions-from-neutral-molecule``
------------------------------
A model that handles the specification of the chemical potentials for ionic
species, given a specification of the chemical potentials for the same phase
expressed in terms of combinations of the ionic species that represent neutral
molecules, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d7/d4a/classCantera_1_1IonsFromNeutralVPSSTP.html#details>`__.
Additional fields:
``neutral-phase``
The ``name`` of the phase definition for the phase containing the neutral
molecules.
Example::
- name: KCl-ions
thermo: ions-from-neutral-molecule
neutral-phase: KCl-neutral
species: [K+, Cl-]
- name: KCl-neutral
species: [KCl(l)]
thermo: Margules
.. _sec-yaml-lattice:
``lattice``
-----------
A simple thermodynamic model for a bulk phase, assuming a lattice of solid
atoms, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d1/da0/classCantera_1_1LatticePhase.html#details>`__.
Additional fields:
``site-density``
The molar density of lattice sites
.. _sec-yaml-liquid-water-IAPWS95:
``liquid-water-IAPWS95``
------------------------
An equation of state for liquid water, as
`described here <https://cantera.org/documentation/dev/doxygen/html/dc/d86/classCantera_1_1WaterSSTP.html#details>`__.
.. _sec-yaml-Margules:
``Margules``
------------
A phase employing the Margules approximation for the excess Gibbs free energy, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d7/dfe/classCantera_1_1MargulesVPSSTP.html#details>`__.
Additional fields:
``interactions``
A list of mappings, where each mapping has the following fields:
``species``
A list of two species names
``excess-enthalpy``
A list of two values specifying the first and second excess enthalpy
coefficients for the interaction of the specified species. Defaults to
[0, 0].
``excess-entropy``
A list of two values specifying the first and second excess entropy
coefficients for the interaction of the specified species. Defaults to
[0, 0].
``excess-volume-enthalpy``
A list of two values specifying the first and second enthalpy
coefficients for the excess volume interaction of the specified species.
Defaults to [0, 0].
``excess-volume-entropy``
A list of two values specifying the first and second entropy
coefficients for the excess volume interaction of the specified species.
Defaults to [0, 0].
Example::
thermo: Margules
interactions:
- species: [KCl(l), LiCl(l)]
excess-enthalpy: [-17570, -377]
excess-entropy: [-7.627, 4.958]
.. _sec-yaml-Maskell-solid-solution:
``Maskell-solid-solution``
--------------------------
A condensed phase non-ideal solution with two species, as
`described here <https://cantera.org/documentation/dev/doxygen/html/dd/d3a/classCantera_1_1MaskellSolidSolnPhase.html#details>`__.
Additional fields:
``excess-enthalpy``
The molar excess enthalpy
``product-species``
String specifying the "product" species
Example::
thermo: Maskell-solid-solution
excess-enthalpy: 5 J/mol
product-species: H(s)
.. _sec-yaml-electron-cloud:
``electron-cloud``
------------------
A phase representing an electron cloud, such as conduction electrons in a metal,
as `described here <https://cantera.org/documentation/dev/doxygen/html/d9/d13/classCantera_1_1MetalPhase.html#details>`__.
Additional fields:
``density``
The density of the bulk metal
.. _sec-yaml-pure-fluid:
``pure-fluid``
--------------
A phase representing a pure fluid equation of state for one of several species,
as `described here <https://cantera.org/documentation/dev/doxygen/html/d1/d29/classCantera_1_1PureFluidPhase.html#details>`__.
Additional fields:
``pure-fluid-name``
Name of the pure fluid model to use:
- ``carbondioxide``
- ``heptane``
- ``hfc134a``
- ``hydrogen``
- ``methane``
- ``nitrogen``
- ``oxygen``
- ``water``
.. _sec-yaml-Redlich-Kister:
``Redlich-Kister``
------------------
A phase employing the Redlich-Kister approximation for the excess Gibbs free
energy, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d0/d23/classCantera_1_1RedlichKisterVPSSTP.html#details>`__.
Additional fields:
``interactions``
A list of mappings, where each mapping has the following fields:
``species``
A list of two species names
``excess-enthalpy``
A list of polynomial coefficients for the excess enthalpy of the
specified binary interaction
``excess-entropy``
A list of polynomial coefficients for the excess entropy of the
specified binary interaction
Example::
thermo: Redlich-Kister
interactions:
- species: [Li(C6), V(C6)]
excess-enthalpy: [-3.268e+06, 3.955e+06, -4.573e+06, 6.147e+06, -3.339e+06,
1.117e+07, 2.997e+05, -4.866e+07, 1.362e+05, 1.373e+08,
-2.129e+07, -1.722e+08, 3.956e+07, 9.302e+07, -3.280e+07]
excess-entropy: [0.0]
.. _sec-yaml-Redlich-Kwong:
``Redlich-Kwong``
-----------------
A multi-species Redlich-Kwong phase as
`described here <https://cantera.org/documentation/dev/doxygen/html/d6/d29/classCantera_1_1RedlichKwongMFTP.html#details>`__.
The parameters for each species are contained in the corresponding species
entries.

View file

@ -0,0 +1,323 @@
.. highlight:: yaml
.. _sec-yaml-reactions:
*********
Reactions
*********
The fields common to all ``reaction`` entries are:
``equation``
The stoichiometric equation for the reaction. Each term (i.e.,
stoichiometric coefficient, species name, ``+`` or ``<=>``) in the equation
must be separated by a space.
Reversible reactions may be written using ``<=>`` or ``=`` to separate
reactants and products. Irreversible reacions are written using ``=>``.
``type``
A string specifying the type of reaction or rate coefficient
parameterization. The default is ``elementary``. Reaction types are:
- :ref:`elementary <sec-elementary>`
- :ref:`three-body <sec-three-body>`
- :ref:`falloff <sec-falloff>`
- :ref:`chemically-activated <sec-chemically-activated>`
- :ref:`pressure-dependent-Arrhenius <sec-pressure-dependent-Arrhenius>`
- :ref:`Chebyshev <sec-Chebyshev>`
Reactions on surfaces or edges are automatically treated as
:ref:`interface <sec-interface-reaction>` reactions, and reactions that
involve charge transfer between phases are automatically treated as
:ref:`electrochemical <sec-electrochemical-reaction>` reactions, without the
need to specify the ``type``.
``duplicate``
Boolean indicating whether the reaction is a known duplicate of another
reaction. The default is ``false``.
``orders``
An optional mapping of species to explicit reaction orders to use. Reaction
orders for reactant species not explicitly mentioned are taken to be their
respective stoichiometric coefficients. See
`Reaction orders <https://cantera.org/science/reactions.html#reaction-orders>`__
for additional information.
``negative-orders``
Boolean indicating whether negative reaction orders are allowed. The
default is ``false``.
``nonreactant-orders``
Boolean indicating whether orders for non-reactant species are allowed.
The default is ``false``.
Depending on the reaction ``type``, other fields may be necessary to specify
the rate of the reaction.
.. _sec-arrhenius:
Arrhenius expression
====================
Arrhenius expressions can be specified as either a three-element list containing
the pre-exponential factor :math:`A`, the temperature exponent :math:`b`, and
the activation energy :math:`E_a`, or a mapping containing the fields ``A``,
``b``, and ``Ea``. The following are equivalent::
{A: -2.70000E+13 cm^3/mol/s, b: 0, Ea: 355 cal/mol}
[-2.70000E+13 cm^3/mol/s, 0, 355 cal/mol]
.. _sec-efficiencies:
Efficiencies
============
Some reaction types include parameters for the "efficiency" of different species
as third-body colliders. For these reactions, the following additional fields
are supported:
``efficiencies``
A mapping of species names to efficiency values
``default-efficiency``
The efficiency for use for species not included in the ``efficiencies``
mapping. Defaults to 1.0.
Reaction types
==============
.. _sec-elementary:
``elementary``
--------------
A homogeneous reaction with a pressure-independent rate coefficient and mass
action kinetics, as
`described here <https://cantera.org/science/reactions.html#reactions-with-a-pressure-independent-rate>`__.
Additional fields are:
``rate-constant``
An :ref:`Arrhenius-type <sec-arrhenius>` list or mapping.
``negative-A``
A boolean indicating whether a negative value for the pre-exponential factor
is allowed. The default is ``false``.
Example::
equation: N + NO <=> N2 + O
rate-constant: {A: -2.70000E+13 cm^3/mol/s, b: 0, Ea: 355 cal/mol}
negative-A: true
.. _sec-three-body:
``three-body``
--------------
A three body reaction as
`described here <https://cantera.org/science/reactions.html#three-body-reactions>`__.
The reaction equation should include the third body collision partner ``M``.
Includes the fields of an ``elementary`` reaction, plus the fields for
specifying :ref:`efficiencies <sec-efficiencies>`.
Example::
equation: 2 O + M = O2 + M
type: three-body
rate-constant: [1.20000E+17 cm^6/mol^2/s, -1, 0]
efficiencies: {AR: 0.83, H2O: 5}
.. _sec-falloff:
``falloff``
-----------
A falloff reaction as
`described here <https://cantera.org/science/reactions.html#falloff-reactions>`__.
The reaction equation should include the pressure-dependent third body collision
partner ``(+M)`` or ``(+name)`` where ``name`` is the name of a species. The
latter case is equivalent to setting the efficiency for ``name`` to 1 and the
efficiency for all other species to 0.
Includes field for specifying :ref:`efficiencies <sec-efficiencies>` as well
as:
``high-P-rate-constant``
An :ref:`sec-arrhenius` expression for the high-pressure limit
``low-P-rate-constant``
An :ref:`sec-arrhenius` expression for the low-pressure limit
``Troe``
Parameters for the
`Troe <https://cantera.org/science/reactions.html#the-troe-falloff-function>`__
falloff function. A mapping containing the keys ``A``, ``T3``, ``T1`` and
optionally ``T2``. The default value for ``T2`` is 0.
``SRI``
Parameters for the
`SRI <https://cantera.org/science/reactions.html#the-sri-falloff-function>`__
falloff function. A mapping containing the keys ``A``, ``B``, ``C``, and
optionally ``D`` and ``E``. The default values for ``D`` and ``E`` are 1.0
and 0.0, respectively.
Example::
equation: H + CH2 (+ N2) <=> CH3 (+N2)
type: falloff
high-P-rate-constant: [6.00000E+14 cm^3/mol/s, 0, 0]
low-P-rate-constant: {A: 1.04000E+26 cm^6/mol^2/s, b: -2.76, Ea: 1600}
Troe: {A: 0.562, T3: 91, T1: 5836}
.. _sec-chemically-activated:
``chemically-activated``
------------------------
A chemically activated reaction as
`described here <https://cantera.org/science/reactions.html#chemically-activated-reactions>`__.
The parameters are the same as for :ref:`sec-falloff` reactions.
Example::
equation: CH3 + OH (+M) <=> CH2O + H2 (+M)
type: chemically-activated
high-P-rate-constant: [5.88E-14, 6.721, -3022.227]
low-P-rate-constant: [282320.078, 1.46878, -3270.56495]
.. _sec-pressure-dependent-Arrhenius:
``pressure-dependent-Arrhenius``
--------------------------------
A pressure-dependent reaction using multiple Arrhenius expressions as
`described here <https://cantera.org/science/reactions.html#pressure-dependent-arrhenius-rate-expressions-p-log>`__.
The only additional field in this reaction type is:
``rate-constants``
A list of mappings, where each mapping is the mapping form of an
:ref:`sec-arrhenius` expression with the addition of a pressure ``P``.
Example::
equation: H + CH4 <=> H2 + CH3
type: pressure-dependent-Arrhenius
rate-constants:
- {P: 0.039474 atm, A: 2.720000e+09 cm^3/mol/s, b: 1.2, Ea: 6834.0}
- {P: 1.0 atm, A: 1.260000e+20, b: -1.83, Ea: 15003.0}
- {P: 1.0 atm, A: 1.230000e+04, b: 2.68, Ea: 6335.0}
- {P: 1.01325 MPa, A: 1.680000e+16, b: -0.6, Ea: 14754.0}
.. _sec-Chebyshev:
``Chebyshev``
-------------
A reaction parameterized as a bivariate Chebyshev polynomial as
`described here <https://cantera.org/science/reactions.html#chebyshev-reaction-rate-expressions>`__.
Additional fields are:
``temperature-range``
A list of two values specifying the minimum and maximum temperatures at
which the rate constant is valid
``pressure-range``
A list of two values specifying the minimum and maximum pressures at
which the rate constant is valid
``data``
A list of lists containing the Chebyshev coefficients
Example::
equation: CH4 <=> CH3 + H
type: Chebyshev
temperature-range: [290, 3000]
pressure-range: [0.0098692326671601278 atm, 98.692326671601279 atm]
data: [[-1.44280e+01, 2.59970e-01, -2.24320e-02, -2.78700e-03],
[ 2.20630e+01, 4.88090e-01, -3.96430e-02, -5.48110e-03],
[-2.32940e-01, 4.01900e-01, -2.60730e-02, -5.04860e-03],
[-2.93660e-01, 2.85680e-01, -9.33730e-03, -4.01020e-03],
[-2.26210e-01, 1.69190e-01, 4.85810e-03, -2.38030e-03],
[-1.43220e-01, 7.71110e-02, 1.27080e-02, -6.41540e-04]]
.. _sec-interface-reaction:
``interface``
-------------
A reaction occuring on a surface between two bulk phases, or along an edge
at the intersection of two surfaces, as
`described here <https://cantera.org/science/reactions.html#surface-reactions>`__.
Includes the fields of an :ref:`sec-elementary` reaction plus:
``sticking-coefficient``
An :ref:`Arrhenius-type <sec-arrhenius>` expression for the sticking coefficient
``Motz-Wise``
A boolean applicable to sticking reactions, indicating whether to use the
Motz-Wise correction factor for sticking coefficients near unity. Defaults
to ``false``.
``sticking-species``
The name of the sticking species. Required for sticking reactions only if
the reaction includes multiple non-surface species.
``coverage-dependencies``
A mapping of species names to coverage dependence parameters, where these
parameters are contained in a mapping with the fields:
``a``
Coefficient for exponential dependence on the coverage
``m``
Power-law exponent of coverage dependence
``E``
Activation energy dependence on coverage
Example::
equation: 2 H(s) => H2 + 2 Pt(s)
rate-constant: {A: 3.7e21 cm^2/mol/s, b: 0, Ea: 67400 J/mol}
coverage-dependencies: {H(s): {a: 0, m: 0, E: -6000 J/mol}}
.. _sec-electrochemical-reaction:
``electrochemical``
-------------------
Interface reactions involving charge transfer between phases,
as `described here <https://cantera.org/documentation/dev/doxygen/html/d6/ddd/classCantera_1_1ElectrochemicalReaction.html#details>`__.
Includes the fields of an :ref:`sec-interface-reaction` reaction, plus:
``beta``
The symmetry factor for the reaction. Default is 0.5.
``exchange-current-density-formulation``
Set to ``true`` if the rate constant parameterizes the exchange current
density. Default is ``false``.
Example::
equation: LiC6 <=> Li+(e) + C6
rate-constant: [5.74, 0.0, 0.0]
beta: 0.4

471
doc/sphinx/yaml/species.rst Normal file
View file

@ -0,0 +1,471 @@
.. highlight:: yaml
.. _sec-yaml-species:
*******
Species
*******
The fields of a ``species`` entry are:
``name``
String identifier used for the species. Required.
``composition``
Mapping that specifies the elemental composition of the species,
e.g., ``{C: 1, H: 4}``. Required.
``thermo``
Mapping containing the reference state thermodynamic model specification
and parameters. See :ref:`sec-yaml-species-thermo`.
``equation-of-state``
Mapping containing the equation of state model specification for the
species, any parameters for that model, and any parameters for interactions
with other species. :ref:`sec-yaml-species-eos`. If this field is absent,
the ``ideal-gas`` model is assumed.
``transport``
Mapping containing the species transport model specification and
parameters. See :ref:`sec-yaml-species-transport`.
``sites``
The number of sites occupied by a surface or edge species. Default is 1.
``ionic-radius``
Size of the species. Used in the Debye-Hückel model.
``electrolyte-species-type``
One of ``solvent``, ``charged-species``, ``weak-acid-associated``,
``strong-acid-associated``, ``polar-neutral``, or ``nonpolar-neutral``.
The types ``solvent``, ``charged-species``, and ``nonpolar-neutral`` can be
inferred automatically. Used in the Debye-Hückel model.
``weak-acid-charge``
Charge to use for species can break apart into charged species. Used in the
Debye-Hückel model.
.. _sec-yaml-species-thermo:
Species thermo models
=====================
Fields of a species ``thermo`` entry used by all models are:
``model``
String specifying the model to be used. Required. Supported model strings
are:
- :ref:`NASA7 <sec-yaml-nasa7>`
- :ref:`NASA9 <sec-yaml-nasa9>`
- :ref:`Shomate <sec-yaml-shomate>`
- :ref:`constant-cp <sec-yaml-constcp>`
- :ref:`piecewise-Gibbs <sec-yaml-piecewise-gibbs>`
``reference-pressure``
The reference pressure at which the given thermodynamic properties apply.
Defaults to 1 atm.
.. _sec-yaml-nasa7:
NASA 7-coefficient polynomials
------------------------------
The polynomial form `described here <https://cantera.org/science/science-species.html#the-nasa-7-coefficient-polynomial-parameterization>`__,
given for one or two temperature regions. Additional fields of a ``NASA7``
thermo entry are:
``temperature-ranges``
A list giving the temperature intervals on which the polynomials are valid.
For one temperature region, this list contains the minimum and maximum
temperatures for the polynomial. For two temperature regions, this list
contains the minimum, intermediate, and maximum temperatures.
``data``
A list with one item per temperature region, where that item is a 7 item
list of polynomial coefficients. The temperature regions are arranged in
ascending order. Note that this is different from the standard CHEMKIN
formulation that uses two temperature regions listed in descending order.
Example::
thermo:
model: NASA7
temperature-ranges: [300.0, 1000.0, 5000.0]
data:
- [3.298677, 0.0014082404, -3.963222e-06, 5.641515e-09,
-2.444854e-12, -1020.8999, 3.950372]
- [2.92664, 0.0014879768, -5.68476e-07, 1.0097038e-10,
-6.753351e-15, -922.7977, 5.980528]
.. _sec-yaml-nasa9:
NASA 9-coefficient polynomials
------------------------------
The polynomial form `described here <https://cantera.org/science/science-species.html#the-nasa-9-coefficient-polynomial-parameterization>`__,
given for any number of temperature regions. Additional fields of a ``NASA9``
thermo entry are:
``temperature-ranges``
A list giving the temperature intervals on which the polynomials are valid.
This list contains the minimum temperature, the intermediate temperatures
between each set pair of regions, and the maximum temperature.
``data``
A list with one item per temperature region, where that item is a 9 item
list of polynomial coefficients. The temperature regions are arranged in
ascending order.
Example::
thermo:
model: NASA9
temperature-ranges: [200.00, 1000.00, 6000.0, 20000]
reference-pressure: 1 bar
data:
- [2.210371497E+04, -3.818461820E+02, 6.082738360E+00, -8.530914410E-03,
1.384646189E-05, -9.625793620E-09, 2.519705809E-12, 7.108460860E+02,
-1.076003744E+01]
- [5.877124060E+05, -2.239249073E+03, 6.066949220E+00, -6.139685500E-04,
1.491806679E-07, -1.923105485E-11, 1.061954386E-15, 1.283210415E+04,
-1.586640027E+01]
- [8.310139160E+08, -6.420733540E+05, 2.020264635E+02, -3.065092046E-02,
2.486903333E-06, -9.705954110E-11, 1.437538881E-15, 4.938707040E+06,
-1.672099740E+03]
.. _sec-yaml-shomate:
Shomate polynomials
-------------------
The polynomial form `described here <https://cantera.org/science/science-species.html#the-shomate-parameterization>`__,
given for one or two temperature regions. Additional fields of a ``Shomate``
thermo entry are:
``temperature-ranges``
A list giving the temperature intervals on which the polynomials are valid.
For one temperature region, this list contains the minimum and maximum
temperatures for the polynomial. For two temperature regions, this list
contains the minimum, intermediate, and maximum temperatures.
``data``
A list with one item per temperature region, where that item is a 7 item
list of polynomial coefficients. The temperature regions are arranged in
ascending order.
Example::
thermo:
model: Shomate
temperature-ranges: [298, 1300, 6000]
data:
- [25.56759, 6.096130, 4.054656, -2.671301, 0.131021,
-118.0089, 227.3665]
- [35.15070, 1.300095, -0.205921, 0.013550, -3.282780,
-127.8375, 231.7120]
.. _sec-yaml-constcp:
Constant heat capacity
----------------------
The constant heat capacity model `described here <https://cantera.org/science/science-species.html#constant-heat-capacity>`__.
Additional fields of a ``constant-cp`` thermo entry are:
``T0``
The reference temperature. Defaults to 298.15 K.
``h0``
The molar enthalpy at the reference temperature. Defaults to 0.0.
``s0``
The molar entropy at the reference temperature. Defaults to 0.0.
``cp0``
The heat capacity at constant pressure. Defaults to 0.0.
Example::
thermo:
model: constant-cp
T0: 1000 K
h0: 9.22 kcal/mol
s0: -3.02 cal/mol/K
cp0: 5.95 cal/mol/K
.. _sec-yaml-piecewise-gibbs:
Piecewise Gibbs
---------------
A model based on piecewise interpolation of the Gibbs free energy as
`described here <https://cantera.org/documentation/dev/doxygen/html/d4/d9e/classCantera_1_1Mu0Poly.html#details>`__
Additional fields of a ``piecewise-Gibbs`` entry are:
``h0``
The molar enthalpy at the reference temperature of 298.15 K. Defaults to
0.0.
``dimensionless``
A boolean flag indicating whether the values of the Gibbs free energy are
given in a dimensionless form, i.e., divided by :math:`RT`. Defaults to
``false``.
``data``
A mapping of temperatures to values of the Gibbs free energy. The Gibbs free
energy can be either in molar units (if ``dimensionless`` is ``false``) or
nondimensionalized by the corresponding temperature (if ``dimensionless`` is
``true``). A value must be provided at :math:`T^\circ = 298.15` K.
Example::
thermo:
model: piecewise-Gibbs
h0: -230.015 kJ/mol
dimensionless: true
data: {298.15: -91.50963, 333.15: -85.0}
.. _sec-yaml-species-eos:
Species equation of state models
================================
``model``
String specifying the model to be used. Required. Supported model strings
are:
- :ref:`constant-volume <sec-yaml-eos-constant-volume>`
- :ref:`density-temperature-polynomial <sec-yaml-eos-density-temperature-polynomial>`
- :ref:`HKFT <sec-yaml-eos-hkft>`
- :ref:`ideal-gas <sec-yaml-eos-ideal-gas>`
- :ref:`ions-from-neutral-molecule <sec-yaml-eos-ions-from-neutral>`
- :ref:`liquid-water-IAPWS95 <sec-yaml-eos-liquid-water-iapws95>`
- :ref:`molar-volume-temperature-polynomial <sec-yaml-eos-molar-volume-temperature-polynomial>`
- :ref:`Redlich-Kwong <sec-yaml-eos-redlich-kwong>`
.. _sec-yaml-eos-constant-volume:
Constant volume
---------------
A constant volume model as
`described here <https://cantera.org/documentation/dev/doxygen/html/da/d33/classCantera_1_1PDSS__ConstVol.html#details>`__.
Any one of the following may be specified:
``molar-volume``
The molar volume of the species.
``molar-density``
The molar density of the species.
``density``
The mass density of the species.
Example::
equation-of-state:
model: constant-volume
molar-volume: 1.3 cm^3/mol
.. _sec-yaml-eos-density-temperature-polynomial:
Density temperature polynomial
------------------------------
A model in which the density varies with temperature as
`described here <https://cantera.org/documentation/dev/doxygen/html/d0/d2f/classCantera_1_1PDSS__SSVol.html#details>`__.
Additional fields:
``data``
Vector of 4 coefficients for a cubic polynomial in temperature
Example::
equation-of-state:
model: density-temperature-polynomial
units: {mass: g, length: cm}
data: [0.536504, -1.04279e-4, 3.84825e-9, -5.2853e-12]
.. _sec-yaml-eos-hkft:
HKFT
----
The Helgeson-Kirkham-Flowers-Tanger model as
`described here <https://cantera.org/documentation/dev/doxygen/html/d9/d18/classCantera_1_1PDSS__HKFT.html#details>`__.
Additional fields:
``h0``
Enthalpy of formation at the reference temperature and pressure
``s0``
Entropy of formation at the reference temperature and pressure
``a``
4-element vector containing the coefficients :math:`a_1, \ldots , a_4`
``c``
2-element vector containing the coefficients :math:`c_1` and :math:`c_2`
``omega``
The :math:`\omega` parameter at the reference temperature and pressure
Example::
equation-of-state:
model: HKFT
h0: -57433. cal/gmol
s0: 13.96 cal/gmol/K
a: [0.1839 cal/gmol/bar, -228.5 cal/gmol,
3.256 cal*K/gmol/bar, -27260. cal*K/gmol]
c: [18.18 cal/gmol/K, -29810. cal*K/gmol]
omega: 33060 cal/gmol
.. _sec-yaml-eos-ideal-gas:
Ideal gas
---------
A species using the ideal gas equation of state, as
`described here <https://cantera.org/documentation/dev/doxygen/html/df/d31/classCantera_1_1PDSS__IdealGas.html#details>`__.
This model is the default if no ``equation-of-state`` section is included.
.. _sec-yaml-eos-ions-from-neutral:
Ions from neutral molecule
--------------------------
A species equation of state model used with the ``ions-from-neutral-molecule``
phase model, as
`described here <https://cantera.org/documentation/dev/doxygen/html/d5/df4/classCantera_1_1PDSS__IonsFromNeutral.html#details>`__.
Additional fields:
``special-species``
Boolean indicating whether the species is the "special species" in the
phase. Default is ``false``.
``multipliers``
A dictionary mapping species to neutral species multiplier values.
Example::
equation-of-state:
model: ions-from-neutral-molecule
multipliers: {KCl(l): 1.2}
.. _sec-yaml-eos-liquid-water-iapws95:
Liquid Water IAPWS95
--------------------
A detailed equation of state for liquid water as
`described here <https://cantera.org/documentation/dev/doxygen/html/de/d64/classCantera_1_1PDSS__Water.html#details>`__.
.. _sec-yaml-eos-molar-volume-temperature-polynomial:
Molar volume temperature polynomial
-----------------------------------
A model in which the molar volume varies with temperature as
`described here <https://cantera.org/documentation/dev/doxygen/html/d0/d2f/classCantera_1_1PDSS__SSVol.html#details>`__.
Additional fields:
``data``
Vector of 4 coefficients for a cubic polynomial in temperature
.. _sec-yaml-eos-redlich-kwong:
Redlich-Kwong
-------------
A model where species follow the Redlich-Kwong equation of state as
`described here <https://cantera.org/documentation/dev/doxygen/html/d6/d29/classCantera_1_1RedlichKwongMFTP.html#details>`__.
Additional fields:
``a``
Pure-species ``a`` coefficient. Scalar or list of two values for a
temperature-dependent expression.
``b``
Pure-species ``b`` coefficient.
``binary-a``
Mapping where the keys are species and the values are the ``a``
coefficients for binary interactions between the two species.
.. _sec-yaml-species-transport:
Species transport models
========================
``model``
String specifying the model type. The only model that is specifically
handled is ``gas``.
Gas transport
-------------
Species transport properties are a rare exception to Cantera's use of SI units,
and use the units in which these properties are customarily reported. No
conversions are supported.
The additional fields of a ``gas`` transport entry are:
``geometry``
A string specifying the geometry of the molecule. One of ``atom``,
``linear``, or ``nonlinear``.
``diameter``
The Lennard-Jones collision diameter [Å]
``well-depth``
The Lennard-Jones well depth [K]
``dipole``
The permanent dipole moment [Debye]. Default 0.0.
``polarizability``
The dipole polarizability [Å^3]. Default 0.0.
``rotational-relaxation``
The rotational relaxation collision number at 298 K [-]. Default 0.0.
``acentric-factor``
Pitzer's acentric factor [-]. Default 0.0.
``dispersion-coefficient``
The dispersion coefficient, normalized by :math:`e^2` [Å^5]. Default 0.0.
``quadrupole-polarizability``
The quadrupole polarizability [Å^5]. Default 0.0.
Example::
transport:
model: gas
geometry: linear
well-depth: 107.4
diameter: 3.458
polarizability: 1.6
rotational-relaxation: 3.8

View file

@ -82,10 +82,29 @@ if env['system_sundials'] == 'n':
libraryTargets.extend(localenv.SharedObject(
[f for f in mglob(localenv, 'sundials/src/'+subdir, 'c')]))
if not env['system_yamlcpp']:
localenv = prep_default(env)
localenv.Prepend(CPPPATH=Dir('#include/cantera/ext'))
license_files.append(('YAML-CPP', 'yaml-cpp/LICENSE'))
# Copy header files into common include directory
for subdir in ('', 'contrib', 'node', 'node/detail'):
for header in mglob(env, 'yaml-cpp/include/yaml-cpp/'+subdir, 'h'):
h = build(localenv.Command('#include/cantera/ext/yaml-cpp/{}/{}'.format(subdir, header.name),
'#ext/yaml-cpp/include/yaml-cpp/{}/{}'.format(subdir, header.name),
Copy('$TARGET', '$SOURCE')))
# Compile yaml-cpp source files
for subdir in ('', 'contrib'):
libraryTargets.extend(localenv.SharedObject(
[f for f in mglob(localenv, 'yaml-cpp/src/'+subdir, 'cpp')]))
if not env['system_eigen']:
license_files.append(('Eigen', 'eigen/COPYING.MPL2'))
build(copyenv.Command('#include/cantera/ext/Eigen', '#ext/eigen/Eigen',
Copy('$TARGET', '$SOURCE')))
h = build(copyenv.Command('#include/cantera/ext/Eigen', '#ext/eigen/Eigen',
Copy('$TARGET', '$SOURCE')))
copyenv.Depends(copyenv['config_h_target'], h)
# Google Test: Used internally for Cantera unit tests.
if env['googletest'] == 'submodule':

1
ext/yaml-cpp Submodule

@ -0,0 +1 @@
Subproject commit 012269756149ae99745b6dafefd415843d7420bb

View file

@ -1,11 +1,13 @@
//! @file Edge.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CXX_EDGE
#define CXX_EDGE
#pragma message("warning: Edge.h is deprecated and will be removed after Cantera 2.5.0.")
#include "thermo/ThermoFactory.h"
#include "kinetics/importKinetics.h"
#include "kinetics/EdgeKinetics.h"
@ -15,6 +17,10 @@ namespace Cantera
{
//! Convenience class which inherits from both EdgePhase and EdgeKinetics
/*!
* @deprecated To be removed after Cantera 2.5.0.
* Replaceable with Solution and/or EdgePhase/EdgeKinetics.
*/
class Edge :
public EdgePhase, public EdgeKinetics
{
@ -22,6 +28,9 @@ public:
Edge(const std::string& infile, std::string id, std::vector<ThermoPhase*> phases)
: m_ok(false), m_r(0)
{
warn_deprecated("class Metal",
"To be removed after Cantera 2.5.0. "
"Replaceable with Solution and/or EdgePhase/EdgeKinetics.");
m_r = get_XML_File(infile);
if (id == "-") {
id = "";

View file

@ -1,11 +1,13 @@
//! @file IdealGasMix.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CXX_IDEALGASMIX
#define CXX_IDEALGASMIX
#pragma message("warning: IdealGasMix.h is deprecated and will be removed after Cantera 2.5.")
#include "thermo/IdealGasPhase.h"
#include "kinetics/GasKinetics.h"
#include "kinetics/importKinetics.h"
@ -15,6 +17,10 @@ namespace Cantera
{
//! Convenience class which inherits from both IdealGasPhase and GasKinetics
/*!
* @deprecated To be removed after Cantera 2.5.
* Replaceable with Solution and/or IdealGasPhase/GasKinetics.
*/
class IdealGasMix :
public IdealGasPhase,
public GasKinetics
@ -25,6 +31,9 @@ public:
IdealGasMix(const std::string& infile, std::string id_="") :
m_ok(false), m_r(0)
{
warn_deprecated("class IdealGasMix",
"To be removed after Cantera 2.5. "
"Replaceable with Solution and/or IdealGasPhase/GasKinetics.");
m_r = get_XML_File(infile);
m_id = id_;
if (id_ == "-") {
@ -38,12 +47,18 @@ public:
IdealGasMix(XML_Node& root,
std::string id_) : m_ok(false), m_r(&root), m_id(id_) {
warn_deprecated("class IdealGasMix",
"To be removed after Cantera 2.5. "
"Replaceable with Solution and/or IdealGasPhase/GasKinetics.");
m_ok = buildSolutionFromXML(root, id_, "phase", this, this);
}
IdealGasMix(const IdealGasMix& other) : m_ok(false),
m_r(other.m_r),
m_id(other.m_id) {
warn_deprecated("class IdealGasMix",
"To be removed after Cantera 2.5. "
"Replaceable with Solution and/or IdealGasPhase/GasKinetics.");
m_ok = buildSolutionFromXML(*m_r, m_id, "phase", this, this);
}

View file

@ -1,11 +1,13 @@
//! @file IncompressibleSolid.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CXX_INCOMPRESSIBLE
#define CXX_INCOMPRESSIBLE
#pragma message("warning: IncompressibleSolid.h is deprecated and will be removed after Cantera 2.5.0.")
#include "thermo/ConstDensityThermo.h"
#include "kinetics/importKinetics.h"
@ -13,19 +15,26 @@ namespace Cantera
{
//! Wrapper for ConstDensityThermo with constructor from file
/*!
* @deprecated To be removed after Cantera 2.5.0.
* Replaceable with Solution and/or LatticePhase/IdealSolidSolnPhase.
*/
class IncompressibleSolid : public ConstDensityThermo
{
public:
IncompressibleSolid(const std::string& infile,
std::string id="") : m_ok(false), m_r(0)
{
warn_deprecated("class IncompressibleSolid",
"To be removed after Cantera 2.5.0. "
"Replaceable with Solution and/or LatticePhase/IdealSolidSolnPhase.");
m_r = get_XML_File(infile);
if (id == "-") {
id = "";
}
m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
if (!m_ok) throw CanteraError("IncompressibleSolid",
"buildSolutionFromXML returned false");
"buildSolutionFromXML returned false");
}
bool operator!() {

View file

@ -4,11 +4,13 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CXX_INTERFACE
#define CXX_INTERFACE
#pragma message("warning: Interface.h is deprecated and will be removed after Cantera 2.5.")
#include "thermo.h"
#include "kinetics.h"
#include "cantera/thermo/SurfPhase.h"
@ -22,6 +24,9 @@ namespace Cantera
* and InterfaceKinetics. It therefore represents a surface phase, and also acts
* as the kinetics manager to manage reactions occurring on the surface,
* possibly involving species from other phases.
*
* @deprecated To be removed after Cantera 2.5.
* Replaceable with Solution and/or SurfPhase/InterfaceKinetics.
*/
class Interface :
public SurfPhase,
@ -42,6 +47,10 @@ public:
std::vector<ThermoPhase*> otherPhases) :
m_ok(false),
m_r(0) {
warn_deprecated("class Interface",
"To be removed after Cantera 2.5. "
"Replaceable with Solution and/or SurfPhase/InterfaceKinetics.");
m_r = get_XML_File(infile);
if (id == "-") {
id = "";
@ -79,11 +88,15 @@ protected:
//! Import an instance of class Interface from a specification in an input file.
/*!
* This is the preferred method to create an Interface instance.
*
* @deprecated To be removed after Cantera 2.5. Replaceable with Solution.
*/
inline Interface* importInterface(const std::string& infile,
const std::string& id,
std::vector<ThermoPhase*> phases)
{
warn_deprecated("importInterface", "To be removed after Cantera 2.5. "
"Replaceable with Solution.");
return new Interface(infile, id, phases);
}

View file

@ -1,11 +1,13 @@
//! @file Metal.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CXX_METAL
#define CXX_METAL
#pragma message("warning: Metal.h is deprecated and will be removed after Cantera 2.5.0.")
#include "thermo/MetalPhase.h"
#include "kinetics/importKinetics.h"
@ -13,18 +15,25 @@ namespace Cantera
{
//! Wrapper for MetalPhase with constructor from file
/*!
* @deprecated To be removed after Cantera 2.5.0.
* Replaceable with Solution and/or MetalPhase.
*/
class Metal : public MetalPhase
{
public:
Metal(const std::string& infile, std::string id="") : m_ok(false), m_r(0)
{
warn_deprecated("class Metal",
"To be removed after Cantera 2.5.0. "
"Replaceable with Solution and/or MetalPhase.");
m_r = get_XML_File(infile);
if (id == "-") {
id = "";
}
m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
if (!m_ok) throw CanteraError("Metal::Metal",
"buildSolutionFromXML returned false");
"buildSolutionFromXML returned false");
}
bool operator!() {

View file

@ -1,11 +1,13 @@
//! @file PureFluid.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CXX_PUREFLUID
#define CXX_PUREFLUID
#pragma message("warning: PureFluid.h is deprecated and will be removed after Cantera 2.5.0.")
#include "thermo/PureFluidPhase.h"
#include "kinetics.h"
@ -13,12 +15,20 @@ namespace Cantera
{
//! Wrapper for PureFluidPhase with constructor from file
/*!
* @deprecated To be removed after Cantera 2.5.0. Replaceable with PureFluidPhase.
*/
class PureFluid : public PureFluidPhase
{
public:
PureFluid() : m_ok(false), m_r(0) {}
PureFluid() : m_ok(false), m_r(0) {
warn_deprecated("class PureFluid", "To be removed after Cantera 2.5.0. "
"Replaceable with PureFluidPhase.");
}
PureFluid(const std::string& infile, std::string id="") : m_ok(false), m_r(0) {
warn_deprecated("class PureFluid", "To be removed after Cantera 2.5.0. "
"Replaceable with PureFluidPhase::initThermoFile.");
m_r = get_XML_File(infile);
if (id == "-") {
id = "";
@ -51,10 +61,18 @@ protected:
XML_Node* m_r;
};
//! Water definition from liquidvapor input file
/*!
* @deprecated To be removed after Cantera 2.5.0. Replaceable with PureFluidPhase.
*/
class Water : public PureFluid
{
public:
Water() : PureFluid(std::string("liquidvapor.cti"),std::string("water")) {}
Water() : PureFluid(std::string("liquidvapor.cti"),std::string("water")) {
warn_deprecated("class Water", "To be removed after Cantera 2.5.0. "
"Replaceable with PureFluidPhase.");
}
virtual ~Water() {}
};

View file

@ -1,16 +1,21 @@
//! @file AnyMap.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_ANYMAP_H
#define CT_ANYMAP_H
#include "cantera/base/ct_defs.h"
#include "cantera/base/global.h"
#include "cantera/base/Units.h"
#include "cantera/base/ctexceptions.h"
#include <string>
#include <vector>
#include <memory>
#include <unordered_map>
#include <functional>
namespace boost
{
@ -21,6 +26,7 @@ namespace Cantera
{
class AnyMap;
class InputFile;
//! A wrapper for a variable whose type is determined at runtime
/*!
@ -30,7 +36,13 @@ class AnyMap;
*
* Elements are set using assignment, and the assignment operator has been
* overloaded for specific types so that only those types are allowed to be
* used in an AnyValue.
* used in an AnyValue. The allowed types are:
* - AnyMap
* - `double`
* - `long int`
* - `bool`
* - `std::string`
* - `std::vector` of any of the above
*/
class AnyValue
{
@ -42,46 +54,87 @@ public:
AnyValue& operator=(AnyValue const& other);
AnyValue& operator=(AnyValue&& other);
//! If this AnyValue is an AnyMap, return the value stored in `key`.
AnyValue& operator[](const std::string& key);
const AnyValue& operator[](const std::string& key) const;
//! Returns `true` if this AnyValue is an AnyMap and that map contains
//! a key with the given name.
bool hasKey(const std::string& key) const;
// The value knows the name of its corresponding key in order to provide
// comprehensible error messages.
//! Set the name of the key storing this value in an AnyMap. Used for
//! providing informative error messages in class InputFileError.
void setKey(const std::string& key);
//! For values which are derived from an input file, set the line and column
//! of this value in that file. Used for providing context for some error
//! messages.
void setLoc(int line, int column);
//! Set information about the file used to create this value. Recursively
//! sets the information on any child elements.
void setFile(shared_ptr<InputFile>& file);
//! Get the value of this key as the specified type.
template<class T>
const T& as() const;
template<class T>
T& as();
const std::type_info& type();
//! Returns the type of the held value.
const std::type_info& type() const;
//! Returns a string specifying the type of the held value.
std::string type_str() const;
//! Returns `true` if the held value is of the specified type.
template<class T>
bool is() const;
//! Returns `true` if the held value is a scalar type (e.g. `double`, `long
//! int`, `string`, or `bool`).
bool isScalar() const;
explicit AnyValue(const std::string& value);
explicit AnyValue(const char* value);
AnyValue& operator=(const std::string& value);
AnyValue& operator=(const char* value);
//! Return the held value, if it is a string
const std::string& asString() const;
explicit AnyValue(double value);
AnyValue& operator=(double value);
double asDouble() const;
//! Return the held value as a `double`, if it is a `double` or a `long
//! int`.
double& asDouble();
const double& asDouble() const;
explicit AnyValue(bool value);
AnyValue& operator=(bool value);
bool asBool() const;
//! Return the held value, if it is a `bool`.
bool& asBool();
const bool& asBool() const;
explicit AnyValue(long int value);
AnyValue& operator=(long int value);
AnyValue& operator=(int value);
long int asInt() const;
//! Return the held value, if it is a `long int`.
long int& asInt();
const long int& asInt() const;
template<class T>
AnyValue& operator=(const std::vector<T>& value);
//! Return the held value, if it is a vector of type `T`. If called with one
//! argument, requires the vector to be of the specified size. If called
//! with two arguments, requires the vector to be within the range specified
//! by the two values, inclusive.
template<class T>
const std::vector<T>& asVector() const;
const std::vector<T>& asVector(size_t nMin=npos, size_t nMax=npos) const;
template<class T>
std::vector<T>& asVector();
std::vector<T>& asVector(size_t nMin=npos, size_t nMax=npos);
explicit AnyValue(const AnyMap& value);
AnyValue& operator=(const AnyMap& value);
AnyValue& operator=(AnyMap&& value);
@ -91,17 +144,81 @@ public:
template<class T>
AnyValue& operator=(const std::map<std::string, T> items);
//! Return the held `AnyMap` as a `std::map` where all of the values have
//! the specified type.
template<class T>
std::map<std::string, T> asMap();
std::map<std::string, T> asMap() const;
//! Access a `vector<AnyMap>` as a mapping using the value of `name` from
//! each item as the key in the new mapping.
/*!
* For example, for the list:
* ```
* [{name: O2, weight: 32}, {name: CH4, weight: 16}]
* ```
* calling `asMap("name")` will create a map with keys ``O2`` and ``CH4``.
*/
std::unordered_map<std::string, const AnyMap*> asMap(const std::string& name) const;
std::unordered_map<std::string, AnyMap*> asMap(const std::string& name);
//! For objects of type `vector<AnyMap>`, return the item where the given
//! key has the specified value. If value is the empty string, returns the
//! first item in the list.
AnyMap& getMapWhere(const std::string& key, const std::string& value);
//! @see AnyMap::applyUnits
void applyUnits(const UnitSystem& units);
private:
std::string demangle(const std::type_info& type) const;
template<class T>
void checkSize(const std::vector<T>& v, size_t nMin, size_t nMax) const;
//! Line where this value occurs in the input file
int m_line;
//! Column where this value occurs in the input file
int m_column;
//! Information about the input file used to create this object
shared_ptr<InputFile> m_file;
//! Key of this value in a parent `AnyMap`
std::string m_key;
//! The held value
std::unique_ptr<boost::any> m_value;
//! Human-readable names for some common types, for use when
//! `boost::demangle` is not available.
static std::map<std::string, std::string> s_typenames;
friend class InputFileError;
};
//! Implicit conversion to vector<AnyValue>
template<>
const std::vector<AnyValue>& AnyValue::asVector<AnyValue>(size_t nMin, size_t nMax) const;
template<>
std::vector<AnyValue>& AnyValue::asVector<AnyValue>(size_t nMin, size_t nMax);
//! Implicit conversion of long int to double if accessed as a vector<double>
template<>
const std::vector<double>& AnyValue::asVector<double>(size_t nMin, size_t nMax) const;
template<>
std::vector<double>& AnyValue::asVector<double>(size_t nMin, size_t nMax);
//! Implicit conversion of long int to double if accessed as a vector<vector<double>>
template<>
const std::vector<vector_fp>& AnyValue::asVector<vector_fp>(size_t nMin, size_t nMax) const;
template<>
std::vector<vector_fp>& AnyValue::asVector<vector_fp>(size_t nMin, size_t nMax);
//! A map of string keys to values whose type can vary at runtime
/*!
* Values in an AnyMap are held by instances of AnyValue. Instances of AnyMap
@ -117,8 +234,6 @@ private:
* // Create a nested AnyMap named "beans" which has a key named "baked"
* // whose value is a vector<double>
* std::vector<double> v{3.14, 1.59, 2.65};
* breakfast["beans/baked"] = v;
* // Equivalently:
* breakfast["beans"]["baked"] = v;
*
* // Create a nested AnyMap with values of the same type
@ -146,7 +261,8 @@ private:
* breakfast["waffle"].asDouble();
* } except (std::exception& err) {
* // Exception will be thrown.
* // 'breakfast' will have an empty key named "waffle"
* // 'breakfast' will have an empty key named "waffle" unless `breakfast`
* // is a `const AnyMap`.
* }
*
* try {
@ -173,17 +289,209 @@ private:
class AnyMap
{
public:
AnyMap() {};
AnyMap(): m_units() {};
//! Create an AnyMap from a YAML file.
/*!
* Searches the directory containing the optionally-specified parent file
* first, followed by the current working directory and the Cantera include
* path.
*/
static AnyMap fromYamlFile(const std::string& name,
const std::string& parent_name="");
//! Create an AnyMap from a string containing a YAML document
static AnyMap fromYamlString(const std::string& yaml);
//! Get the value of the item stored in `key`.
AnyValue& operator[](const std::string& key);
const AnyValue& operator[](const std::string& key) const;
AnyValue& at(const std::string& key);
//! Get the value of the item stored in `key`. Raises an exception if the
//! value does not exist.
const AnyValue& at(const std::string& key) const;
//! Returns `true` if the map contains an item named `key`.
bool hasKey(const std::string& key) const;
//! Erase the value held by `key`.
void erase(const std::string& key);
//! Return a string listing the keys in this AnyMap, e.g. for use in error
//! messages
std::string keys_str() const;
//! For AnyMaps which are derived from an input file, set the line and
//! column of this AnyMap in that file. Used for providing context for some
//! error messages.
void setLoc(int line, int column);
//! Set information about the file used to create this AnyMap. Recursively
//! sets the information on any child elements.
void setFile(shared_ptr<InputFile>& file);
//! Set the name of the file used to create this AnyMap. Recursively sets
//! the information on any child elements.
void setFileName(const std::string& filename);
//! Set the contents of the file used to create this AnyMap. Used in the
//! case where the AnyMap is created from an input string rather than a
//! file. Recursively sets the information on any child elements.
void setFileContents(const std::string& contents);
//! If `key` exists, return it as a `bool`, otherwise return `default_`.
bool getBool(const std::string& key, bool default_) const;
//! If `key` exists, return it as a `long int`, otherwise return `default_`.
long int getInt(const std::string& key, long int default_) const;
//! If `key` exists, return it as a `double`, otherwise return `default_`.
double getDouble(const std::string& key, double default_) const;
//! If `key` exists, return it as a `string`, otherwise return `default_`.
const std::string& getString(const std::string& key,
const std::string& default_) const;
//! Convert the item stored by the given `key` to the units specified in
//! `units`. If the stored value is a double, convert it using the default
//! units. If the input is a string, treat this as a dimensioned value, e.g.
//! '988 kg/m^3' and convert from the specified units.
double convert(const std::string& key, const std::string& units) const;
double convert(const std::string& key, const Units& units) const;
//! Convert the item stored by the given `key` to the units specified in
//! `units`. If the stored value is a double, convert it using the default
//! units. If the input is a string, treat this as a dimensioned value, e.g.
//! '988 kg/m^3' and convert from the specified units. If the key is
//! missing, the `default_` value is returned.
double convert(const std::string& key, const std::string& units,
double default_) const;
//! Convert a vector of dimensional values
/*!
* For each item in the vector, if the stored value is a double, convert it
* using the default units. If the value is a string, treat it as a
* dimensioned value, e.g. '988 kg/m^3', and convert from the specified
* units.
*
* @param key Location of the vector in this AnyMap
* @param units Units to convert to
* @param nMin Minimum allowed length of the vector. If `nMax` is not
* specified, this is also taken to be the maximum length. An exception
* is thrown if this condition is not met.
* @param nMax Maximum allowed length of the vector. An exception is
* thrown if this condition is not met.
*/
vector_fp convertVector(const std::string& key, const std::string& units,
size_t nMin=npos, size_t nMax=npos) const;
using const_iterator = std::unordered_map<std::string, AnyValue>::const_iterator;
//! Defined to allow use with range-based for loops
const_iterator begin() const {
return m_data.begin();
}
//! Defined to allow use with range-based for loops
const_iterator end() const {
return m_data.end();
}
//! Returns the number of elements in this map
size_t size() {
return m_data.size();
};
//! Return the default units that should be used to convert stored values
const UnitSystem& units() const { return m_units; }
//! Use the supplied UnitSystem to set the default units, and recursively
//! process overrides from nodes named `units`.
/*!
* If a `units` node is present in a map that contains other keys, the
* specified units are taken to be the defaults for that map. If the map
* contains only a `units` node, and is the first item in a list of maps,
* then the specified units are taken to be the defaults for all the maps in
* the list.
*
* After being processed, the `units` nodes are removed, so this function
* should be called only once, on the root AnyMap. This function is called
* automatically by the fromYamlFile() and fromYamlString() constructors.
*/
void applyUnits(const UnitSystem& units);
private:
//! The stored data
std::unordered_map<std::string, AnyValue> m_data;
//! The default units that are used to convert stored values
UnitSystem m_units;
//! Starting line for this map in the input file
int m_line;
//! Starting column for this map in the input file
int m_column;
//! Information about the file used to create this map
shared_ptr<InputFile> m_file;
//! Cache for previously-parsed input (YAML) files. The key is the full path
//! to the file, and the second element of the value is the last-modified
//! time for the file, which is used to enable change detection.
static std::unordered_map<std::string, std::pair<AnyMap, int>> s_cache;
friend class AnyValue;
friend class InputFileError;
};
// Define begin() and end() to allow use with range-based for loops
AnyMap::const_iterator begin(const AnyValue& v);
AnyMap::const_iterator end(const AnyValue& v);
//! Error thrown for problems processing information contained in an AnyMap or
//! AnyValue.
/*!
* This class uses the file, line, and column information stored in an AnyMap
* or AnyValue to provide an error message including context lines for the
* original user input.
*/
class InputFileError : public CanteraError
{
public:
//! Indicate an error occurring in `procedure` while using information from
//! `node`. The `message` and `args` are processed as in the CanteraError
//! class.
template <typename... Args>
InputFileError(const std::string& procedure, const AnyValue& node,
const std::string& message, const Args&... args)
: CanteraError(
procedure,
formatError(fmt::format(message, args...),
node.m_line, node.m_column, node.m_file))
{
}
//! Indicate an error occurring in `procedure` while using information from
//! `node`. The `message` and `args` are processed as in the CanteraError
//! class.
template <typename... Args>
InputFileError(const std::string& procedure, const AnyMap& node,
const std::string& message, const Args&... args)
: CanteraError(
procedure,
formatError(fmt::format(message, args...),
node.m_line, node.m_column, node.m_file))
{
}
virtual std::string getClass() const {
return "InputFileError";
}
protected:
static std::string formatError(const std::string& message,
int line, int column,
const shared_ptr<InputFile>& file);
};
}

View file

@ -16,15 +16,20 @@ namespace Cantera
template<class T>
const T &AnyValue::as() const {
try {
if (typeid(T) == typeid(double) && m_value->type() == typeid(long int)) {
// Implicit conversion of long int to double
*m_value = static_cast<double>(as<long int>());
}
return boost::any_cast<const T&>(*m_value);
} catch (boost::bad_any_cast&) {
if (m_value->type() == typeid(void)) {
// Values that have not been set are of type 'void'
throw CanteraError("AnyValue::as", "Key '{}' not found", m_key);
throw InputFileError("AnyValue::as", *this,
"Key '{}' not found", m_key);
} else {
throw CanteraError("AnyValue::as",
"Key '{}' contains a '{}',\nnot a '{}'.",
m_key, demangle(m_value->type()), demangle(typeid(T)));
throw InputFileError("AnyValue::as", *this,
"Key '{}' contains a '{}',\nnot a '{}'",
m_key, demangle(m_value->type()), demangle(typeid(T)));
}
}
}
@ -32,15 +37,20 @@ const T &AnyValue::as() const {
template<class T>
T &AnyValue::as() {
try {
if (typeid(T) == typeid(double) && m_value->type() == typeid(long int)) {
// Implicit conversion of long int to double
*m_value = static_cast<double>(as<long int>());
}
return boost::any_cast<T&>(*m_value);
} catch (boost::bad_any_cast&) {
if (m_value->type() == typeid(void)) {
// Values that have not been set are of type 'void'
throw CanteraError("AnyValue::as", "Key '{}' not found", m_key);
throw InputFileError("AnyValue::as", *this,
"Key '{}' not found", m_key);
} else {
throw CanteraError("AnyValue::as",
"Key '{}' contains a '{}',\nnot a '{}'.",
m_key, demangle(m_value->type()), demangle(typeid(T)));
throw InputFileError("AnyValue::as", *this,
"Key '{}' contains a '{}',\nnot a '{}'",
m_key, demangle(m_value->type()), demangle(typeid(T)));
}
}
}
@ -57,13 +67,17 @@ AnyValue &AnyValue::operator=(const std::vector<T> &value) {
}
template<class T>
const std::vector<T> &AnyValue::asVector() const {
return as<std::vector<T>>();
const std::vector<T> &AnyValue::asVector(size_t nMin, size_t nMax) const {
const auto& v = as<std::vector<T>>();
checkSize(v, nMin, nMax);
return v;
}
template<class T>
std::vector<T> &AnyValue::asVector() {
return as<std::vector<T>>();
std::vector<T> &AnyValue::asVector(size_t nMin, size_t nMax) {
auto& v = as<std::vector<T>>();
checkSize(v, nMin, nMax);
return v;
}
template<class T>
@ -96,27 +110,36 @@ inline AnyMap& AnyValue::as<AnyMap>() {
}
return boost::any_cast<AnyMap&>(*m_value);
} catch (boost::bad_any_cast&) {
throw CanteraError("AnyValue::as",
throw InputFileError("AnyValue::as", *this,
"value of key '{}' is a '{}',\nnot an 'AnyMap'.",
m_key, demangle(m_value->type()));
}
}
template<class T>
std::map<std::string, T> AnyValue::asMap()
std::map<std::string, T> AnyValue::asMap() const
{
std::map<std::string, T> dest;
for (const auto& item : as<AnyMap>().m_data) {
try {
dest[item.first] = boost::any_cast<T>(*item.second.m_value);
} catch (boost::bad_any_cast&) {
throw CanteraError("AnyValue::asMap",
"Value of key '{}' is not a '{}'",
item.first, demangle(typeid(T)));
}
dest[item.first] = item.second.as<T>();
}
return dest;
}
template<class T>
void AnyValue::checkSize(const std::vector<T>& v, size_t nMin, size_t nMax) const
{
if (nMin != npos && nMax == npos && v.size() != nMin) {
throw InputFileError("AnyValue::checkSize", *this,
"Expected array '{}' to have length {}, but found "
"an array of length {}.", m_key, nMin, v.size());
} else if (nMin != npos && nMax != npos
&& (v.size() < nMin || v.size() > nMax)) {
throw InputFileError("AnyValue::checkSize", *this,
"Expected array '{}' to have from {} to {} elements, but found "
"an array of length {}.", m_key, nMin, nMax, v.size());
}
}
}
#endif

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_ARRAY_H
#define CT_ARRAY_H

View file

@ -4,7 +4,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_FACTORY_BASE
#define CT_FACTORY_BASE

View file

@ -0,0 +1,88 @@
//! @file Solution.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_SOLUTION_H
#define CT_SOLUTION_H
#include "cantera/base/ctexceptions.h"
namespace Cantera
{
class ThermoPhase;
class Kinetics;
class Transport;
//! A container class holding managers for all pieces defining a phase
class Solution : public std::enable_shared_from_this<Solution>
{
private:
Solution();
public:
~Solution() {}
Solution(const Solution&) = delete;
Solution& operator=(const Solution&) = delete;
//! Create an empty Solution object
static shared_ptr<Solution> create() {
return shared_ptr<Solution>( new Solution );
}
//! Return the name of this Solution object
std::string name() const;
//! Set the name of this Solution object
void setName(const std::string& name);
//! Set the ThermoPhase object
void setThermo(shared_ptr<ThermoPhase> thermo);
//! Set the Kinetics object
void setKinetics(shared_ptr<Kinetics> kinetics);
//! Set the Transport object
void setTransport(shared_ptr<Transport> transport);
//! Accessor for the ThermoPhase pointer
shared_ptr<ThermoPhase> thermo() {
return m_thermo;
}
//! Accessor for the Kinetics pointer
shared_ptr<Kinetics> kinetics() {
return m_kinetics;
}
//! Accessor for the Transport pointer
shared_ptr<Transport> transport() {
return m_transport;
}
protected:
shared_ptr<ThermoPhase> m_thermo; //!< ThermoPhase manager
shared_ptr<Kinetics> m_kinetics; //!< Kinetics manager
shared_ptr<Transport> m_transport; //!< Transport manager
};
//! Create and initialize a new Solution manager from an input file
/*!
* This constructor wraps newPhase(), newKinetics() and
* newTransportMgr() routines for initialization.
*
* @param infile name of the input file
* @param name name of the phase in the file.
* If this is blank, the first phase in the file is used.
* @param transport name of the transport model.
* @param adjacent vector containing adjacent solution objects.
* @returns an initialized Solution object.
*/
shared_ptr<Solution> newSolution(const std::string& infile,
const std::string& name="",
const std::string& transport="",
const std::vector<shared_ptr<Solution>>& adjacent={});
}
#endif

View file

@ -0,0 +1,208 @@
/**
* @file Units.h
* Header for unit conversion utilities, which are used to translate
* user input from input files (See \ref inputfiles and
* class \link Cantera::Units Units\endlink).
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_UNITS_H
#define CT_UNITS_H
#include "cantera/base/ct_defs.h"
namespace Cantera
{
class AnyValue;
class AnyMap;
//! A representation of the units associated with a dimensional quantity.
/*!
* Used for converting quantities between unit systems and checking for
* dimensional consistency. Units objects are mainly used within UnitSystem
* class to convert values from a user-specified Unit system to Cantera's
* base units (SI + kmol).
*/
class Units
{
public:
//! Create a Units object with the specified dimensions.
explicit Units(double factor=1.0, double mass=0, double length=0,
double time=0, double temperature=0, double current=0,
double quantity=0);
//! Create an object with the specified dimensions
explicit Units(const std::string& name);
//! Returns `true` if the specified Units are dimensionally consistent
bool convertible(const Units& other) const;
//! Return the factor for converting from this unit to Cantera's base
//! units.
double factor() const { return m_factor; }
//! Multiply two Units objects, combining their conversion factors and
//! dimensions
Units& operator*=(const Units& other);
//! Provide a string representation of these Units
std::string str() const;
//! Raise these Units to a power, changing both the conversion factor and
//! the dimensions of these Units.
Units pow(double expoonent) const;
private:
//! Scale the unit by the factor `k`
void scale(double k) { m_factor *= k; }
double m_factor; //!< conversion factor to Cantera base units
double m_mass_dim;
double m_length_dim;
double m_time_dim;
double m_temperature_dim;
double m_current_dim;
double m_quantity_dim;
double m_pressure_dim; //!< pseudo-dimension to track explicit pressure units
double m_energy_dim; //!< pseudo-dimension to track explicit energy units
friend class UnitSystem;
};
//! Unit conversion utility
/*!
* Provides functions for converting dimensional values from a given unit system.
* The main use is for converting values specified in input files to Cantera's
* native unit system, which is SI units except for the use of kmol as the base
* unit of quantity, i.e. kilogram, meter, second, kelvin, ampere, and kmol.
*
* String representations of units can be written using multiplication,
* division, and exponentiation. Spaces are ignored. Positive, negative, and
* decimal exponents are permitted. Examples:
*
* kg*m/s^2
* J/kmol
* m*s^-2
* J/kg/K
*
* Metric prefixes are recognized for all units, e.g. nm, hPa, mg, EJ, mL, kcal.
*
* Special functions for converting activation energies allow these values to be
* expressed as either energy per quantity, energy (e.g. eV), or temperature by
* applying a factor of the Avogadro number or the gas constant where needed.
*
* @ingroup inputfiles
*/
class UnitSystem
{
public:
//! Create a unit system with the specified default units
UnitSystem(std::initializer_list<std::string> units);
//! Default constructor for unit system (needed as VS2019 does not
//! recognize an optional argument with a default value)
UnitSystem() : UnitSystem({}) {}
//! Set the default units to convert from when explicit units are not
//! provided. Defaults can be set for mass, length, time, quantity, energy,
//! and pressure. Conversion using the pressure or energy units is done only
//! when the target units explicitly contain pressure or energy units.
//!
//! * To use SI+kmol: `setDefaults({"kg", "m", "s", "Pa", "J", "kmol"});`
//! * To use CGS+mol: `setDefaults({"cm", "g", "dyn/cm^2", "erg", "mol"});`
void setDefaults(std::initializer_list<std::string> units);
//! Set the default units using a map of dimension to unit pairs.
//!
//! Defaults for dimensions not specified will be left unchanged. To use
//! Cantera's default units:
//! ```
//! UnitSystem system;
//! std::map<string, string> defaults{
//! {"length", "m"}, {"mass", "kg"}, {"time", "s"},
//! {"quantity", "kmol"}, {"pressure", "Pa"}, {"energy", "J"},
//! {"activation-energy", "J/kmol"}
//! };
//! setDefaults(defaults);
//! ```
void setDefaults(const std::map<std::string, std::string>& units);
//! Set the default units to convert from when using the
//! `convertActivationEnergy` function.
void setDefaultActivationEnergy(const std::string& e_units);
//! Convert `value` from the units of `src` to the units of `dest`.
double convert(double value, const std::string& src,
const std::string& dest) const;
double convert(double value, const Units& src, const Units& dest) const;
//! Convert `value` from this unit system (defined by `setDefaults`) to the
//! specified units.
double convert(double value, const std::string& dest) const;
double convert(double value, const Units& dest) const;
//! Convert a generic AnyValue node to the units specified in `dest`. If the
//! input is a double, convert it using the default units. If the input is a
//! string, treat this as a dimensioned value, e.g. '988 kg/m^3' and convert
//! from the specified units.
double convert(const AnyValue& val, const std::string& dest) const;
double convert(const AnyValue& val, const Units& dest) const;
//! Convert an array of AnyValue nodes to the units specified in `dest`. For
//! each node, if the value is a double, convert it using the default units,
//! and if it is a string, treat it as a value with the given dimensions.
vector_fp convert(const std::vector<AnyValue>& vals,
const std::string& dest) const;
vector_fp convert(const std::vector<AnyValue>& vals,
const Units& dest) const;
//! Convert `value` from the units of `src` to the units of `dest`, allowing
//! for the different dimensions that can be used for activation energies
double convertActivationEnergy(double value, const std::string& src,
const std::string& dest) const;
//! Convert `value` from the default activation energy units to the
//! specified units
double convertActivationEnergy(double value, const std::string& dest) const;
//! Convert a generic AnyValue node to the units specified in `dest`. If the
//! input is a double, convert it using the default units. If the input is a
//! string, treat this as a dimensioned value, e.g. '2.7e4 J/kmol' and
//! convert from the specified units.
double convertActivationEnergy(const AnyValue& val,
const std::string& dest) const;
private:
//! Factor to convert mass from this unit system to kg
double m_mass_factor;
//! Factor to convert length from this unit system to meters
double m_length_factor;
//! Factor to convert time from this unit system to seconds
double m_time_factor;
//! Factor to convert pressure from this unit system to Pa
double m_pressure_factor;
//! Factor to convert energy from this unit system to J
double m_energy_factor;
//! Factor to convert activation energy from this unit system to J/kmol
double m_activation_energy_factor;
//! Factor to convert quantity from this unit system to kmol
double m_quantity_factor;
//! True if activation energy units are set explicitly, rather than as a
//! combination of energy and quantity units
bool m_explicit_activation_energy;
};
}
#endif

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_VALUECACHE_H
#define CT_VALUECACHE_H

View file

@ -5,7 +5,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_CLOCKWC_H
#define CT_CLOCKWC_H

View file

@ -44,6 +44,8 @@ typedef int ftnlen; // Fortran hidden string length type
%(CT_USE_SYSTEM_EIGEN)s
%(CT_USE_SYSTEM_FMT)s
%(CT_USE_SYSTEM_YAMLCPP)s
%(CT_USE_DEMANGLE)s
//--------- operating system --------------------------------------

View file

@ -10,7 +10,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_DEFS_H
#define CT_DEFS_H
@ -35,6 +35,8 @@ namespace Cantera
using std::shared_ptr;
using std::make_shared;
using std::unique_ptr;
using std::isnan; // workaround for bug in libstdc++ 4.8
/*!
* All physical constants are stored here.
@ -42,68 +44,89 @@ using std::make_shared;
* @defgroup physConstants Physical Constants
* %Cantera uses the MKS system of units. The unit for moles
* is defined to be the kmol. All values of physical constants
* are consistent with the 2010 CODATA recommendations.
* are consistent with the 2018 CODATA recommendations.
* @ingroup globalData
* @{
*/
//! Pi
const doublereal Pi = 3.14159265358979323846;
const double Pi = 3.14159265358979323846;
/*!
* @name Variations of the Gas Constant
* %Cantera uses the MKS system of units. The unit for moles
* is defined to be the kmol.
* @name Defined Constants
* These constants are defined by CODATA to have a particular value.
* https://physics.nist.gov/cuu/Constants/index.html
*/
//@{
//! Avogadro's Number [number/kmol]
const doublereal Avogadro = 6.02214129e26;
//! Avogadro's Number \f$ N_{\mathrm{A}} $\f [number/kmol]
const double Avogadro = 6.02214076e26;
/// Universal Gas Constant. [J/kmol/K]
const doublereal GasConstant = 8314.4621;
//! Boltzmann constant \f$ k $\f [J/K]
const double Boltzmann = 1.380649e-23;
const doublereal logGasConstant = std::log(GasConstant);
//! Planck constant \f$ h $\f [J-s]
const double Planck = 6.62607015e-34;
//! Elementary charge \f$ e $\f [C]
const double ElectronCharge = 1.602176634e-19;
/// Speed of Light in a vacuum \f$ c $\f [m/s]
const double lightSpeed = 299792458.0;
//! One atmosphere [Pa]
const doublereal OneAtm = 1.01325e5;
const doublereal OneBar = 1.0E5;
const double OneAtm = 1.01325e5;
//! One bar [Pa]
const double OneBar = 1.0E5;
//@}
/*!
* @name Measured Constants
* These constants are measured and reported by CODATA
*/
//@{
//! Fine structure constant \f$ \alpha $\f []
const double fineStructureConstant = 7.2973525693e-3;
//! Electron Mass \f$ m_e $\f [kg]
const double ElectronMass = 9.1093837015e-31;
//@}
/*!
* @name Derived Constants
* These constants are found from the defined and measured constants
*/
//@{
//! Reduced Planck constant \f$ \hbar $\f [m2-kg/s]
const double Planck_bar = Planck / (2 * Pi);
//! Universal Gas Constant \f$ R_u $\f [J/kmol/K]
const double GasConstant = Avogadro * Boltzmann;
const double logGasConstant = std::log(GasConstant);
//! Universal gas constant in cal/mol/K
const doublereal GasConst_cal_mol_K = GasConstant / 4184.0;
const double GasConst_cal_mol_K = GasConstant / 4184.0;
//! Boltzmann's constant [J/K]
const doublereal Boltzmann = GasConstant / Avogadro;
//! log(k_b/h)
const double logBoltz_Planck = std::log(Boltzmann / Planck);
/// Planck's constant. [J-s]
const doublereal Planck = 6.62607009e-34; // J-s
const doublereal Planck_bar = Planck / (2 * Pi); // m2-kg/s
//! Stefan-Boltzmann constant \f$ \sigma $\f [W/m2/K4]
const double StefanBoltz = Pi * Pi * std::pow(Boltzmann, 4.0) / (60.0 * std::pow(Planck_bar, 3.0) * lightSpeed * lightSpeed); // 5.670374419e-8
/// log(k/h)
const doublereal logBoltz_Planck = std::log(Boltzmann / Planck); // ln(k_B/h)
/// Stefan-Boltzmann constant
const doublereal StefanBoltz = 5.670373e-8;
//! Faraday constant \f$ F $\f [C/kmol]
const double Faraday = ElectronCharge * Avogadro;
//@}
/// @name Electron Properties
//@{
const doublereal ElectronCharge = 1.602176565e-19; // C
const doublereal ElectronMass = 9.10938291e-31; // kg
const doublereal Faraday = ElectronCharge * Avogadro;
//@}
//! Permeability of free space \f$ \mu_0 $\f [N/A2]
const double permeability_0 = 2 * fineStructureConstant * Planck / (ElectronCharge * ElectronCharge * lightSpeed);
/// @name Electromagnetism
/// %Cantera uses the MKS unit system.
//@{
/// Speed of Light (m/s).
const doublereal lightSpeed = 299792458.0;
/// Permeability of free space \f$ \mu_0 \f$ in N/A^2.
const doublereal permeability_0 = 4.0e-7*Pi;
/// Permittivity of free space \f$ \epsilon_0 \f$ in F/m.
const doublereal epsilon_0 = 1.0 / (lightSpeed*lightSpeed*permeability_0);
//! Permittivity of free space \f$ \varepsilon_0 $\f [F/m]
const double epsilon_0 = 1.0 / (lightSpeed * lightSpeed * permeability_0);
//@}
//@}
@ -123,15 +146,15 @@ const int VT = -100, PH = -101, PS = -102, VP = -103, PT = -104,
//@}
//! smallest number to compare to zero.
const doublereal SmallNumber = 1.e-300;
const double SmallNumber = 1.e-300;
//! largest number to compare to inf.
const doublereal BigNumber = 1.e300;
const double BigNumber = 1.e300;
//! largest x such that exp(x) is valid
const doublereal MaxExp = 690.775527898;
const double MaxExp = 690.775527898;
//! Fairly random number to be used to initialize variables against
//! to see if they are subsequently defined.
const doublereal Undef = -999.1234;
const double Undef = -999.1234;
//! Small number to compare differences of mole fractions against.
/*!
@ -140,17 +163,17 @@ const doublereal Undef = -999.1234;
* used for the matrix inversion of transport properties when mole fractions
* must be positive.
*/
const doublereal Tiny = 1.e-20;
const double Tiny = 1.e-20;
//! Map connecting a string name with a double.
/*!
* This is used mostly to assign concentrations and mole fractions to species.
*/
typedef std::map<std::string, doublereal> compositionMap;
typedef std::map<std::string, double> compositionMap;
//! Map from string names to doubles. Used for defining species mole/mass
//! fractions, elemental compositions, and reaction stoichiometries.
typedef std::map<std::string, doublereal> Composition;
typedef std::map<std::string, double> Composition;
//! Turn on the use of stl vectors for the basic array type within cantera
//! Vector of doubles.

View file

@ -6,7 +6,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_CTEXCEPTIONS_H
#define CT_CTEXCEPTIONS_H
@ -31,11 +31,6 @@ namespace Cantera
* Any exceptions which are not caught cause a fatal error exit from the
* program.
*
* Below is an example of how to catch errors that throw the CanteraError class.
* In general, all Cantera C++ programs will have this basic structure.
*
* \include demo1a.cpp
*
* A group of defines may be used during debugging to assert conditions which
* should be true. These are named AssertTrace(), AssertThrow(), and
* AssertThrowMsg(). Examples of their usage is given below.

View file

@ -6,7 +6,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_CTML_H
#define CT_CTML_H

View file

@ -14,7 +14,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_GLOBAL_H
#define CT_GLOBAL_H
@ -187,6 +187,26 @@ void warn_deprecated(const std::string& method, const std::string& extra="");
//! @copydoc Application::suppress_deprecation_warnings
void suppress_deprecation_warnings();
//! helper function passing user warning to global handler
void _warn_user(const std::string& method, const std::string& extra);
/*!
* Print a user warning raised from *method*.
*
* @param method method name
* @param msg Python-style format string with the following arguments
* @param args arguments for the format string
*/
template <typename... Args>
void warn_user(const std::string& method, const std::string& msg,
const Args&... args) {
if (sizeof...(args) == 0) {
_warn_user(method, msg);
} else {
_warn_user(method, fmt::format(msg, args...));
}
}
//! @copydoc Application::make_deprecation_warnings_fatal
void make_deprecation_warnings_fatal();

View file

@ -5,7 +5,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_LOGGER_H
#define CT_LOGGER_H

View file

@ -4,7 +4,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_PLOTS_H
#define CT_PLOTS_H

View file

@ -4,7 +4,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_STRINGUTILS_H
#define CT_STRINGUTILS_H

View file

@ -5,7 +5,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
/**
* @defgroup utils Templated Utility Functions
@ -29,6 +29,8 @@ namespace Cantera
/*!
* The form of this operator is designed for use by std::transform.
* @see @ref scale().
*
* @deprecated To be removed after Cantera 2.5. Replaceable with C++11 lambda.
*/
template<class T> struct timesConstant : public std::unary_function<T, double> {
//! Constructor
@ -36,7 +38,10 @@ template<class T> struct timesConstant : public std::unary_function<T, double> {
* @param c Constant of templated type T that will be stored internally
* within the object and used in the multiplication operation
*/
timesConstant(T c) : m_c(c) {}
timesConstant(T c) : m_c(c) {
warn_deprecated("class timesConstant",
"To be removed after Cantera 2.5. Replaceable with C++11 lambda.");
}
//! Parenthesis operator returning a double
/*!
@ -107,7 +112,7 @@ template<class InputIter, class InputIter2>
inline doublereal dot(InputIter x_begin, InputIter x_end,
InputIter2 y_begin)
{
return inner_product(x_begin, x_end, y_begin, 0.0);
return std::inner_product(x_begin, x_end, y_begin, 0.0);
}
//! Multiply elements of an array by a scale factor.
@ -130,7 +135,8 @@ template<class InputIter, class OutputIter, class S>
inline void scale(InputIter begin, InputIter end,
OutputIter out, S scale_factor)
{
std::transform(begin, end, out, timesConstant<S>(scale_factor));
std::transform(begin, end, out,
[scale_factor](double x) { return x * scale_factor; });
}
//! Multiply each entry in x by the corresponding entry in y.
@ -157,11 +163,13 @@ inline void scale(InputIter begin, InputIter end,
* begin determines the loop length
* @param y_begin Iterator pointing to the beginning of the vector y,
* belonging to the iterator class outputIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class OutputIter>
inline void multiply_each(OutputIter x_begin, OutputIter x_end,
InputIter y_begin)
{
warn_deprecated("multiply_each", "To be removed after Cantera 2.5.");
for (; x_begin != x_end; ++x_begin, ++y_begin) {
*x_begin *= *y_begin;
}
@ -190,10 +198,12 @@ inline void multiply_each(OutputIter x_begin, OutputIter x_end,
* @param end Iterator pointing to the end of the x vector, belonging to
* the iterator class InputIter. The difference between end and
* begin determines the loop length
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter>
inline doublereal absmax(InputIter begin, InputIter end)
{
warn_deprecated("absmax", "To be removed after Cantera 2.5.");
doublereal amax = 0.0;
for (; begin != end; ++begin) {
amax = std::max(fabs(*begin), amax);
@ -229,12 +239,14 @@ inline doublereal absmax(InputIter begin, InputIter end)
* begin determines the loop length
* @param out Iterator pointing to the beginning of the output vector,
* belonging to the iterator class OutputIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class OutputIter>
inline void normalize(InputIter begin, InputIter end,
OutputIter out)
{
doublereal sum = accumulate(begin, end, 0.0);
warn_deprecated("normalize", "To be removed after Cantera 2.5.");
doublereal sum = std::accumulate(begin, end, 0.0);
for (; begin != end; ++begin, ++out) {
*out = *begin/sum;
}
@ -264,11 +276,13 @@ inline void normalize(InputIter begin, InputIter end,
* and begin determines the number of inner iterations.
* @param y_begin Iterator pointing to the beginning of the yvector, belonging
* to the iterator class InputIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class OutputIter>
inline void divide_each(OutputIter x_begin, OutputIter x_end,
InputIter y_begin)
{
warn_deprecated("divide_each", "To be removed after Cantera 2.5.");
for (; x_begin != x_end; ++x_begin, ++y_begin) {
*x_begin /= *y_begin;
}
@ -285,11 +299,13 @@ inline void divide_each(OutputIter x_begin, OutputIter x_end,
* and begin determines the number of inner iterations.
* @param y_begin Iterator pointing to the beginning of the yvector, belonging
* to the iterator class InputIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class OutputIter>
inline void sum_each(OutputIter x_begin, OutputIter x_end,
InputIter y_begin)
{
warn_deprecated("sum_each", "To be removed after Cantera 2.5.");
for (; x_begin != x_end; ++x_begin, ++y_begin) {
*x_begin += *y_begin;
}
@ -325,11 +341,13 @@ inline void sum_each(OutputIter x_begin, OutputIter x_end,
* belonging to the iterator class outputIter.
* @param index Iterator pointing to the beginning of the index vector, belonging to the
* iterator class IndexIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class OutputIter, class IndexIter>
inline void scatter_copy(InputIter begin, InputIter end,
OutputIter result, IndexIter index)
{
warn_deprecated("scatter_copy", "To be removed after Cantera 2.5.");
for (; begin != end; ++begin, ++index) {
*(result + *index) = *begin;
}
@ -362,11 +380,13 @@ inline void scatter_copy(InputIter begin, InputIter end,
* be selectively multiplied.
* @param index Iterator pointing to the beginning of the index vector,
* belonging to the iterator class IndexIter.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter, class RandAccessIter, class IndexIter>
inline void scatter_mult(InputIter mult_begin, InputIter mult_end,
RandAccessIter data, IndexIter index)
{
warn_deprecated("scatter_mult", "To be removed after Cantera 2.5.");
for (; mult_begin != mult_end; ++mult_begin, ++index) {
*(data + *index) *= *mult_begin;
}
@ -377,17 +397,19 @@ inline void scatter_mult(InputIter mult_begin, InputIter mult_end,
* The template arguments are: template<class InputIter>
*
* A small number (1.0E-20) is added before taking the log. This templated
* class does the indicated sun. The template must be an iterator.
* class does the indicated sum. The template must be an iterator.
*
* @param begin Iterator pointing to the beginning, belonging to the
* iterator class InputIter.
* @param end Iterator pointing to the end, belonging to the
* iterator class InputIter.
* @return The return from this class is a double.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter>
inline doublereal sum_xlogx(InputIter begin, InputIter end)
{
warn_deprecated("sum_xlogx", "To be removed after Cantera 2.5.");
doublereal sum = 0.0;
for (; begin != end; ++begin) {
sum += (*begin) * std::log(*begin + Tiny);
@ -410,11 +432,13 @@ inline doublereal sum_xlogx(InputIter begin, InputIter end)
* @param Q_begin Iterator pointing to the beginning of Q_k, belonging to the
* iterator class InputIter2.
* @return The return from this class is hard coded to a doublereal.
* @deprecated Unused. To be removed after Cantera 2.5.
*/
template<class InputIter1, class InputIter2>
inline doublereal sum_xlogQ(InputIter1 begin, InputIter1 end,
InputIter2 Q_begin)
{
warn_deprecated("sum_xlogQ", "To be removed after Cantera 2.5.");
doublereal sum = 0.0;
for (; begin != end; ++begin, ++Q_begin) {
sum += (*begin) * std::log(*Q_begin + Tiny);

View file

@ -6,7 +6,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_XML_H
#define CT_XML_H
@ -109,13 +109,12 @@ public:
XML_Node& operator=(const XML_Node& right);
virtual ~XML_Node();
//! Add a child node to the current node containing a comment
//! Clear the current node and everything under it
/*!
* Child node will have the name, comment.
*
* @param comment Content of the comment
* The value, attributes and children are all zeroed. The name and the
* parent information is kept.
*/
void addComment(const std::string& comment);
void clear();
//! Merge an existing node as a child node to the current node
/*!
@ -190,6 +189,14 @@ public:
* isn't modified in any way.
*/
void removeChild(const XML_Node* const node);
//! Add a child node to the current node containing a comment
/*!
* Child node will have the name, comment.
*
* @param comment Content of the comment
*/
void addComment(const std::string& comment);
//! Modify the value for the current node
/*!
@ -306,18 +313,10 @@ public:
*
* @param attr String containing the attribute to be searched for.
* @return If a match is found, the attribute value is returned as a
* string. If no match is found, the empty string is
* returned.
* string. If no match is found, the empty string is returned.
*/
std::string attrib(const std::string& attr) const;
//! Clear the current node and everything under it
/*!
* The value, attributes and children are all zeroed. The name and the
* parent information is kept.
*/
void clear();
private:
//! Returns a changeable value of the attributes map for the current node
/*!
@ -364,9 +363,6 @@ public:
bool hasAttrib(const std::string& a) const;
//! Returns the name of the XML node
/*!
* The name is the XML node is the XML node name
*/
std::string name() const {
return m_name;
}
@ -393,7 +389,7 @@ public:
//! Return an unchangeable reference to the vector of children of the current node
/*!
* Each of the individual XML_Node child pointers, however, is to a
* Each of the individual XML_Node child pointers, however, is pointing to a
* changeable XML node object.
*/
const std::vector<XML_Node*>& children() const;
@ -408,9 +404,9 @@ public:
//! Boolean function indicating whether a comment
bool isComment() const;
//! Require that the current XML node have an attribute named by the first
//! argument, a, and that this attribute have the the string value listed
//! in the second argument, v.
//! Require that the current XML node has an attribute named by the first
//! argument, a, and that this attribute has the string value listed in
//! the second argument, v.
/*!
* @param a attribute name
* @param v required value of the attribute
@ -440,15 +436,15 @@ public:
XML_Node* findNameID(const std::string& nameTarget,
const std::string& idTarget) const;
//! This routine carries out a search for an XML node based
//! on both the XML element name and the attribute ID and an integer index.
//! This routine carries out a search for an XML node based on the XML
//! element name, the attribute ID and an integer index.
/*!
* If exact matches are found for all fields, the pointer
* to the matching XML Node is returned. The search is only carried out on
* the current element and the child elements of the current element.
*
* The "id" attribute may be defaulted by setting it to "". In this case the
* pointer to the first XML element matching the name only is returned.
* pointer to the first XML element matching the name and the Index is returned.
*
* @param nameTarget Name of the XML Node that is being searched for
* @param idTarget "id" attribute of the XML Node that the routine
@ -461,14 +457,11 @@ public:
const std::string& idTarget, const int index) const;
//! This routine carries out a recursive search for an XML node based
//! on the XML element attribute, "id"
//! on the XML element attribute "id"
/*!
* If exact match is found, the pointer to the matching XML Node is
* returned. If not, 0 is returned.
*
* The ID attribute may be defaulted by setting it to "". In this case the
* pointer to the first XML element matching the name only is returned.
*
* @param id "id" attribute of the XML Node that the routine looks for
* @param depth Depth of the search.
* @returns the pointer to the XML node that fits the criteria
@ -704,14 +697,14 @@ protected:
//! Search an XML_Node tree for a named phase XML_Node
/*!
* Search for a phase Node matching a name.
* Search for a phase Node matching an id.
*
* @param root Starting XML_Node* pointer for the search
* @param phaseName Name of the phase to search for
* @param phaseId id of the phase to search for
* @returns the XML_Node pointer if the phase is found. If the phase is not
* found, it returns 0
* found, it returns 0
*/
XML_Node* findXMLPhase(XML_Node* root, const std::string& phaseName);
XML_Node* findXMLPhase(XML_Node* root, const std::string& phaseId);
}

View file

@ -0,0 +1,6 @@
#include "cantera/base/ct_defs.h"
#if CT_USE_SYSTEM_YAMLCPP
#include "yaml-cpp/yaml.h"
#else
#include "cantera/ext/yaml-cpp/yaml.h"
#endif

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CTC_DEFS_H
#define CTC_DEFS_H

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CTC_CT_H
#define CTC_CT_H
@ -16,6 +16,7 @@ extern "C" {
CANTERA_CAPI int ct_appdelete();
CANTERA_CAPI int thermo_newFromFile(const char* filename, const char* phasename);
CANTERA_CAPI int thermo_newFromXML(int mxml);
CANTERA_CAPI int thermo_del(int n);
CANTERA_CAPI size_t thermo_nElements(int n);
@ -72,7 +73,6 @@ extern "C" {
CANTERA_CAPI double thermo_thermalExpansionCoeff(int n);
CANTERA_CAPI double thermo_isothermalCompressibility(int n);
CANTERA_CAPI int thermo_chemPotentials(int n, size_t lenm, double* murt);
CANTERA_CAPI int thermo_elementPotentials(int n, size_t lenm, double* lambda);
CANTERA_CAPI int thermo_getEnthalpies_RT(int n, size_t lenm, double* h_rt);
CANTERA_CAPI int thermo_getEntropies_R(int n, size_t lenm, double* s_r);
CANTERA_CAPI int thermo_getCp_R(int n, size_t lenm, double* cp_r);
@ -102,9 +102,12 @@ extern "C" {
CANTERA_CAPI int thermo_setState_Psat(int n, double p, double x);
CANTERA_CAPI int thermo_setState_Tsat(int n, double t, double x);
CANTERA_CAPI size_t kin_newFromXML(int mxml, int iphase,
int neighbor1, int neighbor2, int neighbor3,
int neighbor4);
CANTERA_CAPI int kin_newFromFile(const char* filename, const char* phasename,
int reactingPhase, int neighbor1, int neighbor2,
int neighbor3, int neighbor4);
CANTERA_CAPI int kin_newFromXML(int mxml, int iphase,
int neighbor1, int neighbor2, int neighbor3,
int neighbor4);
CANTERA_CAPI int kin_del(int n);
CANTERA_CAPI size_t kin_nSpecies(int n);
CANTERA_CAPI size_t kin_nReactions(int n);
@ -137,7 +140,8 @@ extern "C" {
CANTERA_CAPI int kin_advanceCoverages(int n, double tstep);
CANTERA_CAPI size_t kin_phase(int n, size_t i);
CANTERA_CAPI size_t trans_new(const char* model, int th, int loglevel);
CANTERA_CAPI int trans_newDefault(int th, int loglevel);
CANTERA_CAPI int trans_new(const char* model, int th, int loglevel);
CANTERA_CAPI int trans_del(int n);
CANTERA_CAPI double trans_viscosity(int n);
CANTERA_CAPI double trans_electricalConductivity(int n);

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CTC_FUNC1_H
#define CTC_FUNC1_H

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CTC_MULTIPHASE_H
#define CTC_MULTIPHASE_H

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CTC_ONEDIM_H
#define CTC_ONEDIM_H

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CTC_REACTOR_H
#define CTC_REACTOR_H
@ -14,7 +14,8 @@
extern "C" {
#endif
CANTERA_CAPI int reactor_new(int type);
CANTERA_CAPI int reactor_new2(const char* type);
CANTERA_CAPI int reactor_new(int type); //!< @deprecated To be changed after Cantera 2.5.
CANTERA_CAPI int reactor_del(int i);
CANTERA_CAPI int reactor_setInitialVolume(int i, double v);
CANTERA_CAPI int reactor_setChemistry(int i, int cflag);
@ -47,16 +48,23 @@ extern "C" {
CANTERA_CAPI double reactornet_atol(int i);
CANTERA_CAPI double reactornet_sensitivity(int i, const char* v, int p, int r);
CANTERA_CAPI int flowdev_new(int type);
CANTERA_CAPI int flowdev_new2(const char* type);
CANTERA_CAPI int flowdev_new(int type); //!< @deprecated To be changed after Cantera 2.5.
CANTERA_CAPI int flowdev_del(int i);
CANTERA_CAPI int flowdev_install(int i, int n, int m);
CANTERA_CAPI int flowdev_setMaster(int i, int n);
CANTERA_CAPI double flowdev_massFlowRate(int i, double time);
CANTERA_CAPI int flowdev_setMassFlowRate(int i, double mdot);
CANTERA_CAPI int flowdev_setParameters(int i, int n, const double* v);
CANTERA_CAPI int flowdev_setFunction(int i, int n);
CANTERA_CAPI int flowdev_setParameters(int i, int n, const double* v); //!< @deprecated To be removed after Cantera 2.5.
CANTERA_CAPI int flowdev_setMassFlowCoeff(int i, double v);
CANTERA_CAPI int flowdev_setValveCoeff(int i, double v);
CANTERA_CAPI int flowdev_setPressureCoeff(int i, double v);
CANTERA_CAPI int flowdev_setFunction(int i, int n); //!< @deprecated To be removed after Cantera 2.5.
CANTERA_CAPI int flowdev_setPressureFunction(int i, int n);
CANTERA_CAPI int flowdev_setTimeFunction(int i, int n);
CANTERA_CAPI int wall_new(int type);
CANTERA_CAPI int wall_new2(const char* type);
CANTERA_CAPI int wall_new(int type); //!< @deprecated To be changed after Cantera 2.5.
CANTERA_CAPI int wall_del(int i);
CANTERA_CAPI int wall_install(int i, int n, int m);
CANTERA_CAPI double wall_vdot(int i, double t);

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CTC_RXNPATH_H
#define CTC_RXNPATH_H

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CTC_SURF_H
#define CTC_SURF_H

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CTC_XML_H
#define CTC_XML_H

View file

@ -1,5 +1,5 @@
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_CYTHON_FUNC_WRAPPER
#define CT_CYTHON_FUNC_WRAPPER

View file

@ -1,5 +1,5 @@
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#include "cantera/base/logger.h"
#include "cantera/thermo/ThermoPhase.h"
@ -112,6 +112,7 @@ TRANSPORT_1D(getMixDiffCoeffsMass)
TRANSPORT_1D(getMixDiffCoeffsMole)
TRANSPORT_1D(getThermalDiffCoeffs)
TRANSPORT_1D(getSpeciesViscosities)
TRANSPORT_1D(getMobilities)
TRANSPORT_2D(getMultiDiffCoeffs)
TRANSPORT_2D(getBinaryDiffCoeffs)

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_CHEM_EQUIL_H
#define CT_CHEM_EQUIL_H
@ -124,11 +124,6 @@ public:
int equilibrate(thermo_t& s, const char* XY, vector_fp& elMoles,
int loglevel = 0);
//! @deprecated To be removed after Cantera 2.4.
const vector_fp& elementPotentials() const {
return m_lambda;
}
/**
* Options controlling how the calculation is carried out.
* @see EquilOptions
@ -267,10 +262,6 @@ protected:
//! Current value of the mole fractions in the single phase. length = #m_kk.
vector_fp m_molefractions;
//! Current value of the dimensional element potentials. length = #m_mm
//! @deprecated To be removed after Cantera 2.4.
vector_fp m_lambda;
//! Current value of the sum of the element abundances given the current
//! element potentials.
doublereal m_elementTotalSum;

View file

@ -5,7 +5,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_MULTIPHASE_H
#define CT_MULTIPHASE_H

View file

@ -1,7 +1,7 @@
//! @file MultiPhaseEquil.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_MULTIPHASE_EQUIL
#define CT_MULTIPHASE_EQUIL

View file

@ -4,7 +4,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef VCS_MULTIPHASEEQUIL_H
#define VCS_MULTIPHASEEQUIL_H

View file

@ -1,7 +1,7 @@
//! @file vcs_SpeciesProperties.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef VCS_SPECIES_PROPERTIES_H
#define VCS_SPECIES_PROPERTIES_H

View file

@ -4,7 +4,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef VCS_VOLPHASE_H
#define VCS_VOLPHASE_H

View file

@ -4,7 +4,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef VCS_DEFS_H
#define VCS_DEFS_H

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef _VCS_INTERNAL_H
#define _VCS_INTERNAL_H

View file

@ -5,7 +5,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef _VCS_SOLVE_H
#define _VCS_SOLVE_H

View file

@ -1,7 +1,7 @@
//! @file vcs_species_thermo.h
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef VCS_SPECIES_THERMO_H
#define VCS_SPECIES_THERMO_H

View file

@ -1,61 +0,0 @@
/**
* @file AqueousKinetics.h
* @ingroup chemkinetics
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
#ifndef CT_AQUEOUSKINETICS_H
#define CT_AQUEOUSKINETICS_H
#include "BulkKinetics.h"
namespace Cantera
{
/**
* Kinetics manager for elementary aqueous-phase chemistry. This kinetics
* manager implements standard mass-action reaction rate expressions for liquids
*
* @attention This class currently does not have any test cases or examples. Its
* implementation may be incomplete, and future changes to Cantera may
* unexpectedly cause this class to stop working. If you use this class,
* please consider contributing examples or test cases. In the absence of
* new tests or examples, this class may be deprecated and removed in a
* future version of Cantera. See
* https://github.com/Cantera/cantera/issues/267 for additional information.
*
* @deprecated To be removed after Cantera 2.4
*
* @ingroup kinetics
*/
class AqueousKinetics : public BulkKinetics
{
public:
/// Constructor. Creates an empty reaction mechanism.
AqueousKinetics(thermo_t* thermo = 0);
virtual std::string kineticsType() const {
return "Aqueous";
}
virtual void getEquilibriumConstants(doublereal* kc);
virtual void getFwdRateConstants(doublereal* kfwd);
void updateROP();
//! Update temperature-dependent portions of reaction rates
void _update_rates_T();
//! Update properties that depend on concentrations.
void _update_rates_C();
//! Update the equilibrium constants in molar units.
void updateKc();
virtual bool addReaction(shared_ptr<Reaction> r);
virtual void modifyReaction(size_t i, shared_ptr<Reaction> rNew);
};
}
#endif

View file

@ -4,7 +4,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_BULKKINETICS_H
#define CT_BULKKINETICS_H

View file

@ -6,7 +6,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_EDGEKINETICS_H
#define CT_EDGEKINETICS_H

View file

@ -1,10 +1,11 @@
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_FALLOFF_H
#define CT_FALLOFF_H
#include "cantera/kinetics/reaction_defs.h"
#include "cantera/base/global.h"
namespace Cantera
{
@ -74,8 +75,18 @@ public:
return 0;
}
//! Return a string representing the type of the Falloff parameterization.
virtual std::string type() const {
return "Lindemann";
}
//! Return an integer representing the type of the Falloff parameterization.
/*!
* @deprecated To be removed after Cantera 2.5.
*/
virtual int getType() const {
warn_deprecated("Falloff::getType()",
"Replaced by Falloff::type(). To be removed after Cantera 2.5.");
return SIMPLE_FALLOFF;
}
@ -146,7 +157,13 @@ public:
return 1;
}
virtual std::string type() const {
return "Troe";
}
virtual int getType() const {
warn_deprecated("Troe::getType()",
"Replaced by Troe::type(). To be removed after Cantera 2.5.");
return TROE_FALLOFF;
}
@ -181,9 +198,9 @@ protected:
* \f[ P_r = \frac{k_0 [M]}{k_{\infty}} \f]
*
* \f[ F = {\left( a \; exp(\frac{-b}{T}) + exp(\frac{-T}{c})\right)}^n
* \; d \; exp(\frac{-e}{T}) \f]
* \; d \; T^e \f]
* where
* \f[ n = \frac{1.0}{1.0 + {\log_{10} P_r}^2} \f]
* \f[ n = \frac{1.0}{1.0 + (\log_{10} P_r)^2} \f]
*
* \f$ c \f$ s required to greater than or equal to zero. If it is zero, then
* the corresponding term is set to zero.
@ -220,7 +237,13 @@ public:
return 2;
}
virtual std::string type() const {
return "SRI";
}
virtual int getType() const {
warn_deprecated("SRI::getType()",
"Replaced by SRI::type(). To be removed after Cantera 2.5.");
return SRI_FALLOFF;
}

View file

@ -6,7 +6,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_NEWFALLOFF_H
#define CT_NEWFALLOFF_H
@ -58,9 +58,23 @@ public:
* @param c input vector of doubles which populates the falloff
* parameterization.
* @returns a pointer to a new Falloff class.
*
* @deprecated To be removed after Cantera 2.5.
*/
virtual Falloff* newFalloff(int type, const vector_fp& c);
//! Return a pointer to a new falloff function calculator.
/*!
* @param type String identifier specifying the type of falloff function.
* The standard types match class names defined in Falloff.h.
* A factory class derived from FalloffFactory may define
* other types as well.
* @param c input vector of doubles which populates the falloff
* parameterization.
* @returns a pointer to a new Falloff class.
*/
virtual Falloff* newFalloff(const std::string& type, const vector_fp& c);
private:
//! Pointer to the single instance of the factory
static FalloffFactory* s_factory;
@ -73,7 +87,13 @@ private:
};
//! @copydoc FalloffFactory::newFalloff
/*!
* @deprecated To be removed after Cantera 2.5.
*/
shared_ptr<Falloff> newFalloff(int type, const vector_fp& c);
//! @copydoc FalloffFactory::newFalloff
shared_ptr<Falloff> newFalloff(const std::string& type, const vector_fp& c);
}
#endif

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_FALLOFFMGR_H
#define CT_FALLOFFMGR_H

View file

@ -4,7 +4,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_GASKINETICS_H
#define CT_GASKINETICS_H

View file

@ -3,7 +3,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_RXNPATH_GROUP
#define CT_RXNPATH_GROUP

View file

@ -6,7 +6,7 @@
*/
// This file is part of Cantera. See License.txt in the top-level directory or
// at http://www.cantera.org/license.txt for license and copyright information.
// at https://cantera.org/license.txt for license and copyright information.
#ifndef CT_IMPSURFCHEM_H
#define CT_IMPSURFCHEM_H
@ -61,8 +61,19 @@ public:
* @param k Vector of pointers to InterfaceKinetics objects Each object
* consists of a surface or an edge containing internal degrees of
* freedom representing the concentration of surface adsorbates.
* @param rtol The relative tolerance for the integrator
* @param atol The absolute tolerance for the integrator
* @param maxStepSize The maximum step-size the integrator is allowed to take.
* If zero, this option is disabled.
* @param maxSteps The maximum number of time-steps the integrator can take.
* If not supplied, uses the default value in the CVodesIntegrator (20000).
* @param maxErrTestFails the maximum permissible number of error test failures
* If not supplied, uses the default value in CVODES (7).
*/
ImplicitSurfChem(std::vector<InterfaceKinetics*> k);
ImplicitSurfChem(std::vector<InterfaceKinetics*> k,
double rtol=1.e-7, double atol=1.e-14,
double maxStepSize=0, size_t maxSteps=20000,
size_t maxErrTestFails=7);
virtual ~ImplicitSurfChem() {};
@ -71,6 +82,27 @@ public:
*/
virtual void initialize(doublereal t0 = 0.0);
/*!
* Set the maximum integration step-size. Note, setting this value to zero
* disables this option
*/
virtual void setMaxStepSize(double maxstep = 0.0);
/*!
* Set the relative and absolute integration tolerances.
*/
virtual void setTolerances(double rtol=1.e-7, double atol=1.e-14);
/*!
* Set the maximum number of CVODES integration steps.
*/
virtual void setMaxSteps(size_t maxsteps = 20000);
/*!
* Set the maximum number of CVODES error test failures
*/
virtual void setMaxErrTestFails(size_t maxErrTestFails = 7);
//! Integrate from t0 to t1. The integrator is reinitialized first.
/*!
* This routine does a time accurate solve from t = t0 to t = t1.
@ -230,6 +262,8 @@ protected:
std::unique_ptr<Integrator> m_integ;
doublereal m_atol, m_rtol; // tolerances
doublereal m_maxstep; //!< max step size
size_t m_nmax; //!< maximum number of steps allowed
size_t m_maxErrTestFails; //!< maximum number of error test failures allowed
vector_fp m_work;
/**

Some files were not shown because too many files have changed in this diff Show more