jjgomera / iapws

python libray for IAPWS standard calculation of water and steam properties
GNU General Public License v3.0
170 stars 64 forks source link

AttributeError: 'IAPWS97' object has no attribute 'nu' #21

Closed dsysoev closed 6 years ago

dsysoev commented 8 years ago

I have a AttributeError in wet region of HS diagram.

import iapws
s = iapws.IAPWS97(P=0.1, h=2600.)
s.nu

AttributeError: 'IAPWS97' object has no attribute 'nu'

Why IAPWS97 does not calculate nu value?

jjgomera commented 8 years ago

Hi, Because that state is in two phases region, it's defined for both phases but are undefined for global state:

In [1]: import iapws In [2]: s = iapws.IAPWS97(P=0.1, h=2600) In [3]: s.x Out[3]: 0.9667999095971522 In [4]: s.Liquid.nu, s.Vapor.nu Out[4]: (2.949538851800334e-07, 2.0698362356268167e-05)

Is it better define these properties as None than raise an AttributeError?

dsysoev commented 8 years ago

Perhaps there is a way to calculate the viscosity of 2 x phase mixtures?

jjgomera commented 8 years ago

Hi, There are methods for two phase flow, but they are not generally accepted, as I know it. The normal use I understand is specific by phase, use of liquid or vapor value as is necessary. it's like specific heat, exist two phase values for very specific uses. If you want, I can add a two phases value, but I need you give me the referente to the paper to implement it. Cheers