usnistgov / REFPROP-wrappers

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

Enthalpies do not match. #507

Closed MinoB34 closed 1 year ago

MinoB34 commented 1 year ago
SI_WITH_C  = RP.GETENUMdll(0, "SI WITH C").iEnum
T = -50.0
P =  0.1
r = RP.REFPROPdll('R410A.MIX', "TP", "H", SI_WITH_C, 0, 0, T, P,[1.0])
# r = RP.REFPROPdll('R32*R125', "TP", "H", SI_WITH_C, 0, 0, T, P,[0.697614699375863,0.302385300624138])
print(T,P,r.Output[0])

Hello First of all, I'm almost a newbie and looking for help. As an overview, I am trying to calculate the specific enthalpy of R410A from temperature and pressure using Python.

I put the necessary data in the same directory as the code, so it works, but there is a problem. The results calculated by REFPROP.exe and Excel will differ from the results read by this code.

I expect enthalpy would be 400.47 kJ/kg (this matches REFPROP .exe and Excel) but the result was 497.976965536478 kJ/kg I tried the other T or P but the results were slightly different from what I expected.

Versions

REFPROP Version: 10 Operating System and Version: Win10
Access Method: Python

Additional Information

The code I'm actually using outputs the temperature and pressure enthalpies in a table, but an error occurred when I called R410A.MIX in succession, so I specified a mixed refrigerant as in the commented-out part. I tried many things but didn't get the expected result. Such as

I have a PC at work with REFPROP installed, and I'm asking questions from my home PC. I apologize for any inconsistencies in the code.

ianhbell commented 1 year ago

Our most popular FAQ. Please see : https://pages.nist.gov/REFPROP-docs/#reference-states-enthalpy-and-entropy-differences

MinoB34 commented 1 year ago

Thanks for your information. I'll try it.

MinoB34 commented 1 year ago

I tried RP.REFPROPdll("","Flags","SETREF", 0,0,2,0,0,[0.0]) or RP.SETREFdll("",2,[0.697614699375863,0.302385300624138],0,0,0,0) and these were working

It was difficult for me as an ignorant person, but I learned a lot. thank you