#Given Inputs:
T_1 = 310 # inlet air temperature [K]
P_1 = 30 # inlet air pressure [bar]
P_2 = 2 # exit air pressure [bar]
P_3 = P_2 # exit air pressure [bar]
T_2 = 390 # exit air temperature for the hot side [K]
T_3 = 210 # exit air temperature for the cold side [K]
T_b = 300 # surrounding temperature for entropy transfer due to heat transfer [K]
R = 0.287 # specific gas constant of air [kJ/kg-K]
Determine if the given operating condition are possible.
The system is extends slightly beyond the device to include the thermal layer so that the boundary temperature for heat transfer is the environmental temperature.
1) open system, 2) steady state, steady flow (SSSF) 3) neglect changes in kinetic and potential energy, 4) air is an ideal gas, 5) no work
A mass balance is applied to the system, air enters the single inlet and leaves through the two outlets with the assumption of steady flow ($dm/dt=0$).
$$\dfrac{dm}{dt}=\Sigma \dot m_{in}-\Sigma \dot m_{out}$$$$0=\dot m_{1}-\dot m_{2}-\dot m_{3}$$$$\dot m_{1}=\dot m_{2}+\dot m_{3}$$Entropy and energy balances are applied to the entire system with the assumptions of SSSF ($dS/dt=dE/dt=0$), negligible kinetic and potential energy, and no work device.The simplified entropy and energy equations become
$$0 = \dfrac{\dot Q}{T_{boundary}}+ \dot m_{1} s_{1}- \dot m_{2}s_{2}-\dot m_{3}s_{3}+\dot \sigma _{generation}$$$$0 = \dot Q+ \dot m_{1} h_1-\dot m_{2}h_2-\dot m_{3}h_3$$The problem statement indicates that half the air leaves through each exit:
$$\dot m_2=\dot m_3=\dot m_1/2$$The mass balance can then be used to simplify the entropy and energy balances to express the entropy genreation and heat transfer per unit mass flow as
$$\dot \sigma _{generation}/\dot m_1 = 0.5(s_3-s_1)+0.5(s_2-s_1)-\dfrac{\dot Q/\dot m_1}{T_{boundary}}$$$$q= \dot Q/\dot m_1 = 0.5(h_3-h_1)+0.5(h_2-h_1)$$The temperature-dependent properties for each air state are taken from the ideal gas tables at the given temperatures
$$h_1=310.2kJ/kg,s^o_1=1.736kJ/kg-K$$$$h_2=390.9kJ/kg,s^o_2=1.967kJ/kg-K$$$$h_3=210kJ/kg,s^o_3=1.352kJ/kg-K$$The changes in entropy for the air between the outlet and inlet states are then
$$s_2-s_1=s_2^o-s_1^o-R \cdot ln\Bigg(\dfrac{P_2}{P_1}\Bigg)$$$$s_3-s_1=s_3^o-s_1^o-R \cdot ln\Bigg(\dfrac{P_3}{P_1}\Bigg)$$import numpy as np
s_1_o = 1.736 # temperature-dependent portion of entropy for air at state 1 [kJ/kg-K]
s_2_o = 1.967 # temperature-dependent portion of entropy for air at state 2 [kJ/kg-K]
s_3_o = 1.352 # temperature-dependent portion of entropy for air at state 3 [kJ/kg-K]
h_1 = 310.2 # specific enthalpy of air at state 1 [kJ/kg]
h_2 = 390.9 # specific enthalpy of air at state 2 [kJ/kg]
h_3 = 210 # specific enthalpy of air at state 3 [kJ/kg]
q = 0.5*(h_3-h_1)+0.5*(h_2-h_1)
Delta_s13 = s_3_o-s_1_o-R*np.log(P_3/P_1)
Delta_s12 = s_2_o-s_1_o-R*np.log(P_2/P_1)
sigma_gen = 0.5*Delta_s13 +0.5*Delta_s12 - q/T_b
print('q = ',round(q,5),'kJ/kg')
print('sigma_gen = ',round(sigma_gen,5),'kJ/kg-K')
Since the entropy generation is positive, the process is possible.
#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]
m_1 = 4.361 # initial mass of the R134a [kg]
m_2 = 0.525 # final mass of the R134a [kg]
m_out = 3.836 # mass leaving the system
Q_12 = 715.4 # heat transfer into the system [kJ]
P_out = 100 # pressure of the air in the room [kPa]
Determine the total entropy generation (kJ/K).
1) quasi-equlibrium process within the tank, 2) isenthalpic throttling across the leaking valve.
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 $$The values for each mass and the mass leaving the system come from HW 19 (ii)
Now consider an entropy balance applied to the R-134a in the tank
$$\dfrac{dS_{cv}}{dt} = \dfrac{\dot Q}{T_{boundary}} - \dot m_{out}s_{out}+\dot \sigma$$Since the leakage is slow, then the tank temperature remains constant and saturated vapor at 20°C flows into the leaky valve at the top of the tank. The entropy increases across the valve because a throttling process is highly irreversible. However, both the inlet and outlet states for the valve are constant Thus, the entropy balance can be rearranged and integrated to give
$$s_2-s_1 = \int\limits_{1}^{2}{dm_{cv}S_{cv}} = \int\limits_{t_1}^{t_2}{\dfrac{\dot Q}{T_{boundary}}dt}-S_{out}\int\limits_{t_1}^{t_2}{\dot m_{out}dt}+\int\limits_{t_1}^{t_2}{\dot \sigma dt}$$or
$$m_2s_2-m_1s_1 = \dfrac{Q_{12}}{T_{boundary}} - m_{out}s_{out}+\sigma _{12}$$Since the valve is isenthalpic, the enthalpy of the R134a leaving the valve is the same as the enthalpy entering the valve. Therefore, $h_{out} = h_g(20°C)$. The entropy exiting the valve can be determined from the exit enthalpy and exit pressure ($P_{out}=100kPa$) and $s_{out}=s(h_{out},P_{out})$. 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. Thus,
$$\sigma _{12} = m_2s_2 - m_1s_1 + (m_1-m_2)s_{out}-\dfrac{Q_{12}}{T_{boundary}}$$import CoolProp.CoolProp as CP
CP.set_reference_state('R134a','ASHRAE')
s_f_1 = CP.PropsSI('S','T',T_1,'Q',0.0,'R134a')/1000.
s_g_1 = CP.PropsSI('S','T',T_1,'Q',1.0,'R134a')/1000.
s_1 = s_f_1 + x_1*(s_g_1 - s_f_1) # specific entropy of R134a at state 1 [kJ/kg-K]
s_2 = CP.PropsSI('S','T',T_2,'Q',1.0,'R134a')/1000. # specific entropy of R134a at state 2 [kJ/kg-K]
h_g_out = CP.PropsSI('H','T',T_1,'Q',1.0,'R134a') # specific enthalpy of R134a leaving the tank [kJ/kg]
s_out = CP.PropsSI('S','H',h_g_out,'P',P_out*1000,'R134a')/1000. # specific entropy of R134a exiting the leaky valve [kJ/kg-K]
sigma_12 = m_2*s_2 - m_1*s_1 + m_out*s_out-Q_12/(T_1)
print('s_f_1 = ',round(s_f_1,5),'kJ\K')
print('s_g_1 = ',round(s_g_1,5),'kJ\K')
print('s_1 = ',round(s_1,5),'kJ\K')
print('s_2 = ',round(s_2,5),'kJ\K')
print('s_out = ',round(s_out,5),'kJ\K')
print('sigma_12 = ',round(sigma_12,5),'kJ\K')