chmarti1 / PYroMat

PYroMat thermodynamic properties in Python
http://pyromat.org
Other
71 stars 13 forks source link

Inverse routines do not convert units #64

Closed chmarti1 closed 1 year ago

chmarti1 commented 1 year ago

In version 2.2.2, the inverse routines like T_h, T_s, and p_s do not convert the units of the results. They always return their results in the native units of the model. For temperature, that is always Kelvin, but for pressure it could be bar or Pa. This is a bug and not the documented behavior.

The Problem As of version 2.2.0, the inverse methods are simply wrapper functions around the new argument parsing system. They are deprecated in favor of calling property methods directly (e.g. T(s=s, p=p) instead of T_s(s=s, p=p)). We've had a couple of bumps (see issue #52) caused by implementing these wrappers without sufficient caution for the number of ways they can break.

The Fix There is already a plan to release version 2.2.3, in which this issue will be addressed, but users can address the issue right away by transitioning to the new property interface in favor of the old inverse routines. The new argument parsing system will accept combinations of entropy, enthalpy, density, specific volume, temperature, pressure, and quality.

chmarti1 commented 1 year ago

This issue is now addressed in version 2.2.4. The call signatures have also reverted to be identical to their appearances in version 2.1.10 to prevent any more issues like issue #52.