summaryrefslogtreecommitdiff
path: root/Thermodynamics_An_Engineering_Approach/Chapter5.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Thermodynamics_An_Engineering_Approach/Chapter5.ipynb')
-rwxr-xr-xThermodynamics_An_Engineering_Approach/Chapter5.ipynb614
1 files changed, 0 insertions, 614 deletions
diff --git a/Thermodynamics_An_Engineering_Approach/Chapter5.ipynb b/Thermodynamics_An_Engineering_Approach/Chapter5.ipynb
deleted file mode 100755
index da9be875..00000000
--- a/Thermodynamics_An_Engineering_Approach/Chapter5.ipynb
+++ /dev/null
@@ -1,614 +0,0 @@
-{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 5: Mass and Energy Analysis of Control Volumes"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-1 ,Page No.224"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "\n",
- "#given data\n",
- "V=10.0;#volumne of bucket in galon\n",
- "t=50;#time taken to fill the bucket in sec\n",
- "p=1;#density of water in kg/L\n",
- "re=0.8/2/100;#radius of nozzle exit in m\n",
- "\n",
- "#calculations\n",
- "Vd=V/t*3.7854;#factor 0f 3.7854 for gal to L\n",
- "print'volumne flow rate through hose %f L/s'%round(Vd,3);\n",
- "m=p*Vd;\n",
- "print'mass flow rate through hose %f kg/s'%round(m,3);\n",
- "Ae=math.pi*re**2;\n",
- "Ve=Vd/Ae/1000;#factor of 1000 for L to m^3\n",
- "print'average velocity at the nozzle %f m/s'%round(Ve,1);\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "volumne flow rate through hose 0.757000 L/s\n",
- "mass flow rate through hose 0.757000 kg/s\n",
- "average velocity at the nozzle 15.100000 m/s\n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-2 ,Page No.225"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import math\n",
- "from scipy.integrate import quad \n",
- "from pylab import *\n",
- "\n",
- "#given data\n",
- "Dtank=3*12;#diameter of tank in inches\n",
- "Djet=0.5;#diameter of water jet in inches\n",
- "h0=2;#bottom reference in ft\n",
- "h1=4;#height of water tank in ft\n",
- "\n",
- "#constants used \n",
- "g=32.2;#in ft/s^2\n",
- "\n",
- "#calculations\n",
- "#min - mout = dmCV/dt\n",
- "#mout = p*(2*g*h*Ajet)^2\n",
- "#mCV = p*Atank*h\n",
- "#from these we get dt = Dtank^2/Djet^2 * (dh/(2*g*h)^2)\n",
- "def intgrnd1(h): \n",
- " return (Dtank**2/Djet**2*(1/sqrt(2*g*h)))\n",
- "t, err = quad(intgrnd1, h0, h1) \n",
- "t=(t/60);#in min\n",
- "print'time taken to drop to 2 ft %f min'%round(t,1)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "time taken to drop to 2 ft 12.600000 min\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-3 ,Page No.229"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "P=150;#operating pressure in kPa\n",
- "Vliquid=0.6/1000.0;#amount of liquid in the cooker in m^3\n",
- "t=40.0*60;#period of operation in sec\n",
- "Ac=8*10**-6;#exit area of opening in m^2\n",
- "\n",
- "#from Table A-5\n",
- "#from P = 150 kPa\n",
- "h=2693.1;\n",
- "ug=2519.2;\n",
- "vf=0.001053;\n",
- "vg=1.1594;\n",
- "\n",
- "#calculations\n",
- "m=Vliquid/vf;\n",
- "md=m/t;\n",
- "print'mass flow rate %f kg/s'%md;\n",
- "V=md*vg/(Ac);\n",
- "print'exit velocity %f m/s'%round(V,1);\n",
- "Eflow=h-ug;\n",
- "Et=h;\n",
- "print'flow energy %f kJ/kg'%round(Eflow,1);\n",
- "print'total energy %f kJ/kg'%round(Et,1);\n",
- "Emass=md*Et;\n",
- "print'rate at which energy leaves the cooker %f kW'%round(Emass,3)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "mass flow rate 0.000237 kg/s\n",
- "exit velocity 34.400000 m/s\n",
- "flow energy 173.900000 kJ/kg\n",
- "total energy 2693.100000 kJ/kg\n",
- "rate at which energy leaves the cooker 0.639000 kW\n"
- ]
- }
- ],
- "prompt_number": 14
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-4 ,Page No.234"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "T1=283;#temperature of air in K\n",
- "P1=80;#entering pressure in kPa\n",
- "V1=200;#velocity ar inlet in m/s\n",
- "A1=0.4;#inlet area in m^2\n",
- "\n",
- "#constants used\n",
- "R=0.287;#in kPa-m^3/kg-K\n",
- "\n",
- "#calulations\n",
- "v1=R*T1/P1;\n",
- "m=V1*A1/v1;\n",
- "print'mass flow rate of air %f kg/s'%round(m,1);\n",
- "# Ein - Eout = dEsystem / dt\n",
- "#from Table A-17\n",
- "h1=283.14;\n",
- "V2=0;\n",
- "h2=h1-(V2^2 - V1^2)/2/1000;#factor of 1000 to convert to kJ/kg\n",
- "#from Table A-17 at this value of h2\n",
- "T2=303;\n",
- "print'the temperature %i K is'%T2;\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "mass flow rate of air 78.800000 kg/s\n",
- "the temperature 303 K is\n"
- ]
- }
- ],
- "prompt_number": 15
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-5 ,Page No.235"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "P1=250;#inlet pressure in psia\n",
- "T1=700;#inlet temp in F\n",
- "A1=0.2;#inlet area in ft^2\n",
- "qout=1.2;#heat losses in Btu/lbm\n",
- "m=10;#mass flow rate in lbm/sec\n",
- "P2=200;#nozzle pressure in kPa\n",
- "V2=900;#nozzle velocity in m/s\n",
- "\n",
- "#from Table A-6E\n",
- "v1=2.6883;\n",
- "h1=1371.4;\n",
- "\n",
- "#calculations\n",
- "V1=m*v1/A1;\n",
- "print'the inlet velocit %f f/s'%round(V1,1);\n",
- "# Ein - Eout = dEsystem / dt\n",
- "h2=h1-qout-(V2**2 - V1**2)/2/25037;#factor of 25037 to convert to Btu/lbm\n",
- "#at this value h2, from Tablw A-6E\n",
- "T2=662;\n",
- "print'exit temperature %i F'%T2\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "the inlet velocit 134.400000 f/s\n",
- "exit temperature 662 F\n"
- ]
- }
- ],
- "prompt_number": 19
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-6 ,Page No.236"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "T1=280;#intial pressure in kPa\n",
- "P1=100;#intial temp in K\n",
- "m=0.02;#mass flow rate in kg/s\n",
- "qout=16;#heat losses in kJ/kg\n",
- "P2=600;#final pressure in kPa\n",
- "T2=400;#final temp in K\n",
- "\n",
- "#from Table A-17\n",
- "h1=280.13;\n",
- "h2=400.98;\n",
- "\n",
- "#calculations\n",
- "# Ein - Eout = dEsystem / dt\n",
- "Win=m*qout+m*(h2-h1);\n",
- "print'the input power of compressor %f kW'%round(Win,2)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "the input power of compressor 2.740000 kW\n"
- ]
- }
- ],
- "prompt_number": 20
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-7 ,Page No.237"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "P1=2;#inlet pressure in MPa\n",
- "T1=400;#inlet temp in K\n",
- "V1=50.0;#inlet velocity in m/s\n",
- "z1=10;#inlet height in m\n",
- "P2=15;#final pressure in MPa\n",
- "x2=0.9;#final dryness fraction\n",
- "V2=180.0;#final velocity in m/s\n",
- "z2=6;#final height in m\n",
- "Wout=5*1000;#power output in kW\n",
- "\n",
- "#from Table A-6\n",
- "h1=3248.4;\n",
- "#similarly for P2\n",
- "hf=225.94;\n",
- "hfg=2372.3;\n",
- "\n",
- "#constants used \n",
- "g=9.8;#in m/s^2\n",
- "\n",
- "#calcualtions\n",
- "h2=hf+x2*hfg;\n",
- "print'difference in enthalpies %f kJ/kg'%round((h2-h1),2);\n",
- "print'difference in kinetic energy %f kJ/kg'%round((V2**2-V1**2)/2/1000,2);#factor of 1000 to convert to kJ/kg\n",
- "print'difference in potential energy %f kJ/kg'%round(g*(z2-z1)/1000,2);#factor of 1000 to convert to kJ/kg\n",
- "wout=-((h2-h1)+(V2**2-V1**2)/2/1000+g*(z2-z1)/1000);#factor of 1000 to convert to kJ/kg\n",
- "print'work done per unit of mass %f kJ/kg'%round(wout,2);\n",
- "m=Wout/wout;\n",
- "print'mass flow rate %f kg/s'%round(m,2)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "difference in enthalpies -887.390000 kJ/kg\n",
- "difference in kinetic energy 14.950000 kJ/kg\n",
- "difference in potential energy -0.040000 kJ/kg\n",
- "work done per unit of mass 872.480000 kJ/kg\n",
- "mass flow rate 5.730000 kg/s\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-8 ,Page No.239"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "P1=0.8;#entering pressure in MPa\n",
- "P2=0.12;#throttled pressure in MPa\n",
- "\n",
- "#from Table A-12\n",
- "#sat. liq at P1\n",
- "T1=31.31;\n",
- "h1=95.47;\n",
- "#since process is insentropic and at P2\n",
- "h2=h1;\n",
- "hf=22.49;\n",
- "hg=236.97;\n",
- "T2=-22.32;\n",
- "\n",
- "#calculations\n",
- "x2=(h2-hf)/(hg-hf);\n",
- "print'the final state is %f'%round(x2,3);\n",
- "dT=T2-T1;\n",
- "print'temperature drop %f C'%round(dT,2)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "the final state is 0.340000\n",
- "temperature drop -53.630000 C\n"
- ]
- }
- ],
- "prompt_number": 26
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-9 ,Page No.241"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "T1=140;#inlet temp of hot water in F\n",
- "T2=50;#inlet temp of cold water in F\n",
- "T3=110;#steady state output temp in F\n",
- "P=20;#operating pressure in psia\n",
- "\n",
- "#for a compressed liq at given temp\n",
- "h1=107.99;\n",
- "h2=18.07;\n",
- "h3=78.02;\n",
- "\n",
- "#calculations\n",
- "#Mass balance min = mout So, m1+m2 = m3\n",
- "#Energy balance Ein = Eout So, m1*h1 + m2*h2 = m3*h3\n",
- "#combining realations\n",
- "#m1*h1 + m2*h2 = (m1+m2)*h3\n",
- "#dividing by m2 and y=m1/m2\n",
- "#we get, yh1 + h2 = (y+1)*h3\n",
- "y=(h3-h2)/(h1-h3);\n",
- "print'the ratio of mass flow rates %f'%round(y,1)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "the ratio of mass flow rates 2.000000\n"
- ]
- }
- ],
- "prompt_number": 27
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-10 ,Page No.242"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "T1=15;#water inlet temp in C\n",
- "P1=300;#water inlet pressure in kPa\n",
- "T2=25;#water outlet temp in C\n",
- "T3=70;#R-134a inlet temp in C\n",
- "P3=1000;#R-134a inlet pressure in kPa\n",
- "T4=35;#R-134a outlet temp in C\n",
- "mr=6;#mass flow rate in kg/min\n",
- "\n",
- "#from Table A-4, A-13 and A-11\n",
- "h1=62.982;\n",
- "h2=104.83;\n",
- "h3=303.85;\n",
- "h4=100.87;\n",
- "\n",
- "#calculations\n",
- "#mass balance m1=m2=mw and m3=m4=mr\n",
- "#energy balance m1*h1 + m3*h3 = m2*h2 + m4*h4\n",
- "#combining them mw*(h1-h2) = mr*(h4-h3)\n",
- "mw= mr*(h4-h3)/(h1-h2);\n",
- "print'mass flow rate of cooling water %f kg/min'%round(mw,1);\n",
- "Qin=mw*(h2-h1);\n",
- "print'heat transfer rate %i kJ/min'%round(Qin)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "mass flow rate of cooling water 29.100000 kg/min\n",
- "heat transfer rate 1218 kJ/min\n"
- ]
- }
- ],
- "prompt_number": 29
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-11 ,Page No.245"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "T1=17+273;#inlet temp in K\n",
- "P1=100;#inlet pressure in kPa\n",
- "V1=150;#inlet volumetric rate in m^3/min\n",
- "Win=15;#rated power in kW\n",
- "Qout=200/1000;#heat lost in kJ/s\n",
- "\n",
- "#constants used\n",
- "R=0.287;#in kPa-m^3/kg-K\n",
- "cp=1.005;#in kJ/kg C\n",
- "\n",
- "#calculations\n",
- "v1=R*T1/P1;\n",
- "m=V1/v1/60;#factor of 6 to convert to s\n",
- "# Win - Qout = m*cp*(T2-T1)\n",
- "T2= T1 + (Win - Qout)/(m*cp);\n",
- "print'exit temperature %f C'%round((T2-273),2)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "exit temperature 21.970000 C\n"
- ]
- }
- ],
- "prompt_number": 33
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 5-13 ,Page No.250"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "#given data\n",
- "V=6.0/1000;#volumne of cooker in m^3\n",
- "Pgage=75;#operating pressure in kPa\n",
- "Patm=100;#atmospheric pressure in kPa\n",
- "m1=1;#mass of water in kg\n",
- "Qind=0.5;#heat supplying rate in kJ/sec ; d stands for .\n",
- "t=30*60;#operating time in s\n",
- "\n",
- "#calculation\n",
- "Pabs=Pgage+Patm;\n",
- "#from Table A-5, ths saturation temp \n",
- "T=116.04;\n",
- "print'the temperature at which cooking takes place %f C'%T;\n",
- "#mass balance me=(m1-m2)cv\n",
- "#energy balance Qin - mehe = (m2u2 - m1u1)cv\n",
- "Qin=Qind*t;\n",
- "#from Table A-5\n",
- "he=2700.2;\n",
- "vf=0.001;\n",
- "vg=1.004;\n",
- "uf=486.82;\n",
- "ufg=2037.7;\n",
- "v1=V/m1;\n",
- "x1=(v1-vf)/(vg-vf);\n",
- "u1=uf+x1*ufg;\n",
- "U=m1*u1;\n",
- "#Qin = (m1 - V/v2)*he + (V/v2*u2 - m1*u1)\n",
- "#v2=vf + x2*(vg-vf)\n",
- "#u2=uf + x2*ufg\n",
- "#combining these equations we get\n",
- "#solved using EES\n",
- "x2=0.009;\n",
- "v2=vf + x2*(vg-vf);\n",
- "m2=V/v2;\n",
- "print'amount of water left %f kg'%round(m2,1)\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "the temperature at which cooking takes place 116.040000 C\n",
- "amount of water left 0.600000 kg\n"
- ]
- }
- ],
- "prompt_number": 4
- }
- ],
- "metadata": {}
- }
- ]
-} \ No newline at end of file