{
 "metadata": {
  "name": "",
  "signature": "sha256:6c33bc146fd289fab423bb4c093c8f33bd27dc001258cc7dbd47055d0bcb3468"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 14 - Psychrometrics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1 - Pg 257"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the partial pressures, dew temperature and density of air, water and specific humidity, Degree of saturation\n",
      "#Initialization of variables\n",
      "t1=80+460 #R\n",
      "ps=0.5069 #psia\n",
      "print '%s' %(\"from steam tables,\")\n",
      "vs=633.1 #ft^3/lbm\n",
      "phi=0.3\n",
      "R=85.6\n",
      "Ra=53.3\n",
      "p=14.696\n",
      "#calculations\n",
      "tdew=46. #F\n",
      "pw=phi*ps\n",
      "rhos=1/vs\n",
      "rhow=phi*rhos\n",
      "rhow2= pw*144/(R*t1)\n",
      "pa=p-pw\n",
      "rhoa= pa*144/(Ra*t1)\n",
      "w=rhow/rhoa\n",
      "mu=phi*(p-ps)/(p-pw)\n",
      "Ws=0.622*(ps/(p-ps))\n",
      "mu2=w/Ws\n",
      "#results\n",
      "print '%s' %(\"part a\")\n",
      "print '%s %.5f %s' %(\"partial pressure of water =\",pw,\"psia\")\n",
      "print '%s %d %s' %(\"\\n dew temperature =\",tdew,\"F\")\n",
      "print '%s' %(\"part b\")\n",
      "print '%s %.6f %s' %(\"density of water =\",rhow,\"lbm/ft^3\")\n",
      "print '%s %.6f %s' %(\"\\n in case 2, density of water =\",rhow2,\"lbm/ft^3\")\n",
      "print '%s %.6f %s' %(\"\\n density of air =\",rhoa,\"lbm/ft^3\")\n",
      "print '%s' %(\"part c\")\n",
      "print '%s %.4f %s' %(\"specific humidity  =\",w,\"lbm steam/lbm air\")\n",
      "print '%s' %(\"part d\")\n",
      "print '%s %.3f' %(\"In method 1, Degree of saturation = \",mu)\n",
      "print '%s %.3f' %(\"\\n In method 2, Degree of saturation = \",mu2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "from steam tables,\n",
        "part a\n",
        "partial pressure of water = 0.15207 psia\n",
        "\n",
        " dew temperature = 46 F\n",
        "part b\n",
        "density of water = 0.000474 lbm/ft^3\n",
        "\n",
        " in case 2, density of water = 0.000474 lbm/ft^3\n",
        "\n",
        " density of air = 0.072765 lbm/ft^3\n",
        "part c\n",
        "specific humidity  = 0.0065 lbm steam/lbm air\n",
        "part d\n",
        "In method 1, Degree of saturation =  0.293\n",
        "\n",
        " In method 2, Degree of saturation =  0.293\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2 - Pg 258"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the change in moisture content and change in moisture content\n",
      "#Initialization of variables\n",
      "p=14.696 #psia\n",
      "ps=0.0808  #psia\n",
      "ps2=0.5069 #psia\n",
      "phi2=0.5\n",
      "phi=0.6\n",
      "grain=7000.\n",
      "#calculations\n",
      "pw=phi*ps\n",
      "w1=0.622*pw/(p-pw)\n",
      "pw2=phi2*ps2\n",
      "w2=0.622*pw2/(p-pw2)\n",
      "dw=w2-w1\n",
      "dwg=dw*grain\n",
      "#results\n",
      "print '%s %.6f %s' %(\"change in moisture content =\",dw,\" lbm water/lbm dry air\")\n",
      "print '%s %.2f %s' %(\"\\n in grains, change =\",dwg,\"  grains water/lbm dry air\")\n",
      "print '%s' %(\"The answers are a bit different due to rounding off error in textbook\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "change in moisture content = 0.008857  lbm water/lbm dry air\n",
        "\n",
        " in grains, change = 62.00   grains water/lbm dry air\n",
        "The answers are a bit different due to rounding off error in textbook\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3 - Pg 264"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the humidity ratio and relative humidity\n",
      "#Initialization of variables\n",
      "t1=80. #F\n",
      "t2=60. #F\n",
      "p=14.696 #psia\n",
      "ps=0.507 #psia\n",
      "pss=0.256 #psia\n",
      "cp=0.24\n",
      "#calculations\n",
      "ws=0.622*pss/(p-pss)\n",
      "w=(cp*(t2-t1) + ws*1060)/(1060+ 0.45*(t1-t2))\n",
      "pw=w*p/(0.622+w)\n",
      "phi=pw/ps*100\n",
      "td=46. #F\n",
      "#results\n",
      "print '%s %.4f %s' %(\"\\n humidity ratio =\",w,\"lbm/lbm dry air\")\n",
      "print '%s %.1f %s' %(\"\\n relative humidity  =\",phi,\" percent\")\n",
      "print '%s %d %s' %(\"\\n Dew point =\",td,\"F\")\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " humidity ratio = 0.0064 lbm/lbm dry air\n",
        "\n",
        " relative humidity  = 29.7  percent\n",
        "\n",
        " Dew point = 46 F\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4 - Pg 264"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the enthalpy and sigma function\n",
      "#Initialization of variables\n",
      "W=0.0065  #lbm/lbm of dry air\n",
      "t=80. #F\n",
      "td=60. #F\n",
      "#calculations\n",
      "H=0.24*t+W*(1060+0.45*t)\n",
      "sig=H-W*(td-32)\n",
      "Ws=0.0111\n",
      "H2=0.24*td+Ws*(1060+0.45*td)\n",
      "sig2=H2-Ws*(td-32)\n",
      "#results\n",
      "print '%s %.2f %s' %(\"In case 1, enthalpy =\",H,\" Btu/lbm dry air\")\n",
      "print '%s %.2f %s' %(\"\\n In case 1, sigma function =\",sig,\" Btu/lbm dry air\")\n",
      "print '%s %.2f %s' %(\"\\n In case 2, enthalpy =\",H2,\" Btu/lbm dry air\")\n",
      "print '%s %.2f %s' %(\"\\n In case 2, sigma function =\",sig2,\" Btu/lbm dry air\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "In case 1, enthalpy = 26.32  Btu/lbm dry air\n",
        "\n",
        " In case 1, sigma function = 26.14  Btu/lbm dry air\n",
        "\n",
        " In case 2, enthalpy = 26.47  Btu/lbm dry air\n",
        "\n",
        " In case 2, sigma function = 26.15  Btu/lbm dry air\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5 - Pg 264"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the Enthalpy and heat added\n",
      "#Initialization of variables\n",
      "t1=30. #F\n",
      "t2=60. #F\n",
      "t3=80. #F\n",
      "W1=0.00206\n",
      "W2=0.01090\n",
      "#calculations\n",
      "cm1=0.24+0.45*W1\n",
      "H1=cm1*t1+W1*1060\n",
      "cm2=0.24+0.45*W2\n",
      "H2=cm2*t3+W2*1060\n",
      "hf=t2-32\n",
      "dq=H2-H1-(W2-W1)*hf\n",
      "#results\n",
      "print '%s %.2f %s' %(\"In case 1, Enthalpy =\",H1,\" Btu/lbm dry air\")\n",
      "print '%s %.2f %s' %(\"\\n In case 2, Enthalpy =\",H2,\" Btu/lbm dry air\")\n",
      "print '%s %.2f %s' %(\"\\n Heat added =\",dq,\" Btu/lbm dry air\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "In case 1, Enthalpy = 9.41  Btu/lbm dry air\n",
        "\n",
        " In case 2, Enthalpy = 31.15  Btu/lbm dry air\n",
        "\n",
        " Heat added = 21.49  Btu/lbm dry air\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6 - Pg 265"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the partial pressure and dew temperature, density of air, water and specific humidity\n",
      "#Initialization of variables\n",
      "pw=0.15#psia\n",
      "print '%s' %(\"using psychrometric charts,\")\n",
      "tdew=46 #F\n",
      "#calculations\n",
      "va=13.74 #ft^3/lbm dry air\n",
      "rhoa=1./va\n",
      "V=13.74\n",
      "mw=46/7000.\n",
      "rhow=mw/V\n",
      "w=0.00657\n",
      "#results\n",
      "print '%s' %(\"part a\")\n",
      "print '%s %.2f %s' %(\"partial pressure of water =\",pw,\" psia\")\n",
      "print '%s %d %s' %(\"\\n dew temperature =\",tdew,\"F\")\n",
      "print '%s' %(\"part b\")\n",
      "print '%s %.6f %s' %(\"density of water =\",rhow,\"lbm/ft^3\")\n",
      "print '%s %.4f %s' %(\"\\n density of air =\",rhoa,\"lbm/ft^3\")\n",
      "print '%s' %(\"part c\")\n",
      "print '%s %.5f %s' %(\"specific humidity  =\",w,\"lbm steam/lbm air\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "using psychrometric charts,\n",
        "part a\n",
        "partial pressure of water = 0.15  psia\n",
        "\n",
        " dew temperature = 46 F\n",
        "part b\n",
        "density of water = 0.000478 lbm/ft^3\n",
        "\n",
        " density of air = 0.0728 lbm/ft^3\n",
        "part c\n",
        "specific humidity  = 0.00657 lbm steam/lbm air\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7 - Pg 266"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the Enthalpy change\n",
      "#Initialization of variables\n",
      "W1=0.00206 #lbm/lbm dry air\n",
      "W2=0.01090 #lbm/lbm dry air\n",
      "t=60 #F\n",
      "#calculations\n",
      "dw=W1-W2\n",
      "\n",
      "hs=144.4\n",
      "hs2=66.8-32\n",
      "w1=14.4 #Btu/lbm\n",
      "ws1=20 #Btu/lbm\n",
      "w2=76.3 #Btu/lbm\n",
      "ws2=98.5 #Btu/lbm\n",
      "dwh1=-(w1-ws1)/7000. *hs\n",
      "H1=9.3+dwh1\n",
      "dwh2=(w2-ws2)/7000. *hs2\n",
      "H2=31.3+dwh2\n",
      "dwc=dw*(t-32)\n",
      "dq=H2-H1+dwc\n",
      "#results\n",
      "print '%s %.2f %s' %(\"Enthalpy change =\",dq,\" Btu/lbm dry air\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Enthalpy change = 21.53  Btu/lbm dry air\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8 - Pg 267"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the humidity and Temperature\n",
      "#Initialization of variables\n",
      "print '%s' %(\"From psychrometric charts,\")\n",
      "va1=13 #ft^3/lbm dry air\n",
      "va2=13.88 #ft^3/lbm dry air\n",
      "flow=2000. #cfm\n",
      "#calculations\n",
      "ma1= flow/va1\n",
      "ma2=flow/va2\n",
      "t=62.5# F\n",
      "phi=0.83 #percent\n",
      "#results\n",
      "print '%s %.2f' %(\"humidity = \",phi)\n",
      "print '%s %.1f %s' %(\"\\n Temperature =\",t,\" F\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "From psychrometric charts,\n",
        "humidity =  0.83\n",
        "\n",
        " Temperature = 62.5  F\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9 - Pg 270"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the dry bulb temperature and percent humidity\n",
      "#Initialization of variables\n",
      "t=90 #F\n",
      "ts=67.2 #F\n",
      "phi=0.3\n",
      "per=0.8\n",
      "#calculations\n",
      "dep=t-ts\n",
      "dt=dep*per\n",
      "tf=t-dt\n",
      "print '%s' %(\"from psychrometric charts,\")\n",
      "phi2=0.8\n",
      "#results\n",
      "print '%s %.2f %s' %(\"Dry bulb temperature =\",tf,\" F\")\n",
      "print '%s %.2f' %(\"\\n percent humidity  = \",phi2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "from psychrometric charts,\n",
        "Dry bulb temperature = 71.76  F\n",
        "\n",
        " percent humidity  =  0.80\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 10 - Pg 271"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the cooling range and Approach. Also calculate the amount of water cooled and percentage of water lost \n",
      "#Initialization of variables\n",
      "m=1. #lbm\n",
      "t1=100. #F\n",
      "t2=75. #F\n",
      "db=65. #F\n",
      "print '%s' %(\"From psychrometric charts,\")\n",
      "t11=82 #F\n",
      "phi1=0.4\n",
      "H1=30. #Btu/lbm dry air\n",
      "w1=65. #grains/lbm dry air\n",
      "w2=250. #grains/lbm dry air\n",
      "#calculations\n",
      "cr=t1-t2\n",
      "appr=t2-db\n",
      "dmf3=(w2-w1)*0.0001427\n",
      "hf3=68.\n",
      "hf4=43.\n",
      "H2=62.2\n",
      "H1=30.\n",
      "mf4= (H1-H2+ dmf3*hf3)/(hf4-hf3)\n",
      "per=dmf3/(dmf3+mf4)*100\n",
      "#results\n",
      "print '%s %d %s' %(\"cooling range =\",cr,\"F\")\n",
      "print '%s %d %s' %(\"\\n Approach =\",appr,\"F\")\n",
      "print '%s %.3f %s' %(\"\\n amount of water cooled per pound of dry air =\",mf4,\"lbm dry air/lbm dry air\")\n",
      "print '%s %.2f %s' %(\"\\n percentage of water lost by evaporation =\",per,\"percent\")\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "From psychrometric charts,\n",
        "cooling range = 25 F\n",
        "\n",
        " Approach = 10 F\n",
        "\n",
        " amount of water cooled per pound of dry air = 1.216 lbm dry air/lbm dry air\n",
        "\n",
        " percentage of water lost by evaporation = 2.12 percent\n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}