Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
581 stars 342 forks source link

Python solution object query of binary_diff_coeffs returns full list of coefficients #1673

Closed wandadars closed 3 months ago

wandadars commented 3 months ago

I'm not sure if this is actually a bug, but I was using the Python interface and looping over the species in the mechanism and printing the transport properties when I ran into an unexpected behavior regarding the binary diffusion coefficients..

Minimal Example:

import cantera as ct gas = ct.Solution('h2o2.yaml') gas.TP = 300, 1 gas['H2'].binary_diff_coeffs

If I understand correctly, the specific transport properties of a species in the mechanism can be queried by providing a species name to the object like gas['H2'].viscosity. This would be the pure fluid viscosity of the H2 species. I had expected a similar call to gas['H2'].binary_diff_coeffs to return a list of 10 entries, representing the binary diffusion coefficients for species H2 into the rest of the species in the mechanism. What got returned by the call was the full 10x10 list of lists representing the binary diffusion coefficients for all species into all other species.

System information

wandadars commented 3 months ago

I was wrong. That is not how the solution object works at all. I should have been providing an X for a TPX query and setting single species one-at-a-time to get properties for those species.