3.7: Validating Ideal Gas Assumption#
Consider \(1\:kg\) superheated steam at a temperature of \(T=200^\circ C\) and a pressure of \(P=50\:kPa\). Calculate the volume of steam at this state based on:
a) ideal gas assumption
b) thermodynamic tables using CoolProp
c) calculate the error percentage
d) Now consider pressurizing steam at the same temperature to a point close to saturation where the pressure is \(P=1.5\:MPa\). Calculate the error percentage for voulme based on the comparison between ideal gas assumption and using thermodynamic tables from CoolProp
Solution Approach for a)#
based on ideal gas assumption,
\(PV_a=mRT\)
so,
\(V_a=mRT/P\)
#define variables
P = 50E+3 #pressure in Pa
m = 1 #mass in kg
T = 200 + 273.15 #temperature in K
R = 461.5 #steam gas constant in J/kg.K
V_a = m * R * T / P #volume in m3
print('The calculated volume based on ideal gas assumption is:', f"{V_a:.1f}", 'm3')
The calculated volume based on ideal gas assumption is: 4.4 m3
Solution Approach for b)#
Density is used to calculate volume since its an standard output for CoolProp. Then,
\(D=m/V_b\)
so
\(V_b=m/D\)
# import the libraries we'll need
import CoolProp.CoolProp as CP
fluid = "water" # define the fluid or material of interest
D = CP.PropsSI("D", "T", T, "P", P , fluid) #fluid density in kg/m3
V_b = m / D #volume in m3
print('The volume based on thermodynamic tables from CoolProp is:', f"{V_b:.1f}", 'm3')
The volume based on thermodynamic tables from CoolProp is: 4.4 m3
Solution Approach for c)#
Since the value obtained from thermodynamic tables is an experimental value, it is used as a reference to calculate error percentage
\(E=100\times (|V_a-V_b|)/V_b\)
# import the libraries we'll need
import numpy as np
E = 100 * np.absolute(V_a-V_b)/V_b
print('The error percentage is:', f"{E:.3f}", '%')
The error percentage is: 0.253 %
Solution Approach for d)#
the same path is followed for a pressure of \(P=1.5\:MPa\).
P = 1.5E+6 #pressure in Pa
V_a = m * R * T / P #volume based on ideal gas assumption in m3
D = CP.PropsSI("D", "T", T, "P", P , fluid) #fluid density in kg/m3
V_b = m / D #volume based on thermodynamic tables in m3
E = 100 * np.absolute(V_a-V_b)/V_b
print('The error percentage for a higher pressure is:', f"{E:.3f}", '%')
The error percentage for a higher pressure is: 9.905 %