{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Appendix B" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mass of vapour: 2.77 Kg\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "#Example: 13.3\n", "'''Consider 100 m 3 of an air–water vapor mixture at 0.1 MPa, 35◦C, and 70% relative\n", "humidity. Calculate the humidity ratio, dew point, mass of air, and mass of vapor.'''\n", "\n", "#Variable Declaration: \n", "r = 0.70\t\t\t#relative humidity\n", "Pg = 5.628\t\t\t#saturation pressure in kPa\n", "P = 100\t\t\t\t#net pressure kPa \n", "V = 100\t\t\t\t#volume in m**3\n", "Ra = 0.287\t\t\t#gas constant for water vapour\n", "T = 308.2\t\t\t#Temperature in K\n", "\n", "#Calculations:\n", "Pv = r*Pg\t\t\t#vapour pressure in kPa\n", "Pa = P-Pv\t\t\t#Partial pressure of air\n", "w = 0.622*Pv/Pa\t\t#humidity ratio formula\n", "ma = Pa*V/(Ra*T)\t#mass in kg\n", "mv = w*ma\t\t\t#mass of vapour\n", "\n", "#Results:\n", "print 'Mass of vapour: ', round(mv,2),'Kg'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mass of vapour condense 2.175 Kg\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "#Example: 13.4\n", "'''Calculate the amount of water vapor condensed if the mixture of Example 13.3 is cooled\n", "to 5◦C in a constant-pressure process.'''\n", "\n", "#Variable Declaration: \n", "w1 = 0.0255\t\t#w1 = w, humidity ratio at initial temperature\n", "ma = 108.6\t\t#mass of air in kg\n", "P = 100\t\t\t#kPa net pressure\n", "Pg2 = 0.8721\n", "\n", "#Calculations:\n", "Pv2 = Pg2\n", "w2 = 0.622*Pv2/(P-Pg2)\n", "mc = ma*(w1-w2)\n", "\n", "#Results:\n", "print 'Mass of vapour condense',round(mc,3) ,'Kg'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Heat transferred per unit mass: -41.65 kJ/kg of dry air\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "#Example: 13.5\n", "''' An air-conditioning unit is shown in Fig. 13.5, with pressure, temperature, and relative\n", "humidity data. Calculate the heat transfer per kilogram of dry air, assuming that changes\n", "in kinetic energy are negligible.'''\n", "\n", "#Variable Declaration: \n", "r1 = 0.80\t\t\t\t#realtive humidity at state 1\n", "Pg1 = 4.246\t\t\t\t#saturation pressure of vapour in kPa\n", "P1 = 105\t\t\t\t#net pressure at state 1 in kPa\n", "P2 = 100\t\t\t\t#net pressure at state 2 in kPa\n", "r2 = 0.95\t\t\t\t#relative humidity at state 2\n", "Pg2 = 1.7051\t\t\t#saturation pressure of vapour in kPa\n", "T1 = 30\t\t\t\t\t#C\n", "T2 = 15\t\t\t\t\t#C\n", "Cp = 1.004\t\t\t\t#specific heat of water vapour in kJ/kg\n", "hv2 = 2528.9\t\t\t#enthalpy of vapourisation of vapour in kJ/kg\n", "hv1 = 2556.3\t\t\t#enthalpy of vapourisation of vapour in kJ/kg\n", "hl2 = 62.99\t\t\t\n", "\n", "#Calculations:\n", "Pv1 = r1*Pg1\t\t\t#partial pressure of vapour in kPa\n", "w1 = 0.622*Pv1/(P1-Pv1)\t#humidity ratio at state 1\n", "Pv2 = r2*Pg2\t\t\t#partial pressure of vapour in kPa\n", "w2 = 0.622*Pv2/(P2-Pv2)\t#humidity ratio at state 2\n", "q = Cp*(T2-T1)+w2*hv2-w1*hv1+hl2*(w1-w2)\t\t#kJ/kg\n", "\n", "#Results:\n", "print 'Heat transferred per unit mass: ',round(q,2),' kJ/kg of dry air'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 6" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Heat transferred -339.1 kJ\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "#Example: 13.6\n", "''' A tank has a volume of 0.5 m 3 and contains nitrogen and water vapor. The temperature\n", "of the mixture is 50◦C, and the total pressure is 2 MPa. The partial pressure of the water\n", "vapor is 5 kPa. Calculate the heat transfer when the contents of the tank are cooled to\n", "10◦C.'''\n", "\n", "#Variable Declaration: \n", "Pn2 = 1995\t\t\t\t#Pressure of nitrogen in kPa\n", "V = 0.5\t\t\t\t\t#Volume in m**3\n", "Rn2 = 0.2968\t\t\t#Gas constant for nitrogen in kJ/kg.K\n", "Rv = 0.4615\t\t\t\t#gas constant for vapour\n", "T1 = 323.2\t\t\t\t#Temperature in K\n", "T2 = 283.2\t\t\t\t#Temperature in K\n", "Pv1 = 5\t\t\t\t\t#Pressure of water vapour in kPa at state 1\n", "Pv2 = 1.2276\t\t\t#Pressure of water vapour in kPa at state 2\n", "uv1 = 2443.1\t\t\t#specific internal energy of vapour in kJ/kg at state 1\n", "uv2 = 2389.2\t\t\t#specific internal energy of vapour in kJ/kg at state 2\n", "ul2 = 42.0\t\t\t\t#specific internal energy of liquid water in kJ/kg\n", "Cv = 0.745\t\t\t\t#specific heat at constant volume in kJ/kg.K\n", "\n", "#Calculations:\n", "mn2 = Pn2*V/(Rn2*T1)\t#mass of nitrogen\n", "mv1 = Pv1*V/(Rv*T1)\t\t#mass of vapour in kg\n", "mv2 = Pv2*V/(Rv*T2)\t\t#mass of vapour in kg\n", "ml2 = mv1-mv2\t\t\t#mass of liquid condensed n kg\n", "Q = mn2*Cv*(T2-T1)+mv2*uv2+ml2*ul2-mv1*uv1\n", "\n", "#Results:\n", "print 'Heat transferred',round(Q,1),'kJ'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Relative humidity: 0.0107\n", "Humidity ratio: 0.399\n" ] } ], "source": [ "# -*- coding: utf8 -*-\n", "from __future__ import division\n", "#Example: 13.7\n", "'''The pressure of the mixture entering and leaving the adiabatic saturator is 0.1 MPa, the\n", "entering temperature is 30◦C, and the temperature leaving is 20◦C, which is the adiabatic\n", "saturation temperature. Calculate the humidity ratio and relative humidity of the air–water\n", "vapor mixture entering.'''\n", "\n", "#Variable Declaration: \n", "P = 100\t\t\t\t#net pressure n kPa \n", "Pg2 = 2.339\t\t\t#saturation pressure of vapour in kPa\n", "Cpa = 1.004\t\t\t#specific heat n kJ/kg/K\n", "T2 = 20\t\t\t\t#final temp in C\n", "T1 = 30\t\t\t\t#initial temp in C\n", "Hfg2 = 2454.1\t\t#specific heat difference at state 2 in kJ/kg\n", "hv1 = 2556.3\t\t#enthalpy of water vapour at state 1 in kJ/kg\n", "hl2 = 83.96\t\t\t#enthalpy of liquid water in kJ/kg\n", "Pg1 = 4.246\t\t\t#saturation pressure at state 1 in kPa\n", "\n", "#Calculations:\n", "Pv2 = Pg2\t\t\t#partial pressure of vapour\n", "w2 = 0.622*Pv2/(P-Pg2)\n", "w1 = (Cpa*(T2-T1)+w2*Hfg2)/(hv1-hl2)\n", "Pv1 = 100*w1/(0.622+w1)\n", "r = Pv1/Pg1\t\t\t#humidity ratio\n", "\n", "#Results:\n", "print 'Relative humidity: ',round(w1,4)\n", "print 'Humidity ratio: ',round(r,3)" ] } ], "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.6" } }, "nbformat": 4, "nbformat_minor": 0 }