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
Should isobaric mixing of two Quantities with different pressures be disallowed/warned about?
Motivation
I might be wrong, but it seems to me that the current implementation of __iadd__ for the Quantity class doesn’t make physical sense if you set your object‘s constants to 'HP' and then try to add (=mix) two objects with different pressures. The resulting pressure will be the mass averaged pressure off the two gases, which doesn't make much sense thermodynamically and causes the overall entropy of the mixture to decrease, violating the 2nd law if we assume a closed system. In any case, I am not sure if „isobaric“ mixing of two quantities with different pressures is a well-defined process in the first place.
Possible Solutions
Maybe implement a check that pressures are the same (within floating point errors)?
The text was updated successfully, but these errors were encountered:
Yes, I agree this should probably disabled. I'm going to transfer this over to the main code repository, as I think it should just be regarded as a bug, and also not that difficult to fix.
Abstract
Should isobaric mixing of two Quantities with different pressures be disallowed/warned about?
Motivation
I might be wrong, but it seems to me that the current implementation of
__iadd__
for theQuantity
class doesn’t make physical sense if you set your object‘s constants to'HP'
and then try to add (=mix) two objects with different pressures. The resulting pressure will be the mass averaged pressure off the two gases, which doesn't make much sense thermodynamically and causes the overall entropy of the mixture to decrease, violating the 2nd law if we assume a closed system. In any case, I am not sure if „isobaric“ mixing of two quantities with different pressures is a well-defined process in the first place.Possible Solutions
Maybe implement a check that pressures are the same (within floating point errors)?
The text was updated successfully, but these errors were encountered: