Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTSE fails around saturated liquid #622

Closed
delta-pi-1701 opened this issue Apr 26, 2015 · 12 comments
Closed

TTSE fails around saturated liquid #622

delta-pi-1701 opened this issue Apr 26, 2015 · 12 comments
Milestone

Comments

@delta-pi-1701
Copy link

Just did a git pull and build and with reference to, #621

Something like this,

import CoolProp.CoolProp as CPpy
import numpy as np
import CoolProp.constants as CPc

len = 100
st = CPpy.AbstractState('TTSE&HEOS','Water')
h = np.linspace(900e3,1100e3,len)
p = np.linspace(2.8e6,2.9e6,len)


for i in range(1, len):
    st.update(CPc.HmassP_INPUTS, h[i], p[i])
    rho = st.keyed_output(CPc.iDmass)
    t = st.keyed_output(CPc.iT)
    #eta = st.keyed_output(CPc.iviscosity)
    x = st.keyed_output(CPc.iQ)
    if (np.isnan(rho) or np.isinf(rho) or np.isnan(t) or np.isinf(t) or
        np.isnan(x) or np.isinf(x)):
        print('%f %f %f %f %f' % (h[i], p[i], rho, t, x))
    else:
        continue

yields

902020.202020 2801010.101010 852.327019 484.047755 -inf
904040.404040 2802020.202020 851.771352 484.491490 -inf
906060.606061 2803030.303030 851.214734 484.934953 -inf
908080.808081 2804040.404040 850.657163 485.378146 -inf
910101.010101 2805050.505051 850.098641 485.821068 -inf
912121.212121 2806060.606061 849.539167 486.263720 -inf
914141.414141 2807070.707071 848.978740 486.706101 -inf
916161.616162 2808080.808081 848.417363 487.148211 -inf
918181.818182 2809090.909091 847.855033 487.590051 -inf
920202.020202 2810101.010101 847.291751 488.031620 -inf
922222.222222 2811111.111111 846.727387 488.472832 -inf
924242.424242 2812121.212121 846.162193 488.913850 -inf
926262.626263 2813131.313131 845.596023 489.354581 -inf
928282.828283 2814141.414141 845.028878 489.795027 -inf
930303.030303 2815151.515152 844.460757 490.235187 -inf
932323.232323 2816161.616162 843.891662 490.675060 -inf
934343.434343 2817171.717172 843.321591 491.114648 -inf
936363.636364 2818181.818182 842.750545 491.553949 -inf
938383.838384 2819191.919192 842.178524 491.992965 -inf
940404.040404 2820202.020202 841.605528 492.431694 -inf
942424.242424 2821212.121212 841.031556 492.870137 -inf
944444.444444 2822222.222222 840.456609 493.308295 -inf
946464.646465 2823232.323232 839.880539 493.746072 -inf
948484.848485 2824242.424242 839.303621 494.183640 -inf
950505.050505 2825252.525253 838.725701 494.620906 -inf
952525.252525 2826262.626263 838.146779 495.057869 -inf
954545.454545 2827272.727273 837.566856 495.494530 -inf
956565.656566 2828282.828283 836.985931 495.930889 -inf
958585.858586 2829292.929293 836.404005 496.366945 -inf
960606.060606 2830303.030303 835.821077 496.802699 -inf
962626.262626 2831313.131313 835.237148 497.238151 -inf
964646.464646 2832323.232323 834.652217 497.673300 -inf
966666.666667 2833333.333333 834.066284 498.108146 -inf
968686.868687 2834343.434343 833.479184 498.542594 -inf
970707.070707 2835353.535354 832.891242 498.976828 -inf
972727.272727 2836363.636364 832.302269 499.410743 -inf
974747.474747 2837373.737374 831.712265 499.844338 -inf
976767.676768 2838383.838384 831.121230 500.277613 -inf
978787.878788 2839393.939394 830.529163 500.710569 -inf
980808.080808 2840404.040404 829.936066 501.143205 -inf
982828.282828 2841414.141414 829.341937 501.575521 -inf
984848.484848 2842424.242424 828.746776 502.007518 -inf
986868.686869 2843434.343434 828.150585 502.439195 -inf
988888.888889 2844444.444444 827.553363 502.870552 -inf
990909.090909 2845454.545455 826.955109 503.301590 -inf
992929.292929 2846464.646465 nan nan -inf
@delta-pi-1701
Copy link
Author

import CoolProp as CP
print(CP.__version__)
print(CP.__gitrevision__)
5.1.0dev
dfbb05f4c462c77976cdc2a51700ba135bd12752

@jowr
Copy link
Member

jowr commented Apr 26, 2015

Thanks! This saves us from digging into the different revisions ourselves.

@ibell
Copy link
Contributor

ibell commented Apr 26, 2015

I cannot replicate this result with an up-to-date version of CoolProp:

git revision: fff2bd7c6adf9c93b3feb6b8e7871cdf2a73aca1

yields

Loading table: C:\Users\Belli/.CoolProp/Tables/HelmholtzEOSBackend(Water[1.0000000000])/single_phase_logph.bin.z
Loaded table: C:\Users\Belli/.CoolProp/Tables/HelmholtzEOSBackend(Water[1.0000000000])/single_phase_logph.bin.z in 0.25 sec.
Loading table: C:\Users\Belli/.CoolProp/Tables/HelmholtzEOSBackend(Water[1.0000000000])/single_phase_logpT.bin.z
Loaded table: C:\Users\Belli/.CoolProp/Tables/HelmholtzEOSBackend(Water[1.0000000000])/single_phase_logpT.bin.z in 0.184 sec.
Loading table: C:\Users\Belli/.CoolProp/Tables/HelmholtzEOSBackend(Water[1.0000000000])/pure_saturation.bin.z
Loaded table: C:\Users\Belli/.CoolProp/Tables/HelmholtzEOSBackend(Water[1.0000000000])/pure_saturation.bin.z in 0.003 sec.
Loading table: C:\Users\Belli/.CoolProp/Tables/HelmholtzEOSBackend(Water[1.0000000000])/phase_envelope.bin.z
Loaded table: C:\Users\Belli/.CoolProp/Tables/HelmholtzEOSBackend(Water[1.0000000000])/phase_envelope.bin.z in 0.001 sec.
992929.292929 2846464.646465 nan nan -1000.000000

@delta-pi-1701
Copy link
Author

It's still there (git pull just now).....

import CoolProp.CoolProp as CPpy
import CoolProp as CP
import numpy as np
import CoolProp.constants as CPc

print(CP.__version__)
print(CP.__gitrevision__)

len = 1000
st = CPpy.AbstractState('TTSE&HEOS','Water')
h = np.linspace(900e3,1100e3,len)
p = np.linspace(2.8e6,2.9e6,len)


for i in range(1, len):
    st.update(CPc.HmassP_INPUTS, h[i], p[i])
    rho = st.keyed_output(CPc.iDmass)
    t = st.keyed_output(CPc.iT)
    #eta = st.keyed_output(CPc.iviscosity)
    x = st.keyed_output(CPc.iQ)
    if (np.isnan(rho) or np.isinf(rho) or np.isnan(t) or np.isinf(t) or
        np.isnan(x) or np.isinf(x)):
        print('%f %f %f %f %f' % (h[i], p[i], rho, t, x))
    else:
        continue

yields,

5.1.1dev
ba23ccbfd65f119efa26c48521ffd303ef1ec9e9
991491.491491 2845745.745746 nan nan -1000.000000
991691.691692 2845845.845846 nan nan -1000.000000
991891.891892 2845945.945946 nan nan -1000.000000
992092.092092 2846046.046046 nan nan -1000.000000
992292.292292 2846146.146146 nan nan -1000.000000
992492.492492 2846246.246246 nan nan -1000.000000
992692.692693 2846346.346346 nan nan -1000.000000
992892.892893 2846446.446446 nan nan -1000.000000
993093.093093 2846546.546547 nan nan -1000.000000
993293.293293 2846646.646647 nan nan -1000.000000
993493.493493 2846746.746747 nan nan -1000.000000
993693.693694 2846846.846847 nan nan -1000.000000
993893.893894 2846946.946947 nan nan -1000.000000
994094.094094 2847047.047047 nan nan -1000.000000
994294.294294 2847147.147147 nan nan -1000.000000
994494.494494 2847247.247247 nan nan -1000.000000
994694.694695 2847347.347347 nan nan -1000.000000

You may increase the len = 10000 and there's lot of these.

@ibell
Copy link
Contributor

ibell commented Apr 27, 2015

Ah I had missed the bug - it's that T and rho are nan, not that the quality
is -inf. Ok. I'll take a look.

On Mon, Apr 27, 2015 at 8:51 AM, Paul D notifications@github.com wrote:

It's still there (git pull just now).....

import CoolProp.CoolProp as CPpyimport CoolProp as CPimport numpy as npimport CoolProp.constants as CPc
print(CP.version)print(CP.gitrevision)
len = 1000
st = CPpy.AbstractState('TTSE&HEOS','Water')
h = np.linspace(900e3,1100e3,len)
p = np.linspace(2.8e6,2.9e6,len)

for i in range(1, len):
st.update(CPc.HmassP_INPUTS, h[i], p[i])
rho = st.keyed_output(CPc.iDmass)
t = st.keyed_output(CPc.iT)
#eta = st.keyed_output(CPc.iviscosity)
x = st.keyed_output(CPc.iQ)
if (np.isnan(rho) or np.isinf(rho) or np.isnan(t) or np.isinf(t) or
np.isnan(x) or np.isinf(x)):
print('%f %f %f %f %f' % (h[i], p[i], rho, t, x))
else:
continue

yields,

5.1.1dev
ba23ccb
991491.491491 2845745.745746 nan nan -1000.000000
991691.691692 2845845.845846 nan nan -1000.000000
991891.891892 2845945.945946 nan nan -1000.000000
992092.092092 2846046.046046 nan nan -1000.000000
992292.292292 2846146.146146 nan nan -1000.000000
992492.492492 2846246.246246 nan nan -1000.000000
992692.692693 2846346.346346 nan nan -1000.000000
992892.892893 2846446.446446 nan nan -1000.000000
993093.093093 2846546.546547 nan nan -1000.000000
993293.293293 2846646.646647 nan nan -1000.000000
993493.493493 2846746.746747 nan nan -1000.000000
993693.693694 2846846.846847 nan nan -1000.000000
993893.893894 2846946.946947 nan nan -1000.000000
994094.094094 2847047.047047 nan nan -1000.000000
994294.294294 2847147.147147 nan nan -1000.000000
994494.494494 2847247.247247 nan nan -1000.000000
994694.694695 2847347.347347 nan nan -1000.000000

You may increase the len = 1000 and there's lot of these.


Reply to this email directly or view it on GitHub
#622 (comment).

@delta-pi-1701
Copy link
Author

Some problem with viscosity too,

ValueError                                Traceback (most recent call last)
<ipython-input-9-3aa1f94929e1> in <module>()
     18     rho = st.keyed_output(CPc.iDmass)
     19     t = st.keyed_output(CPc.iT)
---> 20     eta = st.keyed_output(CPc.iviscosity)
     21     x = st.keyed_output(CPc.iQ)
     22 

CoolProp/AbstractState.pyx in CoolProp.CoolProp.AbstractState.keyed_output (CoolProp/CoolProp.cpp:10695)()

CoolProp/AbstractState.pyx in CoolProp.CoolProp.AbstractState.keyed_output (CoolProp/CoolProp.cpp:10630)()

ValueError: Cell to TTSEBackend::evaluate_single_phase_transport must have four valid corners for now

@ibell
Copy link
Contributor

ibell commented Apr 28, 2015

What about BICUBIC? TTSE is a bit more fragile for transport properties
for now.

On Mon, Apr 27, 2015 at 10:10 AM, Paul D notifications@github.com wrote:

Some problem with viscosity too,

ValueError Traceback (most recent call last) in ()
18 rho = st.keyed_output(CPc.iDmass)
19 t = st.keyed_output(CPc.iT)---> 20 eta = st.keyed_output(CPc.iviscosity)
21 x = st.keyed_output(CPc.iQ)
22

CoolProp/AbstractState.pyx in CoolProp.CoolProp.AbstractState.keyed_output (CoolProp/CoolProp.cpp:10695)()

CoolProp/AbstractState.pyx in CoolProp.CoolProp.AbstractState.keyed_output (CoolProp/CoolProp.cpp:10630)()
ValueError: Cell to TTSEBackend::evaluate_single_phase_transport must have four valid corners for now


Reply to this email directly or view it on GitHub
#622 (comment).

@ibell
Copy link
Contributor

ibell commented Apr 28, 2015

Works fine with BICUBIC, I see the same behavior with TTSE as you do. Recommend you use BICUBIC.

@ibell
Copy link
Contributor

ibell commented Apr 28, 2015

When you provide PH, please give some information about where on the fluid surface your inputs are.

@ibell ibell changed the title TTSE Water Param bug TTSE fails around saturated liquid Apr 28, 2015
@ibell ibell added this to the v5.1.1 milestone Apr 28, 2015
@ibell ibell closed this as completed in 5aa27d0 Apr 28, 2015
@delta-pi-1701
Copy link
Author

As far PH I/P's being in 1ph or 2ph, I dont want to scrutinize the same. I am trying out a span of i/p which caters the 1ph to 2ph, as it shall be similar in real simulation of large order system.
BICUBIC&HEOS seems ok as of now with water.
But seems problem with D2O.

@ibell
Copy link
Contributor

ibell commented Apr 28, 2015

Sorry what is I/P?

On Tue, Apr 28, 2015 at 8:39 AM, Paul D notifications@github.com wrote:

As far PH I/P's being in 1ph or 2ph, I dont want to scrutinize the same. I
am trying out a span of i/p which caters the 1ph to 2ph, as it shall be
similar in real simulation of large order system.
BICUBIC&HEOS seems ok as of now with water.
But seems problem with D2O.


Reply to this email directly or view it on GitHub
#622 (comment).

@delta-pi-1701
Copy link
Author

Input...(I/P)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants