You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I stumbled across this while using cantera, if my analysis is correct, the problem is fairly straightforward. See https://github.com/Cantera/cantera/blob/main/interfaces/cython/cantera/composite.py#L314 . Note that quantities are fetched from the underlying phase without checking that a mass basis is used - but they're always multiplied by the mass, even though the basis may have been set to molar.
speth
added a commit
to speth/cantera
that referenced
this issue
Jun 29, 2023
Problem description
Quantity addition in Python is incorrect when molar basis is used.
Steps to reproduce
Create two quantities and set their basis to
'molar'
before adding them. See script below.Behavior
Enthalpy is not conserved even when both Quantities are set to
constant='HP'
. The resulting Quantity is different than if basis is kept as mass.System information
Attachments
In contrast, when not setting to molar basis, everything works fine:
The text was updated successfully, but these errors were encountered: