{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 21:Air Treatment Fundamentals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 21.1,PAGE NUMBER:251"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Heat input,Q=1248 kW \n",
      "The mass flow rate of water,Q=27 kg/s\n"
     ]
    }
   ],
   "source": [
    "# Variable declaration\n",
    "m_a=68;# The mass flow rate of air in kg/s\n",
    "T_1=16;# The temperature of air at inlet in °C\n",
    "T_2=34;# The temperature of air at outlet in °C\n",
    "T_win=85;# The temperature of hot water at inlet in °C\n",
    "T_wout=74;# The temperature of hot water at outlet in °C\n",
    "C_pa=1.02;# The specific heat capacity of air in kJ/kg.K\n",
    "C_pw=4.187;# The specific heat capacity of water in kJ/kg.K\n",
    "\n",
    "# Calculation\n",
    "Q=m_a*C_pa*(T_2-T_1);# Heat input in kW\n",
    "m_w=Q/(C_pw*(T_win-T_wout));# The mass flow rate of water in kg/s\n",
    "print\"\\nHeat input,Q=%4.0f kW \\nThe mass flow rate of water,Q=%2.0f kg/s\"%(Q,m_w)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 21.2,PAGE NUMBER:251"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The air-supply temperature,t=26.2°C\n"
     ]
    }
   ],
   "source": [
    "# Variable declaration\n",
    "Q=500;# The amount of heat required for the building in kW\n",
    "T=19;# The temperature at which air enters the heater coil in °C\n",
    "m_a=68;# # The mass flow rate of air in kg/s\n",
    "C_pa=1.02;# The specific heat capacity of air in kJ/kg.K\n",
    "\n",
    "# Calculation\n",
    "t=T+(Q/(m_a*C_pa));# The air supply temperature in °C\n",
    "print\"The air-supply temperature,t=%2.1f°C\"%t"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 21.3,PAGE NUMBER:254"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "The condition of the mixture,t_c=21.0°C\n",
      "\n",
      "                             g_c=0.0083 kg/kg\n",
      "\n",
      "                             h_c=41.8 kJ/kg dry air\n"
     ]
    }
   ],
   "source": [
    "# Variable declaration\n",
    "T_ra=21;# The temperature of the returning air \n",
    "H=50;# % saturation\n",
    "T_d=28;# The dry bulb temperature in °C\n",
    "T_w=20;# The wet bulb temperature in °C\n",
    "m_a=20;# The mass flow rate of returning air in kg/s\n",
    "m_b=3;# The mass flow rate of outside air in kg/s\n",
    "x_ra=0.0079;# The moisture content in kg/kg\n",
    "x_oa=0.0111;# The moisture content in kg/kg\n",
    "h_a=41.8;# The enthalpy in kJ/kg\n",
    "h_b=56.6;# The enthalpy in kJ/kg\n",
    "\n",
    "# Calculation\n",
    "# Method (b)\n",
    "t_c=((T_ra*m_a)+(T_d*m_b))/(m_a+m_b);# °C\n",
    "g_c=((x_ra*m_a)+(x_oa*m_b))/(m_a+m_b);# kg/kg\n",
    "h_c=((h_a*m_a)+(h_a*m_b))/(m_a+m_b);# kJ/kg dry air\n",
    "print\"\\nThe condition of the mixture,t_c=%2.1f°C\"%t_c\n",
    "print\"\\n                             g_c=%0.4f kg/kg\"%g_c\n",
    "print\"\\n                             h_c=%2.1f kJ/kg dry air\"%h_c"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 21.5,PAGE NUMBER:257"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Final moisture content=0.0146 kg/kg \n",
      "The final dry bulb temperature,t=22.02°C\n"
     ]
    }
   ],
   "source": [
    "# Variable declaration\n",
    "T_s=100;# The temperature of steam in °C\n",
    "T_d=21;# The dry bulb temperature in °C\n",
    "H=50;#  % saturation\n",
    "x_ab=0.0079;# Moisture content of air before in kg/kg\n",
    "x_a=0.0067;# Moisture added in kg/kg\n",
    "C_ps=1.972;# The specific heat capacity of the steam in kJ/kg°C\n",
    "C_pa=1.006;# The specific heat capacity of air in kJ/kg.K\n",
    "\n",
    "# Calculation\n",
    "x=x_ab+x_a;# Final moisture content in kg/kg\n",
    "t=((x_a*C_ps*T_s)+(C_pa*T_d))/(((x_a*C_ps)+(C_pa)));# The final dry bulb temperature in °C\n",
    "print\"\\nFinal moisture content=%0.4f kg/kg \\nThe final dry bulb temperature,t=%2.2f°C\"%(x,t)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 21.6,PAGE NUMBER:259"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a) By construction on the chart ( Figure 21.7 ), the final condition is 10.4°C dry bulb,82% saturation\n",
      "\n",
      "(b)The final condition,\n",
      "   The final dry bulb temperature=10.4°C \n",
      "   The moisture content=0.00645 kg/kg\n"
     ]
    }
   ],
   "source": [
    "# Variable declaration\n",
    "T_d1=23;# The dry bulb temperature in °C\n",
    "T_w=5;# The temperature of water in °C\n",
    "H=50;#  % saturation\n",
    "n_s=0.7;# Saturation efficiency in %\n",
    "x_a=0.0089;# Moisture content in kg/kg\n",
    "x_b=0.0054;# Moisture content in kg/kg\n",
    "\n",
    "# Calculation\n",
    "#(a)\n",
    "print\"(a) By construction on the chart ( Figure 21.7 ), the final condition is 10.4°C dry bulb,82% saturation\"\n",
    "#(b)\n",
    "T_d2=T_d1-(n_s*(T_d1-T_w));# The final dry bulb temperature in °C\n",
    "x_f=x_a-(n_s*(x_a-x_b));# kg/kg\n",
    "print\"\\n(b)The final condition,\\n   The final dry bulb temperature=%2.1f°C \\n   The moisture content=%0.5f kg/kg\"%(T_d2,x_f)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 21.7,PAGE NUMBER:259"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Temperature rise of water=1 K\n"
     ]
    }
   ],
   "source": [
    "# Variable declaration\n",
    "m_w=4;# The mass of water in kg\n",
    "m_a=1;# The mass of air in kg\n",
    "h_ab=45.79;# Enthalpy of air before in kJ/kg\n",
    "h_aa=26.7;# Enthalpy of air after in kJ/kg\n",
    "C_pw=4.187;# The specific heat capacity of water in kJ/kg.K\n",
    "\n",
    "# Calculation\n",
    "Q_l=h_ab-h_aa;# Heat lost per kilogram air in kJ\n",
    "Q_g=Q_l/m_w;# Heat gain per kilogram water in kJ\n",
    "dT=Q_g/C_pw;# Temperature rise of water in K\n",
    "print\"Temperature rise of water=%1.0f K\"%dT\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 21.8,PAGE NUMBER:261"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "The drop in dry bulb temperature=10.7°C \n",
      "The drop in enthlpy=27.81 kJ/kg\n"
     ]
    }
   ],
   "source": [
    "# Variable declaration\n",
    "T_d1=24;# The dry bulb temperature in °C\n",
    "T_d2=7;# The dry bulb temperature in °C\n",
    "H=45;#  % saturation\n",
    "cf=0.78;# Contact factor\n",
    "h_1=45.85;# The enthalpy in kJ/kg\n",
    "h_2=22.72;# The enthalpy in kJ/kg\n",
    "\n",
    "# Calculation\n",
    "#(a) By construction on the chart ( Figure 21.9 ), 10.7°C dry bulb, 85% saturation.\n",
    "#(b) By calculation, the dry bulb will drop 78% of 24 to 7°C:\n",
    "dT=T_d1-(cf*(T_d1-T_d2));# The drop in dry bulb temperature in °C\n",
    "dh=h_1-(cf*(h_1-h_2));# The drop in enthalpy in kJ/kg\n",
    "print\"\\nThe drop in dry bulb temperature=%2.1f°C \\nThe drop in enthlpy=%2.2f kJ/kg\"%(dT,dh)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 21.10,PAGE NUMBER:262"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The process line meets the saturation curve at - 1°C, giving the ADP (which meansthat condensate will collect on the fins as frost).\n",
      "Taking the ‘ off ’ condition at 5°C dry bulb and measuring the proportion along theprocess line gives a coil contact factor of 75%.\n"
     ]
    }
   ],
   "source": [
    "# Variable declaration\n",
    "T_d=23;# The dry bulb temperature in °C\n",
    "H=40;# % saturation\n",
    "SH=36;# The sensible heat to be removed in kW\n",
    "LH=14;# The latent heat in kW\n",
    "\n",
    "# Calculation\n",
    "# Plotting on the chart ( Figure 21.10 ) from 23°C/40% and using the ratio\n",
    "R=SH/(SH+LH);\n",
    "print\"The process line meets the saturation curve at - 1°C, giving the ADP (which meansthat condensate will collect on the fins as frost).\"\n",
    "print\"Taking the ‘ off ’ condition at 5°C dry bulb and measuring the proportion along theprocess line gives a coil contact factor of 75%.\"\n"
   ]
  }
 ],
 "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.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
