For this problem consider an electrically powered tankless water heater that produces hot water for home use. In particular, calculate the electrical power required to heat water for a shower, assuming the inlet tap water temperature is 45 deg F, the required shower water temperature is 105 deg F at a flowrate of 2.5 gallons per hour. Assume the device operates at steady state and is 90% efficient, that is 90% of the electrical power is converted to heat and transferred to the water.
The overall energy mass and energy balances for the tankless water heater operating at steady state are
$$\begin{align*} 0 & = \dot{m}_{in} - \dot{m}_{out} \\ 0 & = \dot{m}_{in}\hat{H}_{in} - \dot{m}_{out}\hat{H}_{out} + \dot{Q}_H \end{align*}$$where $\dot{m}$ denotes the mass flow of water, $\hat{H}$ is the mass-specific enthalpy of water, and $\dot{Q}_H$ is the heat input to the water. We're told the efficiency of the water is 90%, that is
$$\dot{Q}_H = 0.9\dot{Q}_{E}$$where $\dot{Q}_E$ is the electrical power input. Setting $\dot{m} = \dot{m}_{in} = \dot{m}_{out}$, and solving for $\dot{Q}_E$,
$$\dot{Q}_E = \frac{\dot{m} \left(\hat{H}_{out} - \hat{H}_{in}\right)}{0.9} $$The ethalpy change of water is solely from an increase in temperature from $T_{in}$ to $T_{out}$. We know this change can be computed using the heat capacity at constant pressure
$$\hat{H}_{out} - \hat{H}_{in} = \int_{T_{in}}^{T_{out}} C_p(T) dT $$Over a limited temperature range we can assume $C_p$ is constant, in which case
$$\begin{align*} \hat{H}_{out} - \hat{H}_{in} & = \int_{T_{in}}^{T_{out}} C_p(T) dT = C_p \int_{T_{in}}^{T_{out}} dT = C_p \left(T_{out}-T_{in}\right) \end{align*}$$The symbolic form, the solution to the problem is
$$\dot{Q}_E = \frac{\dot{m} C_p \left(T_{out} - T_{in}\right)}{0.9} $$and all that remains is to evaluate the right hand side of this equation using the problem data, physical property data for the heat capacity, and appropriate unit conversions.
Tin = 45 # deg F
Tout = 105 # deg F
deltaT = (Tout-Tin)/1.8 # convert difference to deg C
print "Tout - Tin = ", deltaT, "deg C"
Tout - Tin = 33.3333333333 deg C
Cp = 75.4 # J/gmol/K from Murphy textbook
MW = 18.01 # molecular weight
Cp = Cp/MW # convert to J/g/K or kJ/kg/C
print "Heat Capacity = ", Cp, "kJ/kgC"
Heat Capacity = 4.18656302054 kJ/kgC
F = 2.5 # flow in gallons per minute
F = F*3.78541/60.0 # convert flow to liters per sec
rho = 1.0 # density in kg/liter
mdot = rho*F # mass flow in kg/sec
print "Mass flow = ", mdot, "kg/sec"
Mass flow = 0.157725416667 kg/sec
Qe = mdot*Cp*deltaT/0.9
print "Electrical Power = ", Qe, "kW"
Electrical Power = 24.4565702525 kW
A condensate return line to a campus power plant carries saturated water at 1 bar pressure. 100 liters of the condensate (20% liquid and 80% vapor by volume) is collected and sealed in a drum, then heated until the pressure reaches 10 bars. What is the final temperature, how much heat is required, and what are the new liquid and vapor fractions?
This is an unsteady-state energy balance written as
$$\frac{dU}{dt} = \dot{Q}$$where $U$ is the internal energy of the water inside the drum. Integrating over the period of the operation,
$$U_2 - U_1 = Q_{Total}$$To compute the total internal energy at the starting condition, $U_1$, we need to translate volume of the liquid and vapor phases to masses, then use data from the steam tables to compute total internal energy. Algebraically, the problem data tells us
$$\begin{align*} m_1^{liq} \hat{V}_{liq}^{sat} & = 0.20 V \\ m_1^{vap} \hat{V}_{vap}^{sat} & = 0.80 V \end{align*}$$from which we get
$$\begin{align*} m_1^{liq} & = \frac{0.20 V}{\hat{V}_{liq}^{sat}} \\ m_1^{vap} & = \frac{0.80 V}{\hat{V}_{vap}^{sat}} \end{align*}$$where $V = 100$ liters and $\hat{V}_{liq}^{sat}$ and $\hat{V}_{vap}^{sat}$ are found from the steam tables for water under saturated conditions at a pressure $P = 1$ bar.
from iapws import IAPWS97
# State 1: Starting Condition (x = vapor fraction)
V1_liq = 0.2*100.0/1000.0 # cubic meters
V2_vap = 0.8*100.0/1000.0 # cubic meters
m1_liq = V1_liq/IAPWS97(P=0.1,x=0.0).v
m1_vap = V2_vap/IAPWS97(P=0.1,x=1.0).v
print "liq. mass = ", m1_liq, "kg"
print "vap. mass = ", m1_vap, "kg"
m = m1_liq + m1_vap
print " Total = ", m, "kg"
liq. mass = 19.1727377935 kg vap. mass = 0.0472248738836 kg Total = 19.2199626674 kg
The total internal energy is then
$$U_1 = m_1^{liq}\hat{U}_{liq}^{sat} + m_1^{vap}\hat{U}_{vap}^{sat} $$The internal energy at the start of the operation is
u1 = m1_liq*IAPWS97(P=0.1,x=0.0).u + m1_vap*IAPWS97(P=0.1,x=1.0).u
print "U, sat. liq., at 1 bar = ", IAPWS97(P=0.1,x=0.0).u, "kJ/kg"
print "U, sat. vap., at 1 bar = ", IAPWS97(P=0.1,x=1.0).u, "kJ/kg"
print "Total internal energy = ", u1, "kJ"
U, sat. liq., at 1 bar = 417.332171032 kJ/kg U, sat. vap., at 1 bar = 2505.54738854 kJ/kg Total internal energy = 8119.72444744 kJ
For the final state we know the pressure $P$ is 10 bar and the total mass is about 19.2 kg. Let's check to see what the volume would be if the mass was tied up with saturated liquid or saturated vapor.
print "Volume of ", m, "kg at sat. liq at 10 bar = ", m*100.0*IAPWS97(P=1.0,x=0.0).v, "liters"
print "Volume of ", m, "kg at sat. liq at 10 bar = ", m*100.0*IAPWS97(P=1.0,x=1.0).v, "liters"
Volume of 19.2199626674 kg at sat. liq at 10 bar = 2.16653905041 liters Volume of 19.2199626674 kg at sat. liq at 10 bar = 373.537830122 liters
Since the actual volume of 100 liters is between these two limits, we can conclude the final state is mixture of saturated liquid and vapor that satisfy the relationships
$$\begin{align*} m_2^{liq}\hat{V}_{liq}^{sat} + m_2^{vap}\hat{V}_{vap}^{sat} & = V \\ m_2^{liq} + m_2^{vap} & = m \end{align*}$$Solving the second equation for $m_2^{vap}$
$$m_2^{vap} = m - m_2^{liq}$$substituting into the first
$$ m_2^{liq}\hat{V}_{liq}^{sat} + (m - m_2^{liq})\hat{V}_{vap}^{sat} = V $$and solving for $m_2^{liq}$
$$m_2^{liq} = \frac{m \hat{V}_{vap}^{sat} - V}{\hat{V}_{vap}^{sat} - \hat{V}_{liq}^{sat}}$$evaluated for saturated conditions with $P$ = 10$ bar (i.e, 1 MPa).
m2_liq = (m*IAPWS97(P=1.0,x=1.0).v - 0.1)/(IAPWS97(P=1.0,x=1.0).v - IAPWS97(P=1.0,x=0.0).v)
m2_vap = m - m2_liq
print "liq. mass = ", m2_liq, "kg"
print "vap. mass = ", m2_vap, "kg"
print " Total = ", m, "kg"
liq. mass = 18.814549458 kg vap. mass = 0.405413209441 kg Total = 19.2199626674 kg
The total internal energy at the final state is
$$U_2 = m_2^{liq}\hat{U}_{liq}^{sat} + m_2^{vap}\hat{U}_{vap}^{sat} $$u2 = m2_liq*IAPWS97(P=1.0,x=0.0).u + m2_vap*IAPWS97(P=1.0,x=1.0).u
print "U, sat. liq., at 1 bar = ", IAPWS97(P=1.0,x=0.0).u, "kJ/kg"
print "U, sat. vap., at 1 bar = ", IAPWS97(P=1.0,x=1.0).u, "kJ/kg"
print "Total internal energy = ", u2, "kJ"
U, sat. liq., at 1 bar = 761.55561059 kJ/kg U, sat. vap., at 1 bar = 2582.77065336 kJ/kg Total internal energy = 15375.4150403 kJ
print "Temperature at 10 bar = ", IAPWS97(P=1.0,x=1.0).T - 273.15, "deg C"
print "Energy required Q = U2 - U1 = ", u2-u1, "kJ"
print "Liq. Volume Fraction = ", m2_liq*IAPWS97(P=1.0,x=0.0).v/0.1
print "Vap. Volume Fraction = ", m2_vap*IAPWS97(P=1.0,x=1.0).v/0.1
Temperature at 10 bar = 179.885632391 deg C Energy required Q = U2 - U1 = 7255.69059283 kJ Liq. Volume Fraction = 0.212083950535 Vap. Volume Fraction = 0.787916049465