Codes
Codes
2)
FUNCTION klookup(material$)
If material$='Glass' then klookup:=0.78 P = 10 [MPa]*convert(MPa,kPa)
sigma = 5.67e-8"[W/m^2-K^4]"
If material$='Brick' then klookup:=0.72 T_Celsius = 400 [C]
{T_sphere = 70"[C]"
If material$='Fiber Glass' then klookup:=0.043 T = T_Celsius + 273 "[K]"
T_room = 20"[C]"
If material$='Air' then klookup:=0.026 T_critical = t_crit(Steam_iapws)
D_sphere = 5"[cm]"
If material$='Wood(oak)' then klookup:=0.17 P_critical = p_crit(Steam_iapws)
epsilon = 0.1
END {v = Vol/m}
h_c = 15"[W/m^2-K]"}
L=2"[m]" P_table = P; P_comp = P; P_idealgas = P
A = 4 * pi * (D_sphere / 2)^2 *
W=2"[m]" T_table = T; T_comp = T; T_idealgas = T
convert(cm^2,m^2)"[m^2]"
{material$='Glass' v_table = volume(Steam_IAPWS, P = P_table, T = T_table) "EES data for steam as a real gas"
Q_dot_conv = A * h_c * (T_sphere -
T_in=10"[C]" {P_table = pressure(Steam_iapws, T = T_table, v = v)}
T_room)"[W]"
T_out=3"[C]" {T_sat = temperature(Steam_iapws, P = P_table, v = v)}
Q_dot_rad = A * epsilon * sigma *
k=0.78"[W/m-C]" MM = molarmass(water)
((T_sphere + 273)^4 - (T_room +
t=5"[hr]" R_u = 8.314 [kJ/kmol-K] "Universal gas constant"
273)^4)"[W]"
thickness=0.5"[cm]"} R = R_u / MM "[kJ/kg-K], Particular gas constant"
Q_dot_total = Q_dot_conv +
k=klookup(material$)"[W/m-K]" P_idealgas * v_idealgas = R * T_idealgas "Ideal gas equation"
Q_dot_rad"[W]"
A=L*W"[m^2]" z = COMPRESS(T_comp/T_critical, P_comp/P_critical)
Q_dot_loss=A*k*(T_in-T_out)/ P_comp * v_comp = z * R * T_comp "generalized Compressibility factor"
(thickness*convert(cm,m))"[W]" 4) Error_idealgas = abs(v_table - v_idealgas) / v_table * convert(, %)
Q_loss_total=Q_dot_loss*t*convert(hr,s)*convert(J,k Error_comp = abs(v_table - v_comp) / v_table * convert(, %)
J)"[kJ]" "Given Data"
V_A=0.5 [m^3]
T_A=20 [C]
3) P_A=600 [kPa]
6) V_B=0.5 [m^3]
"Given Data" T_B=30 [C]
x_1=0.0 "Given Data" P_B=150 [kPa]
Vol_1=0.01[m^3] D=6 [m] T_2=15 [C]
P_1=800 [kPa] P=200 [kPa]
T_2=20 [C] T=20 [C] "Solution"
P_2=400 [kPa] R_u=8.314 [kJ/kmol-K] R=R_u/molarmass(H2)
"Solution" "Solution" R_u=8.314 [kJ/kmol-K]
v_1=volume(R134a,P=P_1,x=x_1) P*V=N*R_u*(T+273) V_total=V_A+V_B
Vol_1=m*v_1 V=4*pi*(D/2)^3/3 m_total=m_A+m_B
v_2=volume(R134a,P=P_2,T=T_2) m=N*molarmass(Helium) P_A*V_A=m_A*R*(T_A+2
Vol_2=m*v_2 73)
P_B*V_B=m_B*R*(T_B+27
3)
P_2*V_total=m_total*R*(T_
2+273)
7) 8) 9)
"Knowns:"
T_H = 400 [C] "Knowns" "Knowns:"
Q_H = 1300 [kJ] T[1] = 450 [C] T_1_iron = 100 [C]
T_Sys = T_H P[1] = 10000 [kPa] m_iron = 20 [kg]
"Analysis: Vel[1] = 80 [m/s] T_1_al = 200 [C]
(a) & (b) This is a reversible isothermal process, and the P[2] = 10 [kPa] m_al = 20 [kg]
entropy change during such a process X_2 = 0.92 C_al = 0.973 [kJ/kg-K] "FromTable A-3
is given by Vel[2] = 50 [m/s] at the anticipated average temperature of
DELTAS = Q/T" m_dot[1] = 12 [kg/s] 450 K."
"Noting that heat transferred from the source is equal to Fluid$ = 'Steam_IAPWS' C_iron= 0.45 [kJ/kg-K] "FromTable A-3
the heat transferred to the working fluid, at room temperature, the only value
the entropy changes of the fluid and of the source become "Property Data" available."
" h[1] = enthalpy(Fluid$, T = T[1], P = P[1]) "Analysis: "
DELTAS_source = -Q_H/(T_H+273) h[2] = enthalpy(Fluid$, P = P[2], x = X_2) " Treat the iron plus aluminum as a
DELTAS_fluid = +Q_H/(T_Sys+273) T[2] = temperature(Fluid$, P = P[2], x = X_2) closed system, with no heat transfer in,
"(c) entropy generation for the process:" v[1] = volume(Fluid$, T = T[1], P = P[1]) no work out, neglect changes in KE and
S_gen = DELTAS_source + DELTAS_fluid v[2] = volume(Fluid$, P = P[2], x = X_2) PE of the system. "
"The final temperature is found from the
"Conservation of Mass" energy balance."
m_dot[1] = m_dot[2] E_in - E_out = DELTAE_sys
E_out = 0
"Mass Flow Rate" E_in = 0
m_dot[1] = A[1] * Vel[1] / v[1] DELTAE_sys = m_iron*DELTAu_iron + m_al*DELTAu_al
m_dot[2] = A[2] * Vel[2] / v[2] DELTAu_iron = C_iron*(T_2_iron - T_1_iron)
DELTAu_al = C_al*(T_2_al - T_1_al)
"Conservation of Energy - Steady Flow Energy Balance" "the iron and aluminum reach thermal equilibrium:"
m_dot[1] * (h[1] + Vel[1]^2 / 2 * Convert(m^2/s^2, kJ/kg)) = T_2_iron = T_2
m_dot[2] * (h[2] + Vel[2]^2 / 2 * Convert(m^2/s^2, kJ/kg)) + T_2_al = T_2
W_dot_turb * Convert(MW, kJ/s) DELTAS_iron = m_iron*C_iron*ln((T_2_iron+273) / (T_1_iron+273))
DELTAS_al = m_al*C_al*ln((T_2_al+273) / (T_1_al+273))
DELTAke = Vel[2]^2 / 2 * Convert(m^2/s^2, kJ/kg) - DELTAS_total = DELTAS_iron + DELTAS_al
Vel[1]^2 / 2 * Convert(m^2/s^2, kJ/kg)