ME 200 – Thermodynamics I – Spring 2020

Homework 19: Transient Open Systems

Part (i): Evacuated tank in a room

Part (ii): R-134a tank in a room

Part(i): Evacuated tank in a room

Given

A tank with an internal volume of $0.75 m^3$ is intially evacuated and sits in a room with air at $1 bar$ and $25°C$. The tank begins to leak until the pressure inside the tank is $1 bar$. The temperature is constant.

In [10]:
#Given Inputs:
V_tank = 0.75      # volume of the tank[m^3]
T_2 = 25 + 273.15  # final temperature of air in the tank [K]
P_2 = 100          # final pressure of air in the tank [kPa]
T_in = 25 + 273.15 # temperature of air entering the tank [K]

Find:

Determine the heat transfer for the process in kJ.

System Diagram:

Assumptions:

1) air enters tank at the room condition, 2) negligible potential and kinetic energy changes, 3) rigid container (no work), 4) air is an ideal gas

Basic Equations:

$$\dfrac{dm}{dt}=\Sigma \dot m_{in}-\Sigma \dot m_{out}$$$$\dfrac{dE}{dt} = \dot Q- \dot W + \displaystyle\sum_{in} \dot m_{in} (h+ke+pe)_{in}-\displaystyle\sum_{out} \dot m_{out}(h+ke+pe)_{out}$$$$Pv=RT, du=c_vdT, dh=c_pdT$$

Solution:

First consider conservation of mass applied to the air in the tank for this single inlet system.

$$\dfrac{dm}{dt} = \dot m_{in}$$

This differential equation can be rearranged and integrated to determine the total mass entering the tank ($m_{in})$ in terms of the difference between the final ($m_2$) and initial tank mass ($m_1$)

$$m_{in} = \int\limits_{t_1}^{t_2}{\dot m_{in}dt} = \int\limits_{m_1}^{m_2}{dm}$$

or

$$m_{in} = m_2 - m_1$$

The tank is initially evacuated such that $m_1=0$ and t$m_2$ can be determined from the ideal gas equation using the final conditions as

$$m_2 = \dfrac{P_2V_{tank}}{RT_2}$$

where R is the specific gas constant of air ($R=\dfrac{\bar R}{M}=0.287kJ/kg-K$)

In [11]:
R = 0.287                  # gas constant for air [kJ/kg-K]
m_1 = 0                    # initial mass of air in tank [kg]
m_2 = P_2*V_tank/R/T_2     # final mass of air in tank [kg]
m_in = m_2 - m_1           # mass of air added [kg]

print('m_2 = ',round(m_2,2),'kg')
print('m_in = ',round(m_in,2),'kg')
m_2 =  0.88 kg
m_in =  0.88 kg

Now consider conservation of energy applied to the air in this rigid tank having a single inlet, no work ($W=0$), and negligible kinetic and potential energy changes

$$\dfrac{dU}{dt} = \dot Q + \dot m_{in}h_{in}$$

The inlet air condition does not change with time. Thus, the energy balance can be rearranged and integrated to give

$$U_2-U_1 = \int\limits_{U_1}^{U_2}{dU} = \int\limits_{t_1}^{t_2}{\dot Qdt}+h_{in}\int\limits_{t_1}^{t_2}{\dot m_{in}dt}$$

or

$$m_2u_2-m_1u_1 = Q_{12} + m_{in}h_{in}$$

The tank is intially evacuated {$m_1=0 kg, m_{in}=m_2$) and so

$$Q_{12} = m_2(u_2 - h_{in})$$

The values for enthalpy and internal energy can be taken from the ideal gas table for air at 25°C.

In [12]:
h_in = 298.25         # enthalpy of air at 25C entering the tank [kJ/kg]
u_2 = 212.77          # internal energy of air at 25C [kJ/kg]

Q_12 = m_2*(u_2 - h_in)

print('Q_12 = ',round(Q_12,1),'kJ')
Q_12 =  -74.9 kJ

Note that -75 kJ is an acceptable solution. Consider that $h_{in} = u_{in}+P_{in}v_{in}=u_{in}+RT_{in}$, $T_2=T_{in}$, and $u_2=u_{in}$ so that

$$Q_{12}=-m_2RT_{in}$$

This alternative solution does not require interpolation in the ideal gas tables and gives a more accurate result.

In [13]:
Q_12_alt = -m_2*R*T_in

print('Q_12_alt = ',round(Q_12_alt,1),'kJ')
Q_12_alt =  -75.0 kJ

Part(ii): R-134a tank in a room

Given:

A 5-gallon tank of two-phase R134a is intially at $20°C$ and starts to leak at the top. Intially there is 90% liquid by mass and the process continues until no liquid is left. The process is isothermal.

In [14]:
#Given Inputs:
T_1 = 293.15      # intial temperature of the R134a [K]
x_1 = 0.1         # initial quality of the R134a
V_tank = 0.0189   # volume of the tank filled with R134a[m^3]
T_2 = T_1         # final temperature of the R134a [K]

Find:

Determine the heat transfer in kJ.

System Diagram:

Assumptions:

1) quasi-equilibrium process, 2) R-134a exits tank as a saturated vapor, 3) negligible changes in potential and kinetic energy, 4) rigid container (no work)

Basic Equation:

$$\dfrac{dm}{dt}=\Sigma \dot m_{in}-\Sigma \dot m_{out}$$$$\dfrac{dE}{dt} = \dot Q- \dot W + \displaystyle\sum_{in} \dot m_{in} (h+ke+pe)_{in}-\displaystyle\sum_{out} \dot m_{out}(h+ke+pe)_{out}$$$$z_{mix}=xz_g+(1-x)z_f$$

Solution:

Conservation of mass applied to the R134a in the tank results in

$$\dfrac{dm}{dt} = -\dot m_{out}$$

This differential equation can be rearranged and integrated to determine the total mass leaving the tank ($m_{out})$ as

$$m_{out} = \int\limits_{t_1}^{t_2}{\dot m_{out}dt} = -\int\limits_{m_1}^{m_2}{dm}$$

or

$$m_{out} = m_1 - m_2 = V_{tank}\left( \dfrac{1}{v_1} - \dfrac{1}{v_2} \right)$$

The initial state 1 has a quality of 0.1 at a temperature of 20°C and a final quality of 1.0 (saturated vapor) at the same temperature of 20°C.

In [15]:
from CoolProp.CoolProp import PropsSI
v_f_1 = 1./PropsSI('D','T',T_1,'Q',0.0,'R134a')   # saturated liquid specific volume of R134a at state 1 [m^3/kg]
v_g_1 = 1./PropsSI('D','T',T_1,'Q',1.0,'R134a')   # saturated vapor specific volume of R134a at state 1 [m^3/kg]
v_1 = v_f_1 + x_1*(v_g_1 - v_f_1)                 # specific volume of R134a at state 1 [m^3/kg]

v_2 = 1./PropsSI('D','T',T_2,'Q',1.0,'R134a')     # specific volume of R134a at state 2 [m^3/kg]

m_1 = V_tank/v_1                                  # initial mass of R134a at state 1 [kg]
m_2 = V_tank/v_2                                  # final mass of R134a at state 2 [kg]
m_out = m_1 - m_2                                 # mass that left the tank [kg]

print('m_1 = ',round(m_1,3),'kg')
print('m_2 = ',round(m_2,3),'kg')
print('m_out = ',round(m_out,3),'kg')
m_1 =  4.361 kg
m_2 =  0.525 kg
m_out =  3.836 kg

Now consider conservation of energy applied to the R-134a in the tank with no work and negligible changes in kinetic and potential energy

$$\dfrac{dU}{dt} = \dot Q - \dot m_{out}h_{out}$$

Since the leakage is slow, then the tank temperature remains constant and saturated vapor at 20°C flows through the leak at the top of the tank. Thus, the energy balance can be rearranged and integrated to give

$$U_2-U_1 = \int\limits_{U_1}^{U_2}{dU} = \int\limits_{t_1}^{t_2}{\dot Qdt}-h_{out}\int\limits_{t_1}^{t_2}{\dot m_{out}dt}$$

or

$$m_2u_2-m_1u_1 = Q_{12} - m_{out}h_{out}$$

Because the leak is near the top of the tank only saturated vapor leaves. As the vapor leaves the liquid at the bottom of the tank evaporates to fill the space. This process occurs until there is no liquid left in the tank. Therefore, $h_{out} = h_g(20°C)$. Thus,

$$Q_{12} = m_2u_2 - m_1u_1 + (m_1-m_2)h_{g}$$
In [16]:
from CoolProp.CoolProp import PropsSI

u_f_1 = PropsSI('U','T',T_1,'Q',0.0,'R134a')/1000.
u_g_1 = PropsSI('U','T',T_1,'Q',1.0,'R134a')/1000.
u_1 = u_f_1 + x_1*(u_g_1 - u_f_1)                    # specific internal energy of R134a at state 1 [kJ/kg]

u_2 = PropsSI('U','T',T_2,'Q',1.0,'R134a')/1000.     # specific internal energy of R134a at state 2 [kJ/kg]

h_out = PropsSI('H','T',T_1,'Q',1.0,'R134a')/1000.   # specific enthalpy of R134a leaking out of the tank [kJ/kg]

Q_12 = m_2*u_2 - m_1*u_1 + m_out*h_out

print('Q_12 = ',round(Q_12,1),'kJ')
Q_12 =  715.4 kJ
<