5.2 Piston-cylinder: Carbon dioxide#

Problem statement:#

Consider carbon-dioxide stored in a cylinder-and-piston system at \(1\:MPa\) and \(0 ^{\circ} C\) with a volume of \(1\:m^3\). The piston is free to move keeping the pressure of carbon-dioxide constant. The system is then heated to \(25 ^{\circ} C\). Using CoolProp as a tool, determine:

a)the mass of carbon-dioxide

b)heat required to do so

c)the required heat if the weight of the 500g aluminum piston and cylinder are to be considered

d)the required heat in (b) if \(C_p\) is to be used to calculate \(\Delta h\) instead of CoolProp? what assumptions are made in this case?

Solution Approach for a)#

the two knowns to extract thermodynamic properties are

\(P_1=1\:MPa\)

\(T_1=0 ^{\circ} C\)

to calculate mass, density is to be extracted

\(m=D_1V_1\)

#importing the required library
import CoolProp.CoolProp as CP

#define state variables
V_1 = 1 #ninitial volume in m3
P_1 = 1e+6 #initial pressure in Pa
T_1 = 0 + 273.15 #initial temperature in K
D_1 = CP.PropsSI('D', 'P', P_1, 'T', T_1, 'CO2') #calculating density using coolprop kg/m3
m_co2 = D_1 * V_1 #mass of carbon-dioxide in kg
print('The mass of carbon-dioxide is',f"{m_co2:.1f}",'kg')
The mass of carbon-dioxide is 20.8 kg

Solution Approach for b)#

based on the first law,

\(Q=\Delta U + W=\Delta H=m(h_2-h_1)\)

#define state variable
T_2 = 25 + 273.15 #secondary temperature in K
P_2 = P_1 #constant pressure process
#extracting enthalpy
h_1 = CP.PropsSI('H', 'P', P_1, 'T', T_1, 'CO2') #initial enthalpy in J/kg
h_2 = CP.PropsSI('H', 'P', P_2, 'T', T_2, 'CO2') #secondary enthalpy in J/kg
Q = m_co2 * (h_2-h_1) / 1000 #heat required in KJ
print('The required heat for this process is',f"{Q:.1f}",'kJ')
The required heat for this process is 481.1 kJ

Solution Approach for c)#

for solids and liquids

\(\Delta u=\Delta h=C_p\Delta T\)

#define constants
m_alm = 0.5 #mass of aluminum in kg
C_p_alm = 0.897 #C_p of aluminum in kJ/kg.K
Q_alm = m_alm * C_p_alm * (T_2-T_1)
Q_total = Q_alm + Q #total heat required for the process
print('The required total heat for this process is',f"{Q_total:.1f}",'kJ')
The required total heat for this process is 492.4 kJ

Solution Approach for d)#

in order to use \(C_p\) to calculate \(\Delta h\), carbon-dioxide is assumed to be ideal gas; then from the first law,

\(Q=\Delta U + W=\Delta H=mC_p\Delta T\)

#define constants
C_p_co2 = 0.846 #Cp of CO2 in kJ/kg.K
Q = m_co2 * C_p_co2 * (T_2-T_1)
print('The required heat for this process using Cp assumption is',f"{Q:.1f}",'kJ')
The required heat for this process using Cp assumption is 440.7 kJ