Showing posts with label steam. Show all posts
Showing posts with label steam. Show all posts

Steam properties library

The steam properties library is one of the most important tools used by energy engineers. In the past, we used to refer to Steam tables books, but now there are tools available for multiple platforms, including Windows programs and Excel addins.

IAPWS?


The steam property library expresses actual experimental property results in a regression equation. Standardization is managed by the IAPWS organization (http://www.iapws.org). In Python, Among the many Python packages that follow the IAPWS formula, recommend pyXSteam (https://pypi.org/project/pyXSteam).

Use of pyXSteam


pyXSteam provides (mostly) accurate steam and water properties from 0 ~ 1000 bar and from 0 ~ 2000 °C according to the IAPWS release IF-97. Also includes thermal conductivity and viscosity, which are not part of the IF97 release.
There are no requirements for installing pyXSteam with Python 3.6 and up.
When installing the pyXSteam package on a Windows computer, if Python is already installed and you type "pip install pyXSteam" in the command line window, it will be installed immediately if you are connected to the Internet. The steam properties provided by pyXSteam are as follows.

Property Description
t Temperature (°C or °F)
p Pressure (bar or psi)
h Enthalpy (kJ/kg or btu/lb)
v Specific volume (m3/kg or ft^3/lb)
rho Density (kg/m3 or lb/ft^3)
s Specific entropy (kJ/(kg °C) or btu/(lb °F))
u Specific internal energy (kJ/kg or btu/lb)
Cp Specific isobaric heat capacity (kJ/(kg °C) or btu/(lb °F))
Cv Specific isochoric heat capacity (kJ/(kg °C) or btu/(lb °F))
w Speed of sound (m/s or ft/s)
my Viscosity (N s/m^2 or lbm/ft/hr)
tc Thermal Conductivity (W/(m °C) or btu/(h ft °F))
st Surface Tension (N/m or lb/ft)
x Vapor fraction
vx Vapor Volume Fraction

The unit group supports 3 groups as shown below. Please select one of the three.
steamTable = XSteam(XSteam.UNIT_SYSTEM_MKS) # m/kg/sec/°C/bar/W
steamTable = XSteam(XSteam.UNIT_SYSTEM_FLS) # ft/lb/sec/°F/psi/btu
steamTable = XSteam(XSteam.UNIT_SYSTEM_BARE) # m/kg/sec/K/MPa/W


Python code

Please see below for an example of calculating steam properties using pyXSteam.

from pyXSteam.XSteam import XSteam

steamTable = XSteam(XSteam.UNIT_SYSTEM_FLS) # ft/lb/sec/°F/psi/btu

psat = steamTable.psat_t(337)
print("psat : saturation pressure of steam T = 337 degF = ", psat - 14.696, " psig")

tsat = steamTable.tsat_p(100+14.696)
print("tsat : saturation temperature of steam P = 100 psig = ", tsat, " degF")

h_pt = steamTable.h_pt(100+14.696, 400)
print("h_pt : enthalpy a of steam P = 100 psig and T = 400 degF = ", h_pt, " btu/lb")

h_ps = steamTable.h_ps(100+14.696, 1.635)
print("h_ps : enthalpy a of steam P = 100 psig and S = 1.635 btu/lb-F = ", h_ps, " btu/lb")

s_pt = steamTable.s_pt(100+14.696, 400)
print("s_pt : entropy a of steam P = 100 psig and T = 400 degF = ", s_pt, " btu/lb-F")

s_ph = steamTable.s_ph(100+14.696, 1225)
print("s_ph : entropy a of steam P = 100 psig and H = 1225 btu/lb = ", s_ph, " btu/lb-F")

rho_pt = steamTable.rho_pt(100+14.696, 400)
print("rho_pt : density a of steam P = 100 psig and T = 400 degF = ", rho_pt, " lb/ft3")

Cp_pt = steamTable.Cp_pt(100+14.696, 400)
print("Cp_pt : Specific isobaric heat capacity a of steam P = 100 psig and T = 400 degF = ", Cp_pt, " btu/lb-F")

Cv_pt = steamTable.Cv_pt(100+14.696, 400)
print("Cv_pt : Specific isochoric heat capacity a of steam P = 100 psig and T = 400 degF = ", Cv_pt, " btu/lb-F")

When run the code, you get the results below.

psat : saturation pressure of steam T = 337 degF =  98.647  psig
tsat : saturation temperature of steam P = 100 psig =  337.882  degF
h_pt : enthalpy a of steam P = 100 psig and T = 400 degF =  1225.473  btu/lb
h_ps : enthalpy a of steam P = 100 psig and S = 1.635 btu/lb-F =  1225.517  btu/lb
s_pt : entropy a of steam P = 100 psig and T = 400 degF =  1.635  btu/lb-F
s_ph : entropy a of steam P = 100 psig and H = 1225 btu/lb =  1.634  btu/lb-F
rho_pt : density a of steam P = 100 psig and T = 400 degF =  0.234  lb/ft3
Cp_pt : Specific isobaric heat capacity a of steam P = 100 psig and T = 400 degF =  0.544  btu/lb-F
Cv_pt : Specific isochoric heat capacity a of steam P = 100 psig and T = 400 degF =  0.399  btu/lb-F

Isentropic efficiency of steam turbine

In thermodynamics, an isentropic process is an ideal thermodynamic process that is adiabatic and reversible. In this system, the transfer of work is friction less and there is no net transfer of heat or mass. 

Formula of Isentropic efficiency of steam turbine


The isentropic efficiency is the ratio of actual power to the isentropic power and this isentropic efficiency of a steam turbine can be calculated using the following formula:

η = (hi - ho) / (hi - hos)

Here,
hi     : enthalpy of the steam at the inlet of the turbine (btu/lb) 
ho    : enthalpy of the steam at the outlet of the turbine (btu/lb)
hos   : isentropic enthalpy of the steam at the outlet of the turbine (btu/lb)

Python code


The following is a Python example that calculates the isentropic efficiency of a steam turbine when superheated steam at 600 psig, 700 degF operates the turbine and is extracted at 60 psig, 350 degF.

from pyXSteam.XSteam import XSteam

steamTable = XSteam(XSteam.UNIT_SYSTEM_FLS) # ft/lb/sec/°F/psi/btu

def isentropicefficiency(Pi, Ti, Po, To):
    hi = steamTable.h_pt(Pi+14.696, Ti)
    ho = steamTable.h_pt(Po+14.696, To)
    si = steamTable.s_ph(Pi+14.696, hi)
    hos= steamTable.h_ps(Po+14.696, si)
    
    return (hi - ho) / (hi - hos) * 100

# from 600 psig + 700 degF to 60 psig + 350 degF

When run the code, you get the results below.

hi : enthalpy of steam Pi, Ti (btu/lb) = 1350.1
si : entropy  of steam Pi, Ti (btu/lb-F) = 1.584
ho : enthalpy of steam Po, To (btu/lb) = 1205.5
so : entropy  of steam Po, To (btu/lb-F) = 1.657
hos : isentropic enthalpy of steam Po, si (btu/lb) = 1149.6
isentropicefficiency = (1350.1 - 1205.5) / (1350.1 - 1149.6) * 100 = 71.1
isentropicefficiency = 72.1


print("isentropicefficiency = ", isentropicefficiency(600, 700, 60, 350))