{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CHAPTER-12 Fuel injection systems for C.I. Engines "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 12.1 PAGE 421"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Volume of Fuel Injected per Cycle = 0.05 cc \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "# Initialisation of Variables\n",
    "\n",
    "n=6#...............#No of cylinders\n",
    "BP=125#...............#Brake Power in kW\n",
    "N=3000#..............#Engine rpm\n",
    "bsfc=200#............#Brake Specific Fuel Consumption g/kWh\n",
    "spgr=0.85#.............#Specific Gravity\n",
    "\n",
    "#Calculations\n",
    "\n",
    "fc=(bsfc/1000)*BP#.........#Fuel consumption in kg/h\n",
    "fcpc=fc/n#..................#Fuel consumption per cylinder\n",
    "FCPC=(fcpc/60)/(N/2)#................#Fuel Consumption per cycle in kg\n",
    "VFIC = (FCPC*1000)/spgr#...................#Volume of fuel injected per cycle in cc\n",
    "print \"Volume of Fuel Injected per Cycle = %0.2f cc \"%VFIC"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 12.2 PAGE 421"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Diameter of Nozzle Orifice = 8.13e-04 m \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, pi\n",
    "# Initialisation of Variables\n",
    "n=6#...............#No of cylinders\n",
    "N=1500#............#Engine rpm\n",
    "BP=220#.............#Brake Power in kW\n",
    "bsfc=0.273#..........#Brake Specific Fuel Consumption in kg/kWh\n",
    "theta=30#.............#The Period of Injection in degrees of crank angle\n",
    "spgr=0.85#............#Specific Gravity of fuel\n",
    "Cf=0.9#................#Orifice discharge co-efficient\n",
    "ip=160#...............#Injection pressure in bar\n",
    "cp=40#.................#Pressure in combustion chamber in bar\n",
    "rhow=1000#................#Density of water in kg/m**3\n",
    "#Calculations\n",
    "vf = Cf*sqrt((2*(ip-cp)*10**5)/(spgr*rhow))#.............#Actual fuel velocity of injection in m/sec\n",
    "qf=(bsfc*BP)/(spgr*rhow*3600)#..................# Volume of fuel injected per sec in m**3\n",
    "d=sqrt (qf/((pi/4)*n*vf*(theta/360)*(60/N)*(N/120)))#...........#Diameter of nozzle orifice\n",
    "print \"Diameter of Nozzle Orifice = %0.2e m \"%d"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 12.3 PAGE 422"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Volume of Fuel Injected per Cycle = 0.13 cm**3 \n",
      "Diameter of orifice = 0.40 mm \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, pi\n",
    "# Initialisation of Variables\n",
    "n=1#............#No of cylinders\n",
    "N=650#............#Engine rpm\n",
    "theta=28#...........#Crank Travel in degree\n",
    "fc=2.2#...........#Fuel consumption in kg/h\n",
    "spgr=0.875#............#Specific Gravity\n",
    "ip=150#................#Injection Pressure in bar\n",
    "cp=32#.................#Combustion chamber Pressure in bar\n",
    "Cd=0.88#...............#co-efficient of discharge of orifice\n",
    "rhow=1000#...........#Density of water in kg/m**3\n",
    "#Calculation\n",
    "fcpc = fc/60#..............#Fuel consumption per cylinder\n",
    "fipc = fcpc/(N/2)#.........#Fuel Injected per cycle in kg\n",
    "vfpc = fipc/(spgr*rhow)#....#volume of fuel injected per cycle\n",
    "print \"Volume of Fuel Injected per Cycle = %0.2f cm**3 \"%(vfpc*10**6)\n",
    "tfic=(theta/360)*(60/N)#....#Time for Fuel Injection per Cycle in sec\n",
    "mf = fipc/tfic#...............#Mass of fuel injected per cycle in kg/s\n",
    "vf = Cd*sqrt((2*(ip-cp)*10**5)/(spgr*rhow))#.............#Actual fuel velocity of injection in m/sec\n",
    "d=sqrt((mf*4)/(pi*vf*spgr*rhow))\n",
    "print \"Diameter of orifice = %0.2f mm \"%(d*1000)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 12.4 PAGE 423"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Diameter of orifice = 0.56 mm \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, pi\n",
    "# Initialisation of Variables\n",
    "N=2000#............#Engine rpm\n",
    "theta=30#...........#Crank Travel in degree\n",
    "sfc=0.272#...........#Fuel consumption in kg/kWh\n",
    "ip=120#................#Injection Pressure in bar\n",
    "cp=30#.................#Combustion chamber Pressure in bar\n",
    "Cd=0.9#...............#co-efficient of discharge of orifice\n",
    "rhow=1000#...........#Density of water in kg/m**3\n",
    "api = 32#..............#API in degree\n",
    "pw=15#..................#Power Output in kW\n",
    "#Calculation\n",
    "spgr= 141.5/(131.5+api)#............#Specific Gravity\n",
    "fcpc = (sfc*pw)/((N/2)*60)#..............#Fuel consumption per cycle in kg\n",
    "tfic=(theta/360)*(60/N)#....#Time for Fuel Injection per Cycle in sec\n",
    "mf = fcpc/tfic#...............#Mass of fuel injected per cycle in kg/s\n",
    "vf = Cd*sqrt((2*(ip-cp)*10**5)/(spgr*rhow))#.............#Actual fuel velocity of injection in m/sec\n",
    "d=sqrt((mf*4)/(pi*vf*spgr*rhow))\n",
    "print \"Diameter of orifice = %0.2f mm \"%(d*1000)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 12.5 PAGE 424"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fuel consumption = 0.28 kg/kWh \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, pi\n",
    "# Initialisation of Variables\n",
    "N=1800#............#Engine rpm\n",
    "theta=32#...........#Crank Travel in degree\n",
    "ip=118.2#................#Injection Pressure in bar\n",
    "cp=31.38#.................#Combustion chamber Pressure in bar\n",
    "Cd=0.9#...............#co-efficient of discharge of orifice\n",
    "rhow=1000#...........#Density of water in kg/m**3\n",
    "api = 32#..............#API in degree\n",
    "pw=11#..................#Power Output in kW\n",
    "d=0.47#...................#Fuel Injection orifice diameter in mm\n",
    "#Calculation\n",
    "spgr= 141.5/(131.5+api)#............#Specific Gravity\n",
    "tfic=(theta/360)*(60/N)#....#Time for Fuel Injection per Cycle in sec\n",
    "vf = Cd*sqrt((2*(ip-cp)*10**5)/(spgr*rhow))#.............#Actual fuel velocity of injection in m/sec\n",
    "mf=vf*spgr*rhow*(pi/4)*(d/1000)**2#\n",
    "tncp=(N/2)*60#...............#Total no of cycles per hour\n",
    "FIPC=mf*tfic#.................#Mass of fuel injected per cycle in kg/cycle\n",
    "fc=FIPC*tncp*(1/pw)#...................#Fuel consumption in kg/kWh\n",
    "print \"Fuel consumption = %0.2f kg/kWh \"%fc"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 12.6 PAGE 424"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Orifice Area Required per injector = 0.0136 cm**2 \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, pi\n",
    "# Initialisation of Variables\n",
    "n=8#......#No of cylinders\n",
    "pw=386.4#...........#Power output in kW\n",
    "N=800#.............#Engine rpm\n",
    "fc=0.25#.............#Fuel Consumption in kg/kWh\n",
    "theta=12#..............#Crank Travel in degree (for injection)\n",
    "spgr=0.85#...........#Specific Gravity\n",
    "patm=1.013#............#Atmospheric pressure\n",
    "cf=0.6#................#Co-efficient of discharge for injector\n",
    "pcB=32#................#Pressure in cylinder in beginning in bar\n",
    "piB=207#...............#Pressure in injector in beginning in bar\n",
    "pcE=55#...............#Pressure in cylinder at the end in bar\n",
    "piE=595#................#Pressure in injector at the end in bar\n",
    "rhow=1000#..............#density of water in kg/m**3\n",
    "#calculations\n",
    "pwpc = pw/n#......................#Output per cylinder\n",
    "fcpc = (pwpc*fc)/60#.............#Fuel consumption per cylinder in kg/min\n",
    "fipc = fcpc/(N/2)#................#Fuel injected per cycle in kg\n",
    "tfic = (theta*60)/(360*N)#...........#Time for fuel Injection per cycle\n",
    "mf = fipc/tfic#......................#Mass of fuel injected per second\n",
    "pdb = piB-pcB#....................#Pressure difference at beginning\n",
    "pde = piE-pcE#...................#Pressure difference at end\n",
    "apd = (pdb+pde)/2#\n",
    "Ao=mf/(cf*sqrt(2*apd*10**5*spgr*rhow))#\n",
    "print \"Orifice Area Required per injector = %0.4f cm**2 \"%(Ao*10000)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 12.7 PAGE 425"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The mass of fuel injected into each cylinder per second = 1.10 kg/s\n",
      "Diameter of the fuel orifice = 0.55 mm \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, pi\n",
    "# Initialisation of Variables\n",
    "n=6#...............#No of cylinders\n",
    "afr=20#...........#Air fuel ratio\n",
    "d = 0.1#...............#cylinder bore in mm\n",
    "l=0.14#..............#Cylinder length in mm\n",
    "etav=0.8#............#Volumetric Efficiency\n",
    "pa=1#.................#Pressure at the beginning of the compression in bar\n",
    "ta = 300#.............#Temperature at the beginning of the compression in Kelvin\n",
    "theta = 20#...............#Crank travel in degree for injection\n",
    "N = 1500#...................#engine rpm\n",
    "rhof=960#.................#Fuel density in kg/m**3\n",
    "cf=0.67#................#Co efficient of discharge for injector\n",
    "pi=150#....................#injection pressure in bar\n",
    "pc=40#....................#combustion pressure in bar\n",
    "R=287#........................#gas constant for air in kJ/kg.K\n",
    "#calculations\n",
    "V=(pi/4)*d**2*l*etav#......................#Volume of air supplied per cylinder per cycle in m**3\n",
    "ma=(pa*10**5*V)/(R*ta)#.....................#Mass of this air at suction conditions in kg/cycle\n",
    "mf=ma/afr#............................#Mass of fuel in kg/cycle\n",
    "fipc = (theta*60)/(360*N)#...........#Time taken for fuel injection per cycle in seconds\n",
    "MF = mf/fipc#........................#Mass of fuel injected into each cylinder per second\n",
    "print \"The mass of fuel injected into each cylinder per second = %0.2f kg/s\"%MF\n",
    "vf=cf*sqrt((2*(pi-pc)*10**5)/rhof)#.............#fuel velocity injection in m/s\n",
    "d0=sqrt((MF*4)/(pi*vf*rhof))#..................#diameter of fuel orifice in m\n",
    "print \"Diameter of the fuel orifice = %0.2f mm \"%(d0*1000)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 12.8 PAGE 425"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total displacement of plunger = 0.26 cc\n",
      "Effective stroke of plunger = 0.69 mm \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, pi\n",
    "# Initialisation of Variables\n",
    "Vpbes=7#.................#Volume of fuel in the pump barrel before commencement of effective stroke in cc\n",
    "df=3#.................#Diameter of fuel line from pump to injector in mm\n",
    "lf=700#.................#Length of fuel line from pump to injector in mm\n",
    "Vfiv=2#................#Volume of fuel in the injection valve in cc\n",
    "Vfd=0.1#.................#Volume of fuel to be delivered in cc\n",
    "p1=150#..............#Pressure at which fuel is delivered in bar\n",
    "p2=1#.................#atmospheric pressure in bar\n",
    "cc=78.8*10**(-6)#..........#Co - efficient of compressibility per bar\n",
    "dp=7#..............#Diameter of plunger in mm\n",
    "#calculations\n",
    "V1=Vpbes+(pi/4)*((df/10)**2)*(lf/10)+Vfiv#...................#Total initial fuel volume\n",
    "delV=cc*(p1-p2)*V1#................#Change in volume due to compression\n",
    "displu=delV+Vfd#.....................#Total displacement of plunger\n",
    "print \"Total displacement of plunger = %0.2f cc\"%displu\n",
    "lp=(displu*4)/(pi*(dp/10)**2)#.............#Effective stroke of plunger\n",
    "print \"Effective stroke of plunger = %0.2f mm \"%lp"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EXAMPLE 12.9 PAGE 426"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The time required for spray penetration at an injection pressure of 235 bar = 11.98 milliseconds:\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, pi\n",
    "# Initialisation of Variables\n",
    "p1=145#...........#injection pressure in bar\n",
    "p2=235#.........#Injection pressure in bar (2nd case)\n",
    "t1=16#.............#spray penetration time in milliseconds\n",
    "s1=22#................#spray penetration length in cm\n",
    "s2=22#.................#spray penetration length in cm (2nd case)\n",
    "pc=30#.................#combustion chamber pressure in bar\n",
    "#calculations\n",
    "delp1=p1-pc#\n",
    "delp2=p2-pc#\n",
    "t2=(s2/s1)*t1*sqrt(delp1/delp2)#..........#Spray time in seconds for 2nd case\n",
    "#Given that s=t*sqrt(delp)\n",
    "print \"The time required for spray penetration at an injection pressure of 235 bar = %0.2f milliseconds:\"%t2"
   ]
  }
 ],
 "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
}
