Cantera / enhancements

Repository for proposed and ongoing enhancements to Cantera
11 stars 5 forks source link

Cantera should allow three temperature ranges for thermodynamic properties #189

Open Nicholaswogan opened 8 months ago

Nicholaswogan commented 8 months ago

Problem description

Shomate thermodynamic properties only allows for 2 temperature ranges, but Cantera should allow 3 temperature ranges.

Steps to reproduce

See the attached input file example.yaml

import cantera as ct
gas = ct.Solution('input/example.yaml')

The resulting error

---------------------------------------------------------------------------
CanteraError                              Traceback (most recent call last)
Cell In[8], line 1
----> 1 gas = ct.Solution('input/example.yaml')

File build/python/cantera/base.pyx:71, in cantera._cantera._SolutionBase.__cinit__()

File build/python/cantera/base.pyx:128, in cantera._canter
[example.yaml.zip](https://github.com/Cantera/cantera/files/13185073/example.yaml.zip)
a._SolutionBase._cinit()

File build/python/cantera/base.pyx:215, in cantera._cantera._SolutionBase._init_yaml()

CanteraError: 
*******************************************************************************
InputFileError thrown by AnyValue::checkSize:
Error on line 17 of ./input/example.yaml:
Expected array 'temperature-ranges' to have from 2 to 3 elements, but found an array of length 4.
|  Line |
|    12 | species:
|    13 | - name: H2
|    14 |   composition: {H: 2}
|    15 |   thermo:
|    16 |     model: Shomate
>    17 >     temperature-ranges: [0.0, 1000.0, 2500.0, 6000.0]
                                  ^
|    18 |     data:
|    19 |     - [33.066178, -11.36342, 11.432816, -2.772874, -0.158558, -9.980797, 172.708]
|    20 |     - [18.563083, 12.257357, -2.859786, 0.268238, 1.97799, -1.147438, 156.2881]
*******************************************************************************

Behavior

Cantera should be able to deal with 3 temperature ranges. On NIST, H2 has 3 ranges: https://webbook.nist.gov/cgi/cbook.cgi?ID=C1333740&Mask=1#Thermo-Gas

System information

example.yaml.zip

ischoegl commented 8 months ago

Thank you for the suggestion. I am transferring this over to the enhancement repository, as this is a feature request.