jjgomera/iapws

IAPWS97 : Computation of Gamma

Closed this issue · 2 comments

Hi Juan José,

I think there is a problem in the computation of gamma in your IAPWS97 library. I notice a factor 1000 between your IAPWS97 and IAPWS95 gamma values.
fase.gamma = -self.v/self.P/1000*self.derivative("P", "v", "s", fase)
should be :
fase.gamma = -self.v/self.P*self.derivative("P", "v", "s", fase)
You can also compute gamma as well if you do not want to use derivatives:
fase.gamma = 1.e-6*self.w**2/self.P/self.v (if P is in MPa)
I use this last expression in my C code and the results are close to RefProp and IAPWS95 results.
Regards.

Hi Juan José, The first correction I proposed (the suppression of the division /1000) don't gives exactly the good results. They are better but not good anyway. The second solution is correct. Perhaps there is an error in the computation of derivatives.
I will investigate more other and give you news soon.
Regards.

Hi,
Excuse me for the late response, no internet conexion in paradise.

First: Your right, the 1000 factor is clear, a bug.
Second: The definition of gamma isn't correct, has the missing cp/cv factor, with this expression:
fase.gamma = -fase.cp_cv*fase.v/self.P*self.derivative("P", "v", "s", fase)

This expression give quasi identical values to your expression with sound speed.

Thanks for find so elusive bug.
Please, check with the last commit code to close issue.