usnistgov / REFPROP-wrappers

Wrappers around NIST REFPROP for languages such as Python, MATLAB, etc.
190 stars 127 forks source link

-9999990 outputs #375

Closed fuxinniu closed 3 years ago

fuxinniu commented 3 years ago

Hi Ian,

I got the -9999990 outputs. Please correct me what is wrong with the python code..

So appreciate your help.

Frank

import os
import  numpy as np
from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary

RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])
RP.SETPATHdll(os.environ['RPPREFIX'])

p = 300000
h = 400
RefName = "R410A"

SatProp = RP.REFPROPdll(RefName, "P","HLIQ; HVAP", RP.MOLAR_BASE_SI, 0, 0, p, 0, [1])
print(SatProp.Output[0])
GenProp = RP.REFPROPdll(RefName, "PH","T; V; S; CP; CV", RP.MOLAR_BASE_SI, 0, 0, p, h, [1])
print(GenProp.Output[0])
ianhbell commented 3 years ago

Make sure you check ierr and herr (always!). You should not hardcode enthalpy values, rather you should always obtain it from properties that don't have reference states in them (T, p, rho, etc.)