{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 6 : Steam generators"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex: 6.1 Pg: 411"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " (a) The pressure head developed = 35.8 kPa \n",
      " (b)The void fraction at riser exit = 0.5519 \n",
      " (c) The heat transfer rate per unit projected area = 293.1 kW/m**2 \n"
     ]
    }
   ],
   "source": [
    "#Input data\n",
    "H=18##The length of furnace wall riser in m\n",
    "O=76.2##The outer diameter of the furnace wall riser in mm\n",
    "T=6.1##The thickness of the furnace wall riser in mm\n",
    "P=80##Pressure at which saturated water is recieved in bar\n",
    "V=1.5##The velocity of the saturated water in m/s\n",
    "CR=12.5##Assuming circulation ratio\n",
    "S=1.2##Assuming slip ratio\n",
    "g=9.81##Gravitational force constant in m/s**2\n",
    "pi=3.142##Mathematical constant\n",
    "\n",
    "#Calculations\n",
    "xt=1/CR##The quality of steam at the top of the riser\n",
    "vf=0.001384##Specific volume of saturated liquid at 80 bar in m**3/kg\n",
    "vfg=0.02214##Specific volume of Evaporation gas at 80 bar in m**3/kg\n",
    "vg=0.02352##Specific volume of saturated gas at 80 bar in m**3/kg\n",
    "pf=1/vf##Density of the saturated liquid at 80 bar in kg/m**3\n",
    "vt=vf+(xt*vfg)##Specific volume of the steam at the top of the riser in m**3/kg\n",
    "pt=1/vt##Density of steam at the top of the riser in kg/m**3\n",
    "pm=(pt+pf)/2##Mean density in kg/m**3\n",
    "Ph=(H*g*(pf-pm))/1000##The pressure head developed in kPa\n",
    "C=(vf/vg)*S##The part of calculation for the void fraction\n",
    "VF=1/(1+((1-xt)*C)/xt)##The void fraction at riser exit\n",
    "hfg=1441.3##Enthalpy of the evaporation in kJ/kg\n",
    "di=O-12.2##Inner diameter of the furnace wall riser in mm\n",
    "A=(pi*di**2)/4##Inner area in m**2\n",
    "w=pf*A*V##Mass flow rate of saturated water entering the riser in kg/s\n",
    "ws=xt*w##The rate of steam formation in the riser tube in kg/s\n",
    "h=((ws*hfg)/(O*H))/1000##Heat transfer rate per unit projected area in kW/m**2\n",
    "\n",
    "#output\n",
    "print \" (a) The pressure head developed = %3.1f kPa \\n (b)The void fraction at riser exit = %3.4f \\n (c) The heat transfer rate per unit projected area = %3.1f kW/m**2 \"%(Ph,VF,h)\n",
    " "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex: 6.2 Pg: 413"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The amount of water that must be sprayed is 7.737 t/h  or  2.149 kg/s \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "#Input data\n",
    "t=60##The temperature of water while supplying it to desuperheater in degree centigrade\n",
    "ws=200##The amount of steam carrying in a steam line in t/h\n",
    "p=35##The pressure of steam in bar\n",
    "ts=400##The temperature to be maintained by the steam in degree centigrade\n",
    "to=450##The outlet temperature of the steam from boiler in degree centigrade\n",
    "h1=3337.2##The enthalpy of steam at 450 degree C in kJ/kg\n",
    "h2=252##The enthalpy of water at 60 degree C in kJ/kg\n",
    "h3=3222.3##The enthalpy of steam at 400 degree C in kJ/kg\n",
    "\n",
    "#Calculations\n",
    "w=(ws*(h1-h3))/(h3-h2)##Mass flow rate of water in t/h\n",
    "w1=w*(1000/3600)##Mass flow rate of water in kg/s\n",
    "\n",
    "#Output\n",
    "print \"The amount of water that must be sprayed is %3.3f t/h  or  %3.3f kg/s \"%(w,w1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex: 6.3 Pg: 413"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The pressure head developed due to natural circulation is 38163 N/m**2  or  38.163 kPa\n"
     ]
    }
   ],
   "source": [
    "from math import log\n",
    "#Input data\n",
    "\n",
    "H=15##The high of downcomer riser circuit in m\n",
    "P=160##The pressure at which downcomer riser circuit operates in bar\n",
    "xe=0.5##The exit quality of the steam \n",
    "S=1.2##Slip factor\n",
    "vf=0.001711##Specific volume of saturated liquid in m**3/kg\n",
    "vg=0.009306##Specific volume of saturated gas in m**3/kg\n",
    "g=9.806##Gravitational force constant in m/s**2\n",
    "\n",
    "#Calculations\n",
    "C=S*(vf/vg)##The part of calculation for the void fraction \n",
    "VF=1/(1+((1-xe)*C)/xe)##The void fraction at riser exit\n",
    "pf=1/vf##Density of the saturated liquid in kg/m**3\n",
    "pg=1/vg##Density of the saturated gas in kg/m**3\n",
    "pm=pf-(((pf-pg)/(1-C))*(1-((1/((VF)*(1-C)))-1)*log(1/(1-(VF*(1-C))))))##The average mixture density in the riser in kg/m**3\n",
    "P1=g*(pf-pm)*H##Pressure head developed due to natural circulation in N/m**2\n",
    "P2=P1/1000##ressure head developed due to natural circulation in kPa\n",
    "\n",
    "#Output \n",
    "print \"The pressure head developed due to natural circulation is %3.0f N/m**2  or  %3.3f kPa\"%(P1,P2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex: 6.4 Pg: 414"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " (a)The steam generation rate = 93.383 kg/s \n",
      " (b) The fuel burning rate = 10.898 kg/s \n",
      " (c) The evaporation factor = 8.57 \n",
      " (d) The pressure head available for natural circulation = 0.6448 bar \n",
      " (e) The circulation ratio = 12.5 \n",
      " (f)The number of risers required = 713 \n",
      " (g) The heat absorbtion rate per unit projected area of the riser = 72.51 kW/m**2\n"
     ]
    }
   ],
   "source": [
    "from math import ceil\n",
    "#Input data\n",
    "\n",
    "W=120##The amount of electricity produced in the power plant in MW\n",
    "po=100##The pressure of the steam at the outlet of boiler in bar\n",
    "to=500##The temperature of steam at the outlet of boiler in degree centigrade\n",
    "p=0.1##The condenser pressure in bar\n",
    "nb=0.9##The efficiency of the boiler\n",
    "CV=25.7##The calorific value of the coal in MJ/kg\n",
    "ti=160##The feed water temperature at boiler inlet in degree centigrade\n",
    "H=40##The high of the risers in the furnace wall in m\n",
    "xt=0.08##The quality of the steam at the top of the riser\n",
    "v=2##The exit velocity of the riser and entering the drum in m/s\n",
    "Do=60##The outer diameter of the risers in mm\n",
    "T=3##The thickness of the wall in mm\n",
    "pi=3.142##Mathematical constant\n",
    "g=9.806##Gravitational force constant in m/s**2\n",
    "\n",
    "#Calculations\n",
    "h1=3374.8##Enthalpy at point 1 in kJ/kg\n",
    "s1=6.6011##Entropy at point 1 in kJ/kgK\n",
    "sf=0.6479##Entropy of the saturated liquid at point 1 in kJ/kgK\n",
    "sg=7.5055##Entropy of the Saturated vapour at point 1 in kJ/kgK\n",
    "x2=(s1-sf)/sg##The quality of the steam\n",
    "h2=191.46+(x2*2393.29)##Enthalpy at point 2 in kJ/kg\n",
    "h3=191.46##Enthalpy at point 3 in kJ/kg\n",
    "h5=675.5##Enthalpy at point 5 in kJ/kg\n",
    "ws=(W*1000)/(h1-h2)##Mass flow rate of steam in kg/s\n",
    "wf=(ws*(h1-h5))/(nb*CV*1000)##Mass flow rate of fuel in kg/s\n",
    "E=ws/wf##Evaporation factor \n",
    "vf=0.0014523##The specific volume of saturated liquid in m**3/kg\n",
    "vg=0.0165884##The specific volume of saturated vapour in m**3/kg\n",
    "vt=vf+(xt*vg)##Specific volume at the top in m**3/kg\n",
    "pt=1/vt##Density of the steam at the top in kg/m**3\n",
    "pf=1/vf##The density of the steam in kg/m**3\n",
    "pm=(pf+pt)/2##The average mixture density in kg/m**3\n",
    "H1=(g*H*(pf-pm))/10**5##Pressure head available for natural circulation in bar\n",
    "CR=1/xt##Circulation ratio\n",
    "di=(Do-(2*T))/1000##The inner diameter of the riser in m\n",
    "A=(pi*di**2)/4##Area for the inner diameter in m**2\n",
    "w=(A*pt*v*xt)##The rate of steam formation in the riser in kg/s\n",
    "Nr=ceil(ws)/w##The number of risers\n",
    "hfg=1319.8##Enthalpy of the evaporation in kJ/kg\n",
    "Ha=(w*hfg)/((Do/1000)*H)##Heat absorption rate per unit projected area of the riser in kW/m**2\n",
    "\n",
    "#Output \n",
    "print \" (a)The steam generation rate = %3.3f kg/s \\n (b) The fuel burning rate = %3.3f kg/s \\n (c) The evaporation factor = %3.2f \\n (d) The pressure head available for natural circulation = %3.4f bar \\n (e) The circulation ratio = %3.1f \\n (f)The number of risers required = %3.0f \\n (g) The heat absorbtion rate per unit projected area of the riser = %3.2f kW/m**2\"%(ws,wf,E,H1,CR,Nr,Ha)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex: 6.5 Pg: 415"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " (a)The blowdown required = 0.2796 kg/s \n",
      " (b) Heat loss in blowdown as a percentage of total heat released in the furnace = 0.19 percentage \n",
      " (c) The deposition of scale in superheater tube = 0.553 kg/day \n"
     ]
    }
   ],
   "source": [
    "#Input data\n",
    "ws=64##The steam flow rate in kg/s\n",
    "p=60##The pressure at which steam leaves the boiler in bar\n",
    "m=0.02##Moisture contant in the steam \n",
    "wf=62##The feedwater flow rate in kg/s\n",
    "Pf=3##concentration of feedwater in ppm\n",
    "wm=2##The flow rate of makeup water \n",
    "Pm=50##concentration of makeup water in ppm\n",
    "Ps=5##Leaving the drum water in ppm\n",
    "Pw=1000##The concentration in the drum water in ppm\n",
    "mf=7##The fuel burning rate in kg/m\n",
    "CV=23##The heating value in MJ/kg\n",
    "ta=30##The room temperature in degree centigrade\n",
    "hf=1213.35##Enthalpy of saturated liquid at 60 bar in kJ/kg\n",
    "ha=125.79##Enthalpy at ambient temperature in kJ/kg\n",
    "\n",
    "#Calculations\n",
    "BD=((wf*Pf)+(wm*Pm)-(m*ws*Ps))/1000##The rate of blowdown in kg/s\n",
    "E=((BD*(hf-ha))/(mf*CV*1000))*100##The energy loss in blowdown in percentage\n",
    "S=m*ws*Ps*10**-6*3600*24##Scale deposition in superheater tubes\n",
    "\n",
    "#Output\n",
    "print \" (a)The blowdown required = %3.4f kg/s \\n (b) Heat loss in blowdown as a percentage of total heat released in the furnace = %3.2f percentage \\n (c) The deposition of scale in superheater tube = %3.3f kg/day \"%(BD,E,S)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex: 6.6 Pg: 416"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " (a) The number of coils needed in the economiser = 285 \n",
      " (b) The length of one coil = 314.7 m \n",
      " (c) The verticle height of the duct occupied by the economiser coils = 5.26 m \n"
     ]
    }
   ],
   "source": [
    "from math import log\n",
    "#Input data\n",
    "ws=600##Mass flow rate of feedwater in kg/s\n",
    "p=140##The inlet pressure of the feedwater in bar\n",
    "t=170##The inlet temperature of the feedwater in degree centigrade\n",
    "wg=1250##The mass flow rate of flue gases in kg/s\n",
    "tg2=450##The temperature at which flue gases leave the economisers coils in degree centigrade\n",
    "Vf=12##The velocity of the flue gas in m/s\n",
    "Vw=1.2##The velocity of the water leaving the coil in m/s\n",
    "Do=0.07##The outer diameter of the tube in m\n",
    "Di=0.06##The inner diameter of the tube in m\n",
    "U=70##The overall heat transfer coefficient in W/m**2K\n",
    "Cp=1.12##The specific heat capacity of the flue gases in kJ/kgK\n",
    "V=0.08##The vertical pitch of the coil in m\n",
    "B=4.8##The width of the duct in m\n",
    "C=0.005##The clearence on the both sides of the duct in m\n",
    "pi=3.142##Mathematical constant\n",
    "\n",
    "#Calculations\n",
    "hf=1571.1##The enthalpy of the saturated liquid at 140 bar in kJ/Kg\n",
    "ts=336.75##The saturated temperature at 140 bar in degree centigrade\n",
    "vf=0.001611##The specific volume of the saturated liquid at 140 bar in m**3/kg\n",
    "hf1=719.21##The enthalpy of the saturated liquid at 170 degree C in kJ/kg\n",
    "vf1=0.001114##The specific volume of the saturated liquid at 170 degree C in m**3/kg\n",
    "tg1=((ws*(hf-hf1))/(wg*Cp))+tg2##The temperature at which flue gases enters the economisers coils in degree centigrade\n",
    "t1m=(478.25-280)/(log(478.25/280))##The mean temperature for inlet and exit temperature in degree centigrade \n",
    "Q=ws*(hf-hf1)##The rate of heat transfer in the economiser in kW\n",
    "Ao=(Q/(U*t1m))*10**3##The outer area in m**2\n",
    "n=((ws*(vf/Vw)*(4/pi)*(1/Di**2)))##The number of coils needed in the economiser\n",
    "l=Ao/(n*pi*Do)##The length of one coil in m\n",
    "nt=l/(B-(2*C))##The number of turns in on ecoil \n",
    "VH=nt*V##The vertical height of the duct occupied by the economiser coils\n",
    "\n",
    "#Output\n",
    "print \" (a) The number of coils needed in the economiser = %3.0f \\n (b) The length of one coil = %3.1f m \\n (c) The verticle height of the duct occupied by the economiser coils = %3.2f m \"%(n,l,VH)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex: 6.7 Pg: 418"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(a)The length of the tubes = 9.55 m\n",
      " (b) The number of tubes = 69647  \n"
     ]
    }
   ],
   "source": [
    "from math import log\n",
    "#Input data\n",
    "\n",
    "tg2=160##The temperature to which the flue gases are cooled in degree centigrade\n",
    "ta1=35##The ambient temperature of the air in degree centigrade\n",
    "wa=1167##The mass flow rate of air in kg/s\n",
    "Vg=13##The inlet velocity of the flue gases in m/s\n",
    "U=30##The overall heat transfer coefficient in W/m**2K\n",
    "Cpg=1.10##The specific heat of the flue gas in kJ/kgK\n",
    "Cpa=1.005##The specific heat of the air in kJ/kgK\n",
    "R=0.287##Real gas constant in kJ/kgK\n",
    "wg=1250##The mass flow rate of gas in kg/s\n",
    "tg1=450##The temperature at the inlet of flue gas in degree centigrade\n",
    "P=101.325##Atmospheric temperature in kPa\n",
    "pi=3.1414##Mathematical constant\n",
    "Di=0.06##The inner diameter of the tube in m\n",
    "Do=0.065##The outer diameter of the tube in m\n",
    "\n",
    "#Calculations\n",
    "vg1=(R*(273+tg1))/P##Specific volume of the gas in m**3/kg\n",
    "ta2=((wg*Cpg*(tg1-tg2))/(wa*Cpa))+ta1##The temperature of the heated air in degree centigrade\n",
    "t1m=(75-125)/log(75/125)##The mean temperature of the inlet and exit temperature in degree centigrade\n",
    "Q=wg*Cpg*(tg1-tg2)##The rate of heat transfer in the economiser in kW\n",
    "Ao=(Q/(U*t1m))*10**3##The outer area in m**2\n",
    "n=((wg*(vg1/Vg)*(4/pi)*(1/Di**2)))##The number of coils needed in the economiser\n",
    "l=Ao/(n*pi*Do)##The length of one coil in m\n",
    "\n",
    "#Output\n",
    "print \"(a)The length of the tubes = %3.2f m\\n (b) The number of tubes = %3.0f  \"%(l,n)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex: 6.8 Pg: 419"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " (a)The length of the one coil = 8.38 m\n",
      " (b) The number of coils = 231  \n"
     ]
    }
   ],
   "source": [
    "#Input data\n",
    "di=0.05##The inner diameter of the superheater coil in m\n",
    "T=0.005##The thickness of the coil in m\n",
    "p=60##The pressure of the steam at the exit in bar\n",
    "t=500##The temperature of the steam at the exit in degree centigrade\n",
    "V2=10##The velocity of the steam at the exit in m/s\n",
    "ws=80##The mass flow rate of steam in kg/s\n",
    "H=140##The heat flux in the super heated coils in kW/m**2\n",
    "pi=3.142##Mathematical constant\n",
    "Do=0.06##The outer diameter of the tube in m\n",
    "\n",
    "#Calculations\n",
    "h1=2784.3##The enthalpy of the saturated gas at 60 bar in kJ/kg\n",
    "h2=3422.2##The enthalpy of the saturated gas at 500 degreeC in kJ/kg\n",
    "v2=0.05665##The specific volume of gas at 500 degreeC in m**3/kg\n",
    "Q=ws*(h2-h1)##Heat absorption rate in superheater coil in kW\n",
    "Ao=Q/H##Surface area required in m**2\n",
    "n=((ws*(v2/V2)*(4/pi)*(1/di**2)))##The number of coils needed in the economiser\n",
    "l=Ao/(n*pi*Do)##The length of one coil in m\n",
    "\n",
    "#Output\n",
    "print \" (a)The length of the one coil = %3.2f m\\n (b) The number of coils = %3.0f  \"%(l,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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}