usnistgov / REFPROP-issues

A repository solely used for reporting issues with NIST REFPROP
26 stars 13 forks source link

Values of quality close to saturated vapor line seems to diverge #573

Open raphaeltimbo opened 1 year ago

raphaeltimbo commented 1 year ago

Description

Values of quality close to saturated vapor line seems to diverge and go to a value near to zero, which would indicate saturated liquid.

Steps to Reproduce

from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary as REFPROPFunctionLibrary
import os

path = os.environ["RPPREFIX"]
RP = REFPROPFunctionLibrary(path)

fluids0 = "METHANE*ETHANE*PROPANE*ISOBUTAN*BUTANE*IPENTANE*PENTANE*HEXANE*HEPTANE*OCTANE*NONANE*DECANE*NITROGEN*CO2"
mole_fractions0 = [
    0.5635,
    0.08679999999999999,
    0.05710000000000004,
    0.009499999999999953,
    0.020100000000000007,
    0.0046000000000000485,
    0.006399999999999961,
    0.0036000000000000476,
    0.0016000000000000458,
    0.00039999999999995595,
    9.999999999998899e-05,
    9.999999999998899e-05,
    0.0042999999999999705,
    0.2419,
]

T_list = [310.50588773145404 + i/100 for i in range(-3, 5)]

for T in T_list:
    r = RP.REFPROPdll(
        fluids0,
        "PT",
        "QMOLE",
        RP.MASS_BASE_SI,
        0,
        0,
        1736576.570380364,
        T,
        mole_fractions0,
    )
    print(f"Temperature: {T}, Quality: {r[7]}")

Prints:

Temperature: 310.47588773145407, Quality: 0.9999957666151602
Temperature: 310.48588773145406, Quality: 0.9999967024852331
Temperature: 310.49588773145405, Quality: 0.9999976373901811
Temperature: 310.50588773145404, Quality: 4.626625371706439e-08
Temperature: 310.51588773145403, Quality: 4.627077321295303e-08
Temperature: 310.525887731454, Quality: 998.0
Temperature: 310.535887731454, Quality: 998.0
Temperature: 310.54588773145406, Quality: 998.0

Expected behavior:

For this temperature range, values should go from close to one directly to 998.0.

Actual behavior:

Values go from close to 1 to close to 0 and then 998.0.

Versions

REFPROP Version: 10.0.0.98 Operating System and Version: Windows 10 Access Method: Python 3.10.8

ianhbell commented 1 year ago

What are bubble and dew temperatures at this pressure?

raphaeltimbo commented 1 year ago

What are bubble and dew temperatures at this pressure?

Here are the calculated values:

for q in [0, 1]:
    r = RP.REFPROPdll(
        fluids0,
        "PQ",
        "T",
        RP.MASS_BASE_SI,
        0,
        0,
        1736576.570380364,
        q, 
        mole_fractions0
    )
    print(f"Quality: {q} Temperature: {r.Output[0]}")
Quality: 0 Temperature: 173.01944258971852
Quality: 1 Temperature: 310.52120487288676
ianhbell commented 1 year ago

So, very much not what I thought might be the case: that the glide was close to zero.

Let's try with the beta. Please email me: ian.bell@nist.gov