usnistgov / REFPROP-wrappers

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

Mismatch for hvap between Excel Add-In and REFPROP Standalone #373

Closed jpmuncks-cfs closed 3 years ago

jpmuncks-cfs commented 3 years ago

Description

I am getting a mismatch for the heat of vaporization of saturated LN2 in English units between the Excel Add-In and the standalone REFPROP application (for version REFPROP 10)

Steps to Reproduce

Excel steps

  1. Open any Excel sheet with the REFPROP 10 Add-In set up
  2. In a cell, enter formula " =REFPROP("hvap","Nitrogen","PQ","E",14.7,0) "
  3. Record the resultant value
  4. Optional steps for secondary check: In a cell, enter formula " =REFPROP("hvap","Nitrogen","PT","E",14.7,-320.42)"
  5. Record the resultant value

REFPROP application steps

  1. Enter the standalone REFPROP application
  2. In "Options --> Units", click the "English" button in the "Reset Units" region. Click "OK".
  3. In "Options --> Properties", toggle "Quality" and "Heat of Vapor.". Click "OK".
  4. Open "Calculate --> Specified State Points"
  5. Enter 14.7 in the Pressure (psia) and 0 in Quality (lbm/lbm). Press Enter
  6. Record the value of Heat of Vapor. (Btu/lbm)

Expected behavior: I expect the heat of vaporization to be around 86 BTU/lbm, and for the REFPROP Application and the Excel Add-In to both produce similar values that are around 86.

Actual behavior: On my machine, the REFPROP application returns 85.686, while the Excel Add-in returns 33.1948 (when using the PQ as an input).

Versions

REFPROP Version: 10.0 Operating System and Version: Windows 10 Pro (version 10.0.19041 Build 19041) Access Method: Excel Add-In and standalone REFPROP application

Additional Information

REFPROP Application results (I checked a lot of other values to see if it was just hvap that was mismatching) image (17)

Excel Add-In results image (18)

EricLemmon commented 3 years ago

I remember quite well three years ago a quandary that we stumbled upon when we realized that the term "hvap" could refer to the heat of vaporization or the vapor enthalpy of a saturated state. When calculating a two phase state, adding the letters "liq" or "vap" to a property will return the liquid or vapor saturated value. Thus you could send an input command of PQ with Q=1 for the vapor state and request the liquid enthalpy with the string "hliq". For a mixture, you could request properties at a T,P state that is between the saturation values, and then receive back the liquid and vapor enthalpies with "hliq,hvap". To resolve the quandary, we picked "HEATVAPZ" as the input string for the heat of vaporization. I was never happy about having to do this, but did not have a better solution.

The 33.1966 value you obtained is the enthalpy of the vapor at 14.7 psia. With HEATVAPZ it will return 85.6864.

jpmuncks-cfs commented 3 years ago

Ahh, OK, I understand the quandary and the explanation. That's a tough one but I can't think of a better solution, either. Thank you for the feedback.

I can confirm that using "HEATVAPZ" does indeed return the correct value on my Excel Add-In, so that resolves my ticket.