{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Energy Balances Examples\n", "\n", "* [Problem: Power Requirement for a Tankless Water Heater](#Problem:-Power-Requirement-for-a-Tankless-Water-Heater)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Problem: Power Requirement for a Tankless Water Heater\n", "\n", "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.\n", "\n", "#### Solution\n", "\n", "The overall energy mass and energy balances for the tankless water heater operating at steady state are\n", "\n", "$$\\begin{align*}\n", "0 & = \\dot{m}_{in} - \\dot{m}_{out} \\\\\n", "0 & = \\dot{m}_{in}\\hat{H}_{in} - \\dot{m}_{out}\\hat{H}_{out} + \\dot{Q}_H\n", "\\end{align*}$$\n", "\n", "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\n", "\n", "$$\\dot{Q}_H = 0.9\\dot{Q}_{E}$$\n", "\n", "where $\\dot{Q}_E$ is the electrical power input. Setting $\\dot{m} = \\dot{m}_{in} = \\dot{m}_{out}$, and solving for $\\dot{Q}_E$,\n", "\n", "$$\\dot{Q}_E = \\frac{\\dot{m} \\left(\\hat{H}_{out} - \\hat{H}_{in}\\right)}{0.9} $$\n", "\n", "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\n", "\n", "$$\\hat{H}_{out} - \\hat{H}_{in} = \\int_{T_{in}}^{T_{out}} C_p(T) dT $$\n", "\n", "Over a limited temperature range we can assume $C_p$ is constant, in which case\n", "\n", "$$\\begin{align*}\n", "\\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)\n", "\\end{align*}$$\n", "\n", "The symbolic form, the solution to the problem is \n", "\n", "$$\\dot{Q}_E = \\frac{\\dot{m} C_p \\left(T_{out} - T_{in}\\right)}{0.9} $$\n", "\n", "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." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tout - Tin = 33.3333333333 deg C\n" ] } ], "source": [ "Tin = 45 # deg F\n", "Tout = 105 # deg F\n", "deltaT = (Tout-Tin)/1.8 # convert difference to deg C\n", "print \"Tout - Tin = \", deltaT, \"deg C\"" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Heat Capacity = 4.18656302054 kJ/kgC\n" ] } ], "source": [ "Cp = 75.4 # J/gmol/K from Murphy textbook\n", "MW = 18.01 # molecular weight\n", "Cp = Cp/MW # convert to J/g/K or kJ/kg/C\n", "print \"Heat Capacity = \", Cp, \"kJ/kgC\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mass flow = 0.157725416667 kg/sec\n" ] } ], "source": [ "F = 2.5 # flow in gallons per minute\n", "F = F*3.78541/60.0 # convert flow to liters per sec\n", "rho = 1.0 # density in kg/liter\n", "mdot = rho*F # mass flow in kg/sec\n", "print \"Mass flow = \", mdot, \"kg/sec\"" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Electrical Power = 24.4565702525 kW\n" ] } ], "source": [ "Qe = mdot*Cp*deltaT/0.9\n", "print \"Electrical Power = \", Qe, \"kW\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Problem: Heating Partially Condensed Water at Constant Volume\n", "\n", "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?\n", "\n", "#### Solution\n", "\n", "This is an unsteady-state energy balance written as \n", "\n", "$$\\frac{dU}{dt} = \\dot{Q}$$\n", "\n", "where $U$ is the internal energy of the water inside the drum. Integrating over the period of the operation,\n", "\n", "$$U_2 - U_1 = Q_{Total}$$\n", "\n", "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\n", "\n", "$$\\begin{align*}\n", "m_1^{liq} \\hat{V}_{liq}^{sat} & = 0.20 V \\\\\n", "m_1^{vap} \\hat{V}_{vap}^{sat} & = 0.80 V\n", "\\end{align*}$$\n", "\n", "from which we get\n", "\n", "$$\\begin{align*}\n", "m_1^{liq} & = \\frac{0.20 V}{\\hat{V}_{liq}^{sat}} \\\\\n", "m_1^{vap} & = \\frac{0.80 V}{\\hat{V}_{vap}^{sat}}\n", "\\end{align*}$$\n", "\n", "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. " ] }, { "cell_type": "code", "execution_count": 47, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "liq. mass = 19.1727377935 kg\n", "vap. mass = 0.0472248738836 kg\n", " Total = 19.2199626674 kg\n" ] } ], "source": [ "from iapws import IAPWS97\n", "\n", "# State 1: Starting Condition (x = vapor fraction)\n", "\n", "V1_liq = 0.2*100.0/1000.0 # cubic meters\n", "V2_vap = 0.8*100.0/1000.0 # cubic meters\n", "\n", "m1_liq = V1_liq/IAPWS97(P=0.1,x=0.0).v\n", "m1_vap = V2_vap/IAPWS97(P=0.1,x=1.0).v\n", "\n", "print \"liq. mass = \", m1_liq, \"kg\"\n", "print \"vap. mass = \", m1_vap, \"kg\"\n", "\n", "m = m1_liq + m1_vap\n", "\n", "print \" Total = \", m, \"kg\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The total internal energy is then\n", "\n", "$$U_1 = m_1^{liq}\\hat{U}_{liq}^{sat} + m_1^{vap}\\hat{U}_{vap}^{sat} $$\n", "\n", "The internal energy at the start of the operation is " ] }, { "cell_type": "code", "execution_count": 48, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "U, sat. liq., at 1 bar = 417.332171032 kJ/kg\n", "U, sat. vap., at 1 bar = 2505.54738854 kJ/kg\n", "Total internal energy = 8119.72444744 kJ\n" ] } ], "source": [ "u1 = m1_liq*IAPWS97(P=0.1,x=0.0).u + m1_vap*IAPWS97(P=0.1,x=1.0).u\n", "print \"U, sat. liq., at 1 bar = \", IAPWS97(P=0.1,x=0.0).u, \"kJ/kg\"\n", "print \"U, sat. vap., at 1 bar = \", IAPWS97(P=0.1,x=1.0).u, \"kJ/kg\"\n", "print \"Total internal energy = \", u1, \"kJ\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "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." ] }, { "cell_type": "code", "execution_count": 49, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Volume of 19.2199626674 kg at sat. liq at 10 bar = 2.16653905041 liters\n", "Volume of 19.2199626674 kg at sat. liq at 10 bar = 373.537830122 liters\n" ] } ], "source": [ "print \"Volume of \", m, \"kg at sat. liq at 10 bar = \", m*100.0*IAPWS97(P=1.0,x=0.0).v, \"liters\"\n", "print \"Volume of \", m, \"kg at sat. liq at 10 bar = \", m*100.0*IAPWS97(P=1.0,x=1.0).v, \"liters\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "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\n", "\n", "$$\\begin{align*}\n", "m_2^{liq}\\hat{V}_{liq}^{sat} + m_2^{vap}\\hat{V}_{vap}^{sat} & = V \\\\ \n", "m_2^{liq} + m_2^{vap} & = m\n", "\\end{align*}$$\n", "\n", "Solving the second equation for $m_2^{vap}$\n", "\n", "$$m_2^{vap} = m - m_2^{liq}$$\n", "\n", "substituting into the first\n", "\n", "$$\n", "m_2^{liq}\\hat{V}_{liq}^{sat} + (m - m_2^{liq})\\hat{V}_{vap}^{sat} = V \n", "$$\n", "\n", "and solving for $m_2^{liq}$\n", "\n", "$$m_2^{liq} = \\frac{m \\hat{V}_{vap}^{sat} - V}{\\hat{V}_{vap}^{sat} - \\hat{V}_{liq}^{sat}}$$\n", "\n", "evaluated for saturated conditions with $P$ = 10$ bar (i.e, 1 MPa)." ] }, { "cell_type": "code", "execution_count": 55, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "liq. mass = 18.814549458 kg\n", "vap. mass = 0.405413209441 kg\n", " Total = 19.2199626674 kg\n" ] } ], "source": [ "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)\n", "m2_vap = m - m2_liq\n", "\n", "print \"liq. mass = \", m2_liq, \"kg\"\n", "print \"vap. mass = \", m2_vap, \"kg\"\n", "\n", "print \" Total = \", m, \"kg\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The total internal energy at the final state is \n", "\n", "$$U_2 = m_2^{liq}\\hat{U}_{liq}^{sat} + m_2^{vap}\\hat{U}_{vap}^{sat} $$" ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "U, sat. liq., at 1 bar = 761.55561059 kJ/kg\n", "U, sat. vap., at 1 bar = 2582.77065336 kJ/kg\n", "Total internal energy = 15375.4150403 kJ\n" ] } ], "source": [ "u2 = m2_liq*IAPWS97(P=1.0,x=0.0).u + m2_vap*IAPWS97(P=1.0,x=1.0).u\n", "print \"U, sat. liq., at 1 bar = \", IAPWS97(P=1.0,x=0.0).u, \"kJ/kg\"\n", "print \"U, sat. vap., at 1 bar = \", IAPWS97(P=1.0,x=1.0).u, \"kJ/kg\"\n", "print \"Total internal energy = \", u2, \"kJ\"" ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Temperature at 10 bar = 179.885632391 deg C\n", "Energy required Q = U2 - U1 = 7255.69059283 kJ\n", "Liq. Volume Fraction = 0.212083950535\n", "Vap. Volume Fraction = 0.787916049465\n" ] } ], "source": [ "print \"Temperature at 10 bar = \", IAPWS97(P=1.0,x=1.0).T - 273.15, \"deg C\"\n", "print \"Energy required Q = U2 - U1 = \", u2-u1, \"kJ\"\n", "print \"Liq. Volume Fraction = \", m2_liq*IAPWS97(P=1.0,x=0.0).v/0.1\n", "print \"Vap. Volume Fraction = \", m2_vap*IAPWS97(P=1.0,x=1.0).v/0.1" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.10" } }, "nbformat": 4, "nbformat_minor": 0 }