matplotlib

Previous topic

R407F

Next topic

R507A

This Page

R410AΒΆ

View this page as an IPython notebook

In [1]:
# This block does the setup
from IPython.core.display import HTML
from IPython.display import display_html
from CoolProp.Plots.Plots import Ph,Ps
from CoolProp.CoolProp import Props, get_fluid_param_string
import CoolProp.CoolProp as CP
from math import sqrt
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize
%matplotlib inline
labels = {'P' : '$p$', 
          'D' : r'$\rho$', 
          'C' : '$c_p$',
          'O' : '$c_v$', 
          'H' : '$h$',
          'S' : '$s$', 
          'V' : '$\mu$',
          'L' : '$\lambda$'}
sat_labels = labels.copy()
sat_labels['I'] = '$\sigma$'

Fluid = 'R410A'
RPFluid = 'REFPROP-'+get_fluid_param_string(Fluid,'REFPROPName')
Tt = Props(Fluid,'Tmin')
Tc = Props(Fluid,'Tcrit')
rhoc = Props(Fluid,'Tcrit')
T = np.linspace(Tt+0.01,0.99*Tc,20)
h0 = Props('H','T',0.95*Tc,'Q',1,Fluid)
s0 = Props('S','T',0.95*Tc,'Q',1,Fluid)
h0_RP = Props('H','T',0.95*Tc,'Q',1,RPFluid)
s0_RP = Props('S','T',0.95*Tc,'Q',1,RPFluid)

Literature References

In [2]:
from parse_bib import BibTeXerClass
BTC = BibTeXerClass()
    
EOSkey = CP.get_BibTeXKey(Fluid, "EOS")
CP0key = CP.get_BibTeXKey(Fluid, "CP0")
SURFACE_TENSIONkey = CP.get_BibTeXKey(Fluid, "SURFACE_TENSION")
VISCOSITYkey = CP.get_BibTeXKey(Fluid, "VISCOSITY")
CONDUCTIVITYkey = CP.get_BibTeXKey(Fluid, "CONDUCTIVITY")
ECS_LENNARD_JONESkey = CP.get_BibTeXKey(Fluid, "ECS_LENNARD_JONES")
ECS_FITSkey = CP.get_BibTeXKey(Fluid, "ECS_FITS")

BibInfo = ''
if EOSkey:
    BibInfo += '<p><b>Equation of State</b>: ' + BTC.entry2HTML(EOSkey)
if CP0key:
    BibInfo += '<p><b>Ideal-Gas Specific Heat</b>: ' + BTC.entry2HTML(CP0key)
if SURFACE_TENSIONkey:
    BibInfo += '<p><b>Surface Tension</b>: ' + BTC.entry2HTML(SURFACE_TENSIONkey)
if VISCOSITYkey:
    BibInfo += '<p><b>Viscosity</b>: ' + BTC.entry2HTML(VISCOSITYkey)
if CONDUCTIVITYkey:
    BibInfo += '<p><b>Conductivity</b>: ' + BTC.entry2HTML(CONDUCTIVITYkey)
if ECS_LENNARD_JONESkey:
    BibInfo += '<p><b>Lennard-Jones Parameters for ECS</b>: ' + BTC.entry2HTML(ECS_LENNARD_JONESkey)
if ECS_FITSkey:
    BibInfo += '<p><b>ECS Correction Fit</b>: ' + BTC.entry2HTML(ECS_FITSkey)

display_html(HTML(BibInfo))

Equation of State: Lemmon, E.W., 2003, Pseudo-Pure Fluid Equations of State for the Refrigerant Blends R-410A, R-404A, R-507A, and R-407C, Int. J. Thermophys., 24:991-1006

Viscosity: Geller, V., 2000, Viscosity of Mixed Refrigerants R404A, R407C, R410A, and R507A, 2000 International Refrigeration Conferences at Purdue University

Conductivity: Geller, V.Z.; Nemzer, B.Z.; Cheremnykh, U.V., 2001, Thermal Conductivity of the Refrigerant mixtures R404A, R407C, R410A, and R507A, Int. J. Thermophys., 22:1034-1043

Aliases

In [3]:
aliases = get_fluid_param_string(Fluid,'aliases')
if aliases:
    display_html(HTML(', '.join(['"'+alias+'"' for alias in aliases.split(', ')])))
else:
    print '"'+Fluid+'"'
"R410a"

Fluid Constants

In [4]:
params = dict(mm = CP.Props(Fluid,'molemass'),
              Tt = CP.Props(Fluid,'Ttriple'),
              pt = CP.Props(Fluid,'ptriple'),
              Tc = CP.Props(Fluid,'Tcrit'),
              pc = CP.Props(Fluid,'pcrit'),
              rhoc = CP.Props(Fluid,'rhocrit'),
              Tmin = CP.Props(Fluid,'Tmin'),
              CAS = get_fluid_param_string(Fluid,'CAS'),
              ASHRAE = get_fluid_param_string(Fluid,'ASHRAE34')
              )

s = """<table border = "1">
<tr> <th>Parameter</th> <th>Value</th> </tr>
<tr > <td colspan="2"><center>Triple point</center></td> </tr>
<tr> <td>Triple Point Temp. [K]</td> <td>{Tt:0.3f}</td> </tr>
<tr> <td>Triple Point Press. [kPa]</td> <td>{pt:0.10g}</td> </tr>
<tr > <td colspan="2" ><center>Critical point</center></td> </tr>
<tr> <td>Critical Point Temp. [K]</td> <td>{Tc:0.3f}</td> </tr>
<tr> <td>Critical Point Press. [kPa]</td> <td>{pc:0.10g}</td> </tr>
<tr> <td>Critical Point Density. [kPa]</td> <td>{rhoc:0.10g}</td> </tr>
<tr> <td colspan="2"><center>Other Values</center></td> </tr>
<tr> <td>Mole Mass [kg/kmol]</td> <td>{mm:0.5f}</td> </tr>
<tr> <td>Minimum temperature [K]</td> <td>{Tmin:0.3f}</td> </tr>
<tr> <td>CAS number</td> <td>{CAS:s}</td> </tr>
<tr> <td>ASHRAE classification</td> <td>{ASHRAE:s}</td> </tr>
</table>""".format(**params)
HTML(s)
Out[4]:
Parameter Value
Triple point
Triple Point Temp. [K] 200.000
Triple Point Press. [kPa] 29.00978159
Critical point
Critical Point Temp. [K] 344.494
Critical Point Press. [kPa] 4901.2
Critical Point Density. [kPa] 459.0300696
Other Values
Mole Mass [kg/kmol] 72.58540
Minimum temperature [K] 200.000
CAS number R410A.PPF
ASHRAE classification A1

Saturation Property Deviations

In [5]:
fig = plt.figure(figsize=(13,6))
ax1 = fig.add_subplot(121)
ax2 = fig.add_subplot(122)

for ax, Q in zip([ax1,ax2],[0,1]):
    for key, label in sat_labels.iteritems():
        CPval = Props(key, 'T', T, 'Q', Q, Fluid)
        RPval = Props(key, 'T', T, 'Q', Q, RPFluid)
        if key =='H': 
            CPval -= h0
            RPval -= h0_RP
        if key =='S': 
            CPval -= s0
            RPval -= s0_RP
        ax.semilogy(T/Tc, np.abs(CPval/RPval-1)*100, 'o', label=label)
    if Q == 0:
        ax.set_title('Saturated Liquid')
    else:
        ax.set_title('Saturated Vapor')
    ax.set_ylim(1e-18,1000)
    ax.set_xlabel('Reduced temperature T/Tc')
    ax.set_ylabel('Absolute deviation [%]')
    ax.legend(numpoints=1,loc='lower center',ncol = 5)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-03612311a541> in <module>()
      6     for key, label in sat_labels.iteritems():
      7         CPval = Props(key, 'T', T, 'Q', Q, Fluid)
----> 8         RPval = Props(key, 'T', T, 'Q', Q, RPFluid)
      9         if key =='H':
     10             CPval -= h0

C:\Python27\lib\site-packages\CoolProp\CoolProp.pyd in CoolProp.CoolProp.Props (build\temp.win32-2.7\Release\pyrex\CoolProp\CoolProp.cpp:21147)()

C:\Python27\lib\site-packages\CoolProp\CoolProp.pyd in CoolProp.CoolProp.Props (build\temp.win32-2.7\Release\pyrex\CoolProp\CoolProp.cpp:20332)()

ValueError: CoolProp error: [TRNPRP error 40] transport equations are not available for one or more of the fluids :: inputs were:"L",'T',2.0000999999999999e+02,'Q',0.0000000000000000e+00,"REFPROP-R410A"

Along the critical isotherm where \(T=T_c\)

In [6]:
rho = np.linspace(1e-12,1.5*rhoc)

fig = plt.figure(figsize=(6,6))
ax = fig.add_subplot(111)

for key, label in labels.iteritems():
    CPval = Props(key, 'T', Tc, 'D', rho, Fluid)
    RPval = Props(key, 'T', Tc, 'D', rho, RPFluid)
    if key =='H': 
        CPval -= h0
        RPval -= h0_RP
    if key =='S': 
        CPval -= s0
        RPval -= s0_RP
    ax.semilogy(rho/rhoc, np.abs(CPval/RPval-1)*100, 'o', label=label)

ax.set_ylim(1e-18,100)
ax.set_title('Critical isotherm Deviations from REFPROP 9.1')
ax.set_xlabel(r'Reduced density $\rho/\rho_c$')
ax.set_ylabel('Absolute deviation [%]')
ax.legend(numpoints=1,loc='lower center',ncol=4)
plt.show()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-719d680df4f4> in <module>()
      6 for key, label in labels.iteritems():
      7     CPval = Props(key, 'T', Tc, 'D', rho, Fluid)
----> 8     RPval = Props(key, 'T', Tc, 'D', rho, RPFluid)
      9     if key =='H':
     10         CPval -= h0

C:\Python27\lib\site-packages\CoolProp\CoolProp.pyd in CoolProp.CoolProp.Props (build\temp.win32-2.7\Release\pyrex\CoolProp\CoolProp.cpp:21147)()

C:\Python27\lib\site-packages\CoolProp\CoolProp.pyd in CoolProp.CoolProp.Props (build\temp.win32-2.7\Release\pyrex\CoolProp\CoolProp.cpp:19968)()

ValueError: CoolProp error: [TRNPRP error 40] transport equations are not available for one or more of the fluids :: inputs were:"V",'T',3.4449400000000003e+02,'D',9.9999999999999998e-13,"REFPROP-R410A"

Check of p,h and p,s as inputs (X: Failure .: Success)

In [7]:
fig = plt.figure(figsize=(10,5))
ax1 = fig.add_subplot(121)
ax2 = fig.add_subplot(122)

Tmin = Props(Fluid,'Tmin')+3
pmin = Props('P','T',Tmin,'Q',0,Fluid)
pmax = Props(Fluid,'pcrit')*2
hmin = Props('H','T',Tmin,'Q',0,Fluid)
hmax = 2*Props('H','T',Tc-1,'Q',1,Fluid)-hmin
smin = Props('S','T',Tmin,'Q',0,Fluid)
smax = 2*Props('S','T',Tc-1,'Q',1,Fluid)-smin

Ph(Fluid, axis = ax1, Tmin = Tmin, Tmax = Tc-0.01)
Ps(Fluid, axis = ax2, Tmin = Tmin, Tmax = Tc-0.01)

for p in np.linspace(pmin,pmax,10):
    for h in np.linspace(hmin,hmax):
        _bad = False
        try:
            T = Props('T','H',h,'P',p,Fluid)
            rho = Props('D','H',h,'P',p,Fluid)
            hEOS = Props('H','T',T,'D',rho,Fluid)
        except ValueError:
            _bad = True
        if _bad or abs(hEOS/h-1)>1e-6:
            ax1.plot(h,p,'x',ms = 10)
        else:
            ax1.plot(h,p,'k.', ms = 1)

for p in np.linspace(pmin,pmax,10):
    for s in np.linspace(smin,smax):
        _bad = False
        try:
            T = Props('T','S',s,'P',p,Fluid)
            rho = Props('D','S',s,'P',p,Fluid)
            sEOS = Props('S','T',T,'D',rho,Fluid)
        except ValueError:
            _bad = True
        if _bad or abs(sEOS/s-1)>1e-6:
            ax2.plot(s,p,'x',ms = 10)
        else:
            ax2.plot(s,p,'k.', ms = 1)

plt.tight_layout()