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.
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.
This should reduce the time needed to set up the build environment and avoid
build failures associated with errors while updating irrelevant homebrew
packages.
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.
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
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.
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.
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.
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.
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
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.
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.
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.
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.
-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`.
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
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.
-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
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.
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.
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.
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.