Skip to content

Deprecate all instances of gri30_mix and gri30_multi #736

@ischoegl

Description

@ischoegl

Cantera version

2.5.0a3

Operating System / Python/MATLAB version

all

Expected Behavior

The gri30_mix and gri30_multi phases are deprecated and are not part of all gri30.yaml versions (the version in test/work/python defines those, the default version does not). For consistency, all instances should be removed for 2.5, as the transport model can be specified using a flag. I.e. the differentiation of transport models in phases is largely obsolete:

In [1]: import cantera as ct

In [2]: gas = ct.Solution('gri30.yaml', 'gri30_multi')
CanteraError: 
***********************************************************************
InputFileError thrown by AnyValue::getMapWhere:
Error on line 16 of /usr/local/lib/python3.6/dist-packages/cantera/data/gri30.yaml:
List does not contain a map where 'name' = 'gri30_multi'
[...]
***********************************************************************

In [3]: gas = ct.Solution('gri30.xml', 'gri30_multi')

In [4]: gas.composite
Out[4]: ('IdealGas', 'Gas', 'Multi')

In [5]: gas = ct.Solution('gri30.yaml', transport_model='Multi')

In [6]: gas.composite
Out[6]: ('IdealGas', 'Gas', 'Multi')

Questions

There are two questions:

  • it is not straight forward to completely remove the gri_mix and gri_multi phases, as they may be widely used in user-developed code. Should there be a customized error message (or warning)?
  • the default behavior should be clarified: will the transport model default to mixture-averaged or should no transport manager be instantiated if the transport_model flag is not used? (i.e. under many circumstances, the transport manager is not used)

Actual Behavior

gri30.yaml are not consistent, i.e. some have hand-coded entries.

Deprecating gri30_mix is straight-forward (it is replacable by gri30):

$ find . -type f | xargs grep 'gri30_mix'
./samples/cxx/flamespeed/flamespeed.cpp:        IdealGasMix gas("gri30.cti","gri30_mix");
./test_problems/clib_test/output_output.txt:  gri30_mix:
./test_problems/clib_test/output_blessed.txt:  gri30_mix:
./test_problems/clib_test/clib_test.c:    int thermo = thermo_newFromFile("gri30.xml", "gri30_mix");
./test_problems/clib_test/clib_test.c:    int kin = kin_newFromFile("gri30.xml", "gri30_mix", thermo, 0, 0, 0, 0);
./test_problems/mixGasTransport/mixGasTransport.cpp:        IdealGasMix g("gri30.xml", "gri30_mix");
./test_problems/multiGasTransport/multiGasTransport.cpp:        IdealGasMix g("gri30.xml", "gri30_mix");
./test/matlab/TestImport.m:            gas = Solution('gri30.xml', 'gri30_mix');
./test/work/python/gri30.yaml:- name: gri30_mix
./include/cantera/kinetics/importKinetics.h: *        ok =  buildSolutionFromXML(root, "gri30_mix", "phase", th, kin)
./interfaces/matlab/toolbox/GRI30.m:        s = Solution('gri30.xml', 'gri30_mix');
./interfaces/cython/cantera/examples/onedim/flamespeed_sensitivity.py:gas = ct.Solution('gri30.xml', 'gri30_mix')
./interfaces/cython/cantera/examples/onedim/flame_fixed_T.py:gas = ct.Solution('gri30.xml', 'gri30_mix')
./interfaces/cython/cantera/examples/onedim/diffusion_flame.py:gas = ct.Solution('gri30.xml', 'gri30_mix')
./interfaces/cython/cantera/data/gri30_highT.yaml:- name: gri30_mix
./interfaces/cython/cantera/data/gri30_highT.cti:ideal_gas(name = "gri30_mix",
./interfaces/cython/cantera/data/gri30.cti:ideal_gas(name = "gri30_mix",
./data/inputs/gri30_highT.cti:ideal_gas(name = "gri30_mix",
./data/inputs/gri30.cti:ideal_gas(name = "gri30_mix",
[...]

There aren't many instances of gri30_multi:

$ find . -type f | xargs grep 'gri30_multi'
./test/work/python/gri30.yaml:- name: gri30_multi
./interfaces/matlab/toolbox/GRI30.m:        s = Solution('gri30.xml', 'gri30_multi');
./interfaces/cython/cantera/data/gri30_highT.yaml:- name: gri30_multi
./interfaces/cython/cantera/data/gri30_highT.cti:ideal_gas(name = "gri30_multi",
./interfaces/cython/cantera/data/gri30.cti:ideal_gas(name = "gri30_multi",
./data/inputs/gri30_highT.cti:ideal_gas(name = "gri30_multi",
./data/inputs/gri30.cti:ideal_gas(name = "gri30_multi",
[...]

Steps to reproduce

  1. use newest development version (compiled from source)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions