{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CHAPTER 16 - Supercharging of IC Engines"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 16.1 PAGE 525"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Power required to run the supercharger = 90.47 kW \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "# Initialisation of Variables\n",
    "pwu=735#............#Power developed by naturally aspirated engine in kW\n",
    "afru=12.8#.............#Air fuel ratio for naturally aspirated engine\n",
    "bsfc=0.350#......#Brake specific fuel consumption in kg/kWh\n",
    "metau=0.86#...........#Mechanical efficiency of naturally aspirated engine\n",
    "pi=730#...........#Inlet pressure in mm of Hg absolute\n",
    "tm=325#...........#Mixture temperature in Kelvin\n",
    "pr=1.6#.............#Pressure ratio of supercharged engine\n",
    "etaa=0.7#.............#Adiabatic efficiency of supercharged engine\n",
    "metas=0.9#..............#Mechanical efficiency of supercharged engine\n",
    "afrs=12.8#.............#Air fuel ratio for supercharged engine\n",
    "rhohg=13600#.............#Density of mercury in kg/m**3\n",
    "R=0.287#...................#Gas constant in kJ/kgK\n",
    "ga=1.4#................#Degree of freedom for gas\n",
    "cp=1.005#..................#Specific heat of the fuel\n",
    "g=9.81#................#Acceleration due to gravity in m/s**2\n",
    "#calculations\n",
    "t2=tm*(pr)**((ga-1)/ga)#..............#Ideal temperature for the supercharged engine\n",
    "t2a=tm+(t2-tm)/etaa#................#Actual temperature for the supercharged engine\n",
    "wa=cp*(t2a-tm)#.....................#Work of the supercharger\n",
    "wsup=cp*(t2a-tm)/metas#..............#Work required to drive the supercharger in kJ/kg of air\n",
    "#When unsupercharged\n",
    "p1=(pi/1000)*((g*rhohg)/1000)#..............#Inlet pressure in kN/m**2\n",
    "rhounsup=p1/(R*tm)#\n",
    "maunsup=(bsfc*pwu*afrs)/3600#...................#Air consumption in kg/s for unsupercharged engine\n",
    "#When supercharged\n",
    "rhosup=(pr*p1)/(R*t2a)#\n",
    "masup=maunsup*(rhosup/rhounsup)#..................#Air consumption in kg/s\n",
    "Psup=masup*wsup#...............#Power required to run the supercharger in kW\n",
    "print \"The Power required to run the supercharger = %0.2f kW \"%Psup"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 16.2 PAGE 526"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Engin Capacity = 0.02 m**3 \n",
      "The Brake mean effective pressure  = 8.34 bar\n",
      "The Increase of pressure required = 0.47 bar\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "p1=1.0132#..............#Mean pressure at sea level in bar\n",
    "t1=283#................#Mean temperature at sea level in Kelvin\n",
    "BP=260#....................#Brake Power output in kW\n",
    "etaV=0.78#..................#Volumetric efficiency at sea level free air condition\n",
    "sfc=0.247#............#Specific Fuel consumption in kg/kW.h\n",
    "afr=17#...................#Air fuel ratio\n",
    "N=1500#...................#Engine rpm\n",
    "at=2700#.................#Altitude in mts\n",
    "p2=0.72#................#Pressure in bar at the given altitude\n",
    "Psup=0.08#.................#8% power of engine is taken by the supercharger\n",
    "R=287#...................#Gas constant in J/kgK\n",
    "t2=32+273#..............#Temperature in Kelvin at the given altitude\n",
    "#calculations\n",
    "mf=(sfc*BP)/60#.............#Fuel consumption in kg/min\n",
    "ma = mf*afr#..................#Air consumption in ig/min\n",
    "acps = ma/(N/2)#............#Air consumption per stroke in kg\n",
    "Vs=(acps*R*t1)/(etaV*p1*10**5)#................#Engine capacity in m**3\n",
    "print \"The Engin Capacity = %0.2f m**3 \"%Vs\n",
    "pmb=(BP*6)/(Vs*10*(N/2))#........#Brake Mean Effective Pressure in bar\n",
    "print \"The Brake mean effective pressure  = %0.2f bar\"%pmb\n",
    "gp=BP/(1-Psup)#.................#Gross power produced by supercharged engine in kW\n",
    "masup=ma*gp/BP#......................#Mass of air required for supercharged engine in kg\n",
    "matc=masup/(N/2)#..............#Mass of air taken per cycle\n",
    "pressure=(matc*R*t2)/(etaV*10**5*Vs)#\n",
    "print \"The Increase of pressure required = %0.2f bar\"%(pressure-p2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 16.3 PAGE 527"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Net increase in Brake Power = 17.60 kW \n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "ec=3600*10**(-6)#.............#Engine capacity in m**3\n",
    "pw=13#...............#Power developed in kW per m**3 of free air induced per minute\n",
    "etaV=0.82#............#Volumetric Efficiency\n",
    "N=3000#................#Engine rpm\n",
    "p1=1.0132#...........................#Initial Air pressure in bar\n",
    "t1=298#........................#Initial Temperature in Kelvin\n",
    "pr=1.8#.....................#Pressure ratio in rotary compressor\n",
    "etaC=0.75#.................#Isentropic efficiency of compressor\n",
    "etaM=0.8#....................#Mechanical efficiency\n",
    "ga=1.4#.....................#Degree of freedom for the gas\n",
    "td=4#.......................#The amount by which the temperature is kess than delivery temperature from compressor\n",
    "R=287#......................#Gas constant in J/kg.K\n",
    "cp=1.005#.....................#Specific heat capacity\n",
    "#Calculations\n",
    "Vs=(ec*N)/2#....................#Swept volume in m**3/min\n",
    "Vu=Vs*etaV#....................#Unsupercharged volume induced per min\n",
    "rcdp=pr*p1#........#Rotary compressor delivery pressure\n",
    "t2=t1*(pr)**((ga-1)/ga)#..............#Ideal temperature for the supercharged engine\n",
    "t2a=t1+(t2-t1)/etaC#................#Actual temperature for the supercharged engine\n",
    "ta=t2a-td#............................#Temperature of air at intake to the engine cylinder\n",
    "V1=(rcdp*Vs*t1)/(p1*ta)#.................#Equivalent volume at 1.0132 bar and 298 K\n",
    "Vinc=V1-Vs#...........................#Increase in induced Volume of air in m**3/min\n",
    "ipincai=pw*Vinc#.......................#Increase in IP from air induced in kW\n",
    "ipinciip=((rcdp-p1)*10**5*Vs)/(60*1000)#...........#Increase in IP due to increased induction pressure kW\n",
    "ipinctot=ipincai+ipinciip#...............#Total increase in Input Power in kW\n",
    "bpinc=ipinctot*etaM#....................#Increase in Brake Power of the engine in kW\n",
    "ma=(rcdp*10**5*Vs)/(60*R*ta)#...................#Mass of air delivered by the compressor kg/s\n",
    "pc=(ma*cp*(t2a-t1))/etaM#....................#Power required by the compressor\n",
    "bpincnet=bpinc-pc#..........................#Net Increase in BP\n",
    "print \"The Net increase in Brake Power = %0.2f kW \"%bpincnet"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 16.4 PAGE 528"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Engine Capacity = 0.02 m**3:\n",
      "The Brake mean effective pressure = 8.41 bar\n",
      "The Increase of pressure required = 0.47 bar\n"
     ]
    }
   ],
   "source": [
    "# Initialisation of Variables\n",
    "p1=1.0132#..............#Mean pressure at sea level in bar\n",
    "t1=283#................#Mean temperature at sea level in Kelvin\n",
    "BP=250#....................#Brake Power output in kW\n",
    "etaV=0.78#..................#Volumetric efficiency at sea level free air condition\n",
    "sfc=0.245#............#Specific Fuel consumption in kg/kW.h\n",
    "afr=17#...................#Air fuel ratio\n",
    "N=1500#...................#Engine rpm\n",
    "at=2700#.................#Altitude in mts\n",
    "p2=0.72#................#Pressure in bar at the given altitude\n",
    "Psup=0.08#.................#8% power of engine is taken by the supercharger\n",
    "R=287#...................#Gas constant in J/kgK\n",
    "t2=32+273#..............#Temperature in Kelvin at the given altitude\n",
    "#calculations\n",
    "mf=(sfc*BP)/60#.............#Fuel consumption in kg/min\n",
    "ma = mf*afr#..................#Air consumption in ig/min\n",
    "acps = ma/(N/2)#............#Air consumption per stroke in kg\n",
    "Vs=(acps*R*t1)/(etaV*p1*10**5)#................#Engine capacity in m**3\n",
    "print \"The Engine Capacity = %0.2f m**3:\"%Vs\n",
    "pmb=(BP*6)/(Vs*10*(N/2))#........#Brake Mean Effective Pressure in bar\n",
    "print \"The Brake mean effective pressure = %0.2f bar\"%pmb\n",
    "gp=BP/(1-Psup)#.................#Gross power produced by supercharged engine in kW\n",
    "masup=ma*gp/BP#......................#Mass of air required for supercharged engine in kg\n",
    "matc=masup/(N/2)#..............#Mass of air taken per cycle\n",
    "pressure=(matc*R*t2)/(etaV*10**5*Vs)#\n",
    "print \"The Increase of pressure required = %0.2f bar\"%(pressure-p2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 16.5 PAGE 529"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The indicated mean effective pressure = 4.55 bar \n",
      "The total aspirated air mass flow into the engine = 6.73 kg/min \n",
      "Air flow into the compressor = 16.79 kg/min\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import pi\n",
    "# Initialisation of Variables\n",
    "t1=298#.................#Temperature of the air while entering the compressor in Kelvin\n",
    "qrej=1210#..............#Amount of heat rejected in cooler in kJ/min\n",
    "t2=273+65#...............#Temperature of the air leaving the cooler in Kelvin\n",
    "p2=1.75#.................#Pressure of the air leaving the cooler in bar\n",
    "n=6#.....................#No of cylinders\n",
    "d=0.1#...................#Bore of the cylinder in m\n",
    "l=0.11#...................#Stroke of the cylinder in m\n",
    "etaV=0.72#................#volumetric efficiency\n",
    "N=2000#...............#Engine rpm\n",
    "Tout=150#..................#Torque Output in Nm\n",
    "etaM=0.8#..................#Mechanical efficiency\n",
    "R=287#.......................#Gas constant for air in J/kgK\n",
    "cp=1.005#...................#Specific capacity of air\n",
    "#calculations\n",
    "BP=(2*pi*N*Tout)/(60*1000)#...........#Brake power in kW\n",
    "IP=BP/etaM#..........#Input Power in kW\n",
    "Vc=(pi/4)*d*d*l#...................#Cylinder Volume in m**3\n",
    "pmi=(6*IP)/(n*Vc*(N/2)*10)#................#Indicated mean effective pressure\n",
    "print \"The indicated mean effective pressure = %0.2f bar \"%(pmi)\n",
    "Vs=Vc*6*(N/2)#.........................#Engine Swept Volume in m**3/min\n",
    "Vaa=Vs*etaV#..........................#Aspirated volume of air into engine in m**3/min\n",
    "maa=(p2*10**5*Vaa)/(R*t2)#..............#Aspirated air mass flow into the engine in kg/min\n",
    "print \"The total aspirated air mass flow into the engine = %0.2f kg/min \"%maa\n",
    "t2a=((((BP/cp)/(qrej/(60*cp)))*t2)-t1)/(((BP/cp)/(qrej/(60*cp)))-1)#\n",
    "mc=((BP/cp)/(t2a-t1))*60#........................#Air flow into the compressor in kg/min\n",
    "print \"Air flow into the compressor = %0.2f kg/min\"%mc"
   ]
  }
 ],
 "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
}
