Skip to content

Selecting None as transport_model for a 1D flame gives no error but selects default #1680

@Naikless

Description

@Naikless

Problem description

When setting the transport_model property of a FlameBase or derived object to None, the underlying Phase object's default transport model is selected without any information about what happened. This seems undesirable, because the user might get the impression they disabled transport, even though this is not the case. In contrast, providing a phase without transport model to the FlameBase constructor gives an error.

Steps to reproduce

import cantera as ct

gas = ct.Solution('h2o2.yaml')
gas.TPX = 300, ct.one_atm, 'H2:1.1, O2:1, AR:5'
f = ct.FreeFlame(gas, width=0.03)
f.transport_model = None
f.transport_model
>>> 'mixture-averaged'

whereas

gas = ct.Solution('h2o2.yaml', transport_model=None)
f = ct.FreeFlame(gas, width=0.03)
>>> CanteraError: 
*******************************************************************************
CanteraError thrown by StFlow::StFlow:
An appropriate transport model
should be set when instantiating the Solution ('gas') object.
*******************************************************************************

Behavior

I suppose, at the moment, an error should be triggered or at least a warning that the default model was selected instead.

Curious question though: Would it even be possible to deactivate transport for the one-dimensional solvers? Of course this doesn't make much sense physically in most cases, because diffusion is basically the underlying process for all these flames. But for educational purposes or if you want to compare with purely convectional models, I could see some potential application.

Lastly, if the selection of a transport model is mandatory, this should probably also be reflected in the documentation of the transport_model property, with ideally a list of the available options.

System information

  • Cantera version: 3.0
  • OS: Windows 10
  • Python/MATLAB/other software versions: Python 3.11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions