Commit graph

6944 commits

Author SHA1 Message Date
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