Commit graph

7182 commits

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