-
-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of transport_model="None" #1131
Comments
A secondary observation is the following:
Here, the expectation would be to see
|
I'm not sure I agree that this is unexpected. Depending on your definition of "input", you might expect it to remain |
Based on the docstring, it is unexpected, as it refers to the current state 😉 cantera/interfaces/cython/cantera/base.pyx Lines 230 to 235 in 0d7373f
The way it is currently implemented, this isn't meant to guarantee round-trip conversion. The method name is probably a bit ambiguous, as discussed in #984 (and documented in #1053). |
Ha! Fair enough 😄 I thought we had discussed this before, I just couldn't remember where. Thanks for the links! |
Problem description
In the current implementation, specifying a transport model of
"None"
(C++) orNone
(Python) prevents the instantiation of a transport manager object, with various internal pointers being set toNULL
. At least in Python, there is a band-aid in place to make handling safe (using anewDefaultTransportMgr
), but this sometimes fails - see example below. Also, it is not ideal to displaytransport_model = ‘Transport’
, where the meaning is not clear to a user.A safer implementation would use an empty Transport object (similar to a
Kinetics
object with zero reactions added). ASolution
object with noTransport
created in C++ is unsafe as it containsNULL
as theTransport
reference.Steps to reproduce
The following should create equivalent objects (using
mock_ion.xml
, which does not include reactions):Behavior
While the former will prevent
Kinetics
andTransport
methods from being called, the second command should result in an equivalent object with appropriate error handling if a user attempts to access transport properties.System information
Other thoughts
Solution.h
, there was no central object managingTransport
(making this less of an issue)KineticsFactory
does include an empty object, but there is no obvious way to reach itThe text was updated successfully, but these errors were encountered: