From c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Tue, 7 Apr 2015 15:58:05 +0530 Subject: added books --- Fundamentals_Of_Thermodynamics/Chapter10.ipynb | 164 ++++ Fundamentals_Of_Thermodynamics/Chapter11.ipynb | 424 ++++++++++ Fundamentals_Of_Thermodynamics/Chapter11_6.ipynb | 529 ++++++++++++ Fundamentals_Of_Thermodynamics/Chapter12.ipynb | 486 +++++++++++ Fundamentals_Of_Thermodynamics/Chapter12_6.ipynb | 478 +++++++++++ Fundamentals_Of_Thermodynamics/Chapter13.ipynb | 262 ++++++ Fundamentals_Of_Thermodynamics/Chapter13_6.ipynb | 385 +++++++++ Fundamentals_Of_Thermodynamics/Chapter14.ipynb | 295 +++++++ Fundamentals_Of_Thermodynamics/Chapter14_6.ipynb | 325 ++++++++ Fundamentals_Of_Thermodynamics/Chapter15.ipynb | 248 ++++++ Fundamentals_Of_Thermodynamics/Chapter15_6.ipynb | 921 +++++++++++++++++++++ Fundamentals_Of_Thermodynamics/Chapter16.ipynb | 128 +++ Fundamentals_Of_Thermodynamics/Chapter16_6.ipynb | 377 +++++++++ Fundamentals_Of_Thermodynamics/Chapter17.ipynb | 434 ++++++++++ Fundamentals_Of_Thermodynamics/Chapter17_6.ipynb | 462 +++++++++++ Fundamentals_Of_Thermodynamics/Chapter2.ipynb | 314 +++++++ Fundamentals_Of_Thermodynamics/Chapter2_6.ipynb | 379 +++++++++ Fundamentals_Of_Thermodynamics/Chapter3.ipynb | 403 +++++++++ Fundamentals_Of_Thermodynamics/Chapter3_6.ipynb | 571 +++++++++++++ Fundamentals_Of_Thermodynamics/Chapter4.ipynb | 198 +++++ Fundamentals_Of_Thermodynamics/Chapter4_6.ipynb | 198 +++++ Fundamentals_Of_Thermodynamics/Chapter5.ipynb | 469 +++++++++++ Fundamentals_Of_Thermodynamics/Chapter5_6.ipynb | 635 ++++++++++++++ Fundamentals_Of_Thermodynamics/Chapter6.ipynb | 566 +++++++++++++ Fundamentals_Of_Thermodynamics/Chapter6_6.ipynb | 652 +++++++++++++++ Fundamentals_Of_Thermodynamics/Chapter7.ipynb | 188 +++++ Fundamentals_Of_Thermodynamics/Chapter7_6.ipynb | 217 +++++ Fundamentals_Of_Thermodynamics/Chapter8.ipynb | 452 ++++++++++ Fundamentals_Of_Thermodynamics/Chapter8_6.ipynb | 444 ++++++++++ Fundamentals_Of_Thermodynamics/Chapter9.ipynb | 519 ++++++++++++ Fundamentals_Of_Thermodynamics/Chapter9_6.ipynb | 588 +++++++++++++ Fundamentals_Of_Thermodynamics/README.txt | 10 + Fundamentals_Of_Thermodynamics/chapter10.ipynb | 474 +++++++++++ .../screenshots/heat_transfer_6.png | Bin 0 -> 334272 bytes .../screenshots/reversible_work_6.png | Bin 0 -> 86259 bytes .../screenshots/velocity_6.png | Bin 0 -> 84713 bytes 36 files changed, 13195 insertions(+) create mode 100755 Fundamentals_Of_Thermodynamics/Chapter10.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter11.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter11_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter12.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter12_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter13.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter13_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter14.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter14_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter15.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter15_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter16.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter16_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter17.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter17_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter2.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter2_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter3.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter3_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter4.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter4_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter5.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter5_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter6_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter7.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter7_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter8.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter8_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter9.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/Chapter9_6.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/README.txt create mode 100755 Fundamentals_Of_Thermodynamics/chapter10.ipynb create mode 100755 Fundamentals_Of_Thermodynamics/screenshots/heat_transfer_6.png create mode 100755 Fundamentals_Of_Thermodynamics/screenshots/reversible_work_6.png create mode 100755 Fundamentals_Of_Thermodynamics/screenshots/velocity_6.png (limited to 'Fundamentals_Of_Thermodynamics') diff --git a/Fundamentals_Of_Thermodynamics/Chapter10.ipynb b/Fundamentals_Of_Thermodynamics/Chapter10.ipynb new file mode 100755 index 00000000..59bbb80a --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter10.ipynb @@ -0,0 +1,164 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:6310b6690e48041fd88dd8277353623ea538798dfeeeb9a3819409de065b2175" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter10:IRREVERSIBILITY AND AVAILABILITY" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.1:pg-386" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#Calculating reversible work\n", + "\n", + "#Form the Steam Tables,the inlet and the exit state properties are \n", + "hi=171.95 #initial specific heat of enthalpy in kJ/kg\n", + "si=0.5705 #initial specific entropy in kJ/kg-K\n", + "se=2.1341 #final specific entropy in kJ/kg-K\n", + "he=765.34 #final specific heat of enthalpy in kJ/kg-K\n", + "m=5 #mass flow rate of feedwater in kg/s\n", + "q1=900/m #heat added by one of the sources in kJ/kg\n", + "q2=he-hi-q1 #second heat transfer in kJ/kg\n", + "To=25+273.3 #Temp. of the surroundings in K\n", + "T1=100+273.2 #temp. of reservoir of one of the source in K\n", + "T2=200+273.2 #temp. of reservoir of second source in K\n", + "wrev=To*(se-si)-(he-hi)+q1*(1-To/T1)+q2*(1-To/T2) #reversible work in kJ/kg\n", + "print\"\\n Hence, the irreversibility is\",round(wrev,1),\"kJ/kg\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " Hence, the irreversibility is 62.0 kJ/kg\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.2:pg-387" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#Calculating reversible work\n", + "import math\n", + "#Form the Steam Tables,the inlet and the exit state properties are\n", + "hi=298.6 #initial specific heat of enthalpy in kJ/kg\n", + "si=6.8631 #initial specific entropy in kJ/kg-K\n", + "se=7.4664 #final specific entropy in kJ/kg-K\n", + "he=544.7 #final specific heat of enthalpy in kJ/kg-K\n", + "q=-50 #heat lost to surroundings in kJ/kg\n", + "w=hi-he+q #work in kJ/kg\n", + "To=25+273.2 #Temp. of the surroundings in K\n", + "P1=100 #Pressure of ambient air in kPa\n", + "P2=1000 #Final pressure of air after compression in kPa\n", + "R=0.287 #Universal gas constant in kJ/kg-K\n", + "wrev=To*(se-si-R*math.log(P2/P1))-(he-hi)+q*(1-To/To)#reversible work for the given change of state in kJ/kg\n", + "i=wrev-w #irreversibility in kJ/kg\n", + "print\"\\n Hence, the irreversibility is\",round(i,1),\"kJ/kg\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " Hence, the irreversibility is 32.8 kJ/kg\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.3:pg-390" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#Calculating reversible work and irreversibility\n", + "\n", + "#Form the Steam Tables at state 1\n", + "u1=1243.5 #initial specific internal energy in kJ/kg\n", + "s1=4.4819 #initial specific entropy in kJ/kg-K\n", + "v1=28.895 #initial specific volume in m^3/kg\n", + "v2=2*v1 #final specific volume in kg/m^3\n", + "u2=u1 #initial specific internal energy in kJ/kg\n", + "#These two independent properties, v2 and u2 , fix state 2.The final temp. is calculated by interplotation using the data for T2=5C and v2,x=0/3928 and u=948.5 kJ/kg. For T2=10C and v2, x=0.5433 and u=1317 kJ/kg\n", + "T2=9.1+273.2 #final temp. in K\n", + "x2=0.513 #quality in final state\n", + "s2=4.644 #final specific entropy in kJ/kg\n", + "V1=1 #volume of part of A in m^3\n", + "m=V1/v1 #mass flow rate in kg/s\n", + "To=20+273.2 #Room temperature in K\n", + "Wrev=To*m*(s2-s1) #reversible work in kJ\n", + "I=Wrev #irreversibility of the process\n", + "print\"\\n The irreversibility is \",round(I,3),\"kJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " The irreversibility is 1.645 kJ\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter11.ipynb b/Fundamentals_Of_Thermodynamics/Chapter11.ipynb new file mode 100755 index 00000000..f7ce9d5a --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter11.ipynb @@ -0,0 +1,424 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:099777bd4d735e894f7949924f63dca34258026e1381262643494860b41717f6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter11:Power and Refrigeration Systems\u2014With Phase Change" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.1:Pg-425" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Ques 1\n", + "#To determine the efficiency of Rankine cycle\n", + "\n", + "#1-Inlet state of pump\n", + "#2-Exit state of pump\n", + "P2=2000;#Exit pressure in kPa\n", + "P1=10;#Inlet pressure in kPa\n", + "v=0.00101;#specific weight of water in m^3/kg\n", + "wp=v*(P2-P1);#work done in pipe in kJ/kg\n", + "h1=191.8;#Enthalpy in kJ/kg from table\n", + "h2=h1+wp;#enthalpy in kJ/kg\n", + "#2-Inlet state for boiler\n", + "#3-Exit state for boiler\n", + "h3=2799.5;#Enthalpy in kJ/kg\n", + "#3-Inlet state for turbine\n", + "#4-Exit state for turbine\n", + "#s3=s4(Entropy remain same)\n", + "s4=6.3409;#kJ/kg\n", + "sf=0.6493;#Entropy at liquid state in kJ/kg\n", + "sfg=7.5009;#Entropy difference for vapor and liquid state in kJ/kg\n", + "x4=(s4-sf)/sfg;#x-factor\n", + "hfg=2392.8;#Enthalpy difference in kJ/kg for turbine\n", + "h4=h1+x4*hfg;#Enthalpy in kJ/kg\n", + "\n", + "nth=((h3-h2)-(h4-h1))/(h3-h2);\n", + "print\" Percentage efficiency =\",round(nth*100,1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Percentage efficiency = 30.3\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.2:Pg-429" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Ques 2\n", + "#To determine the efficiency of Rankine cycle\n", + "\n", + "#1-Inlet state of pump\n", + "#2-Exit state of pump\n", + "P2=4000;#Exit pressure in kPa\n", + "P1=10;#Inlet pressure in kPa\n", + "v=0.00101;#specific weight of water in m^3/kg\n", + "wp=v*(P2-P1);#work done in pipe in kJ/kg\n", + "h1=191.8;#Enthalpy in kJ/kg from table\n", + "h2=h1+wp;#enthalpy in kJ/kg\n", + "#2-Inlet state for boiler\n", + "#3-Exit state for boiler\n", + "h3=3213.6;#Enthalpy in kJ/kg from table\n", + "#3-Inlet state for turbine\n", + "#4-Exit state for turbine\n", + "#s3=s4(Entropy remain same)\n", + "s4=6.7690;#Entropy in kJ/kg from table\n", + "sf=0.6493;#Entropy at liquid state in kJ/kg from table\n", + "sfg=7.5009;#Entropy difference for vapor and liquid state in kJ/kg from table\n", + "x4=(s4-sf)/sfg;#x-factor\n", + "hfg=2392.8;#Enthalpy difference in kJ/kg for turbine\n", + "h4=h1+x4*hfg;#Enthalpy in kJ/kg\n", + "\n", + "nth=((h3-h2)-(h4-h1))/(h3-h2);\n", + "print\"Percentage efficiency =\",round(nth*100,1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage efficiency = 35.3\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.3:Pg-433" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Ques 3\n", + "#To determine the efficiency of a cycle\n", + "\n", + "#1-Inlet state of pump\n", + "#2-Exit state of pump\n", + "P2=4000;#Exit pressure in kPa\n", + "P1=10;#Inlet pressure in kPa\n", + "v=0.00101;#specific weight of water in m^3/kg\n", + "wp=v*(P2-P1);#work done in pipe in kJ/kg\n", + "h1=191.8;#Enthalpy in kJ/kg from table\n", + "h2=h1+wp;#enthalpy in kJ/kg\n", + "#2-Inlet state for boiler\n", + "#3-Exit state for Boiler\n", + "h3=3213.6;#Enthalpy in kJ/kg from table\n", + "#3-Inlet state for high pressure turbine\n", + "#4-Exit state for high pressure turbine\n", + "#s3=s4(Entropy remain same)\n", + "s4=6.7690;#Entropy in kJ/kg from table\n", + "sf=1.7766;#Entropy at liquid state in kJ/kg from table\n", + "sfg=5.1193;#Entropy difference for vapor and liquid state in kJ/kg from table\n", + "x4=(s4-sf)/sfg;#x-factor\n", + "hf=604.7#Enthalpy of liquid state in kJ/kg\n", + "hfg=2133.8;#Enthalpy difference in kJ/kg for turbine\n", + "h4=hf+x4*hfg;#Enthalpy in kJ/kg\n", + "#5-Inlet state for low pressure turbine\n", + "#6-Exit pressure for low pressure turbine\n", + "sf=0.6493;#Entropy in liquid state in kJ/kg for turbine\n", + "h5=3273.4;#enthalpy in kJ/kg \n", + "s5=7.8985;#Entropy in kJ/kg\n", + "sfg=7.5009;#entropy diff in kJ/kg \n", + "x6=(s5-sf)/sfg;#x-factor\n", + "hfg=2392.8;#enthalpy difference for low pressure turbine in kj/kg\n", + "h6=h1+x6*hfg;#entropy in kg/kg\n", + "wt=(h3-h4)+(h5-h6);#work output in kJ/kg\n", + "qh=(h3-h2)+(h5-h4);\n", + "\n", + "nth=(wt-wp)/qh;\n", + "print\" Percentage efficiency =\",round(nth*100,1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Percentage efficiency = 35.9\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.4:Pg-438" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4\n", + "#Efficiency of Refrigeration cycle\n", + "\n", + "#from previous examples\n", + "h1=191.8;#kJ/kg\n", + "h5=3213.6;#kg/kg\n", + "h6=2685.7;#kJ/kg\n", + "h7=2144.1;#kJ/kg\n", + "h3=604.7;#kJ/kg\n", + "#1-Inlet state of pump\n", + "#2-Exit state of pump\n", + "P2=400;#Exit pressure in kPa\n", + "P1=10; #Inlet pressure in kPa\n", + "v=0.00101;#specific weight of water in m^3/kg\n", + "wp1=v*(P2-P1);#work done for low pressure pump in kJ/kg\n", + "h1=191.8;#Enthalpy in kJ/kg from table\n", + "h2=h1+wp1;#enthalpy in kJ/kg\n", + "#5-Inlet state for turbine\n", + "#6,7-Exit state for turbine\n", + "y=(h3-h2)/(h6-h2);#extraction fraction\n", + "wt=(h5-h6)+(1-y)*(h6-h7);#turbine work in kJ/kg\n", + "#3-Inlet for high pressure pump\n", + "#4-Exit for high pressure pump\n", + "P3=400;#kPa\n", + "P4=4000;#kPa\n", + "v=0.001084;#specific heat for 3-4 process in m^3/kg\n", + "wp2=v*(P4-P3);#work done for high pressure pump\n", + "h4=h3+wp2;#Enthalpy in kJ/kg\n", + "wnet=wt-(1-y)*wp1-wp2;\n", + "qh=h5-h4;#Heat output in kJ/kg\n", + "nth=wnet/qh;\n", + "print\" Refrigerator Efficiency =\",round(nth*100,1)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Refrigerator Efficiency = 37.5\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.5:Pg-443" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#To determine thermal efficiency of cycle\n", + "\n", + "#5-Inlet state for turbine\n", + "#6-Exit state for turbine\n", + "#h-Enthalpy at a state \n", + "#s-Entropy at a state\n", + "#from steam table\n", + "h5=3169.1;#kJ/kg\n", + "s5=6.7235;#kJ/kg\n", + "s6s=s5;\n", + "sf=0.6493;#Entropy for liquid state in kJ/kg\n", + "sfg=7.5009;#Entropy difference in kJ/kg\n", + "hf=191.8;#kJ/kg\n", + "hfg=2392.8;#Enthalpy difference in kJ/kg\n", + "x6s=(s6s-sf)/sfg;#x-factor\n", + "h6s=hf+x6s*hfg;#kJ/Kg at state 6s\n", + "nt=0.86;#turbine efficiency given\n", + "wt=nt*(h5-h6s);\n", + "#1-Inlet state for pump\n", + "#2-Exit state for pump\n", + "np=0.80;#pump efficiency given\n", + "v=0.001009;#specific heat in m^3/kg\n", + "P2=5000;#kPa\n", + "P1=10;#kPa\n", + "wp=v*(P2-P1)/np;#Work done in pump in kJ/kg\n", + "wnet=wt-wp;#net work in kJ/kg\n", + "#3-Inlet state for boiler\n", + "#4-Exit state for boiler\n", + "h3=171.8;#in kJ/kg from table\n", + "h4=3213.6;#kJ/kg from table\n", + "qh=h4-h3;\n", + "nth=wnet/qh;\n", + "print \"Cycle Efficiency =\",round(nth*100,1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cycle Efficiency = 29.2\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.6:Pg-451" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#to determine the rate of refrigeration\n", + "\n", + "# refer to fig 11.21 in book\n", + "mdot=0.03 # mass flow rate in Kg/s\n", + "T1=-20 # temperature in evaporator in celsius\n", + "T3=40 #temperature in evaporator in Celsius\n", + "P2=1017 # saturation pressure in KPa\n", + "\n", + "# from table of R-134a refrigerant\n", + "h1=386.1 # enthalpy at state 1 in kJ/kg,\n", + "S1=1.7395 # entropy at state 1 in kJ/kg.K\n", + "S2=S1 # isentropic process\n", + "T2=47.7# corresponding value to S2 in table of R-134a in degree celsius\n", + "h2=428.4 # corresponding value to S2 in table of R-134a in kJ/kg\n", + "wc=h2-h1 # work done in compressor in kJ/kg\n", + "h4=h3=256.5 #enthalpy at state 4 and 3 in kJ/kg\n", + "qL=h1-h4 #Heat rejected in kJ/kg\n", + "\n", + "B=qL/wc # COP\n", + "\n", + "print\" the COP of the plant is\",round(B,2)\n", + "print\" the refrigeration rate is\",round(mdot*qL,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " the COP of the plant is 3.06\n", + " the refrigeration rate is 3.89\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.7:Pg-454" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#to determine the COP of cycle\n", + "\n", + "P1=125 # pressure at state 1 in kPa\n", + "P2=1.2 # pressure at state 2 in MPa\n", + "P3=1.19 # pressure at state 3 in MPa,\n", + "P4=1.16 # pressure at state 4 in MPa,\n", + "P5=1.15 # pressure at state 5 in MPa,\n", + "P6=P7=140 # pressure at state 6 and 7 in kPa,\n", + "P8=130 # pressure at state 8 in kPa,\n", + "T1=-10 #temperaure at state 1 in \u25e6C\n", + "T2=100 #temperaure at state 2 in \u25e6C\n", + "T3=80 #temperaure at state 3 in \u25e6C\n", + "T4=45 #temperaure at state 4 in \u25e6C\n", + "T5=40 #temperaure at state 5 in \u25e6C\n", + "T8=-20 #temperaure at state 8 in \u25e6C\n", + "q=-4 # heat transfer in kJ/Kg\n", + "\n", + "#x6=x7 quality condition given in question\n", + "\n", + "\n", + "# the following values are taken from table for refrigerant R-134a\n", + "h1=394.9 # enthalpy at state 1 in kJ/kg\n", + "h2=480.9 # enthalpy at state 2 in kJ/kg\n", + "h8=386.6 # enthalpy at state 8 in kJ/kg\n", + "wc=h2-h1-q # from first law\n", + "h5=h6=h7=256.4 # as x6=x7 and from table at state 5 in Kj/Kg\n", + "qL=h8-h7 # from first law \n", + "B=qL/wc # COP\n", + "print\" the COP of the plant is\",round(B,3)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " the COP of the plant is 1.447\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter11_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter11_6.ipynb new file mode 100755 index 00000000..814dd14b --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter11_6.ipynb @@ -0,0 +1,529 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:a88db765bb23172043955029f8f04edaf8e710f3cbd46a5474827f42fa8a65ec" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter11:Power and Refrigeration Systems\u2014With Phase Change" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.1:Pg-425" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Ques 1\n", + "#To determine the efficiency of Rankine cycle\n", + "\n", + "#1-Inlet state of pump\n", + "#2-Exit state of pump\n", + "P2=2000;#Exit pressure in kPa\n", + "P1=10;#Inlet pressure in kPa\n", + "v=0.00101;#specific weight of water in m^3/kg\n", + "wp=v*(P2-P1);#work done in pipe in kJ/kg\n", + "h1=191.8;#Enthalpy in kJ/kg from table\n", + "h2=h1+wp;#enthalpy in kJ/kg\n", + "#2-Inlet state for boiler\n", + "#3-Exit state for boiler\n", + "h3=2799.5;#Enthalpy in kJ/kg\n", + "#3-Inlet state for turbine\n", + "#4-Exit state for turbine\n", + "#s3=s4(Entropy remain same)\n", + "s4=6.3409;#kJ/kg\n", + "sf=0.6493;#Entropy at liquid state in kJ/kg\n", + "sfg=7.5009;#Entropy difference for vapor and liquid state in kJ/kg\n", + "x4=(s4-sf)/sfg;#x-factor\n", + "hfg=2392.8;#Enthalpy difference in kJ/kg for turbine\n", + "h4=h1+x4*hfg;#Enthalpy in kJ/kg\n", + "\n", + "nth=((h3-h2)-(h4-h1))/(h3-h2);\n", + "print\" Percentage efficiency =\",round(nth*100,1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Percentage efficiency = 30.3\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.2:Pg-429" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Ques 2\n", + "#To determine the efficiency of Rankine cycle\n", + "\n", + "#1-Inlet state of pump\n", + "#2-Exit state of pump\n", + "P2=4000;#Exit pressure in kPa\n", + "P1=10;#Inlet pressure in kPa\n", + "v=0.00101;#specific weight of water in m^3/kg\n", + "wp=v*(P2-P1);#work done in pipe in kJ/kg\n", + "h1=191.8;#Enthalpy in kJ/kg from table\n", + "h2=h1+wp;#enthalpy in kJ/kg\n", + "#2-Inlet state for boiler\n", + "#3-Exit state for boiler\n", + "h3=3213.6;#Enthalpy in kJ/kg from table\n", + "#3-Inlet state for turbine\n", + "#4-Exit state for turbine\n", + "#s3=s4(Entropy remain same)\n", + "s4=6.7690;#Entropy in kJ/kg from table\n", + "sf=0.6493;#Entropy at liquid state in kJ/kg from table\n", + "sfg=7.5009;#Entropy difference for vapor and liquid state in kJ/kg from table\n", + "x4=(s4-sf)/sfg;#x-factor\n", + "hfg=2392.8;#Enthalpy difference in kJ/kg for turbine\n", + "h4=h1+x4*hfg;#Enthalpy in kJ/kg\n", + "\n", + "nth=((h3-h2)-(h4-h1))/(h3-h2);\n", + "print\"Percentage efficiency =\",round(nth*100,1),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage efficiency = 35.3 %\n" + ] + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.2E:Pg-431" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Ques 2\n", + "#To determine the efficiency of Rankine cycle\n", + "\n", + "#1-Inlet state of pump\n", + "#2-Exit state of pump\n", + "P2=600.0 ;#Exit pressure in lbf/in^2\n", + "P1=1.0;#Inlet pressure in lbf/in^2\n", + "v=0.01614;#specific weight of water in ft^3/lbm\n", + "wp=v*(P2-P1)*(144.0/778.0);#work done in pipe in Btu/lbm\n", + "h1=69.70;#Enthalpy in Btu/lbm from table\n", + "h2=h1+wp;#enthalpy in Btu/lbm\n", + "#2-Inlet state for boiler\n", + "#3-Exit state for boiler\n", + "h3=1407.6;#Enthalpy in Btu/lbm from table\n", + "#3-Inlet state for turbine\n", + "#4-Exit state for turbine\n", + "#s3=s4(Entropy remain same)\n", + "s4=1.6343;#Entropy in Btu/lbm from table\n", + "sf=1.9779;#Entropy at liquid state in Btu/lbm from table\n", + "sfg=1.8453;#Entropy difference for vapor and liquid state in Btu/lbm from table\n", + "x4=-(s4-sf)/sfg;#x-factor\n", + "hfg=1036.0;#Enthalpy difference in Btu/lbm for turbine\n", + "h4=1105.8-x4*hfg;#Enthalpy in Btu/lbm\n", + "wt=(h3-h4) #work done in turbine in Btu/lbm\n", + "\n", + "nth=((h3-h4)-wp)/(h3-h2);\n", + "print\"Percentage efficiency =\",round(nth*100,1),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage efficiency = 36.9 %\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.3:Pg-433" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Ques 3\n", + "#To determine the efficiency of a cycle\n", + "\n", + "#1-Inlet state of pump\n", + "#2-Exit state of pump\n", + "P2=4000;#Exit pressure in kPa\n", + "P1=10;#Inlet pressure in kPa\n", + "v=0.00101;#specific weight of water in m^3/kg\n", + "wp=v*(P2-P1);#work done in pipe in kJ/kg\n", + "h1=191.8;#Enthalpy in kJ/kg from table\n", + "h2=h1+wp;#enthalpy in kJ/kg\n", + "#2-Inlet state for boiler\n", + "#3-Exit state for Boiler\n", + "h3=3213.6;#Enthalpy in kJ/kg from table\n", + "#3-Inlet state for high pressure turbine\n", + "#4-Exit state for high pressure turbine\n", + "#s3=s4(Entropy remain same)\n", + "s4=6.7690;#Entropy in kJ/kg from table\n", + "sf=1.7766;#Entropy at liquid state in kJ/kg from table\n", + "sfg=5.1193;#Entropy difference for vapor and liquid state in kJ/kg from table\n", + "x4=(s4-sf)/sfg;#x-factor\n", + "hf=604.7#Enthalpy of liquid state in kJ/kg\n", + "hfg=2133.8;#Enthalpy difference in kJ/kg for turbine\n", + "h4=hf+x4*hfg;#Enthalpy in kJ/kg\n", + "#5-Inlet state for low pressure turbine\n", + "#6-Exit pressure for low pressure turbine\n", + "sf=0.6493;#Entropy in liquid state in kJ/kg for turbine\n", + "h5=3273.4;#enthalpy in kJ/kg \n", + "s5=7.8985;#Entropy in kJ/kg\n", + "sfg=7.5009;#entropy diff in kJ/kg \n", + "x6=(s5-sf)/sfg;#x-factor\n", + "hfg=2392.8;#enthalpy difference for low pressure turbine in kj/kg\n", + "h6=h1+x6*hfg;#entropy in kg/kg\n", + "wt=(h3-h4)+(h5-h6);#work output in kJ/kg\n", + "qh=(h3-h2)+(h5-h4);\n", + "\n", + "nth=(wt-wp)/qh;\n", + "print\" Percentage efficiency =\",round(nth*100,1),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Percentage efficiency = 35.9 %\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.4:Pg-438" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4\n", + "#Efficiency of Refrigeration cycle\n", + "\n", + "#from previous examples\n", + "h1=191.8;#kJ/kg\n", + "h5=3213.6;#kg/kg\n", + "h6=2685.7;#kJ/kg\n", + "h7=2144.1;#kJ/kg\n", + "h3=604.7;#kJ/kg\n", + "#1-Inlet state of pump\n", + "#2-Exit state of pump\n", + "P2=400;#Exit pressure in kPa\n", + "P1=10; #Inlet pressure in kPa\n", + "v=0.00101;#specific weight of water in m^3/kg\n", + "wp1=v*(P2-P1);#work done for low pressure pump in kJ/kg\n", + "h1=191.8;#Enthalpy in kJ/kg from table\n", + "h2=h1+wp1;#enthalpy in kJ/kg\n", + "#5-Inlet state for turbine\n", + "#6,7-Exit state for turbine\n", + "y=(h3-h2)/(h6-h2);#extraction fraction\n", + "wt=(h5-h6)+(1-y)*(h6-h7);#turbine work in kJ/kg\n", + "#3-Inlet for high pressure pump\n", + "#4-Exit for high pressure pump\n", + "P3=400;#kPa\n", + "P4=4000;#kPa\n", + "v=0.001084;#specific heat for 3-4 process in m^3/kg\n", + "wp2=v*(P4-P3);#work done for high pressure pump\n", + "h4=h3+wp2;#Enthalpy in kJ/kg\n", + "wnet=wt-(1-y)*wp1-wp2;\n", + "qh=h5-h4;#Heat output in kJ/kg\n", + "nth=wnet/qh;\n", + "print\" Refrigerator Efficiency =\",round(nth*100,1),\"%\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Refrigerator Efficiency = 37.5 %\n" + ] + } + ], + "prompt_number": 44 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.5:Pg-443" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#To determine thermal efficiency of cycle\n", + "\n", + "#5-Inlet state for turbine\n", + "#6-Exit state for turbine\n", + "#h-Enthalpy at a state \n", + "#s-Entropy at a state\n", + "#from steam table\n", + "h5=3169.1;#kJ/kg\n", + "s5=6.7235;#kJ/kg\n", + "s6s=s5;\n", + "sf=0.6493;#Entropy for liquid state in kJ/kg\n", + "sfg=7.5009;#Entropy difference in kJ/kg\n", + "hf=191.8;#kJ/kg\n", + "hfg=2392.8;#Enthalpy difference in kJ/kg\n", + "x6s=(s6s-sf)/sfg;#x-factor\n", + "h6s=hf+x6s*hfg;#kJ/Kg at state 6s\n", + "nt=0.86;#turbine efficiency given\n", + "wt=nt*(h5-h6s);\n", + "#1-Inlet state for pump\n", + "#2-Exit state for pump\n", + "np=0.80;#pump efficiency given\n", + "v=0.001009;#specific heat in m^3/kg\n", + "P2=5000;#kPa\n", + "P1=10;#kPa\n", + "wp=v*(P2-P1)/np;#Work done in pump in kJ/kg\n", + "wnet=wt-wp;#net work in kJ/kg\n", + "#3-Inlet state for boiler\n", + "#4-Exit state for boiler\n", + "h3=171.8;#in kJ/kg from table\n", + "h4=3213.6;#kJ/kg from table\n", + "qh=h4-h3;\n", + "nth=wnet/qh;\n", + "print \"Cycle Efficiency =\",round(nth*100,1),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cycle Efficiency = 29.2 %\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.5E:Pg-445" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#To determine thermal efficiency of cycle\n", + "\n", + "#5-Inlet state for turbine\n", + "#6-Exit state for turbine\n", + "#h-Enthalpy at a state \n", + "#s-Entropy at a state\n", + "#from steam table\n", + "h5=1386.8;#Btu/lbm\n", + "s5=1.6248;#Btu/lbm\n", + "s6s=s5;\n", + "sf=1.9779;#Entropy for liquid state in Btu/lbm\n", + "sfg=1.8453;#Entropy difference in Btu/lbm\n", + "hf=1105.8;# Btu/lbm\n", + "hfg=1036.0;#Enthalpy difference in Btu/lbm\n", + "x6s=(s6s-sf)/sfg;#x-factor\n", + "h6s=hf+x6s*hfg;#Btu/lbm at state 6s\n", + "nt=0.86;#turbine efficiency given\n", + "wt=nt*(h5-h6s);\n", + "#1-Inlet state for pump\n", + "#2-Exit state for pump\n", + "np=0.80;#pump efficiency given\n", + "v=0.016;#specific heat in ft^3/lbm\n", + "P2=800.0;# lbf/in^2\n", + "P1=1.0;# lbf/in^2\n", + "wp=(v*(P2-P1)*144.0)/(np*778.0);#Work done in pump in Btu/lbm\n", + "wnet=wt-wp;#net work in Btu/lbm\n", + "#3-Inlet state for boiler\n", + "#4-Exit state for boiler\n", + "h3=65.1;#in Btu/lbm from table\n", + "h4=1407.6;# Btu/lbm from table\n", + "qh=h4-h3;\n", + "nth=wnet/qh;\n", + "print \"Cycle Efficiency =\",round(nth*100,2),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cycle Efficiency = 30.48 %\n" + ] + } + ], + "prompt_number": 60 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.6:Pg-451" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#to determine the rate of refrigeration\n", + "\n", + "# refer to fig 11.21 in book\n", + "mdot=0.03 # mass flow rate in Kg/s\n", + "T1=-20 # temperature in evaporator in celsius\n", + "T3=40 #temperature in evaporator in Celsius\n", + "P2=1017 # saturation pressure in KPa\n", + "\n", + "# from table of R-134a refrigerant\n", + "h1=386.1 # enthalpy at state 1 in kJ/kg,\n", + "S1=1.7395 # entropy at state 1 in kJ/kg.K\n", + "S2=S1 # isentropic process\n", + "T2=47.7# corresponding value to S2 in table of R-134a in degree celsius\n", + "h2=428.4 # corresponding value to S2 in table of R-134a in kJ/kg\n", + "wc=h2-h1 # work done in compressor in kJ/kg\n", + "h4=h3=256.5 #enthalpy at state 4 and 3 in kJ/kg\n", + "qL=h1-h4 #Heat rejected in kJ/kg\n", + "\n", + "B=qL/wc # COP\n", + "\n", + "print\" the COP of the plant is\",round(B,2)\n", + "print\" the refrigeration rate is\",round(mdot*qL,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " the COP of the plant is 3.06\n", + " the refrigeration rate is 3.89\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex11.7:Pg-454" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#to determine the COP of cycle\n", + "\n", + "P1=125 # pressure at state 1 in kPa\n", + "P2=1.2 # pressure at state 2 in MPa\n", + "P3=1.19 # pressure at state 3 in MPa,\n", + "P4=1.16 # pressure at state 4 in MPa,\n", + "P5=1.15 # pressure at state 5 in MPa,\n", + "P6=P7=140 # pressure at state 6 and 7 in kPa,\n", + "P8=130 # pressure at state 8 in kPa,\n", + "T1=-10 #temperaure at state 1 in \u25e6C\n", + "T2=100 #temperaure at state 2 in \u25e6C\n", + "T3=80 #temperaure at state 3 in \u25e6C\n", + "T4=45 #temperaure at state 4 in \u25e6C\n", + "T5=40 #temperaure at state 5 in \u25e6C\n", + "T8=-20 #temperaure at state 8 in \u25e6C\n", + "q=-4 # heat transfer in kJ/Kg\n", + "\n", + "#x6=x7 quality condition given in question\n", + "\n", + "\n", + "# the following values are taken from table for refrigerant R-134a\n", + "h1=394.9 # enthalpy at state 1 in kJ/kg\n", + "h2=480.9 # enthalpy at state 2 in kJ/kg\n", + "h8=386.6 # enthalpy at state 8 in kJ/kg\n", + "wc=h2-h1-q # from first law\n", + "h5=h6=h7=256.4 # as x6=x7 and from table at state 5 in Kj/Kg\n", + "qL=h8-h7 # from first law \n", + "B=qL/wc # COP\n", + "print\" the COP of the plant is\",round(B,3)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " the COP of the plant is 1.447\n" + ] + } + ], + "prompt_number": 20 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter12.ipynb b/Fundamentals_Of_Thermodynamics/Chapter12.ipynb new file mode 100755 index 00000000..75910c56 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter12.ipynb @@ -0,0 +1,486 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:e3e9cb7f43080b67fa2a22d273814843783e7598e3258877edb209ca16f99bdc" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "CHAPTER13:Gas Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.1:Pg-480" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "#Standard brayton cycle\n", + "\n", + "#1-Inlet for compressor\n", + "#2-Exit for compressor\n", + "#T-Temperature at a state\n", + "#P-Pressure at a state\n", + "T1=288.2;#K\n", + "P2=1000.0;#kPa\n", + "P1=100.0;#kPa\n", + "k=1.4;\n", + "T2=T1*(P2/P1)**(1.0-1/k);#K\n", + "Cp=1.004;#Specific heat at constant pressure in kJ/kg\n", + "wc=Cp*(T2-T1);#compressor work in kJ/kg;\n", + "print\" Temperature T2 =\",round(T2,2),\"K\"\n", + "print\" Compressor work =\",round(wc,1),\"kJ/kg\"\n", + "#3-Turbine Inlet\n", + "#4-Turbine Exit\n", + "P4=P1;\n", + "P3=P2;\n", + "T3=1373.2;#K\n", + "T4=T3*(P4/P3)**(1-1/k);#K\n", + "wt=Cp*(T3-T4);\n", + "wnet=wt-wc;\n", + "print\" Temperature T3 =\",round(T3,2),\" K\"\n", + "print\" Temperature T4 =\",round(T4),\"K\"\n", + "print\" Turbine work =\",round(wt,2),\"kJ/kg\"\n", + "print\" Net work =\",round(wt-wc,2),\"kJ/kg\"\n", + "#2-Also high temperature heat exchanger Inlet\n", + "#3-(-do-) Exit\n", + "qh=Cp*(T3-T2);#Heat of source in kJ/kg\n", + "#4-high temp heat exchanger inlet\n", + "#1-(-do-) Exit\n", + "ql=Cp*(T4-T1);#Heat of sink in kJ/kg\n", + "nth=wnet/qh;\n", + "print\" Thermal Efficiency of cycle =\",round(nth*100,2),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Temperature T2 = 556.43 K\n", + " Compressor work = 269.3 kJ/kg\n", + " Temperature T3 = 1373.2 K\n", + " Temperature T4 = 711.0 K\n", + " Turbine work = 664.6 kJ/kg\n", + " Net work = 395.3 kJ/kg\n", + " Thermal Efficiency of cycle = 48.21 %\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.2:Pg-481" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Calculation mistake in book\n", + "#ques2\n", + "#Standard brayton cycle\n", + "\n", + "#Calculation mistake in book\n", + "#1-Inlet for compressor\n", + "#2-Exit for compressor\n", + "#T-Temperature at a state\n", + "#P-Pressure at a state\n", + "T1=288.2;#K\n", + "P2=1000.0;#kPa\n", + "P1=100.0;#kPa\n", + "k=1.4;\n", + "T2s=T1*(P2/P1)**(1-1/k);#K\n", + "nc=.80;#Compressor Efficiency\n", + "T2=T1+(T2s-T1)/0.80;\n", + "Cp=1.004;#Specific heat at constant pressure in kJ/kg\n", + "wc=Cp*(T2-T1);#compressor work in kJ/kg\n", + "wc=round(wc)\n", + "print\" Temperature T2 =\",round(T2,2),\"K\"\n", + "print\" Compressor work =\",(wc),\"kJ/kg\"\n", + "#3-Turbine Inlet\n", + "#4-Turbine Exit\n", + "P4=P1;\n", + "P3=P2;\n", + "T3=1373.2;#K\n", + "T4s=T3*(P4/P3)**(1-1.0/k);#K\n", + "nt=0.85;#turbine Efficiency\n", + "T4=T3-(T3-T4s)*0.85;\n", + "wt=Cp*(T3-T4);\n", + "wnet=wt-wc;\n", + "print\" Temperature T3 =\",round(T3,1),\"K\"\n", + "print\" Temperature T4 =\",round(T4,1),\"K\"\n", + "print\" Turbine work =\",round(wt,2),\"kJ/kg\"\n", + "print\" Net work =\",round(wt-wc,2),\"kJ/kg\"\n", + "#2-Also high temperature heat exchanger Inlet\n", + "#3-(-do-) Exit\n", + "qh=Cp*(T3-T2);#Heat of source in kJ/kg\n", + "#4-high temp heat exchanger inlet\n", + "#1-(-do-) Exit\n", + "ql=Cp*(T4-T1);#Heat of sink in kJ/kg\n", + "nth=wnet/qh;\n", + "print\" Thermal Efficiency of cycle =\",round(nth*100),\"percent\"\n", + "#some answers are have acceptable difference beacause of approximization in book but here calculations are precise" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Temperature T2 = 623.48 K\n", + " Compressor work = 337.0 kJ/kg\n", + " Temperature T3 = 1373.2 K\n", + " Temperature T4 = 810.5 K\n", + " Turbine work = 564.91 kJ/kg\n", + " Net work = 227.91 kJ/kg\n", + " Thermal Efficiency of cycle = 30.0 percent\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.3:Pg-486" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques3\n", + "#efficiency of the cycle\n", + "\n", + "wnet=395.2;#kJ/kg from example no 1\n", + "#Tx=T4\n", + "Tx=710.8;#K from example no 1\n", + "T3=1373.2;#K from example no 1\n", + "Cp=1.004;#specific heat in kJ/kg \n", + "qh=Cp*(T3-Tx);\n", + "nth=wnet/qh;\n", + "print\" Thermal efficiency =\",round(nth*100,1),\" percent\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Thermal efficiency = 59.4 percent\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.4:Pg-486" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4\n", + "#Calculation of work in the given cycle\n", + "import math\n", + "R=0.287;#gas constant \n", + "T1=288.2;#compressor temperature K\n", + "T2=1373.2;#K turbine temperature K\n", + "#Pe/Pi=c=10, Pi/Pe=1/c from example 12.1\n", + "c=10.0;\n", + "wc=-R*T1*math.log(c);\n", + "print\" Isothermal work in compressor =\",round(wc,1),\"kJ/kg\"\n", + "wt=-R*T2*math.log(1/c);\n", + "print\" Isothermal work in turbine =\",round(wt,1),\"kJ/kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Isothermal work in compressor = -190.5 kJ/kg\n", + " Isothermal work in turbine = 907.5 kJ/kg\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.5:Pg-491" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#air standard cycle for jet repulsion\n", + "import math\n", + "#1-compressor inlet\n", + "#2-Compressor exit\n", + "#P-Pressure at given point\n", + "#T-Temperature at given point\n", + "P1=100;#kPa\n", + "P2=1000;#kPa\n", + "T1=288.2;#K\n", + "T2=556.8;#K\n", + "wc=269.5;#from ex 12.1 work done in compressor in kJ/kg\n", + "#2-Burner inlet\n", + "#3-Burner exit\n", + "P3=1000;#kPa\n", + "T3=1373.2;#K\n", + "#wc=wt\n", + "Cp=1.004;#specific enthalpy of heat at constant pressure in kJ/kg\n", + "k=1.4;\n", + "T4=T3-wc/Cp;\n", + "P4=P3*(T4/T3)**(1-1/k);\n", + "#from s4=s5 and h4=h5+v2/2 we get\n", + "T5=710.8#K, from second law\n", + "v=math.sqrt(2*Cp*1000*(T4-T5));#m/s\n", + "print\" Velocity of air leaving the nozel =\",round(v),\"m/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Velocity of air leaving the nozel = 889.0 m/s\n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.6:Pg-494" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#air standard refrigeration cycle\n", + "\n", + "#1-compressor inlet\n", + "#2-compressor exit\n", + "P1=100;#kPa\n", + "P2=500;#kPa\n", + "k=1.4;\n", + "rp=P2/P1;\n", + "cop=(rp**(1-1/k)-1)**-1;\n", + "print\" Coefficient of performance =\",round(cop,2)\n", + "#3-Expander inlet\n", + "#4-Expander exit\n", + "P3=P2;\n", + "P4=P1;\n", + "T3=288.23;#K, given and fixed\n", + "T4=T3/(P3/P4)**(1-1/k);\n", + "T1=253.2;#K, given\n", + "Cp=1.004;#Specific heat at cons pressure in kJ/kg\n", + "ql=Cp*(T1-T4);#heat released in kJ/kg\n", + "P=1#power required in kW \n", + "ms=P/ql;#kg/s\n", + "print\" Rate at which the air enter the compressor =\",round(ms,3),\"kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Coefficient of performance = 1.71\n", + " Rate at which the air enter the compressor = 0.014 kg/s\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.7:Pg-498" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#the otto cycle\n", + "\n", + "#1-compressor inlet\n", + "#2-compressor exit\n", + "P1=100.0;#kPa\n", + "T1=288.2;#K\n", + "R=0.287;#gas constant\n", + "v1=R*T1/P1;#specific volume at inlet in m^3/kg\n", + "rv=10.0;#compression ratio given\n", + "k=1.4;#constant\n", + "T2=T1*rv**(k-1);#K\n", + "print\" Temperature at compressor exit, T2 =\",round(T2,1),\"K\"\n", + "P2=P1*rv**k;#kPa\n", + "print\" Pressure at compressor exit, P2 =\",round(P2/1000,2),\"MPa\"\n", + "v2=v1/rv;#specific heat at exit in m^3/kg\n", + "#23-heat addition process\n", + "#q23=Cv*(T3-T2)=1800 kJ/kg given\n", + "q23=1800.0;#kJ/kg heat addition, given\n", + "Cv=0.717;#specific heat at constant volume in kJ/kg\n", + "T3=T2+q23/Cv;#K\n", + "print\" Initial Temperature during heat additon process, T3 =\",round(T3,2),\"K\"\n", + "P3=P2*(T3/T2);#kPa\n", + "print\" Initial pressure during heat addition process, P3 =\",round(P3/1000,3),\"MPa\"\n", + "r=10.0;#k=V4/V3=P3/P4\n", + "T4=T3*(1/r)**(k-1);\n", + "print\" Final temperature during heat addition process, T4 =\",round(T4,3),\"K\";\n", + "P4=P3/r**k;#kPa\n", + "print\" Final pressure during heat addition process, P4 =\",round(P4/1000,4),\"MPa\"\n", + "nth=1-1/r**(k-1);#thermal efficiency\n", + "print\" Thermal efficiency =\",round(nth*100,1),\" percent\"\n", + "q41=Cv*(T1-T4);#/heat for process 4-1 in kJ/kg\n", + "wnet=q23+q41;\n", + "mep=wnet/(v1-v2);#effective mean pressure n kPa\n", + "print\" Mean effective pressure =\",round(mep,2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Temperature at compressor exit, T2 = 723.9 K\n", + " Pressure at compressor exit, P2 = 2.51 MPa\n", + " Initial Temperature during heat additon process, T3 = 3234.39 K\n", + " Initial pressure during heat addition process, P3 = 11.223 MPa\n", + " Final temperature during heat addition process, T4 = 1287.632 K\n", + " Final pressure during heat addition process, P4 = 0.4468 MPa\n", + " Thermal efficiency = 60.2 percent\n", + " Mean effective pressure = 1455.37 kPa\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.8:Pg-501" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques8\n", + "#the diesel cycle\n", + "\n", + "#1-compressor inlet\n", + "#2-compressor exit\n", + "P1=100;#kPa\n", + "T1=288.2;#K\n", + "R=0.287;#gas constant\n", + "v1=R*T1/P1;#specific volume at inlet in m^3/kg\n", + "rv=20;#compression ratio given\n", + "k=1.4;#constant\n", + "T2=T1*rv**(k-1);#K\n", + "print\" Temperature at compressor exit, T2 =\",round(T2,1),\"K\"\n", + "P2=P1*rv**k;#kPa\n", + "print\" Pressure at compressor exit, P2 =\",round(P2/1000,3),\" MPa\"\n", + "v2=v1/rv;#specific heat at exit in m^3/kg\n", + "#23-heat addition process\n", + "#q23=Cv*(T3-T2)=1800 kJ/kg given\n", + "q23=1800;#kJ/kg heat addition, given\n", + "Cv=.717;\n", + "Cp=1.004;#specific heat at constant pressure in kJ/kg\n", + "T3=T2+q23/Cp;#K\n", + "print\" Initial Temperature during heat addition process, T3 =\",round(T3,2),\"K\"\n", + "r=T3/T2;#T3/T2=V3/V2=r\n", + "v3=r*v2;\n", + "T4=T3/(v1/v3)**(k-1);\n", + "print\" Final temperature during heat addition process, T4 =\",round(T4),\"K\"\n", + "q41=Cv*(T1-T4);#/heat for process 4-1 in kJ/kg\n", + "wnet=q23+q41;\n", + "mep=wnet/(v1-v2);#effective mean pressure in kPa\n", + "qh=1800;#heat transfer in kJ/kg\n", + "nth=wnet/qh;#thermal efficiency\n", + "\n", + "print\" Thermal efficiency =\",round(nth*100,1),\"percent\"\n", + "print\" Mean effective pressure =\",round(mep,2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Temperature at compressor exit, T2 = 955.2 K\n", + " Pressure at compressor exit, P2 = 6.629 MPa\n", + " Initial Temperature during heat addition process, T3 = 2748.05 K\n", + " Final temperature during heat addition process, T4 = 1265.0 K\n", + " Thermal efficiency = 61.1 percent\n", + " Mean effective pressure = 1399.18 kPa\n" + ] + } + ], + "prompt_number": 47 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter12_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter12_6.ipynb new file mode 100755 index 00000000..e2686e4a --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter12_6.ipynb @@ -0,0 +1,478 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:83a0af04c694ab4b0ad1a0fe252ffa0bd8e87abc642c64323f0c2a0d18dd9f5d" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "CHAPTER13:Gas Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.1:Pg-480" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "#Standard brayton cycle\n", + "\n", + "#1-Inlet for compressor\n", + "#2-Exit for compressor\n", + "#T-Temperature at a state\n", + "#P-Pressure at a state\n", + "T1=288.2;#K\n", + "P2=1000.0;#kPa\n", + "P1=100.0;#kPa\n", + "k=1.4;\n", + "T2=T1*(P2/P1)**(1.0-1/k);#K\n", + "Cp=1.004;#Specific heat at constant pressure in kJ/kg\n", + "wc=Cp*(T2-T1);#compressor work in kJ/kg;\n", + "print\" Temperature T2 =\",round(T2,2),\"K\"\n", + "print\" Compressor work =\",round(wc,1),\"kJ/kg\"\n", + "#3-Turbine Inlet\n", + "#4-Turbine Exit\n", + "P4=P1;\n", + "P3=P2;\n", + "T3=1373.2;#K\n", + "T4=T3*(P4/P3)**(1-1/k);#K\n", + "wt=Cp*(T3-T4);\n", + "wnet=wt-wc;\n", + "print\" Temperature T3 =\",round(T3,2),\" K\"\n", + "print\" Temperature T4 =\",round(T4),\"K\"\n", + "print\" Turbine work =\",round(wt,2),\"kJ/kg\"\n", + "print\" Net work =\",round(wt-wc,2),\"kJ/kg\"\n", + "#2-Also high temperature heat exchanger Inlet\n", + "#3-(-do-) Exit\n", + "qh=Cp*(T3-T2);#Heat of source in kJ/kg\n", + "#4-high temp heat exchanger inlet\n", + "#1-(-do-) Exit\n", + "ql=Cp*(T4-T1);#Heat of sink in kJ/kg\n", + "nth=wnet/qh;\n", + "print\" Thermal Efficiency of cycle =\",round(nth*100,2),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Temperature T2 = 556.43 K\n", + " Compressor work = 269.3 kJ/kg\n", + " Temperature T3 = 1373.2 K\n", + " Temperature T4 = 711.0 K\n", + " Turbine work = 664.6 kJ/kg\n", + " Net work = 395.3 kJ/kg\n", + " Thermal Efficiency of cycle = 48.21 %\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.2:Pg-481" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Calculation mistake in book\n", + "#ques2\n", + "#Standard brayton cycle\n", + "\n", + "#Calculation mistake in book\n", + "#1-Inlet for compressor\n", + "#2-Exit for compressor\n", + "#T-Temperature at a state\n", + "#P-Pressure at a state\n", + "T1=288.2;#K\n", + "P2=1000.0;#kPa\n", + "P1=100.0;#kPa\n", + "k=1.4;\n", + "T2s=T1*(P2/P1)**(1-1/k);#K\n", + "nc=.80;#Compressor Efficiency\n", + "T2=T1+(T2s-T1)/0.80;\n", + "Cp=1.004;#Specific heat at constant pressure in kJ/kg\n", + "wc=Cp*(T2-T1);#compressor work in kJ/kg\n", + "wc=round(wc)\n", + "print\" Temperature T2 =\",round(T2,2),\"K\"\n", + "print\" Compressor work =\",(wc),\"kJ/kg\"\n", + "#3-Turbine Inlet\n", + "#4-Turbine Exit\n", + "P4=P1;\n", + "P3=P2;\n", + "T3=1373.2;#K\n", + "T4s=T3*(P4/P3)**(1-1.0/k);#K\n", + "nt=0.85;#turbine Efficiency\n", + "T4=T3-(T3-T4s)*0.85;\n", + "wt=Cp*(T3-T4);\n", + "wnet=wt-wc;\n", + "print\" Temperature T3 =\",round(T3,1),\"K\"\n", + "print\" Temperature T4 =\",round(T4,1),\"K\"\n", + "print\" Turbine work =\",round(wt,2),\"kJ/kg\"\n", + "print\" Net work =\",round(wt-wc,2),\"kJ/kg\"\n", + "#2-Also high temperature heat exchanger Inlet\n", + "#3-(-do-) Exit\n", + "qh=Cp*(T3-T2);#Heat of source in kJ/kg\n", + "#4-high temp heat exchanger inlet\n", + "#1-(-do-) Exit\n", + "ql=Cp*(T4-T1);#Heat of sink in kJ/kg\n", + "nth=wnet/qh;\n", + "print\" Thermal Efficiency of cycle =\",round(nth*100),\"percent\"\n", + "#some answers are have acceptable difference beacause of approximization in book but here calculations are precise" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Temperature T2 = 623.48 K\n", + " Compressor work = 337.0 kJ/kg\n", + " Temperature T3 = 1373.2 K\n", + " Temperature T4 = 810.5 K\n", + " Turbine work = 564.91 kJ/kg\n", + " Net work = 227.91 kJ/kg\n", + " Thermal Efficiency of cycle = 30.0 percent\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.3:Pg-486" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques3\n", + "#efficiency of the cycle\n", + "\n", + "wnet=395.2;#kJ/kg from example no 1\n", + "#Tx=T4\n", + "Tx=710.8;#K from example no 1\n", + "T3=1373.2;#K from example no 1\n", + "Cp=1.004;#specific heat in kJ/kg \n", + "qh=Cp*(T3-Tx);\n", + "nth=wnet/qh;\n", + "print\" Thermal efficiency =\",round(nth*100,1),\" percent\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Thermal efficiency = 59.4 percent\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.4:Pg-486" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4\n", + "#Calculation of work in the given cycle\n", + "import math\n", + "R=0.287;#gas constant \n", + "T1=288.2;#compressor temperature K\n", + "T2=1373.2;#K turbine temperature K\n", + "#Pe/Pi=c=10, Pi/Pe=1/c from example 12.1\n", + "c=10.0;\n", + "wc=-R*T1*math.log(c);\n", + "print\" Isothermal work in compressor =\",round(wc,1),\"kJ/kg\"\n", + "wt=-R*T2*math.log(1/c);\n", + "print\" Isothermal work in turbine =\",round(wt,1),\"kJ/kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Isothermal work in compressor = -190.5 kJ/kg\n", + " Isothermal work in turbine = 907.5 kJ/kg\n" + ] + } + ], + "prompt_number": 26 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.5:Pg-491" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#air standard cycle for jet repulsion\n", + "import math\n", + "#1-compressor inlet\n", + "#2-Compressor exit\n", + "#P-Pressure at given point\n", + "#T-Temperature at given point\n", + "P1=100;#kPa\n", + "P2=1000;#kPa\n", + "T1=288.2;#K\n", + "T2=556.8;#K\n", + "wc=269.5;#from ex 12.1 work done in compressor in kJ/kg\n", + "#2-Burner inlet\n", + "#3-Burner exit\n", + "P3=1000;#kPa\n", + "T3=1373.2;#K\n", + "#wc=wt\n", + "Cp=1.004;#specific enthalpy of heat at constant pressure in kJ/kg\n", + "k=1.4;\n", + "T4=T3-wc/Cp;\n", + "P4=P3*(T4/T3)**(1-1/k);\n", + "#from s4=s5 and h4=h5+v2/2 we get\n", + "T5=710.8#K, from second law\n", + "v=math.sqrt(2*Cp*1000*(T4-T5));#m/s\n", + "print\" Velocity of air leaving the nozel =\",round(v),\"m/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Velocity of air leaving the nozel = 889.0 m/s\n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.6:Pg-494" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#air standard refrigeration cycle\n", + "\n", + "#1-compressor inlet\n", + "#2-compressor exit\n", + "P1=100;#kPa\n", + "P2=500;#kPa\n", + "k=1.4;\n", + "rp=P2/P1;\n", + "cop=(rp**(1-1/k)-1)**-1;\n", + "print\" Coefficient of performance =\",round(cop,2)\n", + "#3-Expander inlet\n", + "#4-Expander exit\n", + "P3=P2;\n", + "P4=P1;\n", + "T3=288.23;#K, given and fixed\n", + "T4=T3/(P3/P4)**(1-1/k);\n", + "T1=253.2;#K, given\n", + "Cp=1.004;#Specific heat at cons pressure in kJ/kg\n", + "ql=Cp*(T1-T4);#heat released in kJ/kg\n", + "P=1#power required in kW \n", + "ms=P/ql;#kg/s\n", + "print\" Rate at which the air enter the compressor =\",round(ms,3),\"kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Coefficient of performance = 1.71\n", + " Rate at which the air enter the compressor = 0.014 kg/s\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.7:Pg-498" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#the otto cycle\n", + "\n", + "#1-compressor inlet\n", + "#2-compressor exit\n", + "P1=100.0;#kPa\n", + "T1=288.2;#K\n", + "R=0.287;#gas constant\n", + "v1=R*T1/P1;#specific volume at inlet in m^3/kg\n", + "rv=10.0;#compression ratio given\n", + "k=1.4;#constant\n", + "T2=T1*rv**(k-1);#K\n", + "print\" Temperature at compressor exit, T2 =\",round(T2,1),\"K\"\n", + "P2=P1*rv**k;#kPa\n", + "print\" Pressure at compressor exit, P2 =\",round(P2/1000,2),\"MPa\"\n", + "v2=v1/rv;#specific heat at exit in m^3/kg\n", + "#23-heat addition process\n", + "#q23=Cv*(T3-T2)=1800 kJ/kg given\n", + "q23=1800.0;#kJ/kg heat addition, given\n", + "Cv=0.717;#specific heat at constant volume in kJ/kg\n", + "T3=T2+q23/Cv;#K\n", + "print\" Initial Temperature during heat additon process, T3 =\",round(T3,2),\"K\"\n", + "P3=P2*(T3/T2);#kPa\n", + "print\" Initial pressure during heat addition process, P3 =\",round(P3/1000,3),\"MPa\"\n", + "r=10.0;#k=V4/V3=P3/P4\n", + "T4=T3*(1/r)**(k-1);\n", + "print\" Final temperature during heat addition process, T4 =\",round(T4,3),\"K\";\n", + "P4=P3/r**k;#kPa\n", + "print\" Final pressure during heat addition process, P4 =\",round(P4/1000,4),\"MPa\"\n", + "nth=1-1/r**(k-1);#thermal efficiency\n", + "print\" Thermal efficiency =\",round(nth*100,1),\" percent\"\n", + "q41=Cv*(T1-T4);#/heat for process 4-1 in kJ/kg\n", + "wnet=q23+q41;\n", + "mep=wnet/(v1-v2);#effective mean pressure n kPa\n", + "print\" Mean effective pressure =\",round(mep,2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Temperature at compressor exit, T2 = 723.9 K\n", + " Pressure at compressor exit, P2 = 2.51 MPa\n", + " Initial Temperature during heat additon process, T3 = 3234.39 K\n", + " Initial pressure during heat addition process, P3 = 11.223 MPa\n", + " Final temperature during heat addition process, T4 = 1287.632 K\n", + " Final pressure during heat addition process, P4 = 0.4468 MPa\n", + " Thermal efficiency = 60.2 percent\n", + " Mean effective pressure = 1455.37 kPa\n" + ] + } + ], + "prompt_number": 42 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex12.8:Pg-501" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques8\n", + "#the diesel cycle\n", + "\n", + "#1-compressor inlet\n", + "#2-compressor exit\n", + "P1=100;#kPa\n", + "T1=288.2;#K\n", + "R=0.287;#gas constant\n", + "v1=R*T1/P1;#specific volume at inlet in m^3/kg\n", + "rv=20;#compression ratio given\n", + "k=1.4;#constant\n", + "T2=T1*rv**(k-1);#K\n", + "print\" Temperature at compressor exit, T2 =\",round(T2,1),\"K\"\n", + "P2=P1*rv**k;#kPa\n", + "print\" Pressure at compressor exit, P2 =\",round(P2/1000,3),\" MPa\"\n", + "v2=v1/rv;#specific heat at exit in m^3/kg\n", + "#23-heat addition process\n", + "#q23=Cv*(T3-T2)=1800 kJ/kg given\n", + "q23=1800;#kJ/kg heat addition, given\n", + "Cv=.717;\n", + "Cp=1.004;#specific heat at constant pressure in kJ/kg\n", + "T3=T2+q23/Cp;#K\n", + "print\" Initial Temperature during heat addition process, T3 =\",round(T3,2),\"K\"\n", + "r=T3/T2;#T3/T2=V3/V2=r\n", + "v3=r*v2;\n", + "T4=T3/(v1/v3)**(k-1);\n", + "print\" Final temperature during heat addition process, T4 =\",round(T4),\"K\"\n", + "q41=Cv*(T1-T4);#/heat for process 4-1 in kJ/kg\n", + "wnet=q23+q41;\n", + "mep=wnet/(v1-v2);#effective mean pressure in kPa\n", + "qh=1800;#heat transfer in kJ/kg\n", + "nth=wnet/qh;#thermal efficiency\n", + "\n", + "print\" Thermal efficiency =\",round(nth*100,1),\"percent\"\n", + "print\" Mean effective pressure =\",round(mep,2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Temperature at compressor exit, T2 = 955.2 K\n", + " Pressure at compressor exit, P2 = 6.629 MPa\n", + " Initial Temperature during heat addition process, T3 = 2748.05 K\n", + " Final temperature during heat addition process, T4 = 1265.0 K\n", + " Thermal efficiency = 61.1 percent\n", + " Mean effective pressure = 1399.18 kPa\n" + ] + } + ], + "prompt_number": 47 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter13.ipynb b/Fundamentals_Of_Thermodynamics/Chapter13.ipynb new file mode 100755 index 00000000..95893bd9 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter13.ipynb @@ -0,0 +1,262 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:6cc89f09586fc1fc226ee69c300e69ecaeae3fbafe1ae419c1c6cbc4ae7dcf83" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "CHAPTER13:Gas Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.3:Pg-533" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques3\n", + "#calculating humidity ratio, dew point,mass of air, mass of vapor\n", + "\n", + "r=0.70;#relative humidity\n", + "Pg=5.628;#saturation pressure in kPa\n", + "Pv=r*Pg;#vapour pressure in kPa\n", + "P=100;#net pressure kPa \n", + "Pa=P-Pv;#Partial pressure of air\n", + "w=0.622*Pv/Pa;#humidity ratio formula\n", + "V=100;#volume in m^3\n", + "Ra=0.287;#gas constant for water vapour\n", + "T=308.2;#Temperature in K\n", + "ma=Pa*V/(Ra*T);#mass in kg\n", + "mv=w*ma;#mass of vapour\n", + "print\" Mass of vapour is\",round(mv,3),\"Kg \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Mass of vapour is 2.77 Kg \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.4:Pg-534" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4 \n", + "#calculating amount of water vapour condensed on cooling\n", + "\n", + "#from example 3\n", + "w1=0.0255;#w1=w, humidity ratio at initial temperature\n", + "ma=108.6;#mass of air in kg\n", + "P=100;#kPa net pressure\n", + "#at 5 C mixture is saturated so Pv2=Pg2\n", + "Pg2=0.8721;\n", + "Pv2=Pg2;\n", + "w2=0.622*Pv2/(P-Pg2);\n", + "mc=ma*(w1-w2);\n", + "print\"Mass of vapour condense is \",round(mc,3),\"kg \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of vapour condense is 2.175 kg \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.5:Pg-536" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#calculating heat transfer per kilogram of dry air\n", + "\n", + "#1-inlet state\n", + "#2-Exit state\n", + "r1=0.80;#realtive humidity at state 1\n", + "Pg1=4.246;#saturation pressure of vapour in kPa\n", + "P1=105.0;#net pressure at state 1 in kPa\n", + "P2=100.0;#net pressure at state 2 in kPa\n", + "Pv1=r1*Pg1;#partial pressure of vapour in kPa\n", + "w1=0.622*Pv1/(P1-Pv1);#humidity ratio at state 1\n", + "r2=0.95;#relative humidity at state 2\n", + "Pg2=1.7051;#saturation pressure of vapour in kPa\n", + "Pv2=r2*Pg2;#partial pressure of vapour in kPa\n", + "w2=0.622*Pv2/(P2-Pv2);#humidity ratio at state 2\n", + "T1=30.0;#C\n", + "T2=15.0;#C\n", + "Cp=1.004;#specific heat of water vapour in kJ/kg\n", + "hv2=2528.9;#enthalpy of vapourisation of vapour in kJ/kg\n", + "hv1=2556.3;#enthalpy of vapourisation of vapour in kJ/kg\n", + "hl2=62.99;#enthalpy of \n", + "q=Cp*(T2-T1)+w2*hv2-w1*hv1+hl2*(w1-w2);#kJ/kg\n", + "print\" Heat transferred per unit mass =\",round(q,1),\"kJ/kg of dry air\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Heat transferred per unit mass = -41.7 kJ/kg of dry air\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.6:Pg-537" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#calculating heat transferred in gas vapour mixture\n", + "\n", + "#n-Nitrogen\n", + "#v-water vapour\n", + "Pn2=1995;#Pressure of nitrogen in kPa\n", + "V=0.5;#Volume in m^3\n", + "Rn2=0.2968;#Gas constant for nitrogen in kJ/kg.K\n", + "Rv=0.4615;#gas constant for vapour\n", + "T1=323.2;#Temperature in K\n", + "T2=283.2;#Temperature in K\n", + "Pv1=5;#Pressure of water vapour in kPa at state 1\n", + "Pv2=1.2276;#Pressure of water vapour in kPa at state 2\n", + "mn2=Pn2*V/(Rn2*T1);#mass of nitrogen\n", + "mv1=Pv1*V/(Rv*T1);#mass of vapour in kg\n", + "mv2=Pv2*V/(Rv*T2);#mass of vapour in kg\n", + "ml2=mv1-mv2;#mass of liquid condensed n kg\n", + "uv1=2443.1;#specific internal energy of vapour in kJ/kg at state 1\n", + "uv2=2389.2;#specific internal energy of vapour in kJ/kg at state 2\n", + "ul2=42.0;#specific internal energy of liquid water in kJ/kg\n", + "Cv=0.745;#specific heat at constant volume in kJ/kg.K\n", + "Q=mn2*Cv*(T2-T1)+mv2*uv2+ml2*ul2-mv1*uv1;\n", + "print\"Heat transferred =\",round(Q,2),\"kJ \"\n", + "\n", + "#the answer is different in book due to intermediate approximization " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transferred = -339.1 kJ \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.7:Pg-539" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#calculating humidity ratio and relative humidity \n", + "\n", + "#1-Inlet state\n", + "#2-Exit state\n", + "P=100;#net pressure n kPa \n", + "#it is steady state adiabatic process\n", + "#water vapour leaving is saturated so Pv2=Pg2\n", + "Pg2=2.339;#saturation pressure of vapour in kPa\n", + "Pv2=Pg2;#partial pressure of vapour\n", + "w2=0.622*Pv2/(P-Pg2);\n", + "Cpa=1.004;#specific heat n kJ/kg/K\n", + "T2=20;# final temp in C\n", + "T1=30;# initial temp in C\n", + "Hfg2=2454.1;#specific heat difference at state 2 in kJ/kg\n", + "hv1=2556.3;#enthalpy of water vapour at state 1 in kJ/kg\n", + "hl2=83.96;#enthalpy of liquid water in kJ/kg\n", + "w1=(Cpa*(T2-T1)+w2*Hfg2)/(hv1-hl2);\n", + "print \" Relative humidity =\",round(w1,4)\n", + "#also w1=0.622*Pv1/(100-Pv2)\n", + "Pv1=100*w1/(0.622+w1);\n", + "Pg1=4.246;#saturation pressure at state 1 in kPa\n", + "r=Pv1/Pg1;#humidity ratio\n", + "print\" Humidity ratio =\",round(r,4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Relative humidity = 0.0107\n", + " Humidity ratio = 0.3993\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter13_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter13_6.ipynb new file mode 100755 index 00000000..5863fc4c --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter13_6.ipynb @@ -0,0 +1,385 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:13df1b90ea06630bb54a561fa81d4ebbaaa2d68a225d0631603576a208acfb40" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "CHAPTER13:Gas Mixtures" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.3:Pg-533" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques3\n", + "#calculating humidity ratio, dew point,mass of air, mass of vapor\n", + "\n", + "r=0.70;#relative humidity\n", + "Pg=5.628;#saturation pressure in kPa\n", + "Pv=r*Pg;#vapour pressure in kPa\n", + "P=100;#net pressure kPa \n", + "Pa=P-Pv;#Partial pressure of air\n", + "w=0.622*Pv/Pa;#humidity ratio formula\n", + "V=100;#volume in m^3\n", + "Ra=0.287;#gas constant for water vapour\n", + "T=308.2;#Temperature in K\n", + "ma=Pa*V/(Ra*T);#mass in kg\n", + "mv=w*ma;#mass of vapour\n", + "print\" Mass of vapour is\",round(mv,3),\"Kg \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Mass of vapour is 2.77 Kg \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.3E:Pg-533" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques3\n", + "#calculating humidity ratio, dew point,mass of air, mass of vapor\n", + "\n", + "r=0.70;#relative humidity\n", + "Pg=0.6988 ;#saturation pressure in lbf/in^2\n", + "Pv=r*Pg;#vapour pressure in lbf/in^2\n", + "P=14.7;#net pressure in lbf/in^2\n", + "Pa=P-Pv;#Partial pressure of air\n", + "w=0.622*Pv/Pa;#humidity ratio formula\n", + "V=2000;#volume in ft^3\n", + "Ra=53.34;#gas constant for water vapour\n", + "T=70;#Temperature in F\n", + "ma=Pa*V*144/(Ra*(T+480));#mass in lbm\n", + "mv=w*ma;#mass of vapour\n", + "print\" Mass of vapour is\",round(mv,2),\"lbm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Mass of vapour is 2.99 lbm\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.4:Pg-534" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4 \n", + "#calculating amount of water vapour condensed on cooling\n", + "\n", + "#from example 3\n", + "w1=0.0255;#w1=w, humidity ratio at initial temperature\n", + "ma=108.6;#mass of air in kg\n", + "P=100;#kPa net pressure\n", + "#at 5 C mixture is saturated so Pv2=Pg2\n", + "Pg2=0.8721;\n", + "Pv2=Pg2;\n", + "w2=0.622*Pv2/(P-Pg2);\n", + "mc=ma*(w1-w2);\n", + "print\"Mass of vapour condense is \",round(mc,3),\"kg \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of vapour condense is 2.175 kg \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.4E:Pg-535" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4 \n", + "#calculating amount of water vapour condensed on cooling\n", + "\n", + "#from example 3 \n", + "w1=0.02135;#w1=w, humidity ratio at initial temperature\n", + "ma=139.6;#mass of air in lbm\n", + "P=14.7;#net pressure in lbf/in^2\n", + "#at 40 degree F mixture is saturated so Pv2=Pg2\n", + "Pg2=0.1217 # lbf/in^2\n", + "Pv2=Pg2;\n", + "w2=0.622*Pv2/(P-Pg2);# humidity ratio at final temperature\n", + "mc=ma*(w1-w2); #Mass of vapour condense in lbm\n", + "print\"Mass of vapour condense is \",round(mc,3),\"lbm \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mass of vapour condense is 2.256 lbm \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.5:Pg-536" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#calculating heat transfer per kilogram of dry air\n", + "\n", + "#1-inlet state\n", + "#2-Exit state\n", + "r1=0.80;#realtive humidity at state 1\n", + "Pg1=4.246;#saturation pressure of vapour in kPa\n", + "P1=105.0;#net pressure at state 1 in kPa\n", + "P2=100.0;#net pressure at state 2 in kPa\n", + "Pv1=r1*Pg1;#partial pressure of vapour in kPa\n", + "w1=0.622*Pv1/(P1-Pv1);#humidity ratio at state 1\n", + "r2=0.95;#relative humidity at state 2\n", + "Pg2=1.7051;#saturation pressure of vapour in kPa\n", + "Pv2=r2*Pg2;#partial pressure of vapour in kPa\n", + "w2=0.622*Pv2/(P2-Pv2);#humidity ratio at state 2\n", + "T1=30.0;#C\n", + "T2=15.0;#C\n", + "Cp=1.004;#specific heat of water vapour in kJ/kg\n", + "hv2=2528.9;#enthalpy of vapourisation of vapour in kJ/kg\n", + "hv1=2556.3;#enthalpy of vapourisation of vapour in kJ/kg\n", + "hl2=62.99;#enthalpy of \n", + "q=Cp*(T2-T1)+w2*hv2-w1*hv1+hl2*(w1-w2);#kJ/kg\n", + "print\" Heat transferred per unit mass =\",round(q,1),\"kJ/kg of dry air\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Heat transferred per unit mass = -41.7 kJ/kg of dry air\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.6:Pg-537" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#calculating heat transferred in gas vapour mixture\n", + "\n", + "#n-Nitrogen\n", + "#v-water vapour\n", + "Pn2=1995;#Pressure of nitrogen in kPa\n", + "V=0.5;#Volume in m^3\n", + "Rn2=0.2968;#Gas constant for nitrogen in kJ/kg.K\n", + "Rv=0.4615;#gas constant for vapour\n", + "T1=323.2;#Temperature in K\n", + "T2=283.2;#Temperature in K\n", + "Pv1=5;#Pressure of water vapour in kPa at state 1\n", + "Pv2=1.2276;#Pressure of water vapour in kPa at state 2\n", + "mn2=Pn2*V/(Rn2*T1);#mass of nitrogen\n", + "mv1=Pv1*V/(Rv*T1);#mass of vapour in kg\n", + "mv2=Pv2*V/(Rv*T2);#mass of vapour in kg\n", + "ml2=mv1-mv2;#mass of liquid condensed n kg\n", + "uv1=2443.1;#specific internal energy of vapour in kJ/kg at state 1\n", + "uv2=2389.2;#specific internal energy of vapour in kJ/kg at state 2\n", + "ul2=42.0;#specific internal energy of liquid water in kJ/kg\n", + "Cv=0.745;#specific heat at constant volume in kJ/kg.K\n", + "Q=mn2*Cv*(T2-T1)+mv2*uv2+ml2*ul2-mv1*uv1;\n", + "print\"Heat transferred =\",round(Q,2),\"kJ \"\n", + "\n", + "#the answer is different in book due to intermediate approximization " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transferred = -339.1 kJ \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.7:Pg-539" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#calculating humidity ratio and relative humidity \n", + "\n", + "#1-Inlet state\n", + "#2-Exit state\n", + "P=100;#net pressure in kPa \n", + "#it is steady state adiabatic process\n", + "#water vapour leaving is saturated so Pv2=Pg2\n", + "Pg2=2.339;#saturation pressure of vapour in kPa\n", + "Pv2=Pg2;#partial pressure of vapour\n", + "w2=0.622*Pv2/(P-Pg2);\n", + "Cpa=1.004;#specific heat n kJ/kg/K\n", + "T2=20;# final temp in C\n", + "T1=30;# initial temp in C\n", + "Hfg2=2454.1;#specific heat difference at state 2 in kJ/kg\n", + "hv1=2556.3;#enthalpy of water vapour at state 1 in kJ/kg\n", + "hl2=83.96;#enthalpy of liquid water in kJ/kg\n", + "w1=(Cpa*(T2-T1)+w2*Hfg2)/(hv1-hl2);\n", + "print \" Relative humidity =\",round(w1,4)\n", + "#also w1=0.622*Pv1/(100-Pv2)\n", + "Pv1=100*w1/(0.622+w1);\n", + "Pg1=4.246;#saturation pressure at state 1 in kPa\n", + "r=Pv1/Pg1;#humidity ratio\n", + "print\" Humidity ratio =\",round(r,4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Relative humidity = 0.0107\n", + " Humidity ratio = 0.3993\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex13.7E:Pg-540" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#calculating humidity ratio and relative humidity \n", + "\n", + "#1-Inlet state\n", + "#2-Exit state\n", + "P=14.7;#net pressure in lbf/in^2\n", + "#it is steady state adiabatic process\n", + "#water vapour leaving is saturated so Pv2=Pg2\n", + "Pg2=0.3632;#saturation pressure of vapour in lbf/in^2\n", + "Pv2=Pg2;#partial pressure of vapour\n", + "w2=0.622*Pv2/(P-Pg2);\n", + "Cpa=0.24;#specific heat n Btu/lbm/F\n", + "T2=70;# final temp in F\n", + "T1=84;# initial temp in F\n", + "Hfg2=1054.0;#specific heat difference at state 2 in Btu/lbm\n", + "hv1=1098.1;#enthalpy of water vapour at state 1 in Btu/lbm\n", + "hl2=38.1;#enthalpy of liquid water in Btu/lbm\n", + "w1=(Cpa*(T2-T1)+w2*Hfg2)/(hv1-hl2);\n", + "print \" Relative humidity =\",round(w1,4)\n", + "#also w1=0.622*Pv1/(100-Pv2)\n", + "Pv1=14.7*w1/(0.622+w1);\n", + "Pg1=0.584;#saturation pressure at state 1 in lbf/in^2\n", + "r=Pv1/Pg1;#humidity ratio\n", + "print\" Humidity ratio =\",round(r,4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Relative humidity = 0.0125\n", + " Humidity ratio = 0.4958\n" + ] + } + ], + "prompt_number": 18 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter14.ipynb b/Fundamentals_Of_Thermodynamics/Chapter14.ipynb new file mode 100755 index 00000000..6654362c --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter14.ipynb @@ -0,0 +1,295 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b6f84d510db3595ba71244d9d44f7e9987d44c62ba0d0520a72da2384551019e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter14:THERMODYNAMIC RELATIONS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.1:Pg-567" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "#to determine the sublimation pressure of water\n", + "import math\n", + "#from table in appendix B.1.5\n", + "T1=213.2;#K, Temperature at state 1\n", + "P2=0.0129;#kPa, pressure at state 2\n", + "T2=233.2;#K, Temperature at state 2\n", + "hig=2838.9;#kJ/kg, enthalpy of sublimation \n", + "R=.46152;#Gas constant \n", + "#using relation log(P2/P1)=(hig/R)*(1/T1-1/T2) \n", + "P1=P2*math.exp(-hig/R*(1/T1-1/T2));\n", + "print\" Sublimation Pressure \",round(P1,5),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Sublimation Pressure 0.00109 kPa\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.4:Pg-579" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4\n", + "#Volume expansivity, Isothermal and Adiabatic compressibility\n", + "\n", + "#known data\n", + "ap=5*10**-5;#K^-1 Volume expansivity\n", + "bt=8.6*10**-12;#m^2/N, Isothermal compressibility\n", + "v=0.000114;#m^3/kg, specific volume\n", + "P2=100*10**6;#pressure at state 2 in kPa\n", + "P1=100;#pressure at state 1 in kPa\n", + "w=-v*bt*(P2**2-P1**2)/2;#work done in J/kg\n", + "#q=T*ds and ds=-v*ap*(P2-P1)\n", + "#so q=-T*v*ap*(P2-P1)\n", + "T=288.2;#Temperature in K\n", + "q=-T*v*ap*(P2-P1);#heat in J/kg\n", + "du=q-w;#change in internal energy in J/kg\n", + "print\" Change in internal energy =\",round(du,3),\"J/kg\"\n", + "\n", + "#the answer is correct within given limts\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Change in internal energy = -159.372 J/kg\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.5:Pg-586" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#adiabatic steady state processes\n", + "\n", + "#from table A.2\n", + "P1=20;#pressure at state 1 in MPa\n", + "P2=2;#pressure at state 2 in MPa\n", + "T1=203.2;#Temperature at state 1 in K\n", + "Pr1=P1/3.39;#Reduced pressure at state 1\n", + "Pr2=P2/3.39;#Reduced pressure at state 2\n", + "Tr1=T1/126.2;#Reduced temperature\n", + "#from compressibility chart h1*-h1=2.1*R*Tc\n", + "#from zero pressure specific heat data h1*-h2*=Cp*(T1a-T2a)\n", + "#h2*-h2=0.5*R*Tc\n", + "#this gives dh=h1-h2=-2.1*R*Tc+Cp*(T1a-T2a)+0.5*R*Tc\n", + "R=0.2968;#gas constant for given substance\n", + "Tc=126.2;#K, Constant temperature\n", + "Cp=1.0416;#heat enthalpy at constant pressure in kJ/kg\n", + "T2=146;#temperature at state 2\n", + "dh=-1.6*R*Tc+Cp*(T1-T2);#\n", + "print\" Enthalpy change =\",round(dh,3),\"kJ/kg \\n\"\n", + "print\" Since Enthalpy change is nearly \",-round(dh),\"kJ/kg so Temperature =\",round(T2,3),\"K\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Enthalpy change = -0.35 kJ/kg \n", + "\n", + " Since Enthalpy change is nearly 0.0 kJ/kg so Temperature = 146.0 K\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.6:Pg-589" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#isothermal steady state processes\n", + "import math\n", + "#from table A.2\n", + "P1=8;#pressure at state 1 in MPa\n", + "P2=0.5;#pressure at state 2 in MPa\n", + "T1=150.0;#Temperature at state 1 in K\n", + "Pr1=P1/3.39;#Reduced pressure at state 1\n", + "Pr2=P2/3.39;#Reduced pressure at state 2\n", + "Tr1=T1/126.2;#Reduced temperature\n", + "T2=125.0;#temperature at state 2\n", + "#from compressibility chart h1*-h1=2.1*R*Tc\n", + "#from zero pressure specific heat data h1*-h2*=Cp*(T1a-T2a)\n", + "#h2*-h2=0.5*R*Tc\n", + "#this gives dh=h1-h2=-2.1*R*Tc+Cp*(T1a-T2a)+0.15*R*Tc\n", + "R=0.2968;#gas constant for given substance\n", + "Tc=126.2;#K, Constant temperature\n", + "Cp=1.0416;#heat enthalpy at constant pressure in kJ/kg\n", + "dh=(2.35)*R*Tc+Cp*(T2-T1);#\n", + "print\" Enthalpy change =\",round(dh),\"kJ/kg\"\n", + "#change in entropy \n", + "#ds= -(s2*-s2)+(s2*-s1*)+(s1*-s1)\n", + "#s1*-s1=1.6*R\n", + "#s2*-s2=0.1*R\n", + "#s2*-s1*=Cp*log(T2/T1)-R*log(P2/P1)\n", + "#so\n", + "ds=1.6*R-0.1*R+Cp*math.log(T2/T1)-R*math.log(P2/P1);\n", + "print\" Entropy Change =\",round(ds,3),\"kJ/kg.K \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Enthalpy change = 62.0 kJ/kg\n", + " Entropy Change = 1.078 kJ/kg.K \n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.7:Pg-596" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#percent deviation using specific volume calculated by kays rule and vander waals rule\n", + "import math\n", + "\n", + "#a-denotes C02\n", + "#b-denotes CH4\n", + "T=310.94;#Temperature of mixture K\n", + "P=86.19;#Pressure of mixture in MPa\n", + "#Tc- critical Temperature\n", + "#Pc-critical pressure\n", + "Tca=304.1;#K\n", + "Tcb=190.4;#K\n", + "Pca=7.38;#MPa\n", + "Pcb=4.60;#MPa\n", + "Ra=0.1889;#gas constant for a in kJ/kg.K\n", + "Rb=0.5183;#gas constant for b in kJ/kg.K\n", + "xa=0.8;#fraction of CO2\n", + "xb=0.2;#fraction of CH4\n", + "Rm=xa*Ra+xb*Rb;#mean gas constant in kJ/kg.K\n", + "Ma=44.01;#molecular mass of a\n", + "Mb=16.043;#molecular mass of b\n", + "#1.Kay's rule\n", + "ya=xa/Ma/(xa/Ma+xb/Mb);#mole fraction of a\n", + "yb=xb/Mb/(xa/Ma+xb/Mb);#mole fraction of b\n", + "Tcm=ya*Tca+yb*Tcb;#mean critical temp in K\n", + "Pcm=ya*Pca+yb*Tcb;#mean critical pressure n MPa\n", + "#therefore pseudo reduced property of mixture\n", + "Trm=T/Tcm;\n", + "Prm=P/Pcm;\n", + "Zm=0.7;#Compressiblity from generalised compressibility chart\n", + "vc=Zm*Rm*T/P/1000;#specific volume calculated in m^3/kg\n", + "ve=0.0006757;#experimental specific volume in m^3/kg\n", + "pd1=(ve-vc)/ve*100;#percent deviation\n", + "print\" Percentage deviation in specific volume using Kays rule =\",round(pd1,1),\"percent \\n\"\n", + "\n", + "#2. using vander waals equation\n", + "#values of vander waals constant\n", + "Aa=27*(Ra**2)*(Tca**2)/(64*Pca*1000);\n", + "Ba=Ra*Tca/(8*Pca*1000);\n", + "Ab=27*(Rb**2)*(Tcb**2)/(64*Pcb*1000);\n", + "Bb=Rb*Tcb/(8*Pcb*1000);\n", + "#mean vander waals constant\n", + "Am=(xa*math.sqrt(Aa)+xb*math.sqrt(Ab))**2;\n", + "Bm=(xa*Ba+xb*Bb);\n", + "#using vander waals equation we get cubic equation \n", + "#solving we get\n", + "vc=0.0006326;#calculated specific volume in m^3/kg\n", + "pd2=((ve-vc)/ve)*100;\n", + "print\" Percentage deviation in specific volume using vander waals eqn =\",round(pd2,1),\"percent\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Percentage deviation in specific volume using Kays rule = 4.8 percent \n", + "\n", + " Percentage deviation in specific volume using vander waals eqn = 6.4 percent\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter14_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter14_6.ipynb new file mode 100755 index 00000000..8c5a5922 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter14_6.ipynb @@ -0,0 +1,325 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4d90868c7316d94fc2ffdc05c5691234f77f3a832d71da7eb2108eaff0a215bc" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter14:THERMODYNAMIC RELATIONS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.1:Pg-567" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "#to determine the sublimation pressure of water\n", + "import math\n", + "#from table in appendix B.1.5\n", + "T1=213.2;#K, Temperature at state 1\n", + "P2=0.0129;#kPa, pressure at state 2\n", + "T2=233.2;#K, Temperature at state 2\n", + "hig=2838.9;#kJ/kg, enthalpy of sublimation \n", + "R=.46152;#Gas constant \n", + "#using relation log(P2/P1)=(hig/R)*(1/T1-1/T2) \n", + "P1=P2*math.exp(-hig/R*(1/T1-1/T2));\n", + "print\" Sublimation Pressure \",round(P1,5),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Sublimation Pressure 0.00109 kPa\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.1E:Pg-567\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "#to determine the sublimation pressure of water\n", + "import math\n", + "#from table in appendix B.1.5\n", + "T1=-70+460.7;# R, Temperature at state 1\n", + "P2=0.0019 # lbf/in^2 pressure at state 2\n", + "T2=-40+460.7;# R, Temperature at state 2\n", + "hig=1218.7;#Btu/lbm, enthalpy of sublimation \n", + "R=85.67;#Gas constant \n", + "#using relation log(P2/P1)=(hig/R)*(1/T1-1/T2) \n", + "P1=P2*math.exp(-hig*778/R*(1/T1-1/T2));\n", + "print\" Sublimation Pressure \",round(P1,5),\"lbf/in^2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Sublimation Pressure 0.00025 lbf/in^2\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.4:Pg-579" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4\n", + "#Volume expansivity, Isothermal and Adiabatic compressibility\n", + "\n", + "#known data\n", + "ap=5*10**-5;#K^-1 Volume expansivity\n", + "bt=8.6*10**-12;#m^2/N, Isothermal compressibility\n", + "v=0.000114;#m^3/kg, specific volume\n", + "P2=100*10**6;#pressure at state 2 in kPa\n", + "P1=100;#pressure at state 1 in kPa\n", + "w=-v*bt*(P2**2-P1**2)/2;#work done in J/kg\n", + "#q=T*ds and ds=-v*ap*(P2-P1)\n", + "#so q=-T*v*ap*(P2-P1)\n", + "T=288.2;#Temperature in K\n", + "q=-T*v*ap*(P2-P1);#heat in J/kg\n", + "du=q-w;#change in internal energy in J/kg\n", + "print\" Change in internal energy =\",round(du,3),\"J/kg\"\n", + "\n", + "#the answer is correct within given limts\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Change in internal energy = -159.372 J/kg\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.5:Pg-586" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#adiabatic steady state processes\n", + "\n", + "#from table A.2\n", + "P1=20;#pressure at state 1 in MPa\n", + "P2=2;#pressure at state 2 in MPa\n", + "T1=203.2;#Temperature at state 1 in K\n", + "Pr1=P1/3.39;#Reduced pressure at state 1\n", + "Pr2=P2/3.39;#Reduced pressure at state 2\n", + "Tr1=T1/126.2;#Reduced temperature\n", + "#from compressibility chart h1*-h1=2.1*R*Tc\n", + "#from zero pressure specific heat data h1*-h2*=Cp*(T1a-T2a)\n", + "#h2*-h2=0.5*R*Tc\n", + "#this gives dh=h1-h2=-2.1*R*Tc+Cp*(T1a-T2a)+0.5*R*Tc\n", + "R=0.2968;#gas constant for given substance\n", + "Tc=126.2;#K, Constant temperature\n", + "Cp=1.0416;#heat enthalpy at constant pressure in kJ/kg\n", + "T2=146;#temperature at state 2\n", + "dh=-1.6*R*Tc+Cp*(T1-T2);#\n", + "print\" Enthalpy change =\",round(dh,3),\"kJ/kg \\n\"\n", + "print\" Since Enthalpy change is nearly \",-round(dh),\"kJ/kg so Temperature =\",round(T2,3),\"K\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Enthalpy change = -0.35 kJ/kg \n", + "\n", + " Since Enthalpy change is nearly 0.0 kJ/kg so Temperature = 146.0 K\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.6:Pg-589" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#isothermal steady state processes\n", + "import math\n", + "#from table A.2\n", + "P1=8;#pressure at state 1 in MPa\n", + "P2=0.5;#pressure at state 2 in MPa\n", + "T1=150.0;#Temperature at state 1 in K\n", + "Pr1=P1/3.39;#Reduced pressure at state 1\n", + "Pr2=P2/3.39;#Reduced pressure at state 2\n", + "Tr1=T1/126.2;#Reduced temperature\n", + "T2=125.0;#temperature at state 2\n", + "#from compressibility chart h1*-h1=2.1*R*Tc\n", + "#from zero pressure specific heat data h1*-h2*=Cp*(T1a-T2a)\n", + "#h2*-h2=0.5*R*Tc\n", + "#this gives dh=h1-h2=-2.1*R*Tc+Cp*(T1a-T2a)+0.15*R*Tc\n", + "R=0.2968;#gas constant for given substance\n", + "Tc=126.2;#K, Constant temperature\n", + "Cp=1.0416;#heat enthalpy at constant pressure in kJ/kg\n", + "dh=(2.35)*R*Tc+Cp*(T2-T1);#\n", + "print\" Enthalpy change =\",round(dh),\"kJ/kg\"\n", + "#change in entropy \n", + "#ds= -(s2*-s2)+(s2*-s1*)+(s1*-s1)\n", + "#s1*-s1=1.6*R\n", + "#s2*-s2=0.1*R\n", + "#s2*-s1*=Cp*log(T2/T1)-R*log(P2/P1)\n", + "#so\n", + "ds=1.6*R-0.1*R+Cp*math.log(T2/T1)-R*math.log(P2/P1);\n", + "print\" Entropy Change =\",round(ds,3),\"kJ/kg.K \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Enthalpy change = 62.0 kJ/kg\n", + " Entropy Change = 1.078 kJ/kg.K \n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex14.7:Pg-596" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#percent deviation using specific volume calculated by kays rule and vander waals rule\n", + "import math\n", + "\n", + "#a-denotes C02\n", + "#b-denotes CH4\n", + "T=310.94;#Temperature of mixture K\n", + "P=86.19;#Pressure of mixture in MPa\n", + "#Tc- critical Temperature\n", + "#Pc-critical pressure\n", + "Tca=304.1;#K\n", + "Tcb=190.4;#K\n", + "Pca=7.38;#MPa\n", + "Pcb=4.60;#MPa\n", + "Ra=0.1889;#gas constant for a in kJ/kg.K\n", + "Rb=0.5183;#gas constant for b in kJ/kg.K\n", + "xa=0.8;#fraction of CO2\n", + "xb=0.2;#fraction of CH4\n", + "Rm=xa*Ra+xb*Rb;#mean gas constant in kJ/kg.K\n", + "Ma=44.01;#molecular mass of a\n", + "Mb=16.043;#molecular mass of b\n", + "#1.Kay's rule\n", + "ya=xa/Ma/(xa/Ma+xb/Mb);#mole fraction of a\n", + "yb=xb/Mb/(xa/Ma+xb/Mb);#mole fraction of b\n", + "Tcm=ya*Tca+yb*Tcb;#mean critical temp in K\n", + "Pcm=ya*Pca+yb*Tcb;#mean critical pressure n MPa\n", + "#therefore pseudo reduced property of mixture\n", + "Trm=T/Tcm;\n", + "Prm=P/Pcm;\n", + "Zm=0.7;#Compressiblity from generalised compressibility chart\n", + "vc=Zm*Rm*T/P/1000;#specific volume calculated in m^3/kg\n", + "ve=0.0006757;#experimental specific volume in m^3/kg\n", + "pd1=(ve-vc)/ve*100;#percent deviation\n", + "print\" Percentage deviation in specific volume using Kays rule =\",round(pd1,1),\"percent \\n\"\n", + "\n", + "#2. using vander waals equation\n", + "#values of vander waals constant\n", + "Aa=27*(Ra**2)*(Tca**2)/(64*Pca*1000);\n", + "Ba=Ra*Tca/(8*Pca*1000);\n", + "Ab=27*(Rb**2)*(Tcb**2)/(64*Pcb*1000);\n", + "Bb=Rb*Tcb/(8*Pcb*1000);\n", + "#mean vander waals constant\n", + "Am=(xa*math.sqrt(Aa)+xb*math.sqrt(Ab))**2;\n", + "Bm=(xa*Ba+xb*Bb);\n", + "#using vander waals equation we get cubic equation \n", + "#solving we get\n", + "vc=0.0006326;#calculated specific volume in m^3/kg\n", + "pd2=((ve-vc)/ve)*100;\n", + "print\" Percentage deviation in specific volume using vander waals eqn =\",round(pd2,1),\"percent\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Percentage deviation in specific volume using Kays rule = 4.8 percent \n", + "\n", + " Percentage deviation in specific volume using vander waals eqn = 6.4 percent\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter15.ipynb b/Fundamentals_Of_Thermodynamics/Chapter15.ipynb new file mode 100755 index 00000000..18f2c842 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter15.ipynb @@ -0,0 +1,248 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:49d323999697626f705831867b32f6c520c5287d76ed00656f7259e6db65356e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter15:CHEMICAL REACTIONS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.1:Pg-621" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "#theoratical air-fuel ratio for combustion of octane\n", + "#combustion equation is\n", + "#C8H18 + 12.5O2 + 12.5(3.76) N2 \u2192 8 CO2 + 9H2O + 47.0N2\n", + "rm=(12.5+47.0)/1;#air fuel ratio on mole basis\n", + "rma=rm*28.97/114.2;#air fuel ratio on mass basis;\n", + "print \"Theoratical air fuel ratio on mass basis is\",round(rma),\"kg air/kg fuel\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Theoratical air fuel ratio on mass basis is 15.0 kg air/kg fuel\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.6:Pg-629" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#determining heat transfer per kilomole of fuel entering combustion chamber\n", + "\n", + "#1-CH4\n", + "#2-CO2\n", + "#3-H2O\n", + "#hf-standard enthalpy of given substance\n", + "hf1=-74.873;#kJ\n", + "hf2=-393.522;#kJ\n", + "hf3=-285.830;#kJ\n", + "Qcv=hf2+2*hf3-hf1;#kJ\n", + "print \"Heat transfer per kilomole of fuel entering combustion chamber is\",round(Qcv,3),\"kJ\"\n", + "#the answers in the book is different as they have not printed the decimals in values" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer per kilomole of fuel entering combustion chamber is -890.309 kJ\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.7:Pg-631" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#calculating enthalpy of water at given pressure and temperature\n", + "\n", + "#1.Assuming steam to be an ideal gas with value of Cp\n", + "T1=298.15;#Initial temperature in K\n", + "T2=573.15;#final temperature in K\n", + "T=(T1+T2)/2;#average temperature in K\n", + "Cp=1.79+0.107*T/1000+0.586*(T/1000)**2-.20*(T/1000)**3;#specific heat at constant pressure in kj/kg.K\n", + "M=18.015;#mass in kg\n", + "dh=M*Cp*(T2-T1);#enthalpy change in kJ/kmol\n", + "ho=-241.826;#enthalpy at standard temperature and pressure in kJ/mol\n", + "htp1=ho+dh/1000;#enthalpy at given temp and pressure in kJ/kmol\n", + "print \" 1. Enthalpy of water at given pressure and temperature using value of Cp =\",round(htp1,3),\"kJ/kmol\"\n", + "\n", + "#2..Assuming steam to be an ideal gas with value for dh\n", + "dh=9359;#enthalpy change from table A.9 in kJ/mol\n", + "htp2=ho+dh/1000;#enthalpy at given temp and pressure in kJ/kmol\n", + "print \" 2. Enthalpy of water at given pressure and temperature assuming value od dh =\",round(htp2,3),\"kJ/kmol \"\n", + "\n", + "#3. Using steam table\n", + "dh=M*(2977.5-2547.2);#enthalpy change for gases in kJ/mol\n", + "htp3g=dh/1000+ho;\n", + "dh=M*(2977.5-104.9);#enthalpy change for liquid in kJ/mol\n", + "hl=-285.830;#standard enthalpy for liquid in kJ/kmol\n", + "htp31=hl+dh/1000.0;#enthalpy at given temp and pressure in kJ/kmol\n", + "print \" 3.(i) enthalpy at given temp and pressure in kJ/kmol in terms of liquid =\",round(htp31,3),\"kJ/kmol \"\n", + "print \" 3.(ii) enthalpy at given temp and pressure in kJ/kmol in terms of liquid =\",round(htp3g,3),\"kJ/kmol \"\n", + "#4.using generalised charts\n", + "#htp=ho-(h2*-h2)+(h2*-h1*)+(h1*-h1);\n", + "#h2*-h2=Z*R*Tc,\n", + "#h2*-h1*=9539 kJ/mol, from part 2\n", + "#h1*-h1=0 ,as ideal gas \n", + "Z=0.21;#from chart\n", + "R=8.3145;#gas constant in SI units\n", + "Tc=647.3;#critical temperature in K\n", + "htp4=ho+9539/1000-Z*R*Tc/1000;#enthalpy at given temp and pressure in kJ/kmol\n", + "print \" 4. enthalpy at given temp and pressure in kJ/kmol using compressibility chart = \",round(htp4,3),\"kJ/kmol\"\n", + "#the answers in book are different as they have not printed the decimals in values" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " 1. Enthalpy of water at given pressure and temperature using value of Cp = -232.258 kJ/kmol\n", + " 2. Enthalpy of water at given pressure and temperature assuming value od dh = -232.826 kJ/kmol \n", + " 3.(i) enthalpy at given temp and pressure in kJ/kmol in terms of liquid = -234.08 kJ/kmol \n", + " 3.(ii) enthalpy at given temp and pressure in kJ/kmol in terms of liquid = -234.074 kJ/kmol \n", + " 4. enthalpy at given temp and pressure in kJ/kmol using compressibility chart = -233.956 kJ/kmol\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.15:Pg-649" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques15\n", + "#calculatng reversible elecromotive force \n", + "\n", + "#1-H2O\n", + "#2-H2\n", + "#3-O2\n", + "#hf-standard enthalpy \n", + "#sf-standard entropy\n", + "hf1=-285.830;#kJ\n", + "hf2=0;#kJ\n", + "hf3=0;#kJ\n", + "sf1=69.950;#kJ/K\n", + "sf2=130.678;#kJ/K\n", + "sf3=205.148;#kJ/K\n", + "dH=2*hf1-2*hf2-hf3;#change in enthalpy in kJ\n", + "dS=2*sf1-2*sf2-sf3;#change in entropy in kJ/K\n", + "T=298.15;#temperature in K\n", + "dG=dH-T*dS/1000;#change in gibbs free energy in kJ\n", + "E=-dG*1000/(96485*4);#emf in V\n", + "print\" Reversible electromotive Force =\",round(E,3),\" V\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Reversible electromotive Force = 1.229 V\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.17:Pg-654" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques17\n", + "#efficiency of generator and plant\n", + "\n", + "q=325000*(3398.3-856.0);#heat transferred to H2O/kg fuel in kJ/kg\n", + "qv=26700.0*33250;#higher heating value in kJ/kg\n", + "nst=q/qv*100;#efficiency of steam generator\n", + "w=81000.0*3600;#net work done in kJ/kg\n", + "nth=w/qv*100.0;#thermal efficiency\n", + "print\" Efficiency of generator =\",round(nst,1),\"percent\\n\"\n", + "print\" Thermal Efficiency =\",round(nth,1),\" percent\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Efficiency of generator = 93.1 percent\n", + "\n", + " Thermal Efficiency = 32.8 percent\n" + ] + } + ], + "prompt_number": 20 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter15_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter15_6.ipynb new file mode 100755 index 00000000..1c9182a7 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter15_6.ipynb @@ -0,0 +1,921 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4afaac3b11e3c61840a392c8cec12435d16ae2f3d2cdfe278957aaca509d72f5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter15:CHEMICAL REACTIONS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.1:Pg-621" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "#theoratical air-fuel ratio for combustion of octane\n", + "#combustion equation is\n", + "#C8H18 + 12.5O2 + 12.5(3.76) N2 \u2192 8 CO2 + 9H2O + 47.0N2\n", + "rm=(12.5+47.0)/1;#air fuel ratio on mole basis\n", + "rma=rm*28.97/114.2;#air fuel ratio on mass basis;\n", + "print \"Theoratical air fuel ratio on mass basis is\",round(rma),\"kg air/kg fuel\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Theoratical air fuel ratio on mass basis is 15.0 kg air/kg fuel\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.2:Pg-622" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 2\n", + "# molal analysis of the products of combustion\n", + "# combustion equation is \n", + "# C8H18 + 12.5(2) O2 + 12.5(2)(3.76) N2 \u2192 8 CO2 + 9H2O + 12.5O2 + 94.0N2\n", + "nCO2=8 # number of moles of CO2 \n", + "nH2O=9 # number of moles of H2O\n", + "nO2=12.5 # number of moles of O2\n", + "nN2=94.0 # number of moles of N2\n", + "moles=nCO2+nH2O+nO2+nN2 # total moles\n", + "# molal analysis of products\n", + "xCO2=nCO2*100/moles \n", + "xH2O=nH2O*100/moles\n", + "xO2=nO2*100/moles\n", + "xN2=nN2*100/moles\n", + "print \" CO2 =\",round(xCO2,2)\n", + "print \"\\n H2O=\",round(xH2O,2)\n", + "print \"\\n O2=\",round(xO2,2)\n", + "print \"\\n N2=\",round(xN2,2)\n", + "print \"\\n The dew point temp. corresponding to partial pressure of water i.e \",round(xH2O,2),\"KPa is 39.7 degree C\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " CO2 = 6.48\n", + "\n", + " H2O= 7.29\n", + "\n", + " O2= 10.12\n", + "\n", + " N2= 76.11\n", + "\n", + " The dew point temp. corresponding to partial pressure of water i.e 7.29 KPa is 39.7 degree C\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.2E:Pg-622" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 2\n", + "# molal analysis of the products of combustion\n", + "# combustion equation is \n", + "# C8H18 + 12.5(2) O2 + 12.5(2)(3.76) N2 \u2192 8 CO2 + 9H2O + 12.5O2 + 94.0N2\n", + "pressure=14.7 # in lbf/in^2\n", + "nCO2=8 # number of moles of CO2 \n", + "nH2O=9 # number of moles of H2O\n", + "nO2=12.5 # number of moles of O2\n", + "nN2=94.0 # number of moles of N2\n", + "moles=nCO2+nH2O+nO2+nN2 # total moles\n", + "# molal analysis of products\n", + "xCO2=nCO2*100/moles \n", + "xH2O=nH2O*100/moles\n", + "xO2=nO2*100/moles\n", + "xN2=nN2*100/moles\n", + "print \" CO2 =\",round(xCO2,2)\n", + "print \"\\n H2O=\",round(xH2O,2)\n", + "print \"\\n O2=\",round(xO2,2)\n", + "print \"\\n N2=\",round(xN2,2)\n", + "PressureO2=pressure*xH2O/100 # partial pressure of O2\n", + "print \"\\n The dew point temp. corresponding to partial pressure of water i.e \",round(PressureO2,3),\"lbf/in^2 is 104 F degree C\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " CO2 = 6.48\n", + "\n", + " H2O= 7.29\n", + "\n", + " O2= 10.12\n", + "\n", + " N2= 76.11\n", + "\n", + " The dew point temp. corresponding to partial pressure of water i.e 1.071 lbf/in^2 is 104 F degree C\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.3:Pg-623" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 3\n", + "# to determine the air\u2013fuel ratio on a volumetric basis\n", + "# the combustion equation is\n", + "# 0.14H2+0.27CO+0.03CH4+0.006O2+0.509N2+0.045CO2+0.259O2+0.259(3.76)N2\u21920.20H2O+0.345CO2+1.482 N2\n", + "mH2=2 # molar mass of H2\n", + "mCO=28 # molar mass of CO\n", + "mCH4=16 # molar mass of CH4\n", + "mO2=32 # molar mass of O2\n", + "mN2=28 # molar mass of N2\n", + "mCO2=44 # molar mass of CO2\n", + "\n", + "\n", + "kmolair=0.259 # moles of air in mixture using combustion equation\n", + "kmolfuel=0.21 # moles of fuel in mixture using combustion equation\n", + "ratioth=kmolair/kmolfuel # theoratical ratio\n", + "\n", + "# For 20% excess air\n", + "vratio=ratioth*(1+0.2) # new ratio for excess air on volume basis\n", + "\n", + "print \" The A/F ratio on volumetric basis is \",round(vratio,2)\n", + "mratio=vratio*28.97 /(0.14*mH2+0.27*mCO+0.03*mCH4+0.006*mO2+0.509*mN2+0.045*mCO2)\n", + "print \"\\n The A/F ratio on mass basis is \",round(mratio,2),\"kg air/kg fuel\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The A/F ratio on volumetric basis is 1.48\n", + "\n", + " The A/F ratio on mass basis is 1.73 kg air/kg fuel\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.4:Pg-624" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 4\n", + "# determining the air\u2013fuel ratio and the percent theoretical air\n", + "CO2=10.00 # percentage\n", + "O2=2.37 # percentage\n", + "CO=0.53 # percentage\n", + "N2=87.10 # percentage\n", + "mCH4=16 # molecular mass of CH4\n", + "# using this data the combustion equation is\n", + "# a CH4 + b O2 + c N2 \u2192 10.0 CO2 + 0.53 CO + 2.37 O2 + d H2O + 87.1N2\n", + "# on balancing we get\n", + "# 10.53 CH4 + 23.16 O2 + 87.1N2 \u219210.0 CO2 + 0.53 CO + 2.37 O2 + 21.06 H2O + 87.1N2\n", + "# balanced combustion equation for per Kmole of fuel is:\n", + "# CH4 + 2.2O2 + 8.27 N2 \u2192 0.95 CO2 + 0.05 CO + 2H2O + 0.225 O2 + 8.27 N2\n", + "molesAir=2.2+8.27 # moles of air\n", + "AF= 28.97*molesAir/mCH4 # air fuel ratio on mass basis\n", + "print \"\\n The A/F ratio on mass basis is \",round(AF,2),\"kg air/kg fuel\"\n", + "# Theoritical combustion equation:\n", + "# CH4 + 2O2 + 2(3.76)N2 \u2192 CO2 + 2H2O + 7.52 N2\n", + "molesAirth=2+2*3.76 # moles of air(theoritical)\n", + "AFth= 28.97*molesAirth/mCH4 # air fuel ratio on mass basis (theoritical)\n", + "print \"\\n The A/F ratio (theoritical) on mass basis is \",round(AFth,2),\"kg air/kg fuel\"\n", + "print \"\\n The percent theoretical air is\",round(AF*100/AFth,1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " The A/F ratio on mass basis is 18.96 kg air/kg fuel\n", + "\n", + " The A/F ratio (theoritical) on mass basis is 17.24 kg air/kg fuel\n", + "\n", + " The percent theoretical air is 110.0\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.5:Pg-625" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 5\n", + "\n", + "Sulfur=0.6 # percent by mass\n", + "Hydrogen=5.7 # percent by mass\n", + "Carbon=79.2 # percent by mass\n", + "Oxygen=10.0 # percent by mass\n", + "Nitrogen=1.5 # percent by mass\n", + "Ash=3.0 # percent by mass\n", + "mS=32.0 # molecular mass \n", + "mH2=2.0 # molecular mass\n", + "mC=12.0 # molecular mass\n", + "mO2=32.0 # molecular mass\n", + "mN2=28.0 # molecular mass\n", + "# molal composition per 100 Kg of fuel:\n", + "S=Sulfur/mS # molal composition \n", + "H=Hydrogen/mH2 # molal composition\n", + "C=Carbon/mC # molal composition\n", + "O2=Oxygen/mO2 # molal composition\n", + "N2=Nitrogen/mN2 # molal composition\n", + "\n", + "#The combustion equation becomes \n", + "# 0.02 S + 0.02 O2 \u21920.02 SO2\n", + "# 2.85 H2 + 1.42 O2 \u21922.85 H2O\n", + "# 6.60 C + 6.60 O2 \u21926.60 CO2\n", + "\n", + "O2req=0.02+1.42+6.60 # kmol O2 required/100 kg fuel\n", + "O2present=O2req-O2 # kmol O2 from air/100 kg fuel\n", + "AFtheo= (O2present+O2present*3.76)*28.97/100 # AF ration theoritical kg air/kg fuel\n", + "print \"\\n The A/F ratio (theoritical) on mass basis is \",round(AFtheo,2),\"kg air/kg fuel\"\n", + "print \"\\n The A/F ratio for 30% excess air on mass basis is \",round(AFtheo*1.3,2),\"kg air/kg fuel\"\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " The A/F ratio (theoritical) on mass basis is 10.66 kg air/kg fuel\n", + "\n", + " The A/F ratio for 30% excess air on mass basis is 13.85 kg air/kg fuel\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.6:Pg-629" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "# determining heat transfer per kilomole of fuel entering combustion chamber\n", + "\n", + "#1-CH4\n", + "#2-CO2\n", + "#3-H2O\n", + "#hf-standard enthalpy of given substance\n", + "hf1=-74.873;#kJ\n", + "hf2=-393.522;#kJ\n", + "hf3=-285.830;#kJ\n", + "Qcv=hf2+2*hf3-hf1;#kJ\n", + "print \"Heat transfer per kilomole of fuel entering combustion chamber is\",round(Qcv,3),\"kJ\"\n", + "#the answers in the book is different as they have not printed the decimals in values" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Heat transfer per kilomole of fuel entering combustion chamber is -890.309 kJ\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.7:Pg-631" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#calculating enthalpy of water at given pressure and temperature\n", + "\n", + "#1.Assuming steam to be an ideal gas with value of Cp\n", + "T1=298.15;#Initial temperature in K\n", + "T2=573.15;#final temperature in K\n", + "T=(T1+T2)/2;#average temperature in K\n", + "Cp=1.79+0.107*T/1000+0.586*(T/1000)**2-.20*(T/1000)**3;#specific heat at constant pressure in kj/kg.K\n", + "M=18.015;#mass in kg\n", + "dh=M*Cp*(T2-T1);#enthalpy change in kJ/kmol\n", + "ho=-241.826;#enthalpy at standard temperature and pressure in kJ/mol\n", + "htp1=ho+dh/1000;#enthalpy at given temp and pressure in kJ/kmol\n", + "print \" 1. Enthalpy of water at given pressure and temperature using value of Cp =\",round(htp1,3),\"kJ/kmol\"\n", + "\n", + "#2..Assuming steam to be an ideal gas with value for dh\n", + "dh=9359;#enthalpy change from table A.9 in kJ/mol\n", + "htp2=ho+dh/1000;#enthalpy at given temp and pressure in kJ/kmol\n", + "print \" 2. Enthalpy of water at given pressure and temperature assuming value od dh =\",round(htp2,3),\"kJ/kmol \"\n", + "\n", + "#3. Using steam table\n", + "dh=M*(2977.5-2547.2);#enthalpy change for gases in kJ/mol\n", + "htp3g=dh/1000+ho;\n", + "dh=M*(2977.5-104.9);#enthalpy change for liquid in kJ/mol\n", + "hl=-285.830;#standard enthalpy for liquid in kJ/kmol\n", + "htp31=hl+dh/1000.0;#enthalpy at given temp and pressure in kJ/kmol\n", + "print \" 3.(i) enthalpy at given temp and pressure in kJ/kmol in terms of liquid =\",round(htp31,3),\"kJ/kmol \"\n", + "print \" 3.(ii) enthalpy at given temp and pressure in kJ/kmol in terms of liquid =\",round(htp3g,3),\"kJ/kmol \"\n", + "#4.using generalised charts\n", + "#htp=ho-(h2*-h2)+(h2*-h1*)+(h1*-h1);\n", + "#h2*-h2=Z*R*Tc,\n", + "#h2*-h1*=9539 kJ/mol, from part 2\n", + "#h1*-h1=0 ,as ideal gas \n", + "Z=0.21;#from chart\n", + "R=8.3145;#gas constant in SI units\n", + "Tc=647.3;#critical temperature in K\n", + "htp4=ho+9539/1000-Z*R*Tc/1000;#enthalpy at given temp and pressure in kJ/kmol\n", + "print \" 4. enthalpy at given temp and pressure in kJ/kmol using compressibility chart = \",round(htp4,3),\"kJ/kmol\"\n", + "#the answers in book are different as they have not printed the decimals in values" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " 1. Enthalpy of water at given pressure and temperature using value of Cp = -232.258 kJ/kmol\n", + " 2. Enthalpy of water at given pressure and temperature assuming value od dh = -232.826 kJ/kmol \n", + " 3.(i) enthalpy at given temp and pressure in kJ/kmol in terms of liquid = -234.08 kJ/kmol \n", + " 3.(ii) enthalpy at given temp and pressure in kJ/kmol in terms of liquid = -234.074 kJ/kmol \n", + " 4. enthalpy at given temp and pressure in kJ/kmol using compressibility chart = -233.956 kJ/kmol\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.8:Pg-632" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 8\n", + "# Determine the heat transfer\n", + "airth=400 # % excess theoritical air\n", + "Ti=25 # Entry temp in degree celsius\n", + "To=900 # Exit temp in Kelvin\n", + "mf=0.25 # specific fuel consumption in kg/s of fuel per megawatt output\n", + "# The combustion equation is:\n", + "# C8H18(l) + 4(12.5)O2 + 4(12.5)(3.76)N2 \u2192 8CO2 + 9H2O + 37.5O2 + 188.0N2\n", + "hfC8H18=-250105 # is the enthalpy of fuel in kJ/kmol \n", + "nCO2=8 # moles\n", + "hfCO2=-393522 # enthalpy in kJ/kmol\n", + "DelhCO2=28030 # enthalpy in kJ/kmol\n", + "mC8H18=114.23 # molecular mass\n", + "nH2O=9 # moles\n", + "hfH2O=-241826 # enthalpy in kJ/kmol\n", + "DelhH2O=21937 # enthalpy in kJ/kmol\n", + "DelhO2=19241 # enthalpy in kJ/kmol\n", + "nO2=37.5 # moles\n", + "DelhN2=18225 # enthalpy in kJ/kmol\n", + "nN2=188.0 # moles\n", + "Eproduct=nCO2*(hfCO2+DelhCO2)+nH2O*(hfH2O+DelhH2O)+nO2*DelhO2+nN2*DelhN2\n", + "\n", + "Wcv=1000*mC8H18/mf # work in kJ/kmol fuel\n", + "print \" The work is \",Wcv,\"kJ/kmol fuel\"\n", + "\n", + "Qcv=Eproduct+Wcv-hfC8H18 # using first law\n", + "print \" The Heat transfer is \",Qcv,\"kJ/kmol fuel\"\n", + "\n", + "# the answer is slightly different in textbook due to approximation while here the answers are precise\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The work is 456920.0 kJ/kmol fuel\n", + " The Heat transfer is -48074.5 kJ/kmol fuel\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.8E:Pg-633" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 8\n", + "# Determine the heat transfer\n", + "airth=400 # % excess theoritical air\n", + "Ti=77 # Entry temp in F\n", + "To=1100 # Exit temp in F\n", + "mf=1 # specific fuel consumption in lb of fuel per horsepower-hour\n", + "# The combustion equation is:\n", + "# C8H18(l) + 4(12.5)O2 + 4(12.5)(3.76)N2 \u2192 8CO2 + 9H2O + 37.5O2 + 188.0N2\n", + "hfC8H18=-107526 # is the enthalpy of fuel in Btu/lb.mol\n", + "nCO2=8 # moles\n", + "hfCO2=-169184 # enthalpy in Btu/lb.mol\n", + "DelhCO2=11391 # enthalpy in Btu/lb.mol\n", + "mC8H18=114.23 # molecular mass\n", + "nH2O=9 # moles\n", + "hfH2O=-103966 # enthalpy in Btu/lb.mol\n", + "DelhH2O=8867 # enthalpy in Btu/lb.mol\n", + "DelhO2=7784 # enthalpy in Btu/lb.mol\n", + "nO2=37.5 # moles\n", + "DelhN2=7374 # enthalpy in Btu/lb.mol\n", + "nN2=188.0 # moles\n", + "Eproduct=nCO2*(hfCO2+DelhCO2)+nH2O*(hfH2O+DelhH2O)+nO2*DelhO2+nN2*DelhN2\n", + "\n", + "Wcv=2544*mC8H18 # work in kJ/kmol fuel\n", + "print \" The work is \",Wcv,\"Btu/lb.mol fuel\"\n", + "\n", + "Qcv=Eproduct+Wcv-hfC8H18 # using first law\n", + "print \" The Heat transfer is \",Qcv,\"Btu/lb.mol fuel\"\n", + "\n", + "# the answer is slightly different in textbook due to approximation while here the answers are precise\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The work is 290601.12 Btu/lb.mol fuel\n", + " The Heat transfer is -41895.88 Btu/lb.mol fuel\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.9:Pg-634" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques 9\n", + "\n", + "# The combustion equation is\n", + "# C2H4 + 3O2 \u2192 2 CO2 + 2H2O(g)\n", + "hfC2H4=52467 # enthalpy in KJ/mol\n", + "R=8.314 # gas constant\n", + "T=298.2 # temperature in Kelvin\n", + "hfCO2=-393522 # enthalpy in kJ/kmol\n", + "DelhCO2=12906 # enthalpy in kJ/kmol\n", + "hfH2O=-241826 # enthalpy in kJ/kmol\n", + "DelhH2O=10499 # enthalpy in kJ/kmol\n", + "Ureactant=hfC2H4-4*R*T # energy of reactant in KJ\n", + "Uproduct=2*(hfCO2+DelhCO2)+2*(hfH2O+DelhH2O) # energy of product in KJ\n", + "Q=Uproduct-Ureactant # using first law\n", + "print \"The Heat transfer is \",Q,\"kJ\"\n", + "\n", + "# the answer is slightly different in textbook due to approximation while here the answers are precise" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Heat transfer is -1266436.0608 kJ\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.10:Pg-638" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques 10\n", + "\n", + "# The combustion equation is\n", + "# C3H8 + 5O2 \u2192 3 CO2 + 4H2O\n", + "hfC3H8g=-103900 # enthalpy of C3H8 in KJ/mol from Table A.10\n", + "hfC3H8l=hfC3H8g-44.097*370 # enthalpy of C3H8 liquid as enthalpy of evaporation is given in question\n", + "hfH2Ol=285830 # enthalpy of water in KJ/mol\n", + "hfH2Og=241826 # enthalpy in KJ/mol\n", + "hfCO2=393522 # enthalpy in KJ/mol\n", + "nO2=5 # moles\n", + "nCO2=3 # moles\n", + "nH2O=4 # moles\n", + "nC3H8=1 # moles\n", + "# part(1) : liquid propane-liquid water\n", + "hrP=(nCO2*hfCO2 + nH2O*hfH2Ol -nC3H8*hfC3H8l)/44.097 # higher heating value of liquid propane \n", + "print \"The higher heating value of liquid propane is\",round(hrP,2),\"KJ/kg\"\n", + "\n", + "# part(2) : Liquid propane\u2013gaseous water\n", + "\n", + "hrP=(nCO2*hfCO2 + nH2O*hfH2Og -nC3H8*hfC3H8l)/44.097 # lower heating value of liquid propane \n", + "print \"The lower heating value of liquid propane is\",round(hrP,2),\"KJ/kg\"\n", + "\n", + "# part(3) :Gaseous propane\u2013liquid water\n", + "hrP=(nCO2*hfCO2 + nH2O*hfH2Ol -nC3H8*hfC3H8g)/44.097 # higher heating value of gaseous propane \n", + "print \"The higher heating value of gaseous propane is\",round(hrP,2),\"KJ/kg\"\n", + "\n", + "# part(4) :Gaseous propane\u2013Gaseous water\n", + "hrP=(nCO2*hfCO2 + nH2O*hfH2Og -nC3H8*hfC3H8g)/44.097 # lower heating value of gaseous propane \n", + "print \"The lower heating value of gaseous propane is\",round(hrP,2),\"KJ/kg\"\n", + "\n", + "\n", + "# the answer is slightly different in textbook due to approximation while here the answers are precise\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The higher heating value of liquid propane is -120215.89 KJ/kg\n", + "The lower heating value of liquid propane is 51434.02 KJ/kg\n", + "The higher heating value of gaseous propane is 55055.58 KJ/kg\n", + "The lower heating value of gaseous propane is 51064.02 KJ/kg\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.11:Pg-638" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques 10\n", + "# The combustion equation is\n", + "# C3H8(g) + 5O2 \u2192 3 CO2 + 4H2O(g)\n", + "hfC3H8=-103900 # enthalpy of C3H8 in KJ/mol from Table A.10\n", + "Cp=2.1 # in KJ/Kg.K\n", + "T1=500 # temp in Kelvin\n", + "T2=298.2 # temp in Kelvin\n", + "DelhO2=6086 # enthalpy of O2 in KJ/mol\n", + "hfCO2=-393522 # enthalpy in KJ/mol\n", + "DelhCO2=8305 # enthalpy of CO2 in KJ/mol\n", + "hfH2O=-241826 # enthalpy of H2O in KJ/mol\n", + "DelhH2O=6922 # enthalpy in KJ/mol\n", + "nO2=5 # moles\n", + "nCO2=3 # moles\n", + "nH2O=4 # moles\n", + "nC3H8=1 # moles\n", + "\n", + "hR500= hfC3H8+Cp*44.097*(T1-T2)+nO2*DelhO2 # in KJ/mol\n", + "hP500= nCO2*(hfCO2+DelhCO2)+ nH2O*(DelhH2O+hfH2O) # in KJ/mol\n", + "hRP500=hP500-hR500 # in KJ/mol\n", + "Hrp500=hRP500/44.097 # KJ/Kg\n", + "\n", + "print \" The enthalpy of combustion of gaseous propane at 500 K \",round(Hrp500)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The enthalpy of combustion of gaseous propane at 500 K -46273.0\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.12:Pg-639" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 12\n", + "# The question is solved by Trial and Error and using the table , no need for Calculation Thus not solved in Python" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.13:Pg-645" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 13\n", + "# The equation for this chemical reaction is\n", + "# C2H4(g) + 3(4) O2 + 3(4)(3.76) N2 \u2192 2 CO2+2H2O(g) + 9O2 + 45.1 N2\n", + "T=25+273.15 # temp in degree kelvin\n", + "P=0.1 # pressure in Mpa\n", + "hfCO2=-393522 # enthalpy in KJ/mol\n", + "hfH2O=-241826 # enthalpy of H2O in KJ/mol\n", + "HfC2H4=52467 # enthalpy of C2H4 in KJ/mol\n", + "hfO2=0 # enthalpy of formation in KJ/mol\n", + "SCO2=213.795 # kJ/kmol fuel\n", + "SH2O=188.243 # kJ/kmol fuel\n", + "SC2H4=219.330 # kJ/kmol fuel\n", + "SO2=205.148 # kJ/kmol fuel\n", + "DelH=2*hfCO2+2*hfH2O-HfC2H4-3*hfO2 # in KJ/mol\n", + "DelS=2*SCO2+2*SH2O-SC2H4-3*SO2 # kJ/kmol fuel\n", + "DelG=DelH-T*(DelS) # Gibbs Energy\n", + "Wrev=-DelG/28.054 # reversible work in kJ/kg\n", + "print \"The reversible work is \",round(Wrev,2),\"kJ/kg \"\n", + "\n", + "# the answer is slightly different in textbook due to approximation while here the answers are precise" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The reversible work is 46838.61 kJ/kg \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.14:Pg-647" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques \n", + "# The question is solved by Trial and Error and using the table , no need for Calculation Thus not solved in Python" + ], + "language": "python", + "metadata": {}, + "outputs": [] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.15:Pg-649" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques15\n", + "#calculatng reversible elecromotive force \n", + "\n", + "#1-H2O\n", + "#2-H2\n", + "#3-O2\n", + "#hf-standard enthalpy \n", + "#sf-standard entropy\n", + "hf1=-285.830;#kJ\n", + "hf2=0;#kJ\n", + "hf3=0;#kJ\n", + "sf1=69.950;#kJ/K\n", + "sf2=130.678;#kJ/K\n", + "sf3=205.148;#kJ/K\n", + "dH=2*hf1-2*hf2-hf3;#change in enthalpy in kJ\n", + "dS=2*sf1-2*sf2-sf3;#change in entropy in kJ/K\n", + "T=298.15;#temperature in K\n", + "dG=dH-T*dS/1000;#change in gibbs free energy in kJ\n", + "E=-dG*1000/(96485*4);#emf in V\n", + "print\" Reversible electromotive Force =\",round(E,3),\" V\"\n", + "\n", + "# the answer is slightly different in textbook due to approximation while here the answers are precise" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Reversible electromotive Force = 1.229 V\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.16:Pg-654" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 16\n", + "# to Calculate the combustion efficiency\n", + "Tair = 400 # temp in K\n", + "Vair = 100 # velocity in m/s\n", + "Tfuel = 50 # temp of fuel in \u25e6C\n", + "Tproducts = 1100 # temp of product in K\n", + "Vproducts = 150 # velocity of product in m/s\n", + "FAactual = 0.0211 # air fuel ratio kg fuel/kg air\n", + "\n", + "# HR + KER= \u2212243737 + 14892nO2 \n", + "# HP + KEP= \u22125 068 599 + 120 853nO2 \n", + "# using these two equations :\n", + "no2=(-5068599.0 + 243737.0)/(14892.0-120853) # in kmol O2/kmol fuel\n", + "FAideal=114.23/(4.76*no2*28.91) # in kg fuel/kg air\n", + "\n", + "efficomb=FAideal*100/FAactual # Efficiency\n", + "\n", + "print \" The combustion efficiency is \",round(efficomb,2),\"%\"\n", + "\n", + "# the answer is slightly different in textbook due to approximation while here the answers are precise\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The combustion efficiency is 86.4 %\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex15.17:Pg-654" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques17\n", + "#efficiency of generator and plant\n", + "\n", + "q=325000*(3398.3-856.0);#heat transferred to H2O/kg fuel in kJ/kg\n", + "qv=26700.0*33250;#higher heating value in kJ/kg\n", + "nst=q/qv*100;#efficiency of steam generator\n", + "w=81000.0*3600;#net work done in kJ/kg\n", + "nth=w/qv*100.0;#thermal efficiency\n", + "print\" Efficiency of generator =\",round(nst,1),\"percent\\n\"\n", + "print\" Thermal Efficiency =\",round(nth,1),\" percent\"\n", + "\n", + "# the answer is slightly different in textbook due to approximation while here the answers are precise" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Efficiency of generator = 93.1 percent\n", + "\n", + " Thermal Efficiency = 32.8 percent\n" + ] + } + ], + "prompt_number": 13 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter16.ipynb b/Fundamentals_Of_Thermodynamics/Chapter16.ipynb new file mode 100755 index 00000000..6a07737d --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter16.ipynb @@ -0,0 +1,128 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7c7e50fa2880e870c4aa1630bafd7d049a3cb3c4e646a0d88068a55be4a3d00f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 16:INTRODUCTION TO PHASE AND CHEMICAL EQUILIBRIUM" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.2:PG-681" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques2\n", + "#to determine change in gibbs free energy\n", + "\n", + "#1-H2\n", + "#2-O2\n", + "#3-H2O\n", + "\n", + "#at T=298 K\n", + "T1=298.0;#K\n", + "Hf1=0;#Enthalpy of formation of H2 at 298 K\n", + "Hf2=0;#Enthalpy of formation of O2 at 298 K\n", + "Hf3=-241826;#enthalpy of formation of H2O at 298 K in kJ\n", + "dH=2*Hf1+Hf2-2*Hf3;#Change in enthalpy in kJ\n", + "Sf1=130.678;#Entropy of H2 at 298 K n kJ/K\n", + "Sf2=205.148;#Entropy of O2 at 298 K in kJ/K\n", + "Sf3=188.834;#entropy of H2O at 298 K in kJ/K\n", + "dS=2*Sf1+Sf2-2*Sf3;#Change in entropy in kJ/K\n", + "dG1=dH-T1*dS;#change n gibbs free energy in kJ\n", + "print\" Change in gibbs free energy at\",T1,\"kelvin is\",round(dG1),\"kJ \"\n", + "#at T=2000 K\n", + "T2=2000.0;#K\n", + "Hf1=52942-0;#Enthalpy of formation of H2 at 2000 K\n", + "Hf2=59176-0;#Enthalpy of formation of O2 at 2000 K\n", + "Hf3=-241826+72788;#enthalpy of formation of H2O at 2000 K in kJ\n", + "dH=2*Hf1+Hf2-2*Hf3;#Change in enthalpy in kJ\n", + "Sf1=188.419;#Entropy of H2 at 2000 K n kJ/K\n", + "Sf2=268.748;#Entropy of O2 at 2000 K in kJ/K\n", + "Sf3=264.769;#entropy of H2O at 2000 K in kJ/K\n", + "dS=2*Sf1+Sf2-2*Sf3;#Change in entropy in kJ/K\n", + "dG2=dH-(T2*dS);#change n gibbs free energy in kJ\n", + "print\" Change in gibbs free energy at\",T2,\"kelvin is\",round(dG2),\" kJ \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Change in gibbs free energy at 298.0 kelvin is 457179.0 kJ \n", + " Change in gibbs free energy at 2000.0 kelvin is 271040.0 kJ \n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.3:PG-683" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques3\n", + "#calculating equilibrium constant \n", + "\n", + "dG1=-457.166;#change in gibbs free energy at temp 298 K from example2 in kJ\n", + "dG2=-271.040;#change in gibbs free energy at temp 2000 K from example2 n kJ\n", + "T1=298;#K\n", + "T2=2000;#K\n", + "R=8.3145;#gas constant\n", + "K1=dG1*1000/(R*T1);\n", + "K2=dG2*1000/(R*T2);\n", + "print\" Equilibrium constant at \",T1,\"K = \",round(K1,2)\n", + "print\" Equilibrium constant at \",T2,\"K = \",round(K2,3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Equilibrium constant at 298 K = -184.51\n", + " Equilibrium constant at 2000 K = -16.299\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter16_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter16_6.ipynb new file mode 100755 index 00000000..c155fdc6 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter16_6.ipynb @@ -0,0 +1,377 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:2573953a96bd6739252db580058edb8938919cec53d4f1d76f9484cfa4f2a1d5" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 16:INTRODUCTION TO PHASE AND CHEMICAL EQUILIBRIUM" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.1:676" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "# pressure required to make diamonds from graphite\n", + "import math\n", + "T=25 # temp in degree C\n", + "ggrp= 0 # g for fraphite\n", + "gdiamnd=2867.8 # g for diamond in kJ/mol\n", + "vgrp=0.000444 # specific volume of graphite in m^3/kg\n", + "vdiamnd=0.000284 # specific volume of graphite in m^3/kg\n", + "BetaTgrp=0.304e-6 # beta for graphite in 1/MPa\n", + "BetaTdiamnd=0.016e-6 # beta for diamond in 1/MPa\n", + "\n", + "P=-(-2*(vgrp-vdiamnd)+math.sqrt((2*vgrp-2*vdiamnd)**2-4*(vgrp*BetaTgrp-vdiamnd*BetaTdiamnd)*(2*gdiamnd/(12.011*1000))))/(2*(vgrp*BetaTgrp-vdiamnd*BetaTdiamnd))\n", + "print int(P),\" MPa is the pressure at which possibility exists for conversion from graphite to diamonds\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1493 MPa is the pressure at which possibility exists for conversion from graphite to diamonds\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.2:PG-681" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques2\n", + "#to determine change in gibbs free energy\n", + "\n", + "#1-H2\n", + "#2-O2\n", + "#3-H2O\n", + "\n", + "#at T=298 K\n", + "T1=298.0;#K\n", + "Hf1=0;#Enthalpy of formation of H2 at 298 K\n", + "Hf2=0;#Enthalpy of formation of O2 at 298 K\n", + "Hf3=-241826;#enthalpy of formation of H2O at 298 K in kJ\n", + "dH=2*Hf1+Hf2-2*Hf3;#Change in enthalpy in kJ\n", + "Sf1=130.678;#Entropy of H2 at 298 K n kJ/K\n", + "Sf2=205.148;#Entropy of O2 at 298 K in kJ/K\n", + "Sf3=188.834;#entropy of H2O at 298 K in kJ/K\n", + "dS=2*Sf1+Sf2-2*Sf3;#Change in entropy in kJ/K\n", + "dG1=dH-T1*dS;#change n gibbs free energy in kJ\n", + "print\" Change in gibbs free energy at\",T1,\"kelvin is\",round(dG1),\"kJ \"\n", + "#at T=2000 K\n", + "T2=2000.0;#K\n", + "Hf1=52942-0;#Enthalpy of formation of H2 at 2000 K\n", + "Hf2=59176-0;#Enthalpy of formation of O2 at 2000 K\n", + "Hf3=-241826+72788;#enthalpy of formation of H2O at 2000 K in kJ\n", + "dH=2*Hf1+Hf2-2*Hf3;#Change in enthalpy in kJ\n", + "Sf1=188.419;#Entropy of H2 at 2000 K n kJ/K\n", + "Sf2=268.748;#Entropy of O2 at 2000 K in kJ/K\n", + "Sf3=264.769;#entropy of H2O at 2000 K in kJ/K\n", + "dS=2*Sf1+Sf2-2*Sf3;#Change in entropy in kJ/K\n", + "dG2=dH-(T2*dS);#change n gibbs free energy in kJ\n", + "print\" Change in gibbs free energy at\",T2,\"kelvin is\",round(dG2),\" kJ \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Change in gibbs free energy at 298.0 kelvin is 457179.0 kJ \n", + " Change in gibbs free energy at 2000.0 kelvin is 271040.0 kJ \n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.3:PG-683" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques3\n", + "#calculating equilibrium constant \n", + "\n", + "dG1=-457.166;#change in gibbs free energy at temp 298 K from example2 in kJ\n", + "dG2=-271.040;#change in gibbs free energy at temp 2000 K from example2 n kJ\n", + "T1=298;#K\n", + "T2=2000;#K\n", + "R=8.3145;#gas constant\n", + "K1=dG1*1000/(R*T1);\n", + "K2=dG2*1000/(R*T2);\n", + "print\" Equilibrium constant at \",T1,\"K = \",round(K1,2)\n", + "print\" Equilibrium constant at \",T2,\"K = \",round(K2,3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Equilibrium constant at 298 K = -184.51\n", + " Equilibrium constant at 2000 K = -16.299\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.4:Pg-684" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# The example is about proving that Equlibrium constant can be found using table hence doesn't require solution in python " + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.5:Pg-685" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 5\n", + "# To determine Heat Transfer\n", + "# The process is two step as:\n", + "# Combustion: C + O2--->CO2\n", + "# Dissociation reaction: 2CO2---->2CO + O2\n", + "# overall process : C + O2 \u2192 0.5622 CO2 + 0.4378 CO + 0.2189 O2\n", + "nCO2=0.5622 # moles of CO2\n", + "nCO=0.4378 # moles of CO\n", + "nO2=0.2189 # moles of NO2\n", + "\n", + "# from Table A.9:\n", + "hfCO2=0 # enthalpy of formation\n", + "hfC=0 # enthalpy of formation\n", + "hfCO=0 # enthalpy of formation\n", + "hfO2=0 # enthalpy of formation\n", + "hfCO23000=-393522 # enthalpy @ 3000K\n", + "hfCO3000=-110527 # enthalpy @ 3000K\n", + "hfO23000=0 # enthalpy @ 3000K\n", + "hfCO2298=-152853 # enthalpy @ 298K\n", + "hfCO298=-93504 # enthalpy @ 298K\n", + "hfO2298=-98013 # enthalpy @ 298K\n", + "\n", + "Hr=hfC+hfO2 # enthalpy of reactants\n", + "Hp=nCO2*(hfCO2+hfCO23000-hfCO2298)+nCO*(hfCO+hfCO3000-hfCO298)+nO2*(hfO2+hfO23000-hfO2298)\n", + "\n", + "Qcv=Hp-Hr # using first law\n", + "print round(Qcv),\"kJ/kmol C is the heat transfer \"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "-121302.0 kJ/kmol C is the heat transfer \n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.6:Pg-687" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 6\n", + "# to determine the composition\n", + "# the standard equation is C + 2O2 \u2192 CO2 + O2\n", + "# from equilibrium C + 2O2 \u2192 (1 \u2212 2z)CO2 + 2zCO + (1 + z)O2\n", + "T=3000 # temp in K\n", + "P=0.1 # prssure in MPa\n", + "z = 0.1553 # from equilibrium equation using table\n", + "yCO2=(1-2*z)/(2+z) # mole fraction of CO2\n", + "yCO = 2*z/(2+z) # mole fraction of CO\n", + "yO2=(1+z)/(2+z) # mole fraction of O2\n", + "print \"The mole fraction is \",round(yCO2,3),\" for CO2 \\n\"\n", + "print \"The mole fraction is \",round(yCO,3),\" for CO \\n\"\n", + "print \"The mole fraction is \",round(yO2,3),\" for O2 \\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mole fraction is 0.32 for CO2 \n", + "\n", + "The mole fraction is 0.144 for CO \n", + "\n", + "The mole fraction is 0.536 for O2 \n", + "\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.7:Pg-691" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 7\n", + "# to determine the equilibrium composition\n", + "# The reaction equation is:\n", + "# (1): 2.H2O -->2H2 + O2\n", + "# (2): 2 H2O -->H2 + 2OH\n", + "# the equilibrium equation is \n", + "# H2O \u2192 (1 \u2212 2a \u2212 2b)H2O + (2a + b)H2 + aO2 + 2bOH\n", + "P= 0.1 # pressure in MPa\n", + "T=3000 # temp in Kelvin\n", + "a=0.0534 # using value of K from Table A.11 @ 3000k\n", + "b=0.0551 # using value of K from Table A.11 @ 3000k\n", + "nH2O= (1-2*a-b) # moles of H2O\n", + "nH2=2*a+b# moles of H2\n", + "nO2=a# moles of O2\n", + "nOH= 2*b# moles of OH\n", + "X=nH2O+nH2+nO2+nOH\n", + "yH2O=nH2O/X # mole fraction\n", + "yH2=nH2/X # mole fraction\n", + "yO2=nO2/X # mole fraction\n", + "yOH=nOH/X # mole fraction\n", + "print \"The mole fraction of H2O is\",round(yH2O,2),\"\\n\"\n", + "print \"The mole fraction of H2 is\",round(yH2,2),\"\\n\"\n", + "print \"The mole fraction of O2 is\",round(yO2,2),\"\\n\"\n", + "print \"The mole fraction of OH is\",round(yOH,2),\"\\n\"\n", + "# the answers are slightly different due to approximation in textbook while here the answers are precise" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mole fraction of H2O is 0.72 \n", + "\n", + "The mole fraction of H2 is 0.139 \n", + "\n", + "The mole fraction of O2 is 0.046 \n", + "\n", + "The mole fraction of OH is 0.095 \n", + "\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex16.8:pg-696" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# ques 8\n", + "# determine the the equilibrium composition\n", + "P= 1 # pressure in Kpa\n", + "T=10000 # temp in Kelvin\n", + "z=0.2008 # using k from table \n", + "# the chemical equation is Ar -->Ar^(+) + e\u2212\n", + "\n", + "yAr=(1-z)/(1 + z) # mole fraction of Ar\n", + "yArpositive= z/(1+z) # mole fraction of Ar(+)\n", + "yenegative=z/(1+z) # mole fraction of ye-\n", + "print \"The mole fraction of Ar is\",round(yAr,3),\"\\n\"\n", + "print \"The mole fraction of Ar+ is\",round(yArpositive,3),\"\\n\"\n", + "print \"The mole fraction of e- is\",round(yenegative,3),\"\\n\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mole fraction of Ar is 0.666 \n", + "\n", + "The mole fraction of Ar+ is 0.167 \n", + "\n", + "The mole fraction of e- is 0.167 \n", + "\n" + ] + } + ], + "prompt_number": 32 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter17.ipynb b/Fundamentals_Of_Thermodynamics/Chapter17.ipynb new file mode 100755 index 00000000..4ae8005b --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter17.ipynb @@ -0,0 +1,434 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:70b7f86a423a7c9685f997491946441e1c53cfe8fe328afd6e5b37a44e4dce11" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 17: COMPRESSIBLE FLOW" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.1:PG-710" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "#to determine isentropic stagnation pressure and temperature \n", + "\n", + "T=300;#Temperature of air in K\n", + "P=150;#Pressure of air in kPa\n", + "v=200;#velocity of air flow n m/s\n", + "Cp=1.004;#specific heat at constant pressure in kJ/kg\n", + "To=v**2/(2000*Cp)+T;#stagnation temperature in K\n", + "k=1.4;#constant\n", + "Po=P*(To/T)**(k/(k-1));#stagnation pressure in kPa\n", + "print 'Stagnation Temperature is ',round(To,1),' K \\n'\n", + "print 'Stagnation Pressure is ',round(Po,2),'kPa \\n'" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Stagnation Temperature is 319.9 K \n", + "\n", + "Stagnation Pressure is 187.85 kPa \n", + "\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.2:PG-713" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques2\n", + "#to determine the force\n", + "\n", + "#initializing variables\n", + "mdot=-1 # mass flow rate out of control volume in kg/s\n", + "Vx=-1 # x component of velocity of control volume in m/s\n", + "Vy=10 # y component of velocity of control volume in m/s\n", + "\n", + "Fx=mdot*Vx # Force in X direction\n", + "\n", + "Fy=mdot*Vy # Force in Y direction\n", + "\n", + "print \"the force the man exert on the wheelbarrow\",round(Fx),\"N\"\n", + "print \"the force the floor exerts on the wheelbarrow\",round(Fy),\"N\"\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the force the man exert on the wheelbarrow 1.0 N\n", + "the force the floor exerts on the wheelbarrow -10.0 N\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.3:PG-715" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques3\n", + "#determining the thrust acting on a control surface\n", + "\n", + "#i-inlet\n", + "#e-exit\n", + "#using momentum equation on control surface in x direction\n", + "me=20.4;#mass exiting in kg\n", + "mi=20;#mass entering in kg\n", + "ve=450;#exit velocity in m/s\n", + "vi=100;#inlet velocity in m/s\n", + "Pi=95;#Pressure at inlet in kPa\n", + "Pe=125;#Pressure at exit in kPa\n", + "Po=100;#surrounding pressure in kPa\n", + "Ai=0.2;#inlet area in m^2\n", + "Ae=0.1;#exit area in m^2\n", + "Rx=(me*ve-mi*vi)/1000-(Pi-Po)*Ai+(Pe-Po)*Ae;#thrust in x direction in kN\n", + "\n", + "print \"Thrust acting in x direction is \",round(Rx,2),\"kN\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust acting in x direction is 10.68 kN\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.4:PG-717" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4\n", + "#to determine increase in enthalpy\n", + "#initializing variables\n", + "#i-inlet\n", + "#e-exit\n", + "\n", + "T=25+273 # temperature in kelvin\n", + "v=0.001003 # specific volume of water in kg/m^3 at 25 *c from table B.1.1 \n", + "ve=7;#exit velocity in m/s\n", + "vi=30;#inlet velocity in m/s\n", + "Pi=350;#Pressure at inlet in kPa\n", + "Pe=600;#Pressure at exit in kPa\n", + "\n", + "#using momentum equation on control surface \n", + "Pes= (vi**2-ve**2)/(2*v*1000)+Pi # exit pressure for reversible diffuser\n", + "delH=(vi**2-ve**2)/(2*1000.0) # change in enthalpy from first law in kJ/kg\n", + "delU=delH-v*(Pe-Pi) # change in internal energy in kJ/kg\n", + "delS=delU/T # change in entropy in kJ/kg.K\n", + "print\"the exit pressure for reversible diffuser is \",round(Pes),\"kPa\"\n", + "print\"the increase in enthalpy is \",round(delH,5),\"kJ/kg\"\n", + "print\"the increase in internal energy is \",round(delU,5),\"kJ/kg\"\n", + "print\"the increase in entropy is \",round(delS,6),\"kJ/kg.K\"\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the exit pressure for reversible diffuser is 774.0 kPa\n", + "the increase in enthalpy is 0.4255 kJ/kg\n", + "the increase in internal energy is 0.17475 kJ/kg\n", + "the increase in entropy is 0.000586 kJ/kg.K\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.5:PG-720" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#determining velocity of sound in air\n", + "import math\n", + "k=1.4;#constant\n", + "R=0.287;#gas constant\n", + "#at 300K\n", + "T1=300;# temperature in kelvin\n", + "c1=math.sqrt(k*R*T1*1000)\n", + "print \"Speed of sound at 300 K is\",round(c1,1),\" m/s\" \n", + "#at 1000K\n", + "T2=1000;# temperature in kelvin\n", + "c2=math.sqrt(k*R*T2*1000)\n", + "print \"Speed of sound at 1000 K is\",round(c2,1),\" m/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of sound at 300 K is 347.2 m/s\n", + "Speed of sound at 1000 K is 633.9 m/s\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.6:PG-727" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#determining mass flow rate through control volume\n", + "import math\n", + "k=1.4;#constant\n", + "R=0.287;#gas constant\n", + "To=360;#stagnation Temperature in K \n", + "T=To*0.8333;#Temperature of air in K, 0.8333 stagnation ratio from table\n", + "v=math.sqrt(k*R*T*1000);#velocity in m/s\n", + "P=528;#stagnation pressure in kPa\n", + "d=P/(R*T);#stagnation density in kg/m^3\n", + "A=500*10**-6;#area in m^2\n", + "ms=d*A*v;#mass flow rate in kg/s\n", + "print\" Mass flow rate at the throat section is\",round(ms,4),\"kg/s\"\n", + "#e-exit state\n", + "Te=To*0.9381;#exit temperature in K, ratio from table\n", + "ce=math.sqrt(k*R*Te*1000);#exit velocity of sound in m/s\n", + "Me=0.573;#Mach number\n", + "ve=Me*ce;\n", + "Pe=800;#exit pressure in kPa\n", + "de=Pe/R/Te;\n", + "mse=de*A*ve;\n", + "print\" Mass flow rate at the exit section is\",round(mse,4),\" kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Mass flow rate at the throat section is 1.0646 kg/s\n", + " Mass flow rate at the exit section is 0.8711 kg/s\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.7:PG-728" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#determining exit properties in a control volume\n", + "import math\n", + "Po=1000;#stagnation pressure in kPa\n", + "To=360;#stagnation temperature in K\n", + "\n", + "#when diverging section acting as nozzle\n", + "\n", + "Pe1=0.0939*Po;#exit pressure of air in kPa\n", + "Te1=0.5089*To;#exit temperature in K\n", + "k=1.4;#constant\n", + "R=0.287;#gas constant for air\n", + "ce=math.sqrt(k*R*Te1*1000);#velocity of sound in exit section in m/s\n", + "Me=2.197;#mach number from table\n", + "ve1=Me*ce;#velocity of air at exit section in m/s\n", + "print \"When diverging section act as a nozzle :-\"\n", + "print \"Exit pressure is\",round(Pe1,4),\" kPa\"\n", + "print \"Exit Temperature\",round(Te1,1),\" K\"\n", + "print \"Exit velocity is\",round(ve1,1),\" m/s \"\n", + "\n", + "#when diverging section act as diffuser\n", + "\n", + "Me=0.308;\n", + "Pe2=0.0936*Po;#exit pressure of air in kPa\n", + "Te2=0.9812*To;#exit temperature in K\n", + "ce=math.sqrt(k*R*Te2*1000);#velocity of sound in exit section in m/s\n", + "ve2=Me*ce;\n", + "print \"When diverging section act as a diffuser :-\"\n", + "print \"Exit pressure is\",round(Pe2,1),\" kPa\"\n", + "print \"Exit Temperature\",round(Te2,2),\" K\"\n", + "print \"Exit velocity is\",round(ve2,),\" m/s \"\n", + "\n", + "# The value of Exit pressure when diverging section acts as diffuser is wrong\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "When diverging section act as a nozzle :-\n", + "Exit pressure is 93.9 kPa\n", + "Exit Temperature 183.2 K\n", + "Exit velocity is 596.1 m/s \n", + "When diverging section act as a diffuser :-\n", + "Exit pressure is 93.6 kPa\n", + "Exit Temperature 353.23 K\n", + "Exit velocity is 116.0 m/s \n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.9:PG-733" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques9\n", + "#determining exit plane properties in control volume\n", + "\n", + "#x-inlet\n", + "#y-exit\n", + "Mx=1.5;#mach number for inlet\n", + "My=0.7011;#mach number for exit\n", + "Px=272.4;#inlet pressure in kPa\n", + "Tx=248.3;#inlet temperature in K\n", + "Tox=360 # stagnation temperature in Kelvin\n", + "Pox=1000.0;#stagnation pressure for inlet\n", + "Py=2.4583*Px;# Pressure at 1.5 mach in kPa\n", + "Ty=1.320*Tx;# temperature at 1.5 mach in K\n", + "Poy=0.9298*Pox;# pressure at 1.5 mach in kPa\n", + "\n", + "Toy=Tox # constant\n", + "Me=0.339 # from table with A/A*=1.860 and M < 1\n", + "Pe=0.9222*Py;#Exit Pressure in kPa\n", + "Te=0.9771*Toy;#Exit temperature in K\n", + "Poe=0.9222*Poy;#Exit pressure in kPa\n", + "\n", + "print \"Exit Mach no.=\",Me\n", + "print \"Exit temperature =\",round(Te,2),\"K \"\n", + "print \"Exit pressure =\",round(Poe,1),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Exit Mach no.= 0.339\n", + "Exit temperature = 351.76 K \n", + "Exit pressure = 857.5 kPa\n" + ] + } + ], + "prompt_number": 50 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 45 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter17_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter17_6.ipynb new file mode 100755 index 00000000..11b9507c --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter17_6.ipynb @@ -0,0 +1,462 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:e77c793709c88cc39a2de404e997a6f1eed32d352c214c1580d822fd7a5a83a2" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 17: COMPRESSIBLE FLOW" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.1:PG-710" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques1\n", + "#to determine isentropic stagnation pressure and temperature \n", + "\n", + "T=300;#Temperature of air in K\n", + "P=150;#Pressure of air in kPa\n", + "v=200;#velocity of air flow n m/s\n", + "Cp=1.004;#specific heat at constant pressure in kJ/kg\n", + "To=v**2/(2000*Cp)+T;#stagnation temperature in K\n", + "k=1.4;#constant\n", + "Po=P*(To/T)**(k/(k-1));#stagnation pressure in kPa\n", + "print 'Stagnation Temperature is ',round(To,1),' K \\n'\n", + "print 'Stagnation Pressure is ',round(Po,2),'kPa \\n'" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Stagnation Temperature is 319.9 K \n", + "\n", + "Stagnation Pressure is 187.85 kPa \n", + "\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.2:PG-713" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques2\n", + "#to determine the force\n", + "\n", + "#initializing variables\n", + "mdot=-1 # mass flow rate out of control volume in kg/s\n", + "Vx=-1 # x component of velocity of control volume in m/s\n", + "Vy=10 # y component of velocity of control volume in m/s\n", + "\n", + "Fx=mdot*Vx # Force in X direction\n", + "\n", + "Fy=mdot*Vy # Force in Y direction\n", + "\n", + "print \"the force the man exert on the wheelbarrow\",round(Fx),\"N\"\n", + "print \"the force the floor exerts on the wheelbarrow\",round(Fy),\"N\"\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the force the man exert on the wheelbarrow 1.0 N\n", + "the force the floor exerts on the wheelbarrow -10.0 N\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.3:PG-715" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques3\n", + "#determining the thrust acting on a control surface\n", + "\n", + "#i-inlet\n", + "#e-exit\n", + "#using momentum equation on control surface in x direction\n", + "me=20.4;#mass exiting in kg\n", + "mi=20;#mass entering in kg\n", + "ve=450;#exit velocity in m/s\n", + "vi=100;#inlet velocity in m/s\n", + "Pi=95;#Pressure at inlet in kPa\n", + "Pe=125;#Pressure at exit in kPa\n", + "Po=100;#surrounding pressure in kPa\n", + "Ai=0.2;#inlet area in m^2\n", + "Ae=0.1;#exit area in m^2\n", + "Rx=(me*ve-mi*vi)/1000-(Pi-Po)*Ai+(Pe-Po)*Ae;#thrust in x direction in kN\n", + "\n", + "print \"Thrust acting in x direction is \",round(Rx,2),\"kN\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Thrust acting in x direction is 10.68 kN\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.4:PG-717" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques4\n", + "#to determine increase in enthalpy\n", + "#initializing variables\n", + "#i-inlet\n", + "#e-exit\n", + "\n", + "T=25+273 # temperature in kelvin\n", + "v=0.001003 # specific volume of water in kg/m^3 at 25 *c from table B.1.1 \n", + "ve=7;#exit velocity in m/s\n", + "vi=30;#inlet velocity in m/s\n", + "Pi=350;#Pressure at inlet in kPa\n", + "Pe=600;#Pressure at exit in kPa\n", + "\n", + "#using momentum equation on control surface \n", + "Pes= (vi**2-ve**2)/(2*v*1000)+Pi # exit pressure for reversible diffuser\n", + "delH=(vi**2-ve**2)/(2*1000.0) # change in enthalpy from first law in kJ/kg\n", + "delU=delH-v*(Pe-Pi) # change in internal energy in kJ/kg\n", + "delS=delU/T # change in entropy in kJ/kg.K\n", + "print\"the exit pressure for reversible diffuser is \",round(Pes),\"kPa\"\n", + "print\"the increase in enthalpy is \",round(delH,5),\"kJ/kg\"\n", + "print\"the increase in internal energy is \",round(delU,5),\"kJ/kg\"\n", + "print\"the increase in entropy is \",round(delS,6),\"kJ/kg.K\"\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the exit pressure for reversible diffuser is 774.0 kPa\n", + "the increase in enthalpy is 0.4255 kJ/kg\n", + "the increase in internal energy is 0.17475 kJ/kg\n", + "the increase in entropy is 0.000586 kJ/kg.K\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.5:PG-720" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques5\n", + "#determining velocity of sound in air\n", + "import math\n", + "k=1.4;#constant\n", + "R=0.287;#gas constant\n", + "#at 300K\n", + "T1=300;# temperature in kelvin\n", + "c1=math.sqrt(k*R*T1*1000)\n", + "print \"Speed of sound at 300 K is\",round(c1,1),\" m/s\" \n", + "#at 1000K\n", + "T2=1000;# temperature in kelvin\n", + "c2=math.sqrt(k*R*T2*1000)\n", + "print \"Speed of sound at 1000 K is\",round(c2,1),\" m/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of sound at 300 K is 347.2 m/s\n", + "Speed of sound at 1000 K is 633.9 m/s\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.6:PG-727" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques6\n", + "#determining mass flow rate through control volume\n", + "import math\n", + "k=1.4;#constant\n", + "R=0.287;#gas constant\n", + "To=360;#stagnation Temperature in K \n", + "T=To*0.8333;#Temperature of air in K, 0.8333 stagnation ratio from table\n", + "v=math.sqrt(k*R*T*1000);#velocity in m/s\n", + "P=528;#stagnation pressure in kPa\n", + "d=P/(R*T);#stagnation density in kg/m^3\n", + "A=500*10**-6;#area in m^2\n", + "ms=d*A*v;#mass flow rate in kg/s\n", + "print\" Mass flow rate at the throat section is\",round(ms,4),\"kg/s\"\n", + "#e-exit state\n", + "Te=To*0.9381;#exit temperature in K, ratio from table\n", + "ce=math.sqrt(k*R*Te*1000);#exit velocity of sound in m/s\n", + "Me=0.573;#Mach number\n", + "ve=Me*ce;\n", + "Pe=800;#exit pressure in kPa\n", + "de=Pe/R/Te;\n", + "mse=de*A*ve;\n", + "print\" Mass flow rate at the exit section is\",round(mse,4),\" kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " Mass flow rate at the throat section is 1.0646 kg/s\n", + " Mass flow rate at the exit section is 0.8711 kg/s\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.7:PG-728" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques7\n", + "#determining exit properties in a control volume\n", + "import math\n", + "Po=1000;#stagnation pressure in kPa\n", + "To=360;#stagnation temperature in K\n", + "\n", + "#when diverging section acting as nozzle\n", + "\n", + "Pe1=0.0939*Po;#exit pressure of air in kPa\n", + "Te1=0.5089*To;#exit temperature in K\n", + "k=1.4;#constant\n", + "R=0.287;#gas constant for air\n", + "ce=math.sqrt(k*R*Te1*1000);#velocity of sound in exit section in m/s\n", + "Me=2.197;#mach number from table\n", + "ve1=Me*ce;#velocity of air at exit section in m/s\n", + "print \"When diverging section act as a nozzle :-\"\n", + "print \"Exit pressure is\",round(Pe1,4),\" kPa\"\n", + "print \"Exit Temperature\",round(Te1,1),\" K\"\n", + "print \"Exit velocity is\",round(ve1,1),\" m/s \"\n", + "\n", + "#when diverging section act as diffuser\n", + "\n", + "Me=0.308;\n", + "Pe2=0.0936*Po;#exit pressure of air in kPa\n", + "Te2=0.9812*To;#exit temperature in K\n", + "ce=math.sqrt(k*R*Te2*1000);#velocity of sound in exit section in m/s\n", + "ve2=Me*ce;\n", + "print \"When diverging section act as a diffuser :-\"\n", + "print \"Exit pressure is\",round(Pe2,1),\" kPa\"\n", + "print \"Exit Temperature\",round(Te2,2),\" K\"\n", + "print \"Exit velocity is\",round(ve2,),\" m/s \"\n", + "\n", + "# The value of Exit pressure when diverging section acts as diffuser is wrong\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "When diverging section act as a nozzle :-\n", + "Exit pressure is 93.9 kPa\n", + "Exit Temperature 183.2 K\n", + "Exit velocity is 596.1 m/s \n", + "When diverging section act as a diffuser :-\n", + "Exit pressure is 93.6 kPa\n", + "Exit Temperature 353.23 K\n", + "Exit velocity is 116.0 m/s \n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.8:PG-731" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques8\n", + "#Determine the static pressure and temperature of supersonic nozzle\n", + "#x-inlet\n", + "#y-exit\n", + "# using the data from previous example\n", + "Mx=2.197 # Mach number at x\n", + "Px=93.9 # IN kPa\n", + "Tx=183.2 # IN K\n", + "P0x=1000 # IN kPa\n", + "T0x = 360 # in K\n", + "My=0.547 # Mach number at y From Table A.13\n", + "Py = 5.46*Px # From Table A.13\n", + "Ty = 1.854 * Tx # From Table A.13\n", + "P0y= 0.630 * P0x # From Table A.13\n", + "print \"Exit pressure after shock is\",round(Py,1),\" kPa\"\n", + "print \"Exit Temperature after shock is\",round(Ty,1),\" K\"\n", + "print \"Exit stagnation pressure after shock is\",round(P0y,1),\" kPa\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Exit pressure after shock is 512.7 kPa\n", + "Exit Temperature after shock is 339.7 K\n", + "Exit stagnation pressure after shock is 630.0 kPa\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex17.9:PG-733" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#ques9\n", + "#determining exit plane properties in control volume\n", + "\n", + "#x-inlet\n", + "#y-exit\n", + "Mx=1.5;#mach number for inlet\n", + "My=0.7011;#mach number for exit\n", + "Px=272.4;#inlet pressure in kPa\n", + "Tx=248.3;#inlet temperature in K\n", + "Tox=360 # stagnation temperature in Kelvin\n", + "Pox=1000.0;#stagnation pressure for inlet\n", + "Py=2.4583*Px;# Pressure at 1.5 mach in kPa\n", + "Ty=1.320*Tx;# temperature at 1.5 mach in K\n", + "Poy=0.9298*Pox;# pressure at 1.5 mach in kPa\n", + "\n", + "Toy=Tox # constant\n", + "Me=0.339 # from table with A/A*=1.860 and M < 1\n", + "Pe=0.9222*Py;#Exit Pressure in kPa\n", + "Te=0.9771*Toy;#Exit temperature in K\n", + "Poe=0.9222*Poy;#Exit pressure in kPa\n", + "\n", + "print \"Exit Mach no.=\",Me\n", + "print \"Exit temperature =\",round(Te,2),\"K \"\n", + "print \"Exit pressure =\",round(Poe,1),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Exit Mach no.= 0.339\n", + "Exit temperature = 351.76 K \n", + "Exit pressure = 857.5 kPa\n" + ] + } + ], + "prompt_number": 50 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter2.ipynb b/Fundamentals_Of_Thermodynamics/Chapter2.ipynb new file mode 100755 index 00000000..95850873 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter2.ipynb @@ -0,0 +1,314 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:eb1b6239947f111d6ea8f1bcaafe0bb84b121b2561bbb9f5f8a8bdec77169fd2" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter2:SOME CONCEPTS AND DEFINITIONS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.1:pg-19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#weight of a person\n", + "\n", + "\n", + "m=1 #kg\n", + "g=9.75 #acc.due to gravity in m/s^2\n", + "F=m*g #weight of 1 kg mass in N\n", + "print\"\\n hence,weight of person is\",round(F,2),\" N\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,weight of person is 9.75 N\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.2:pg-24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#average volume and density\n", + "\n", + "Vliq=0.2 #volume of liquid in m^3\n", + "dliq=997 #density of liquid in kg/m^3\n", + "Vstone=0.12 #volume of stone in m^3\n", + "Vsand=0.15 #volume of sand in m^3\n", + "Vair=0.53 #vo;ume of air in m^3\n", + "mliq=Vliq*dliq #mass of liquid in kg\n", + "dstone=2750 #density of stone in kg/m^3\n", + "dsand=1500 #density of sand in kg/m^3\n", + "mstone=Vstone*dstone #volume of stone in m^3\n", + "msand=Vsand*dsand #volume of sand in m^3\n", + "Vtot=1 #total volume in m^3\n", + "dair=1.1 #density of air in kg/m^3\n", + "mair=Vair*dair #mass of air\n", + "mtot=mair+msand+mliq+mstone #total mass in kg\n", + "v=Vtot/mtot #specific volume in m^3/kg\n", + "d=1/v #overall density in kg/m^3\n", + "print\"\\n hence,average specific volume is\",round(v,6),\"m^3/kg\" \n", + "print\"\\n and overall density is\", round(d),\"kg/m^3\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,average specific volume is 0.001325 m^3/kg\n", + "\n", + " and overall density is 755.0 kg/m^3\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.3:pg-26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#calculating the required force\n", + "import math\n", + "\n", + "Dcyl=0.1 #cylinder diameter in m\n", + "Drod=0.01 #rod diameter in m\n", + "Acyl=math.pi*Dcyl**2/4 #cross sectional area of cylinder in m^2\n", + "Arod=math.pi*Drod**2/4 #cross sectional area of rod in m^2\n", + "Pcyl=250000 #inside hydaulic pressure in Pa\n", + "Po=101000 #outside atmospheric pressure in kPa\n", + "g=9.81 #acc. due to gravity in m/s^2\n", + "mp=25 #mass of (rod+piston) in kg\n", + "F=Pcyl*Acyl-Po*(Acyl-Arod)-mp*g #the force that rod can push within the upward direction in N\n", + "print\"\\n hence,the force that rod can push within the upward direction is\",round(F,1),\" N\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the force that rod can push within the upward direction is 932.9 N\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.4:pg-28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#Calculating atmospheric pressure \n", + "\n", + "dm=13534 #density of mercury in kg/m^3\n", + "H=0.750 #height difference between two columns in metres\n", + "g=9.80665 #acc. due to gravity in m/s^2\n", + "Patm=dm*H*g/1000 #atmospheric pressure in kPa\n", + "print\"\\n hence, atmospheric pressure is\",round(Patm,2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, atmospheric pressure is 99.54 kPa\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.5:pg-28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#pressure inside vessel\n", + "\n", + "dm=13590 #density of mercury in kg/m^3\n", + "H=0.24 #height difference between two columns in metres\n", + "g=9.80665 #acc. due to gravity in m/s^2\n", + "dP=dm*H*g #pressure difference in Pa\n", + "Patm=13590*0.750*9.80665 #Atmospheric Pressure in Pa\n", + "Pvessel=dP+Patm #Absolute Pressure inside vessel in Pa\n", + "Pvessel=Pvessel/101325 #Absolute Pressure inside vessel in atm\n", + "print\"\\n hence, the absolute pressure inside vessel is\",round(Pvessel,3),\"atm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, the absolute pressure inside vessel is 1.302 atm\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.6:pg-29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#calculating pressure\n", + "\n", + "dg=750 #density of gaasoline in kg/m^3\n", + "dR=1206 #density of R-134a in kg/m^3\n", + "H=7.5 #height of storage tank in metres\n", + "g=9.807 #acc. due to gravity in m/s^2\n", + "dP1=dg*g*H/1000 #in kPa\n", + "Ptop1=101 #atmospheric pressure in kPa\n", + "P1=dP1+Ptop1\n", + "print\"hence,pressure at the bottom of storage tank if fluid is gasoline is\",round(P1,1),\"kPa\" \n", + "dP2=dR*g*H/1000 #in kPa\n", + "Ptop2=1000 #top surface pressure in kPa\n", + "P2=dP2+Ptop2\n", + "print\"\\n hence, pressure at the bottom of storage tank if liquid is R-134a is\",round(P2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,pressure at the bottom of storage tank if fluid is gasoline is 156.2 kPa\n", + "\n", + " hence, pressure at the bottom of storage tank if liquid is R-134a is 1089.0 kPa\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.7:pg-29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#calculating balancing force\n", + "\n", + "Po=100#Outside atmospheric pressure in kPa\n", + "F1=25 #net force on the smallest piston in kN\n", + "A1=0.01 #cross sectional area of lower piston in m^2\n", + "P1=Po+F1/A1 #fluid pressure in kPa\n", + "d=900 #density of fluid in kg/m^3\n", + "g=9.81 #acc. due to gravity in m/s^2\n", + "H=6 #height of second piston in comparison to first one in m\n", + "P2=P1-d*g*H/1000 #pressure at higher elevation on piston 2 in kPa\n", + "A2=0.05 #cross sectional area of higher piston in m^3\n", + "F2=(P2-Po)*A2 #balancing force on second piston in kN\n", + "print\"\\n hence, balancing force on second larger piston is\",round(F2,1),\"N\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, balancing force on second larger piston is 122.4 N\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter2_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter2_6.ipynb new file mode 100755 index 00000000..08e192fe --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter2_6.ipynb @@ -0,0 +1,379 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:96f5bd0fa542764d6a8f75d5a1a42e4b79791697476f4029d0fa0fea1de65bed" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter2:SOME CONCEPTS AND DEFINITIONS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.1:pg-19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#weight of a person\n", + "\n", + "\n", + "m=1 #kg\n", + "g=9.75 #acc.due to gravity in m/s^2\n", + "F=m*g #weight of 1 kg mass in N\n", + "print\"\\n hence,weight of person is\",round(F,2),\" N\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,weight of person is 9.75 N\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.1E:pg-20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#weight of a person\n", + "\n", + "\n", + "m=1 #lbm\n", + "g=32 #acc.due to gravity in ft/s^2\n", + "F=m*g/32.174 #weight of 1 lbm mass in lbf\n", + "print\"\\n hence,weight of person is\",round(F,4),\" lbf\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,weight of person is 0.9946 lbf\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.2:pg-24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#average volume and density\n", + "\n", + "Vliq=0.2 #volume of liquid in m^3\n", + "dliq=997 #density of liquid in kg/m^3\n", + "Vstone=0.12 #volume of stone in m^3\n", + "Vsand=0.15 #volume of sand in m^3\n", + "Vair=0.53 #vo;ume of air in m^3\n", + "mliq=Vliq*dliq #mass of liquid in kg\n", + "dstone=2750 #density of stone in kg/m^3\n", + "dsand=1500 #density of sand in kg/m^3\n", + "mstone=Vstone*dstone #volume of stone in m^3\n", + "msand=Vsand*dsand #volume of sand in m^3\n", + "Vtot=1 #total volume in m^3\n", + "dair=1.1 #density of air in kg/m^3\n", + "mair=Vair*dair #mass of air\n", + "mtot=mair+msand+mliq+mstone #total mass in kg\n", + "v=Vtot/mtot #specific volume in m^3/kg\n", + "d=1/v #overall density in kg/m^3\n", + "print\"\\n hence,average specific volume is\",round(v,6),\"m^3/kg\" \n", + "print\"\\n and overall density is\", round(d),\"kg/m^3\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,average specific volume is 0.001325 m^3/kg\n", + "\n", + " and overall density is 755.0 kg/m^3\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.3:pg-26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#calculating the required force\n", + "import math\n", + "\n", + "Dcyl=0.1 #cylinder diameter in m\n", + "Drod=0.01 #rod diameter in m\n", + "Acyl=math.pi*Dcyl**2/4 #cross sectional area of cylinder in m^2\n", + "Arod=math.pi*Drod**2/4 #cross sectional area of rod in m^2\n", + "Pcyl=250000 #inside hydaulic pressure in Pa\n", + "Po=101000 #outside atmospheric pressure in kPa\n", + "g=9.81 #acc. due to gravity in m/s^2\n", + "mp=25 #mass of (rod+piston) in kg\n", + "F=Pcyl*Acyl-Po*(Acyl-Arod)-mp*g #the force that rod can push within the upward direction in N\n", + "print\"\\n hence,the force that rod can push within the upward direction is\",round(F,1),\" N\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the force that rod can push within the upward direction is 932.9 N\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.4:pg-28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#Calculating atmospheric pressure \n", + "\n", + "dm=13534 #density of mercury in kg/m^3\n", + "H=0.750 #height difference between two columns in metres\n", + "g=9.80665 #acc. due to gravity in m/s^2\n", + "Patm=dm*H*g/1000 #atmospheric pressure in kPa\n", + "print\"\\n hence, atmospheric pressure is\",round(Patm,2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, atmospheric pressure is 99.54 kPa\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.5:pg-28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#pressure inside vessel\n", + "\n", + "dm=13590 #density of mercury in kg/m^3\n", + "H=0.24 #height difference between two columns in metres\n", + "g=9.80665 #acc. due to gravity in m/s^2\n", + "dP=dm*H*g #pressure difference in Pa\n", + "Patm=13590*0.750*9.80665 #Atmospheric Pressure in Pa\n", + "Pvessel=dP+Patm #Absolute Pressure inside vessel in Pa\n", + "Pvessel=Pvessel/101325 #Absolute Pressure inside vessel in atm\n", + "print\"\\n hence, the absolute pressure inside vessel is\",round(Pvessel,3),\"atm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, the absolute pressure inside vessel is 1.302 atm\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.5E:pg-28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#pressure inside vessel\n", + "\n", + "dm=848 #density of mercury in lbm/ft^3\n", + "H=9.5 #height difference between two columns in inches\n", + "g=32.174 #acc. due to gravity in ft/s^2\n", + "dP=dm*H*g #pressure difference in lbf/in^2\n", + "Patm=848*9.5*32.174/(1728*32.174) #Atmospheric Pressure in lbf/in^2\n", + "Pvessel=dP+Patm #Absolute Pressure inside vessel in lbf/in^2\n", + "Pvessel=848*29.5*32.174/(1728*32.174)+Patm #Absolute Pressure inside vessel in lbf/in^2\n", + "print\"\\n hence, the absolute pressure inside vessel is\",round(Pvessel,2),\"lbf/in^2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, the absolute pressure inside vessel is 19.14 lbf/in^2\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.6:pg-29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#calculating pressure\n", + "\n", + "dg=750 #density of gaasoline in kg/m^3\n", + "dR=1206 #density of R-134a in kg/m^3\n", + "H=7.5 #height of storage tank in metres\n", + "g=9.807 #acc. due to gravity in m/s^2\n", + "dP1=dg*g*H/1000 #in kPa\n", + "Ptop1=101 #atmospheric pressure in kPa\n", + "P1=dP1+Ptop1\n", + "print\"hence,pressure at the bottom of storage tank if fluid is gasoline is\",round(P1,1),\"kPa\" \n", + "dP2=dR*g*H/1000 #in kPa\n", + "Ptop2=1000 #top surface pressure in kPa\n", + "P2=dP2+Ptop2\n", + "print\"\\n hence, pressure at the bottom of storage tank if liquid is R-134a is\",round(P2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,pressure at the bottom of storage tank if fluid is gasoline is 156.2 kPa\n", + "\n", + " hence, pressure at the bottom of storage tank if liquid is R-134a is 1089.0 kPa\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex2.7:pg-29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#calculating balancing force\n", + "\n", + "Po=100#Outside atmospheric pressure in kPa\n", + "F1=25 #net force on the smallest piston in kN\n", + "A1=0.01 #cross sectional area of lower piston in m^2\n", + "P1=Po+F1/A1 #fluid pressure in kPa\n", + "d=900 #density of fluid in kg/m^3\n", + "g=9.81 #acc. due to gravity in m/s^2\n", + "H=6 #height of second piston in comparison to first one in m\n", + "P2=P1-d*g*H/1000 #pressure at higher elevation on piston 2 in kPa\n", + "A2=0.05 #cross sectional area of higher piston in m^3\n", + "F2=(P2-Po)*A2 #balancing force on second piston in kN\n", + "print\"\\n hence, balancing force on second larger piston is\",round(F2,1),\"N\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, balancing force on second larger piston is 122.4 N\n" + ] + } + ], + "prompt_number": 19 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter3.ipynb b/Fundamentals_Of_Thermodynamics/Chapter3.ipynb new file mode 100755 index 00000000..7447d700 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter3.ipynb @@ -0,0 +1,403 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:6916c81bc8c1ac256991650a35c94801d5197d3ce593f7738220895278cf5f8b" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter3:PROPERTIES OF A PURE SUBSTANCE" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.3:pg-59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#determining the quality and specific volume\n", + "\n", + "v1=0.5 #given specific volume in m^3/kg\n", + "vf=0.001073 #specific volume when only liquid phase is present in m^3/kg\n", + "vfg=0.60475 #in m^3/kg\n", + "x=(v1-vf)/vfg #quality\n", + "print\"For water at a pressure of 300 kPa,the state at which v1 is 0.5 m^3/kg is seen to be in the liquid-vapor two-phase region,at which T=133.6 C and the quality is\",round(x,3)\n", + "\n", + "v2=1 #given specific volume in m^3/kg\n", + "\n", + " # using the method of interplotation\n", + "T=((400-300)*(1.0-0.8753))/(1.0315-0.8753)+300 #temperature of the water\n", + "print\"For water at a pressure of 300 kPa,the state at which v2 is 1 m^3/kg is seen to be in the liquid-vapor two-phase region,the temperature is\",round(T,1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For water at a pressure of 300 kPa,the state at which v1 is 0.5 m^3/kg is seen to be in the liquid-vapor two-phase region,at which T=133.6 C and the quality is 0.825\n", + "For water at a pressure of 300 kPa,the state at which v2 is 1 m^3/kg is seen to be in the liquid-vapor two-phase region,the temperature is 379.8\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.4:pg-60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #example 4\n", + "#percentage of vapor \n", + "\n", + "vliq=0.1 #volume of saturated liquid in m^3\n", + "vf=0.000843 #in m^3/kg\n", + "vvap=0.9 #volume of saturated vapor R-134a in equilbrium\n", + "vg=0.02671 #in m^3/kg\n", + "mliq=vliq/vf #mass of liquid in kg \n", + "mvap=vvap/vg #mass of vapor in kg\n", + "m=mliq+mvap #total mass in kg\n", + "x=mvap*100/m #percentage of vapor on mass basis\n", + "print\"hence,% vapor on mass basis is\",round(x,1),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,% vapor on mass basis is 22.1 %\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.6:pg-61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#Determinig the missing property\n", + "\n", + "T1=273-53.2 #given temperature in K\n", + "P1=600 #given pressure in kPa\n", + "print\"This temperature is higher than the critical temperature (critical temp. at P=600 kPa) is 96.37 K.Hence,v=0.10788 m^3/kg\"\n", + "T2=100 #given temp. in K\n", + "v2=0.008 #given specific volume in m^3/kg\n", + "vf=0.001452 #in m^3/kg\n", + "vg=0.0312 #in m^3/kg\n", + "Psat=779.2 #saturation pressure in kPa\n", + "vfg=vg-vf #in m^3/kg\n", + "x=(v2-vf)/vfg #quality\n", + "print\"\\n hence, the pressure is\",round(Psat,1),\"kPa\"\n", + "print\"\\n and quality is\",round(x,4),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "This temperature is higher than the critical temperature (critical temp. at P=600 kPa) is 96.37 K.Hence,v=0.10788 m^3/kg\n", + "\n", + " hence, the pressure is 779.2 kPa\n", + "\n", + " and quality is 0.2201 %\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.7:pg-62" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#determining the pressure of water\n", + "\n", + "vg=0.12736 #specific volume in m^3/kg for water at 200C\n", + "v=0.4 #specific volume in m^3/kg\n", + "P1=500 #in kPa\n", + "v1=0.42492 #specific volume at P1 in m^3/kg\n", + "P2=600 #in kPa\n", + "v2=0.35202 #specific volume at P2 in m^3/kg\n", + "P=P1+(P2-P1)*(v-v1)/(v2-v1) #calculating pressure by interplotation\n", + "print \"hence,the pressure of water is\",round(P,1),\" kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " hence,the pressure of water is 534.2 kPa\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.8:pg-66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#calculating mass of air\n", + "\n", + "P=100 #pressure in kPa\n", + "V=6*10*4 #volume of room in m^3\n", + "R=0.287 #in kN-m/kg-K\n", + "T=25 #temperature in Celsius\n", + "m=P*V/(R*(T+273.1)) #mass of air contained in room\n", + "print\"\\n hence, mass of air contained in room is\",round(m,1),\"kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, mass of air contained in room is 280.5 kg\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.9:pg-67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#calculating pressure inside tank\n", + "\n", + "V=0.5 #volumr of tank in m^3\n", + "m=10 #mass of ideal gas in kg\n", + "T=25 #temperature of tank in Celsius\n", + "M=24 #molecular mass of gas in kg/kmol\n", + "Ru=8.3145 #universal gas constant in kN-m/kmol-K\n", + "R=Ru/M #gas constant for given ideal gas in kN-m/kg-K\n", + "P=m*R*(T+273.2)/V #pressure inside tank\n", + "print\"\\n hence,pressure inside tank is\",round(P),\"kpa\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,pressure inside tank is 2066.0 kpa\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.10:pg-67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#mass flow rate\n", + "\n", + "dt=185 #time period in seconds over which there is incrrease in volume \n", + "dV=0.75 #increase in volume in 0.75 in m^3\n", + "V=dV/dt #volume flow rate in m^3/s\n", + "P=105 #pressure inside gas bell kPa\n", + "T=21 #temperature in celsius\n", + "R=0.1889 #ideal gas constant in kJ/kg-K\n", + "m=P*V/(R*(T+273.15)) #mass flow rate of the flow in kg/s\n", + "print\"\\n hence,mass flow rate is\",round(m,5),\"kg/s\"\n", + "print\"\\n and volume flow rate is\",round(V,5),\"m^3/s\"\n", + "#The answer of volume flow rate in the book is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,mass flow rate is 0.00766 kg/s\n", + "\n", + " and volume flow rate is 0.00405 m^3/s\n" + ] + } + ], + "prompt_number": 40 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.12:pg-71" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 12\n", + "#determining specific using diffenet laws\n", + "\n", + "T=100.0 #given temp.in 100 celsius\n", + "P=3.0 #given pressure in MPa\n", + "v1=0.0065 #specific volume in m^3/kg using table\n", + "print\"\\n hence,the specific volume for R-134a using R-134a tables is\",round(v1,3),\"m^3/kg\"\n", + "M=102.3 #molecular mass in kg\n", + "R=8.3145 #in kJ/K\n", + "Ru=R/M #in kJ/K-kg\n", + "v2=Ru*(T+273)/(P*1000) #specific volume assuming R-134a to be ideal gas in m^3/kg\n", + "print\"\\n hence,the specific volume for R-134a using R-134a the ideal gas laws is\",round(v2,5),\"m^3/kg\"\n", + "Tr=373.2/374.2 #reduced temperature using generalized chart\n", + "Pr=3.0/4.06 #reduced pressure using generalized chart\n", + "Z=0.67 #compressibility factor \n", + "v3=Z*v2 # specific volume using generalized chart in m^3/kg\n", + "print\"\\n hence,the specific volume for R-134a using the generalized chart is\",round(v3,5),\"m^3/kg\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the specific volume for R-134a using R-134a tables is 0.006 m^3/kg\n", + "\n", + " hence,the specific volume for R-134a using R-134a the ideal gas laws is 0.01011 m^3/kg\n", + "\n", + " hence,the specific volume for R-134a using the generalized chart is 0.00677 m^3/kg\n" + ] + } + ], + "prompt_number": 51 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.13:pg-71" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 13\n", + "#calculating mass of gas\n", + "\n", + "Pc=4250 #critical pressure of propane in kPa\n", + "Tc=369.8 #critical temperature in K\n", + "T=15 #temperature of propane in celsius\n", + "Tr=T/Tc #reduced temperature\n", + "Prsat=0.2 # reduced pressure \n", + "P=Prsat*Pc #pressure in kPa\n", + "x=0.1 #given quality\n", + "Zf=0.035 #from graph\n", + "Zg=0.83 #from graph\n", + "Z=(1-x)*Zf+x*Zg #overall compressibility factor\n", + "V=0.1 #volume of steel bottle in m^3\n", + "R=0.1887 #in kPa-m^3/kg-K\n", + "m=P*V/(Z*R*(T+273)) #total propane mass in kg\n", + "print\"\\n hence,the total propane mass is\",round(m,2),\"kg\"\n", + "print\"\\n and pressure is\",round(P,2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the total propane mass is 13.66 kg\n", + "\n", + " and pressure is 850.0 kPa\n" + ] + } + ], + "prompt_number": 44 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter3_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter3_6.ipynb new file mode 100755 index 00000000..64998280 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter3_6.ipynb @@ -0,0 +1,571 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b6e51b20af9aaa1b32972245e7dbe7cc42b3ed40e5f3cbf6db8837625a12aebc" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter3:PROPERTIES OF A PURE SUBSTANCE" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.1:pg-57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#determinig the phase of water\n", + "\n", + "print\"from the table,we find that at 120C,saturation pressure of water is 198.5 kPa.But here we have pressure of 500 kPa.hence,water exists as a compressed liquid here.\"\n", + "print\"also at 120C,vf=0.00106 kg/m^3 and vg=0.89186 kg/m^3.given v=0.5 m^3/kg i.e. vfvg,so the state is superheated vapor\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "from the table,we find that at 30C,saturation pressure of ammonia is 1167 kPa.But here we have pressure of 1000 kPa.hence,ammonia exists in superheated vapor state.\n", + "for R-22 at 200 kPa,vg=0.1119 kg/m^3.given v=0.15 m^3/kg i.e. v>vg,so the state is superheated vapor\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.3:pg-59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#determining the quality and specific volume\n", + "\n", + "v1=0.5 #given specific volume in m^3/kg\n", + "vf=0.001073 #specific volume when only liquid phase is present in m^3/kg\n", + "vfg=0.60475 #in m^3/kg\n", + "x=(v1-vf)/vfg #quality\n", + "print\"For water at a pressure of 300 kPa,the state at which v1 is 0.5 m^3/kg is seen to be in the liquid-vapor two-phase region,at which T=133.6 C and the quality is\",round(x,3)\n", + "\n", + "v2=1 #given specific volume in m^3/kg\n", + "\n", + " # using the method of interplotation\n", + "T=((400-300)*(1.0-0.8753))/(1.0315-0.8753)+300 #temperature of the water\n", + "print\"For water at a pressure of 300 kPa,the state at which v2 is 1 m^3/kg is seen to be in the liquid-vapor two-phase region,the temperature is\",round(T,1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For water at a pressure of 300 kPa,the state at which v1 is 0.5 m^3/kg is seen to be in the liquid-vapor two-phase region,at which T=133.6 C and the quality is 0.825\n", + "For water at a pressure of 300 kPa,the state at which v2 is 1 m^3/kg is seen to be in the liquid-vapor two-phase region,the temperature is 379.8\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.4:pg-60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #example 4\n", + "#percentage of vapor \n", + "\n", + "vliq=0.1 #volume of saturated liquid in m^3\n", + "vf=0.000843 #in m^3/kg\n", + "vvap=0.9 #volume of saturated vapor R-134a in equilbrium\n", + "vg=0.02671 #in m^3/kg\n", + "mliq=vliq/vf #mass of liquid in kg \n", + "mvap=vvap/vg #mass of vapor in kg\n", + "m=mliq+mvap #total mass in kg\n", + "x=mvap*100/m #percentage of vapor on mass basis\n", + "print\"hence,% vapor on mass basis is\",round(x,1),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,% vapor on mass basis is 22.1 %\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.4E:pg-60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #example 5\n", + "#percentage of vapor \n", + "\n", + "vliq=0.1 #volume of saturated liquid in ft^3\n", + "vf=0.0136 #in ft^3/lbm\n", + "vvap=0.9 #volume of saturated vapor R-134a in equilbrium\n", + "vg=0.4009 #in ft^3/lbm\n", + "mliq=vliq/vf #mass of liquid in lbm \n", + "mvap=vvap/vg #mass of vapor in lbm\n", + "m=mliq+mvap #total mass in lbm\n", + "x=mvap*100/m #percentage of vapor on mass basis\n", + "print\"hence,% vapor on mass basis is\",round(x,1),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,% vapor on mass basis is 23.4 %\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.5:pg-61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#calculating pressure after heat addition\n", + "\n", + "v1=0.14922 #specific volume of sautrated ammonia in m^3/kg\n", + "print\"Since the volume does not change during the process,the specific volume remains constant.therefore\"\n", + "v2=v1 #in m^3/kg\n", + "print\"Since vg at 40C is less than v2,it is evident that in the final state the Ammonia is superheated vapor.By interplotation,we find that\"\n", + "P2=945 #final pressure in kPa\n", + "print\"hence,the final pressure is 945 kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Since the volume does not change during the process,the specific volume remains constant.therefore\n", + "Since vg at 40C is less than v2,it is evident that in the final state the Ammonia is superheated vapor.By interplotation,we find that\n", + "hence,the final pressure is 945 kPa\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.5E:pg-61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#calculating pressure after heat addition\n", + "\n", + "v1=2.311 #specific volume of sautrated ammonia in ft^3/lbm\n", + "print\"Since the volume does not change during the process,the specific volume remains constant.therefore\"\n", + "v2=v1 #in ft^3/lbm\n", + "print\"Since vg at 120f is less than v2,it is evident that in the final state the Ammonia is superheated vapor.By interplotation,we find that\"\n", + "P2=145 #final pressure in lbf/in^2\n", + "print\"hence,the final pressure is 145 lbf/in^2\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Since the volume does not change during the process,the specific volume remains constant.therefore\n", + "Since vg at 120f is less than v2,it is evident that in the final state the Ammonia is superheated vapor.By interplotation,we find that\n", + "hence,the final pressure is 145 lbf/in^2\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.6:pg-61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#Determinig the missing property\n", + "\n", + "T1=273-53.2 #given temperature in K\n", + "P1=600 #given pressure in kPa\n", + "print\"This temperature is higher than the critical temperature (critical temp. at P=600 kPa) is 96.37 K.Hence,v=0.10788 m^3/kg\"\n", + "T2=100 #given temp. in K\n", + "v2=0.008 #given specific volume in m^3/kg\n", + "vf=0.001452 #in m^3/kg\n", + "vg=0.0312 #in m^3/kg\n", + "Psat=779.2 #saturation pressure in kPa\n", + "vfg=vg-vf #in m^3/kg\n", + "x=(v2-vf)/vfg #quality\n", + "print\"\\n hence, the pressure is\",round(Psat,1),\"kPa\"\n", + "print\"\\n and quality is\",round(x,4),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "This temperature is higher than the critical temperature (critical temp. at P=600 kPa) is 96.37 K.Hence,v=0.10788 m^3/kg\n", + "\n", + " hence, the pressure is 779.2 kPa\n", + "\n", + " and quality is 0.2201 %\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.7:pg-62" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#determining the pressure of water\n", + "\n", + "vg=0.12736 #specific volume in m^3/kg for water at 200C\n", + "v=0.4 #specific volume in m^3/kg\n", + "P1=500 #in kPa\n", + "v1=0.42492 #specific volume at P1 in m^3/kg\n", + "P2=600 #in kPa\n", + "v2=0.35202 #specific volume at P2 in m^3/kg\n", + "P=P1+(P2-P1)*(v-v1)/(v2-v1) #calculating pressure by interplotation\n", + "print \"hence,the pressure of water is\",round(P,1),\" kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " hence,the pressure of water is 534.2 kPa\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.8:pg-66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#calculating mass of air\n", + "\n", + "P=100 #pressure in kPa\n", + "V=6*10*4 #volume of room in m^3\n", + "R=0.287 #in kN-m/kg-K\n", + "T=25 #temperature in Celsius\n", + "m=P*V/(R*(T+273.1)) #mass of air contained in room\n", + "print\"\\n hence, mass of air contained in room is\",round(m,1),\"kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, mass of air contained in room is 280.5 kg\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.9:pg-67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#calculating pressure inside tank\n", + "\n", + "V=0.5 #volumr of tank in m^3\n", + "m=10 #mass of ideal gas in kg\n", + "T=25 #temperature of tank in Celsius\n", + "M=24 #molecular mass of gas in kg/kmol\n", + "Ru=8.3145 #universal gas constant in kN-m/kmol-K\n", + "R=Ru/M #gas constant for given ideal gas in kN-m/kg-K\n", + "P=m*R*(T+273.2)/V #pressure inside tank\n", + "print\"\\n hence,pressure inside tank is\",round(P),\"kpa\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,pressure inside tank is 2066.0 kpa\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.10:pg-67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#mass flow rate\n", + "\n", + "dt=185 #time period in seconds over which there is incrrease in volume \n", + "dV=0.75 #increase in volume in 0.75 in m^3\n", + "V=dV/dt #volume flow rate in m^3/s\n", + "P=105 #pressure inside gas bell kPa\n", + "T=21 #temperature in celsius\n", + "R=0.1889 #ideal gas constant in kJ/kg-K\n", + "m=P*V/(R*(T+273.15)) #mass flow rate of the flow in kg/s\n", + "print\"\\n hence,mass flow rate is\",round(m,5),\"kg/s\"\n", + "print\"\\n and volume flow rate is\",round(V,5),\"m^3/s\"\n", + "#The answer of volume flow rate in the book is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,mass flow rate is 0.00766 kg/s\n", + "\n", + " and volume flow rate is 0.00405 m^3/s\n" + ] + } + ], + "prompt_number": 40 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.12:pg-71" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 12\n", + "#determining specific using diffenet laws\n", + "\n", + "T=100.0 #given temp.in 100 celsius\n", + "P=3.0 #given pressure in MPa\n", + "v1=0.0065 #specific volume in m^3/kg using table\n", + "print\"\\n hence,the specific volume for R-134a using R-134a tables is\",round(v1,3),\"m^3/kg\"\n", + "M=102.3 #molecular mass in kg\n", + "R=8.3145 #in kJ/K\n", + "Ru=R/M #in kJ/K-kg\n", + "v2=Ru*(T+273)/(P*1000) #specific volume assuming R-134a to be ideal gas in m^3/kg\n", + "print\"\\n hence,the specific volume for R-134a using R-134a the ideal gas laws is\",round(v2,5),\"m^3/kg\"\n", + "Tr=373.2/374.2 #reduced temperature using generalized chart\n", + "Pr=3.0/4.06 #reduced pressure using generalized chart\n", + "Z=0.67 #compressibility factor \n", + "v3=Z*v2 # specific volume using generalized chart in m^3/kg\n", + "print\"\\n hence,the specific volume for R-134a using the generalized chart is\",round(v3,5),\"m^3/kg\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the specific volume for R-134a using R-134a tables is 0.006 m^3/kg\n", + "\n", + " hence,the specific volume for R-134a using R-134a the ideal gas laws is 0.01011 m^3/kg\n", + "\n", + " hence,the specific volume for R-134a using the generalized chart is 0.00677 m^3/kg\n" + ] + } + ], + "prompt_number": 51 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex3.13:pg-71" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 13\n", + "#calculating mass of gas\n", + "\n", + "Pc=4250 #critical pressure of propane in kPa\n", + "Tc=369.8 #critical temperature in K\n", + "T=15 #temperature of propane in celsius\n", + "Tr=T/Tc #reduced temperature\n", + "Prsat=0.2 # reduced pressure \n", + "P=Prsat*Pc #pressure in kPa\n", + "x=0.1 #given quality\n", + "Zf=0.035 #from graph\n", + "Zg=0.83 #from graph\n", + "Z=(1-x)*Zf+x*Zg #overall compressibility factor\n", + "V=0.1 #volume of steel bottle in m^3\n", + "R=0.1887 #in kPa-m^3/kg-K\n", + "m=P*V/(Z*R*(T+273)) #total propane mass in kg\n", + "print\"\\n hence,the total propane mass is\",round(m,2),\"kg\"\n", + "print\"\\n and pressure is\",round(P,2),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the total propane mass is 13.66 kg\n", + "\n", + " and pressure is 850.0 kPa\n" + ] + } + ], + "prompt_number": 44 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter4.ipynb b/Fundamentals_Of_Thermodynamics/Chapter4.ipynb new file mode 100755 index 00000000..eed9d20a --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter4.ipynb @@ -0,0 +1,198 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:da3557673ab31ece618ad10f5b0d3ef78112ff36bd0b260e508d99211060a1c9" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4:WORK AND HEAT" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4.1:PG-96" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#work done during different processes\n", + "import math\n", + "\n", + "P1=200 #initial pressure inside cylinder in kPa\n", + "V2=0.1 #in m^3\n", + "V1=0.04 #initial volume of gas in m^3\n", + "\n", + "W1=P1*(V2-V1) #work done in isobaric process in kJ\n", + "print\"\\n hence,the work done during the isobaric process is\",round(W1,2),\"kJ. \\n\"\n", + "\n", + "W2=P1*V1*math.log(V2/V1) #work done in isothermal process in kJ\n", + "print\"\\n hence,the work done in isothermal process is\",round(W2,2),\"kJ. \\n\"\n", + "\n", + "P2=P1*(V1/V2)**(1.3) #final pressure according to the given process\n", + "W3=(P2*V2-P1*V1)/(1-1.3)\n", + "print\"\\n hence,the work done during the described process is\",round(W3,2),\"kJ. \\n\"\n", + "\n", + "W4=0 #work done in isochoric process\n", + "print\"\\n hence,the work done in the isochoric process is\",round(W4,3),\"kJ. \\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the work done during the isobaric process is 12.0 kJ. \n", + "\n", + "\n", + " hence,the work done in isothermal process is 7.33 kJ. \n", + "\n", + "\n", + " hence,the work done during the described process is 6.41 kJ. \n", + "\n", + "\n", + " hence,the work done in the isochoric process is 0.0 kJ. \n", + "\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4.3:PG-99" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "\n", + "#work produced\n", + "\n", + "Psat=190.2 #in kPa\n", + "P1=Psat #saturation pressure in state 1\n", + "vf=0.001504 #in m^3/kg\n", + "vfg=0.62184 #in m^3/kg\n", + "x1=0.25 #quality\n", + "v1=vf+x1*vfg #specific volume at state 1 in m^3/kg\n", + "v2=1.41*v1 #specific volume at state 2 in m^3/kg\n", + "P2=600 #pressure in state 2 in kPa from Table B.2.2\n", + "m=0.5 #mass of ammonia in kg\n", + "W=m*(P1+P2)*(v2-v1)/2 #woork produced by ammonia in kJ\n", + "print \"The final pressure is\",round(P2),\"kPa\\n\"\n", + "print \"hence,work produced by ammonia is\",round(W,2),\"kJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The final pressure is 600.0 kPa\n", + "\n", + "hence,work produced by ammonia is 12.71 kJ\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4.4:PG-100" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "\n", + "#calculating work done\n", + "\n", + "v1=0.35411 #specific volume at state 1 in m^3/kg\n", + "v2=v1/2 \n", + "m=0.1 #mass of water in kg\n", + "P1=1000 #pressure inside cylinder in kPa\n", + "W=m*P1*(v2-v1) #in kJ\n", + "print \"the work in the overall process is\",round(W,1),\"kJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the work in the overall process is -17.7 kJ\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4.7:PG-108" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#heat transfer\n", + "k=1.4 #conductivity of glass pane in W/m-K\n", + "A=0.5 #total surface area of glass pane\n", + "dx=0.005 #thickness of glasspane in m\n", + "dT1=20-12.1 #temperature difference between room air and outer glass surface temperature in celsius\n", + "Q=-k*A*dT1/dx #conduction through glass slab in W\n", + "h=100 #convective heat transfer coefficient in W/m^2-K \n", + "dT=12.1-(-10) #temperature difference between warm room and colder ambient in celsius\n", + "Q2=h*A*dT #heat transfer in convective layer in W\n", + "#result\n", + "print \"the rate of heat transfer in the glass and convective layer is\",round(Q2),\"kW.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the rate of heat transfer in the glass and convective layer is 1105.0 kW.\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter4_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter4_6.ipynb new file mode 100755 index 00000000..eed9d20a --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter4_6.ipynb @@ -0,0 +1,198 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:da3557673ab31ece618ad10f5b0d3ef78112ff36bd0b260e508d99211060a1c9" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4:WORK AND HEAT" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4.1:PG-96" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#work done during different processes\n", + "import math\n", + "\n", + "P1=200 #initial pressure inside cylinder in kPa\n", + "V2=0.1 #in m^3\n", + "V1=0.04 #initial volume of gas in m^3\n", + "\n", + "W1=P1*(V2-V1) #work done in isobaric process in kJ\n", + "print\"\\n hence,the work done during the isobaric process is\",round(W1,2),\"kJ. \\n\"\n", + "\n", + "W2=P1*V1*math.log(V2/V1) #work done in isothermal process in kJ\n", + "print\"\\n hence,the work done in isothermal process is\",round(W2,2),\"kJ. \\n\"\n", + "\n", + "P2=P1*(V1/V2)**(1.3) #final pressure according to the given process\n", + "W3=(P2*V2-P1*V1)/(1-1.3)\n", + "print\"\\n hence,the work done during the described process is\",round(W3,2),\"kJ. \\n\"\n", + "\n", + "W4=0 #work done in isochoric process\n", + "print\"\\n hence,the work done in the isochoric process is\",round(W4,3),\"kJ. \\n\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the work done during the isobaric process is 12.0 kJ. \n", + "\n", + "\n", + " hence,the work done in isothermal process is 7.33 kJ. \n", + "\n", + "\n", + " hence,the work done during the described process is 6.41 kJ. \n", + "\n", + "\n", + " hence,the work done in the isochoric process is 0.0 kJ. \n", + "\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4.3:PG-99" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "\n", + "#work produced\n", + "\n", + "Psat=190.2 #in kPa\n", + "P1=Psat #saturation pressure in state 1\n", + "vf=0.001504 #in m^3/kg\n", + "vfg=0.62184 #in m^3/kg\n", + "x1=0.25 #quality\n", + "v1=vf+x1*vfg #specific volume at state 1 in m^3/kg\n", + "v2=1.41*v1 #specific volume at state 2 in m^3/kg\n", + "P2=600 #pressure in state 2 in kPa from Table B.2.2\n", + "m=0.5 #mass of ammonia in kg\n", + "W=m*(P1+P2)*(v2-v1)/2 #woork produced by ammonia in kJ\n", + "print \"The final pressure is\",round(P2),\"kPa\\n\"\n", + "print \"hence,work produced by ammonia is\",round(W,2),\"kJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The final pressure is 600.0 kPa\n", + "\n", + "hence,work produced by ammonia is 12.71 kJ\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4.4:PG-100" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "\n", + "#calculating work done\n", + "\n", + "v1=0.35411 #specific volume at state 1 in m^3/kg\n", + "v2=v1/2 \n", + "m=0.1 #mass of water in kg\n", + "P1=1000 #pressure inside cylinder in kPa\n", + "W=m*P1*(v2-v1) #in kJ\n", + "print \"the work in the overall process is\",round(W,1),\"kJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the work in the overall process is -17.7 kJ\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex4.7:PG-108" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#heat transfer\n", + "k=1.4 #conductivity of glass pane in W/m-K\n", + "A=0.5 #total surface area of glass pane\n", + "dx=0.005 #thickness of glasspane in m\n", + "dT1=20-12.1 #temperature difference between room air and outer glass surface temperature in celsius\n", + "Q=-k*A*dT1/dx #conduction through glass slab in W\n", + "h=100 #convective heat transfer coefficient in W/m^2-K \n", + "dT=12.1-(-10) #temperature difference between warm room and colder ambient in celsius\n", + "Q2=h*A*dT #heat transfer in convective layer in W\n", + "#result\n", + "print \"the rate of heat transfer in the glass and convective layer is\",round(Q2),\"kW.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the rate of heat transfer in the glass and convective layer is 1105.0 kW.\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter5.ipynb b/Fundamentals_Of_Thermodynamics/Chapter5.ipynb new file mode 100755 index 00000000..24351fdb --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter5.ipynb @@ -0,0 +1,469 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:8e29dcea16eab605fcf93b95197200be339c1be6076d5413e7d70418a9a6df29" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter5:THE FIRST LAW OF THERMODYNAMICS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.1:pg-131" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#calculating height\n", + "\n", + "m=1100 #mass of car in kg\n", + "ke=400 #kinetic energy of car in kJ\n", + "V=(2*ke*1000/m)**0.5 #velocity of car in m/s\n", + "g=9.807 #acc. due to gravity in m/s^2\n", + "H=ke*1000/(m*g) #height to which the car should be lifted so that its potential energy equals its kinetic energy\n", + "print\"hence,the car should be raised to a height is\",round(H,1),\"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,the car should be raised to a height is 37.1 m\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.2:pg-134" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#change in internal energy\n", + "\n", + "W=-5090 #work input to paddle wheel in kJ\n", + "Q=-1500 #heat transfer from tank in kJ\n", + "dU=Q-W #change in internal energy in kJ\n", + "print\"hence,change in internal energy is\",round(dU),\"kj\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,change in internal energy is 3590.0 kj\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.3:pg-134" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#analysis of energy transfer\n", + "\n", + "g=9.806 #acceleration due to gravity in m/s^2\n", + "m=10 #mass of stone in kg\n", + "H1=10.2 #initial height of stone above water in metres\n", + "H2=0 #final height in metres\n", + "dKE1=-m*g*(H2-H1) #change in kinetic energy when stone enters state 2 in J\n", + "dPE1=-1 #change in potential energy when stone enters state 2 in J\n", + "print\"\\n hence,when stone is \",round(dKE1),\"J\"\n", + "print\"\\n and change in potential energy is \",round(dPE1),\"J\"\n", + "dPE2=0 #change in potential energy when stone enters state 3 in JQ2=0 //no heat transfer when stone enters state 3 in J\n", + "W2=0 #no work done when stone enters state 3 in J\n", + "dKE2=-1 #change in kinetic energy when stone enters state 3\n", + "dU2=-dKE2 #change in internal energy when stone enters state 3 in J\n", + "print\"\\n hence,when stone has just come to rest in the bucket is \",round(dKE2),\"J\" \n", + "print\"\\n and dU is\",round(dU2),\"J\" \n", + "dKE3=0 #change in kinetic energy when stone enters state 4\n", + "dPE=0 #change in potential energy when stone enters state 4 in J\n", + "W3=0 #no work done when stone enters state 4 in J\n", + "dU3=-1 #change in internal energy when stone enters state 4 in J\n", + "Q3=dU3 #heat transfer when stone enters state 4 in J\n", + "print\"\\n hence,when stone has entered state 4 is\",round(dU3),\"J\" \n", + "print\"\\n and Q3 is \",round(Q3),\"J\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,when stone is 1000.0 J\n", + "\n", + " and change in potential energy is -1.0 J\n", + "\n", + " hence,when stone has just come to rest in the bucket is -1.0 J\n", + "\n", + " and dU is 1.0 J\n", + "\n", + " hence,when stone has entered state 4 is -1.0 J\n", + "\n", + " and Q3 is -1.0 J\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.4:pg-136" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#Determinig the missing properties \n", + "\n", + "T1=300 #given temp. in Celsius\n", + "u1=2780 #given specific internal enrgy in kJ/kg\n", + "print\"From steam table, at T=300 C,ug=2563.0 kJ/kg.So,u1>ug ,it means the state is in the superheated vapor region.So, by interplotation,we find P=1648 kPa and v=0.1542 m^3/kg\" #hiven pressure in kPa\n", + "u2=2000 #given specific intrernal energy in kJ/kg\n", + "print\"at P=2000 kPa\"\n", + "uf=906.4 #in kJ/kg\n", + "ug=2600.3 #in kJ/kg \n", + "x2=(u2-906.4)/(ug-uf) \n", + "print\"Also, under the given conditions\"\n", + "vf=0.001177 #in m^3/kg \n", + "vg=0.099627 #in m^3/kg\n", + "v2=vf+x2*(vg-vf)#Specific volume for water in m^3/kg\n", + "print\"\\n hence,specific volume for water is \",round(v2,5),\"m^3/kg\" \n", + "print\"\\n Therefore ,this state is \",round(x2,4),\"N\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From steam table, at T=300 C,ug=2563.0 kJ/kg.So,u1>ug ,it means the state is in the superheated vapor region.So, by interplotation,we find P=1648 kPa and v=0.1542 m^3/kg\n", + "at P=2000 kPa\n", + "Also, under the given conditions\n", + "\n", + " hence,specific volume for water is 0.06474 m^3/kg\n", + "\n", + " Therefore ,this state is 0.6456 N\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.5:pg-138" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#calculating heat transfer for the given process\n", + "\n", + "Vliq=0.05 #volume of saturated liquid in m^3\n", + "vf=0.001043 #in m^3/kg\n", + "Vvap=4.95 #volume of saturated water vapour in m^3\n", + "vg=1.6940 #in m^3/kg\n", + "m1liq=Vliq/vf #mass of liquid in kg\n", + "m1liq=round(m1liq,2)\n", + "m1vap=Vvap/vg #mass of vapors in kg\n", + "m1vap=round(m1vap,2)\n", + "u1liq=417.36 #specific internal energy of liquid in kJ/kg\n", + "u1vap=2506.1 #specific internal energy of vapors in kJ/kg\n", + "U1=m1liq*u1liq + m1vap*u1vap #total internal energy in kJ\n", + "m=m1liq+m1vap #total mass in kg\n", + "V=5.0 #total volume in m^3\n", + "v2=V/m #final specific volume in m^3/kg\n", + "print\"by interplotation we find that for steam, if vg=0.09831 m^3/kg then pressure is 2.03 Mpa\"\n", + "u2=2600.5 #specific internal energy at final state in kJ/kg\n", + "U2=m*u2 #internal energy at final state in kJ\n", + "Q=U2-U1 #heat transfer for the process in kJ\n", + "print\"\\n hence,heat transfer for the process is\",round(Q),\"kJ\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "by interplotation we find that for steam, if vg=0.09831 m^3/kg then pressure is 2.03 Mpa\n", + "\n", + " hence,heat transfer for the process is 104935.0 kJ\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.6:pg-143" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#calculating work and heat transfer for the process\n", + "\n", + "V1=0.1 #volume of cylinder in m^3\n", + "m=0.5 #mass of steam in kg\n", + "v1=V1/m #specific volume of steam in m^3/kg\n", + "vf=0.001084 #m^3/kg\n", + "vfg=0.4614 #m^3/kg\n", + "x1=(v1-vf)/vfg #quality\n", + "hf=604.74 #kJ/kg\n", + "hfg=2133.8#kJ/kg\n", + "h2=3066.8 #final specific heat enthalpy in kJ/kg\n", + "h1=hf+x1*hfg #initial specific enthalpy in kJ/kg\n", + "Q=m*(h2-h1) #heat transfer for this process in kJ\n", + "P=400 #pressure inside cylinder in kPa\n", + "v2=0.6548 #specific enthalpy in m^3/kg\n", + "W=m*P*(v2-v1) #work done for the process in kJ\n", + "print\"\\n hence, work done for the process is\",round(W),\"kJ\" \n", + "print\"\\n and heat transfer is \",round(Q,1),\"kJ\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, work done for the process is 91.0 kJ\n", + "\n", + " and heat transfer is 771.1 kJ\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.8:pg-151" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#calculating change in enthalpy\n", + "import math\n", + "\n", + "h1=273.2 #specific heat enthalpy for oxygen at 300 K\n", + "h2=1540.2 #specific heat enthalpy for oxygen at 1500 K\n", + "T1=300 #initial temperature in K\n", + "T2=1500 #final temparature in K\n", + "\n", + "dh1=h2-h1 #this change in specific heat enthalpy is calculated using ideal gas tables \n", + "dh3=0.922*(T2-T1) #it is claculated if we assume specific heat enthalpy to be constant and uses its value at 300K\n", + "dh4=1.0767*(T2-T1) #it is claculated if we assume specific heat enthalpy to be constant and uses its value at 900K i.e mean of initial and final temperature\n", + "print\"\\n Hence,change in specific heat enthalpy if ideal gas tables are used is \",round(dh1,1),\"kJ/kg\"\n", + "print\"\\n if specific heat is assumed to be constant and using its value at T1 is\",round(dh3,1),\"kJ/kg\"\n", + "print\"\\n if specific heat is assumed to be constant at its value at (T1+T2)/2 is\",round(dh4,1),\"kJ/kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " Hence,change in specific heat enthalpy if ideal gas tables are used is 1267.0 kJ/kg\n", + "\n", + " if specific heat is assumed to be constant and using its value at T1 is 1106.4 kJ/kg\n", + "\n", + " if specific heat is assumed to be constant at its value at (T1+T2)/2 is 1292.0 kJ/kg\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.9:pg-152" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#determining amount of heat transfer\n", + "\n", + "P=150 #pressure of nitrogen in cylinder in kPa\n", + "V=0.1 #initial volume of cylinder in m^3\n", + "T1=25 #initial temperature of nitrogen in celsius\n", + "T2=150 #final tempareture of nitrogen in celsius\n", + "R=0.2968 #in kJ/kg-K\n", + "m=P*V/(R*(T1+273)) #mass of nitrogen in kg\n", + "Cv=0.745 #constant volume specific heat for nitrogen in kJ/kg-K\n", + "W=-20 #work done on nitrogen gas in kJ\n", + "Q=m*Cv*(T2-T1)+W #heat transfer during the process in kJ\n", + "print\"\\n hence,the heat transfer for the above process is\",round(Q,1),\"kJ\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the heat transfer for the above process is -4.2 kJ\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.10:pg-155" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#calculating rate of increase of internal energy\n", + "\n", + "W=-12.8*20 #power consumed in J/s\n", + "Q=-10 #heat transfer rate from battery in J/s\n", + "r=Q-W #rate of increase of internal energy\n", + "print\"\\n hence,the rate of increase of internal energy is\",round(r),\"J/s\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the rate of increase of internal energy is 246.0 J/s\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.11:pg-155" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 11\n", + "#rate of change of temperature\n", + "\n", + "Q=1500.0 #power produced by burning wood in J/s\n", + "mair=1 #mass of air in kg\n", + "mwood=5 #mass of soft pine wood in kg \n", + "miron=25 #mass of cast iron in kg\n", + "Cvair=0.717 #constant volume specific heat for air in kJ/kg\n", + "Cwood=1.38 #constant volume specific heat for wood in kJ/kg\n", + "Ciron=0.42 #constant volume specific heat for iron in kJ/kg\n", + "dT=75-20 #increase in temperature in Celsius\n", + "T=(Q/1000)/(mair*Cvair+mwood*Cwood+miron*Ciron) #rate of change of temperature in K/s\n", + "dt=(dT/T)/60 #in minutes\n", + "print\" hence,the rate of change of temperature is\",round(T,4),\"k/s\" \n", + "print\" and time taken to reach a temperature of T is\",round(dt),\"min\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " hence,the rate of change of temperature is 0.0828 k/s\n", + " and time taken to reach a temperature of T is 11.0 min\n" + ] + } + ], + "prompt_number": 49 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter5_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter5_6.ipynb new file mode 100755 index 00000000..5a9734bc --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter5_6.ipynb @@ -0,0 +1,635 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:bc9fbdf4ecee4bce9770355a576adf487ef4df6d34bad14ada42e8383ea01d91" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter5:THE FIRST LAW OF THERMODYNAMICS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.1:pg-131" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#calculating height\n", + "\n", + "m=1100 #mass of car in kg\n", + "ke=400 #kinetic energy of car in kJ\n", + "V=(2*ke*1000/m)**0.5 #velocity of car in m/s\n", + "g=9.807 #acc. due to gravity in m/s^2\n", + "H=ke*1000/(m*g) #height to which the car should be lifted so that its potential energy equals its kinetic energy\n", + "print\"hence,the car should be raised to a height is\",round(H,1),\"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,the car should be raised to a height is 37.1 m\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.1E:pg-132" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1E\n", + "#calculating height\n", + "\n", + "m=2400 #mass of car in lbm\n", + "ke=400 #kinetic energy of car in Btu\n", + "V=(2*ke*778.17*32.174/m)**0.5 #velocity of car in ft/s\n", + "g=32.174 #acc. due to gravity in ft/s^2\n", + "H=ke*778.17*32.174/(m*g) #height to which the car should be lifted so that its potential energy equals its kinetic energy\n", + "print\"hence,the car should be raised to a height is\",round(H,1),\"ft\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,the car should be raised to a height is 129.7 ft\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.2:pg-134" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#change in internal energy\n", + "\n", + "W=-5090 #work input to paddle wheel in kJ\n", + "Q=-1500 #heat transfer from tank in kJ\n", + "dU=Q-W #change in internal energy in kJ\n", + "print\"hence,change in internal energy is\",round(dU),\"kj\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "hence,change in internal energy is 3590.0 kj\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.3:pg-134" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#analysis of energy transfer\n", + "\n", + "g=9.806 #acceleration due to gravity in m/s^2\n", + "m=10 #mass of stone in kg\n", + "H1=10.2 #initial height of stone above water in metres\n", + "H2=0 #final height in metres\n", + "dKE1=-m*g*(H2-H1) #change in kinetic energy when stone enters state 2 in J\n", + "dPE1=-1 #change in potential energy when stone enters state 2 in J\n", + "print\"\\n hence,when stone is \",round(dKE1),\"J\"\n", + "print\"\\n and change in potential energy is \",round(dPE1),\"J\"\n", + "dPE2=0 #change in potential energy when stone enters state 3 in JQ2=0 //no heat transfer when stone enters state 3 in J\n", + "W2=0 #no work done when stone enters state 3 in J\n", + "dKE2=-1 #change in kinetic energy when stone enters state 3\n", + "dU2=-dKE2 #change in internal energy when stone enters state 3 in J\n", + "print\"\\n hence,when stone has just come to rest in the bucket is \",round(dKE2),\"J\" \n", + "print\"\\n and dU is\",round(dU2),\"J\" \n", + "dKE3=0 #change in kinetic energy when stone enters state 4\n", + "dPE=0 #change in potential energy when stone enters state 4 in J\n", + "W3=0 #no work done when stone enters state 4 in J\n", + "dU3=-1 #change in internal energy when stone enters state 4 in J\n", + "Q3=dU3 #heat transfer when stone enters state 4 in J\n", + "print\"\\n hence,when stone has entered state 4 is\",round(dU3),\"J\" \n", + "print\"\\n and Q3 is \",round(Q3),\"J\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,when stone is 1000.0 J\n", + "\n", + " and change in potential energy is -1.0 J\n", + "\n", + " hence,when stone has just come to rest in the bucket is -1.0 J\n", + "\n", + " and dU is 1.0 J\n", + "\n", + " hence,when stone has entered state 4 is -1.0 J\n", + "\n", + " and Q3 is -1.0 J\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.4:pg-136" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#Determinig the missing properties \n", + "\n", + "T1=300 #given temp. in Celsius\n", + "u1=2780 #given specific internal enrgy in kJ/kg\n", + "print\"From steam table, at T=300 C,ug=2563.0 kJ/kg.So,u1>ug ,it means the state is in the superheated vapor region.So, by interplotation,we find P=1648 kPa and v=0.1542 m^3/kg\" #hiven pressure in kPa\n", + "u2=2000 #given specific intrernal energy in kJ/kg\n", + "print\"at P=2000 kPa\"\n", + "uf=906.4 #in kJ/kg\n", + "ug=2600.3 #in kJ/kg \n", + "x2=(u2-906.4)/(ug-uf) \n", + "print\"Also, under the given conditions\"\n", + "vf=0.001177 #in m^3/kg \n", + "vg=0.099627 #in m^3/kg\n", + "v2=vf+x2*(vg-vf)#Specific volume for water in m^3/kg\n", + "print\"\\n hence,specific volume for water is \",round(v2,5),\"m^3/kg\" \n", + "print\"\\n Therefore ,this state is \",round(x2,4),\"N\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From steam table, at T=300 C,ug=2563.0 kJ/kg.So,u1>ug ,it means the state is in the superheated vapor region.So, by interplotation,we find P=1648 kPa and v=0.1542 m^3/kg\n", + "at P=2000 kPa\n", + "Also, under the given conditions\n", + "\n", + " hence,specific volume for water is 0.06474 m^3/kg\n", + "\n", + " Therefore ,this state is 0.6456 N\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.5:pg-138" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#calculating heat transfer for the given process\n", + "\n", + "Vliq=0.05 #volume of saturated liquid in m^3\n", + "vf=0.001043 #in m^3/kg\n", + "Vvap=4.95 #volume of saturated water vapour in m^3\n", + "vg=1.6940 #in m^3/kg\n", + "m1liq=Vliq/vf #mass of liquid in kg\n", + "m1liq=round(m1liq,2)\n", + "m1vap=Vvap/vg #mass of vapors in kg\n", + "m1vap=round(m1vap,2)\n", + "u1liq=417.36 #specific internal energy of liquid in kJ/kg\n", + "u1vap=2506.1 #specific internal energy of vapors in kJ/kg\n", + "U1=m1liq*u1liq + m1vap*u1vap #total internal energy in kJ\n", + "m=m1liq+m1vap #total mass in kg\n", + "V=5.0 #total volume in m^3\n", + "v2=V/m #final specific volume in m^3/kg\n", + "print\"by interplotation we find that for steam, if vg=0.09831 m^3/kg then pressure is 2.03 Mpa\"\n", + "u2=2600.5 #specific internal energy at final state in kJ/kg\n", + "U2=m*u2 #internal energy at final state in kJ\n", + "Q=U2-U1 #heat transfer for the process in kJ\n", + "print\"\\n hence,heat transfer for the process is\",round(Q),\"kJ\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "by interplotation we find that for steam, if vg=0.09831 m^3/kg then pressure is 2.03 Mpa\n", + "\n", + " hence,heat transfer for the process is 104935.0 kJ\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.5E:pg-140" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5E\n", + "#calculating heat transfer for the given process\n", + "\n", + "Vliq=1 #volume of saturated liquid in ft^3\n", + "vf=0.01672 #in ft^3/lbm\n", + "Vvap=99 #volume of saturated water vapour in m^3\n", + "vg=26.80 #in ft^3/lbm\n", + "m1liq=Vliq/vf #mass of liquid in lbm\n", + "m1liq=round(m1liq,2)\n", + "m1vap=Vvap/vg #mass of vapors in lbm\n", + "m1vap=round(m1vap,2)\n", + "u1liq=180.1 #specific internal energy of liquid in Btu/lbm\n", + "u1vap=1077.6 #specific internal energy of vapors in Btu/lbm\n", + "U1=m1liq*u1liq + m1vap*u1vap #total internal energy in Btu\n", + "U1=round(U1)\n", + "m=m1liq+m1vap #total mass in lbm\n", + "V=100.0 #total volume in ft^3\n", + "v2=V/m #final specific volume in ft^3/lbm\n", + "print\"by interplotation we find that for steam, if vg=1.575 ft^3/lbm then pressure is 294 lbf/in^2\"\n", + "u2=1117.0 #specific internal energy at final state in Btu/lbm\n", + "U2=m*u2 #internal energy at final state in Btu\n", + "U2=round(U2)\n", + "Q=U2-U1 #heat transfer for the process in Btu\n", + "print\"\\n hence,heat transfer for the process is\",round(Q),\"Btu\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "by interplotation we find that for steam, if vg=1.575 ft^3/lbm then pressure is 294 lbf/in^2\n", + "\n", + " hence,heat transfer for the process is 56182.0 Btu\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.6:pg-143" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#calculating work and heat transfer for the process\n", + "\n", + "V1=0.1 #volume of cylinder in m^3\n", + "m=0.5 #mass of steam in kg\n", + "v1=V1/m #specific volume of steam in m^3/kg\n", + "vf=0.001084 #m^3/kg\n", + "vfg=0.4614 #m^3/kg\n", + "x1=(v1-vf)/vfg #quality\n", + "hf=604.74 #kJ/kg\n", + "hfg=2133.8#kJ/kg\n", + "h2=3066.8 #final specific heat enthalpy in kJ/kg\n", + "h1=hf+x1*hfg #initial specific enthalpy in kJ/kg\n", + "Q=m*(h2-h1) #heat transfer for this process in kJ\n", + "P=400 #pressure inside cylinder in kPa\n", + "v2=0.6548 #specific enthalpy in m^3/kg\n", + "W=m*P*(v2-v1) #work done for the process in kJ\n", + "print\"\\n hence, work done for the process is\",round(W),\"kJ\" \n", + "print\"\\n and heat transfer is \",round(Q,1),\"kJ\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, work done for the process is 91.0 kJ\n", + "\n", + " and heat transfer is 771.1 kJ\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.7:pg-144" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# example 7\n", + "#calculating work and heat transfer for the process\n", + "V1=0.010 #volume of cylinder in m^3\n", + "V2=0.040 # m^3\n", + "P1=573 #kPa\n", + "v1=0.03606 #specific volume of steam in m^3/kg\n", + "u1=389.2 #kJ/kg\n", + "m=V1/v1#mass of steam in kg\n", + "v2=v1*(V2/V1)\n", + "P2=163 #kPa\n", + "u2=395.8 # kJ/kg\n", + "W=8 # kJ\n", + "Q2=m*(u2-u1)+W\n", + "u3=383.4#kJ/kg\n", + "W2=m*(u1-u3)#kJ\n", + "print\"\\n and heat transfer is \",round(Q2,2),\"kJ\" \n", + "print\"\\n hence, work done for the process is\",round(W2,1),\"kJ\" \n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " and heat transfer is 9.83 kJ\n", + "\n", + " hence, work done for the process is 1.6 kJ\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.8:pg-151" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#calculating change in enthalpy\n", + "import math\n", + "\n", + "h1=273.2 #specific heat enthalpy for oxygen at 300 K\n", + "h2=1540.2 #specific heat enthalpy for oxygen at 1500 K\n", + "T1=300 #initial temperature in K\n", + "T2=1500 #final temparature in K\n", + "\n", + "dh1=h2-h1 #this change in specific heat enthalpy is calculated using ideal gas tables \n", + "dh3=0.922*(T2-T1) #it is claculated if we assume specific heat enthalpy to be constant and uses its value at 300K\n", + "dh4=1.0767*(T2-T1) #it is claculated if we assume specific heat enthalpy to be constant and uses its value at 900K i.e mean of initial and final temperature\n", + "print\"\\n Hence,change in specific heat enthalpy if ideal gas tables are used is \",round(dh1,1),\"kJ/kg\"\n", + "print\"\\n if specific heat is assumed to be constant and using its value at T1 is\",round(dh3,1),\"kJ/kg\"\n", + "print\"\\n if specific heat is assumed to be constant at its value at (T1+T2)/2 is\",round(dh4,1),\"kJ/kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " Hence,change in specific heat enthalpy if ideal gas tables are used is 1267.0 kJ/kg\n", + "\n", + " if specific heat is assumed to be constant and using its value at T1 is 1106.4 kJ/kg\n", + "\n", + " if specific heat is assumed to be constant at its value at (T1+T2)/2 is 1292.0 kJ/kg\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.9:pg-152" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#determining amount of heat transfer\n", + "\n", + "P=150 #pressure of nitrogen in cylinder in kPa\n", + "V=0.1 #initial volume of cylinder in m^3\n", + "T1=25 #initial temperature of nitrogen in celsius\n", + "T2=150 #final tempareture of nitrogen in celsius\n", + "R=0.2968 #in kJ/kg-K\n", + "m=P*V/(R*(T1+273)) #mass of nitrogen in kg\n", + "Cv=0.745 #constant volume specific heat for nitrogen in kJ/kg-K\n", + "W=-20 #work done on nitrogen gas in kJ\n", + "Q=m*Cv*(T2-T1)+W #heat transfer during the process in kJ\n", + "print\"\\n hence,the heat transfer for the above process is\",round(Q,1),\"kJ\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the heat transfer for the above process is -4.2 kJ\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.9E:pg-153" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9E\n", + "#determining amount of heat transfer\n", + "\n", + "P=20 #pressure of nitrogen in cylinder in lbf/in^2\n", + "V=2 #initial volume of cylinder in ft^3\n", + "T1=80 #initial temperature of nitrogen in F\n", + "T2=300 #final tempareture of nitrogen in F\n", + "R=55.15 #in ft*lbf/lbm-R\n", + "m=P*V*144/(R*(540)) #mass of nitrogen in lbm\n", + "Cv=0.177 #constant volume specific heat for nitrogen in Btu/lbm-R\n", + "W=-9.15 #work done on nitrogen gas in Btu\n", + "Q=m*Cv*(T2-T1)+W #heat transfer during the process in Btu\n", + "print\"\\n hence,the heat transfer for the above process is\",round(Q,2),\"Btu\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the heat transfer for the above process is -1.62 Btu\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.10:pg-155" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#calculating rate of increase of internal energy\n", + "\n", + "W=-12.8*20 #power consumed in J/s\n", + "Q=-10 #heat transfer rate from battery in J/s\n", + "r=Q-W #rate of increase of internal energy\n", + "print\"\\n hence,the rate of increase of internal energy is\",round(r),\"J/s\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the rate of increase of internal energy is 246.0 J/s\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex5.11:pg-155" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 11\n", + "#rate of change of temperature\n", + "\n", + "Q=1500.0 #power produced by burning wood in J/s\n", + "mair=1 #mass of air in kg\n", + "mwood=5 #mass of soft pine wood in kg \n", + "miron=25 #mass of cast iron in kg\n", + "Cvair=0.717 #constant volume specific heat for air in kJ/kg\n", + "Cwood=1.38 #constant volume specific heat for wood in kJ/kg\n", + "Ciron=0.42 #constant volume specific heat for iron in kJ/kg\n", + "dT=75-20 #increase in temperature in Celsius\n", + "T=(Q/1000)/(mair*Cvair+mwood*Cwood+miron*Ciron) #rate of change of temperature in K/s\n", + "dt=(dT/T)/60 #in minutes\n", + "print\" hence,the rate of change of temperature is\",round(T,4),\"k/s\" \n", + "print\" and time taken to reach a temperature of T is\",round(dt),\"min\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " hence,the rate of change of temperature is 0.0828 k/s\n", + " and time taken to reach a temperature of T is 11.0 min\n" + ] + } + ], + "prompt_number": 49 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter6.ipynb new file mode 100755 index 00000000..2548c7ee --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter6.ipynb @@ -0,0 +1,566 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:084379625b3dc39247a3be2201f659a82e58d8004d66338e0ef15cb00bca073d" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter6:FIRST-LAW ANALYSIS FOR A CONTROL VOLUME" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.1:pg-182" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#calculating mass flow rate in kg/s\n", + "import math\n", + "R=0.287 #in kJ/kg-K\n", + "T=25 #temperature in celsius\n", + "P=150 #pressure in kPa\n", + "v=R*(T+273.15)/P #specific volume in m^3/kg\n", + "D=0.2 #diameter of pipe in metre\n", + "A=math.pi*D**2/4 #cross sectional area in m^2\n", + "V=0.1 #velocity of air in m/s\n", + "m=V*A/v #mass flow rate in kg/s\n", + "print\"\\n hence,the mass flow rate is\",round(m,4),\"kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the mass flow rate is 0.0055 kg/s\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.2:pg-184" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#work done for adding the fluid\n", + "\n", + "P=600 #pressure in kPa\n", + "m=1 #in kg\n", + "v=0.001 #specific volume in m^3/kg\n", + "W=P*m*v #necessary work in kJ for adding the fluid \n", + "print\" \\n hence,the work involved in this process is\",round(W,4),\"kJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,the work involved in this process is 0.6 kJ\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.3:pg-188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#rate of flow of water\n", + "\n", + "hir=441.89 #in kJ/kg for refrigerant using steam table \n", + "her=249.10 #in kJ/kg for refrigerant using steam table\n", + "hiw=42 #in kJ/kg for water using steam table\n", + "hew=83.95 #in kJ/kg for water using steam table\n", + "mr=0.2 #the rate at which refrigerant enters the condenser in kg/s\n", + "mw=mr*(hir-her)/(hew-hiw) #rate of flow of water in kg/s\n", + "print\"\\n hence,the rate at which cooling water flows thorugh the condenser is\",round(mw,3),\"kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the rate at which cooling water flows thorugh the condenser is 0.919 kg/s\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.4:pg-190" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#determining quality of steam\n", + "\n", + "hi=2850.1 #initial specific heat enthalpy for steam in kJ/kg\n", + "Vi=50 #initial velocity of steam in m/s\n", + "Ve=600 #final velocity of steam in m/s\n", + "he=hi+Vi**2/(2*1000)-Ve**2/(2*1000) #final specific heat enthalpy for steam in kJ/kg\n", + "hf=467.1 #at final state in kJ/kg\n", + "hfg=2226.5 #at final state in kJ/kg\n", + "xe=(he-hf)/hfg #quality of steam in final state\n", + "print\" \\n hence, the quality is\",round(xe,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence, the quality is 0.99\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.5:pg-193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#quality of ammonia leaving expansion valve\n", + "\n", + "hi=346.8 #specific heat enthalpy for ammonia at initial state in kJ/kg\n", + "he=hi #specific heat enthalpy for ammonia at final state will be equal that at initial state because it is a throttling process\n", + "hf=134.4 #at final state in kJ/kg\n", + "hfg=1296.4#at final state in kJ/kg\n", + "xe=(he-hf)*100/hfg #quality at final state\n", + "print\"\\n hence,quality of the ammonia leaving the expansion valve is\",round(xe,2),\"%\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,quality of the ammonia leaving the expansion valve is 16.38 %\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.6:pg-194" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#power output of turbine in kW\n", + "\n", + "hi=3137 #initial specific heat of enthalpy in kJ/kg\n", + "he=2675.5 #final specific heat of enthalpy in kJ/kg\n", + "Vi=50.0 #initial velocity of steam in m/s\n", + "Ve=100 #final velocity of steam in m/s\n", + "Zi=6 #height of inlet conditions in metres\n", + "Ze=3 #height of exit conditions in metres\n", + "m=1.5 #mass flow rate of steam in kg/s\n", + "g=9.8066 #acc. due to gravity in m/s^2\n", + "Qcv=-8.5 #heat transfer rate from turbine in kW\n", + "Wcv=Qcv+m*(hi+Vi**2/(2*1000)+g*Zi/1000)-m*(he+Ve**2/(2*1000)+g*Ze/1000) #power output of turbine in kW\n", + "print\"\\n hence,the power output of the turbine is\",round(Wcv,1),\"kW\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the power output of the turbine is 678.2 kW\n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.7:pg-196" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#heat transfer rate in aftercooler\n", + "\n", + "V1=0 #we assume initial velocity to be zero because its given that it enters with a low velocity\n", + "V2=25.0 #final velocity with which carbon dioxide exits in m/s\n", + "h2=401.52 #final specific enthalpy of heat when carbon dioxide exits in kJ/kg\n", + "h1=198 #initial specific enthalpy of heat in kJ/kg\n", + "w=h1-h2-V2**2/(2*1000) #in kJ/kg\n", + "Wc=-50 #power input to the compressor in kW\n", + "m=Wc/w #mass flow rate of carbon dioxide in kg/s\n", + "h3=257.9 #final specific enthalpy of heat when carbon dioxide flows into a constant pressure aftercooler\n", + "Qcool=-m*(h3-h2) #heat transfer rate in the aftercooler in kW\n", + "print\" \\n hence,heat transfer rate in the aftercooler is\",round(Qcool,1),\"kW\" \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,heat transfer rate in the aftercooler is 35.2 kW\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.8:pg-197" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#Required pump work\n", + "\n", + "m=1.5 #mass flow rate of water in kg/s\n", + "g=9.807 #acceleration due to gravity in m/s^2\n", + "Zin=-15 #depth of water pump in well in metres\n", + "Zex=0 #in metres\n", + "v=0.001001 #specific volume in m^3/kg\n", + "Pex=400+101.3 #exit pressure in kPa\n", + "Pin=90 #in kPa\n", + "W=m*(g*(Zin-Zex)*0.001-(Pex-Pin)*v) #power input in kW\n", + "print\" \\n Hence, the pump requires power of input is\",-round(W,2),\"kW\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " Hence, the pump requires power of input is 0.84 kW\n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.9:pg-198" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#heat tranfer in simple steam power plant\n", + "\n", + "h1=3023.5 #specific heat of enthalpy of steam leaving boiler in kJ/kg\n", + "h2=3002.5 #specific heat of enthalpy of steam entering turbine in kJ/kg\n", + "x=0.9 #quality of steam entering condenser\n", + "hf=226 #in kJ/kg\n", + "hfg=2373.1 #in kJ/kg\n", + "h3=hf+x*hfg #specific heat of enthalpy of steam entering condenser in kJ/kg\n", + "h4=188.5 #specific heat of enthalpy of steam entering pump in kJ/kg\n", + "q12=h2-h1 #heat transfer in line between boiler and turbine in kJ/kg\n", + "w23=h2-h3 #turbine work in kJ/kg\n", + "q34=h4-h3 #heat transfer in condenser\n", + "w45=-4 #pump work in kJ/kg\n", + "h5=h4-w45 #in kJ/kg\n", + "q51=h1-h5 #heat transfer in boiler in kJ/kg\n", + "print\"\\n hence, heat transfer in line between boiler and turbine is\",round(q12,1),\"kJ/kg\" \n", + "print\"\\n hence, turbine work is\",round(w23,1),\"kJ/kg\" \n", + "print\"\\n hence, heat transfer in condenser is \",round(q34,1),\"kJ/kg\" \n", + "print\"\\n hence, heat transfer in boiler is \",round(q51,1),\"kJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, heat transfer in line between boiler and turbine is -21.0 kJ/kg\n", + "\n", + " hence, turbine work is 640.7 kJ/kg\n", + "\n", + " hence, heat transfer in condenser is -2173.3 kJ/kg\n", + "\n", + " hence, heat transfer in boiler is 2831.0 kJ/kg\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.10:pg-200" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#analysis of refrigerator\n", + "\n", + "hf4=167.4 #in kJ/kg\n", + "hfg4=215.6 #in kJ/kg\n", + "h3=241.8 #specific heat of enthalpy of R-134a entering expansion valve\n", + "h4=h3 #specific heat of enthalpy of R-134a leaving expansion valve\n", + "h1=387.2 #in kJ/kg\n", + "h2=435.1 #in kJ/kg\n", + "x4=(h3-hf4)/hfg4 #quality of R-134a at evaporator inlet\n", + "m=0.1 #mass flow rate in kg/s\n", + "Qevap=m*(h1-h4) #rate of heat transfer to the evaporator\n", + "Wcomp=-5 #power input to compressor in kW\n", + "Qcomp=m*(h2-h1)+Wcomp #rate of heat transfer from compressor\n", + "print\"\\n hence, the quality at the evaporator inlet is \",round(x4,3), \n", + "print\"\\n hence, the rate of heat transfer to the evaporator is \",round(Qevap,2),\n", + "print\"\\n hence, rate of heat transfer from the compressor is\",round(Qcomp,2), " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, the quality at the evaporator inlet is 0.345 \n", + " hence, the rate of heat transfer to the evaporator is 14.54 \n", + " hence, rate of heat transfer from the compressor is -0.21\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.11:pg-204" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 11\n", + "#Determining the final temperature of steam\n", + "\n", + "u2=3040.4 #final internal energy in kJ/kg\n", + "hi=u2 #in kJ/kg\n", + "P2=1.4 #final Pressure in MPa\n", + "print\"Since, the final pressure is given as 1.4 MPa,we know two properties at the final state and hence,final state can be determined.The temperature corresponding to a pressure of 1.4 MPa and an internal energy of 3040.4 kJ/kg is found to be \"\n", + "T2=452 #final temperature in Celsius" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Since, the final pressure is given as 1.4 MPa,we know two properties at the final state and hence,final state can be determined.The temperature corresponding to a pressure of 1.4 MPa and an internal energy of 3040.4 kJ/kg is found to be \n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.12:pg-206" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 12\n", + "#Calculating mass flow of steam in tank\n", + "\n", + "V1=0.4 #initial volume fo tank in m^3\n", + "v1=0.5243 #initial specific volume in m^3/kg\n", + "h1=3040.4 #initial specific enthalpy in kJ/kg\n", + "u1=2548.9 #initial specific internal energy in kJ/kg\n", + "m1=V1/v1 #initial mass of steam in tank in kg\n", + "V2=0.4 #final volume in m^3\n", + "print\"let x=V*(h1-u2)/v2-m1*(h1-u1).If we assume T2=300C, then v2=0.1823m^3/kg ,u2=2785.2kJ/kg and x=+ve.If we assume T2=350C,then v2=0.2003 m^3/kg, u2=2869.1kJ/kg and x=-ve.Hence,actualt T2 must be between these two assumed values in order that x=0.By interplotation\" \n", + "T2=342 #final temperature in Celsius\n", + "v2=0.1974 #final specific volume in m^3/kg\n", + "m2=V2/v2 #final mass of the steam in the tank in kg\n", + "m=m2-m1 #mass of steam that flowsinto the tank\n", + "print\" \\n Hence,mass of the steam that flows into the tank is\",round(m,3),\"kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "let x=V*(h1-u2)/v2-m1*(h1-u1).If we assume T2=300C, then v2=0.1823m^3/kg ,u2=2785.2kJ/kg and x=+ve.If we assume T2=350C,then v2=0.2003 m^3/kg, u2=2869.1kJ/kg and x=-ve.Hence,actualt T2 must be between these two assumed values in order that x=0.By interplotation\n", + " \n", + " Hence,mass of the steam that flows into the tank is 1.263 kg\n" + ] + } + ], + "prompt_number": 48 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.13:pg-207" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 13\n", + "#Calculating mass flow of steam in tank\n", + "\n", + "vf1=0.001725 #in m^3/kg\n", + "vf2=0.0016 #in m^3/kg\n", + "uf1=368.7 #in kJ/kg\n", + "uf2=226 #in kJ/kg\n", + "vg1=0.08313 #in m^3/kg\n", + "vfg2=0.20381\n", + "ug1=1341 #in kJ/kg\n", + "ufg2=1099.7 #in kJ/kg\n", + "Vf=1 #initial volume of liquid in m^3\n", + "Vg=1 #initial volume of vapor in m^3\n", + "mf1=Vf/vf1 #initial mass of liquid in kg\n", + "mg1=Vg/vg1 #initial mass of vapor in kg\n", + "m1=mf1+mg1 #initial mass of liquid in kg\n", + "he=1461.1 #in kJ/kg\n", + "V=2 #volume of tank in m^3\n", + "print\"m1u1=mf1*uf1+mg1*ug1.If x2 is the quality,then m2=V/v2=2/(0.00160+0.20381*x2) and u2=uf2+x2*ufg2=226.0+1099.7*x2.\"\n", + "print\"Also,m2*(he-u2)=m1*he-m1u1.From this equation,we will get an equation for x2.\"\n", + "x2=((2*1461.1)-(2*226)-(0.00160*634706))/((634706*0.20381)+(2*1099.7)) #quality of ammonia\n", + "v2=0.00160+(0.20381*x2) #final specific volume in m^3/kg\n", + "m2=V/v2 #final mass of ammonia in kg\n", + "m=m1-m2 #mass of ammonia withdrawn\n", + "print\" \\n Hence,mass of ammonia withdrawn is\",round(m,1),\"kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "m1u1=mf1*uf1+mg1*ug1.If x2 is the quality,then m2=V/v2=2/(0.00160+0.20381*x2) and u2=uf2+x2*ufg2=226.0+1099.7*x2.\n", + "Also,m2*(he-u2)=m1*he-m1u1.From this equation,we will get an equation for x2.\n", + " \n", + " Hence,mass of ammonia withdrawn is 72.7 kg\n" + ] + } + ], + "prompt_number": 50 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter6_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter6_6.ipynb new file mode 100755 index 00000000..953e821b --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter6_6.ipynb @@ -0,0 +1,652 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:c03e579abb4dafb7ea55c1a7f66b6338546355647f3c3d21afe4e72021a3ad5f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter6:FIRST-LAW ANALYSIS FOR A CONTROL VOLUME" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.1:pg-182" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#calculating mass flow rate in kg/s\n", + "import math\n", + "R=0.287 #in kJ/kg-K\n", + "T=25 #temperature in celsius\n", + "P=150 #pressure in kPa\n", + "v=R*(T+273.15)/P #specific volume in m^3/kg\n", + "D=0.2 #diameter of pipe in metre\n", + "A=math.pi*D**2/4 #cross sectional area in m^2\n", + "V=0.1 #velocity of air in m/s\n", + "m=V*A/v #mass flow rate in kg/s\n", + "print\"\\n hence,the mass flow rate is\",round(m,4),\"kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the mass flow rate is 0.0055 kg/s\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.2:pg-184" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#work done for adding the fluid\n", + "\n", + "P=600 #pressure in kPa\n", + "m=1 #in kg\n", + "v=0.001 #specific volume in m^3/kg\n", + "W=P*m*v #necessary work in kJ for adding the fluid \n", + "print\" \\n hence,the work involved in this process is\",round(W,4),\"kJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,the work involved in this process is 0.6 kJ\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.3:pg-188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#rate of flow of water\n", + "\n", + "hir=441.89 #in kJ/kg for refrigerant using steam table \n", + "her=249.10 #in kJ/kg for refrigerant using steam table\n", + "hiw=42 #in kJ/kg for water using steam table\n", + "hew=83.95 #in kJ/kg for water using steam table\n", + "mr=0.2 #the rate at which refrigerant enters the condenser in kg/s\n", + "mw=mr*(hir-her)/(hew-hiw) #rate of flow of water in kg/s\n", + "print\"\\n hence,the rate at which cooling water flows thorugh the condenser is\",round(mw,3),\"kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the rate at which cooling water flows thorugh the condenser is 0.919 kg/s\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.4:pg-190" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#determining quality of steam\n", + "\n", + "hi=2850.1 #initial specific heat enthalpy for steam in kJ/kg\n", + "Vi=50 #initial velocity of steam in m/s\n", + "Ve=600 #final velocity of steam in m/s\n", + "he=hi+Vi**2/(2*1000)-Ve**2/(2*1000) #final specific heat enthalpy for steam in kJ/kg\n", + "hf=467.1 #at final state in kJ/kg\n", + "hfg=2226.5 #at final state in kJ/kg\n", + "xe=(he-hf)/hfg #quality of steam in final state\n", + "print\" \\n hence, the quality is\",round(xe,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence, the quality is 0.99\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.4E:pg-191" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4E\n", + "#determining quality of steam\n", + "\n", + "hi=1227.5 #initial specific heat enthalpy for steam in Btu/lbm\n", + "Vi=200 #initial velocity of steam in ft/s\n", + "Ve=2000 #final velocity of steam in ft/s\n", + "he=hi+Vi**2/(2*32.17*778)-Ve**2/(2*32.17*778) #final specific heat enthalpy for steam in Btu/lbm\n", + "hf=198.31 #at final state in Btu/lbm\n", + "hfg=958.81 #at final state in Btu/lbm\n", + "xe=(he-hf)/hfg #quality of steam in final state\n", + "print\" \\n hence, the quality is\",round(xe,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence, the quality is 0.99\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.5:pg-193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#quality of ammonia leaving expansion valve\n", + "\n", + "hi=346.8 #specific heat enthalpy for ammonia at initial state in kJ/kg\n", + "he=hi #specific heat enthalpy for ammonia at final state will be equal that at initial state because it is a throttling process\n", + "hf=134.4 #at final state in kJ/kg\n", + "hfg=1296.4#at final state in kJ/kg\n", + "xe=(he-hf)*100/hfg #quality at final state\n", + "print\"\\n hence,quality of the ammonia leaving the expansion valve is\",round(xe,2),\"%\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,quality of the ammonia leaving the expansion valve is 16.38 %\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.6:pg-194" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#power output of turbine in kW\n", + "\n", + "hi=3137 #initial specific heat of enthalpy in kJ/kg\n", + "he=2675.5 #final specific heat of enthalpy in kJ/kg\n", + "Vi=50.0 #initial velocity of steam in m/s\n", + "Ve=100 #final velocity of steam in m/s\n", + "Zi=6 #height of inlet conditions in metres\n", + "Ze=3 #height of exit conditions in metres\n", + "m=1.5 #mass flow rate of steam in kg/s\n", + "g=9.8066 #acc. due to gravity in m/s^2\n", + "Qcv=-8.5 #heat transfer rate from turbine in kW\n", + "Wcv=Qcv+m*(hi+Vi**2/(2*1000)+g*Zi/1000)-m*(he+Ve**2/(2*1000)+g*Ze/1000) #power output of turbine in kW\n", + "print\"\\n hence,the power output of the turbine is\",round(Wcv,1),\"kW\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the power output of the turbine is 678.2 kW\n" + ] + } + ], + "prompt_number": 28 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.7:pg-196" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#heat transfer rate in aftercooler\n", + "\n", + "V1=0 #we assume initial velocity to be zero because its given that it enters with a low velocity\n", + "V2=25.0 #final velocity with which carbon dioxide exits in m/s\n", + "h2=401.52 #final specific enthalpy of heat when carbon dioxide exits in kJ/kg\n", + "h1=198 #initial specific enthalpy of heat in kJ/kg\n", + "w=h1-h2-V2**2/(2*1000) #in kJ/kg\n", + "Wc=-50 #power input to the compressor in kW\n", + "m=Wc/w #mass flow rate of carbon dioxide in kg/s\n", + "h3=257.9 #final specific enthalpy of heat when carbon dioxide flows into a constant pressure aftercooler\n", + "Qcool=-m*(h3-h2) #heat transfer rate in the aftercooler in kW\n", + "print\" \\n hence,heat transfer rate in the aftercooler is\",round(Qcool,1),\"kW\" \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,heat transfer rate in the aftercooler is 35.2 kW\n" + ] + } + ], + "prompt_number": 30 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.8:pg-197" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#Required pump work\n", + "\n", + "m=1.5 #mass flow rate of water in kg/s\n", + "g=9.807 #acceleration due to gravity in m/s^2\n", + "Zin=-15 #depth of water pump in well in metres\n", + "Zex=0 #in metres\n", + "v=0.001001 #specific volume in m^3/kg\n", + "Pex=400+101.3 #exit pressure in kPa\n", + "Pin=90 #in kPa\n", + "W=m*(g*(Zin-Zex)*0.001-(Pex-Pin)*v) #power input in kW\n", + "print\" \\n Hence, the pump requires power of input is\",-round(W,2),\"kW\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " Hence, the pump requires power of input is 0.84 kW\n" + ] + } + ], + "prompt_number": 39 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.9:pg-198" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#heat tranfer in simple steam power plant\n", + "\n", + "h1=3023.5 #specific heat of enthalpy of steam leaving boiler in kJ/kg\n", + "h2=3002.5 #specific heat of enthalpy of steam entering turbine in kJ/kg\n", + "x=0.9 #quality of steam entering condenser\n", + "hf=226 #in kJ/kg\n", + "hfg=2373.1 #in kJ/kg\n", + "h3=hf+x*hfg #specific heat of enthalpy of steam entering condenser in kJ/kg\n", + "h4=188.5 #specific heat of enthalpy of steam entering pump in kJ/kg\n", + "q12=h2-h1 #heat transfer in line between boiler and turbine in kJ/kg\n", + "w23=h2-h3 #turbine work in kJ/kg\n", + "q34=h4-h3 #heat transfer in condenser\n", + "w45=-4 #pump work in kJ/kg\n", + "h5=h4-w45 #in kJ/kg\n", + "q51=h1-h5 #heat transfer in boiler in kJ/kg\n", + "print\"\\n hence, heat transfer in line between boiler and turbine is\",round(q12,1),\"kJ/kg\" \n", + "print\"\\n hence, turbine work is\",round(w23,1),\"kJ/kg\" \n", + "print\"\\n hence, heat transfer in condenser is \",round(q34,1),\"kJ/kg\" \n", + "print\"\\n hence, heat transfer in boiler is \",round(q51,1),\"kJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, heat transfer in line between boiler and turbine is -21.0 kJ/kg\n", + "\n", + " hence, turbine work is 640.7 kJ/kg\n", + "\n", + " hence, heat transfer in condenser is -2173.3 kJ/kg\n", + "\n", + " hence, heat transfer in boiler is 2831.0 kJ/kg\n" + ] + } + ], + "prompt_number": 43 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.10:pg-200" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#analysis of refrigerator\n", + "\n", + "hf4=167.4 #in kJ/kg\n", + "hfg4=215.6 #in kJ/kg\n", + "h3=241.8 #specific heat of enthalpy of R-134a entering expansion valve\n", + "h4=h3 #specific heat of enthalpy of R-134a leaving expansion valve\n", + "h1=387.2 #in kJ/kg\n", + "h2=435.1 #in kJ/kg\n", + "x4=(h3-hf4)/hfg4 #quality of R-134a at evaporator inlet\n", + "m=0.1 #mass flow rate in kg/s\n", + "Qevap=m*(h1-h4) #rate of heat transfer to the evaporator\n", + "Wcomp=-5 #power input to compressor in kW\n", + "Qcomp=m*(h2-h1)+Wcomp #rate of heat transfer from compressor\n", + "print\"\\n hence, the quality at the evaporator inlet is \",round(x4,3), \n", + "print\"\\n hence, the rate of heat transfer to the evaporator is \",round(Qevap,2),\n", + "print\"\\n hence, rate of heat transfer from the compressor is\",round(Qcomp,2), " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, the quality at the evaporator inlet is 0.345 \n", + " hence, the rate of heat transfer to the evaporator is 14.54 \n", + " hence, rate of heat transfer from the compressor is -0.21\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.11:pg-204" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 11\n", + "#Determining the final temperature of steam\n", + "\n", + "u2=3040.4 #final internal energy in kJ/kg\n", + "hi=u2 #in kJ/kg\n", + "P2=1.4 #final Pressure in MPa\n", + "print\"Since, the final pressure is given as 1.4 MPa,we know two properties at the final state and hence,final state can be determined.The temperature corresponding to a pressure of 1.4 MPa and an internal energy of 3040.4 kJ/kg is found to be \"\n", + "T2=452 #final temperature in Celsius" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Since, the final pressure is given as 1.4 MPa,we know two properties at the final state and hence,final state can be determined.The temperature corresponding to a pressure of 1.4 MPa and an internal energy of 3040.4 kJ/kg is found to be \n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.12:pg-206" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 12\n", + "#Calculating mass flow of steam in tank\n", + "\n", + "V1=0.4 #initial volume fo tank in m^3\n", + "v1=0.5243 #initial specific volume in m^3/kg\n", + "h1=3040.4 #initial specific enthalpy in kJ/kg\n", + "u1=2548.9 #initial specific internal energy in kJ/kg\n", + "m1=V1/v1 #initial mass of steam in tank in kg\n", + "V2=0.4 #final volume in m^3\n", + "print\"let x=V*(h1-u2)/v2-m1*(h1-u1).If we assume T2=300C, then v2=0.1823m^3/kg ,u2=2785.2kJ/kg and x=+ve.If we assume T2=350C,then v2=0.2003 m^3/kg, u2=2869.1kJ/kg and x=-ve.Hence,actualt T2 must be between these two assumed values in order that x=0.By interplotation\" \n", + "T2=342 #final temperature in Celsius\n", + "v2=0.1974 #final specific volume in m^3/kg\n", + "m2=V2/v2 #final mass of the steam in the tank in kg\n", + "m=m2-m1 #mass of steam that flowsinto the tank\n", + "print\" \\n Hence,mass of the steam that flows into the tank is\",round(m,3),\"kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "let x=V*(h1-u2)/v2-m1*(h1-u1).If we assume T2=300C, then v2=0.1823m^3/kg ,u2=2785.2kJ/kg and x=+ve.If we assume T2=350C,then v2=0.2003 m^3/kg, u2=2869.1kJ/kg and x=-ve.Hence,actualt T2 must be between these two assumed values in order that x=0.By interplotation\n", + " \n", + " Hence,mass of the steam that flows into the tank is 1.263 kg\n" + ] + } + ], + "prompt_number": 48 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.13:pg-207" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 13\n", + "#Calculating mass flow of steam in tank\n", + "\n", + "vf1=0.001725 #in m^3/kg\n", + "vf2=0.0016 #in m^3/kg\n", + "uf1=368.7 #in kJ/kg\n", + "uf2=226 #in kJ/kg\n", + "vg1=0.08313 #in m^3/kg\n", + "vfg2=0.20381\n", + "ug1=1341 #in kJ/kg\n", + "ufg2=1099.7 #in kJ/kg\n", + "Vf=1 #initial volume of liquid in m^3\n", + "Vg=1 #initial volume of vapor in m^3\n", + "mf1=Vf/vf1 #initial mass of liquid in kg\n", + "mg1=Vg/vg1 #initial mass of vapor in kg\n", + "m1=mf1+mg1 #initial mass of liquid in kg\n", + "he=1461.1 #in kJ/kg\n", + "V=2 #volume of tank in m^3\n", + "print\"m1u1=mf1*uf1+mg1*ug1.If x2 is the quality,then m2=V/v2=2/(0.00160+0.20381*x2) and u2=uf2+x2*ufg2=226.0+1099.7*x2.\"\n", + "print\"Also,m2*(he-u2)=m1*he-m1u1.From this equation,we will get an equation for x2.\"\n", + "x2=((2*1461.1)-(2*226)-(0.00160*634706))/((634706*0.20381)+(2*1099.7)) #quality of ammonia\n", + "v2=0.00160+(0.20381*x2) #final specific volume in m^3/kg\n", + "m2=V/v2 #final mass of ammonia in kg\n", + "m=m1-m2 #mass of ammonia withdrawn\n", + "print\" \\n Hence,mass of ammonia withdrawn is\",round(m,1),\"kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "m1u1=mf1*uf1+mg1*ug1.If x2 is the quality,then m2=V/v2=2/(0.00160+0.20381*x2) and u2=uf2+x2*ufg2=226.0+1099.7*x2.\n", + "Also,m2*(he-u2)=m1*he-m1u1.From this equation,we will get an equation for x2.\n", + " \n", + " Hence,mass of ammonia withdrawn is 72.7 kg\n" + ] + } + ], + "prompt_number": 50 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex6.13E:pg-209" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 13E\n", + "#Calculating mass flow of steam in tank\n", + "\n", + "vf1=0.02747#in ft3/lbm\n", + "vf2=0.02564#in ft3/lbm\n", + "uf1=153.89#in Btu/lbm\n", + "uf2=97.16#in Btu/lbm\n", + "vg1=1.4168 #in ft^3/lbm\n", + "vfg2=3.2647#in ft^3/lbm\n", + "ug1=576.23#in Btu/lbm\n", + "ufg2=472.78#in Btu/lbm\n", + "Vf=25 #initial volume of liquid in ft^3\n", + "Vg=25 #initial volume of vapor in ft^3\n", + "mf1=Vf/vf1 #initial mass of liquid in lbm\n", + "mg1=Vg/vg1 #initial mass of vapor in lbm\n", + "m1=mf1+mg1 #initial mass of liquid in lbm\n", + "he=628 #in Btu/lbm\n", + "V=50 #volume of tank in ft^3\n", + "print\"m1u1=mf1*uf1+mg1*ug1.If x2 is the quality,then m2=V/v2=2/(0.02564+3.2647*x2) and u2=uf2+x2*ufg2=97.16+3.2647*x2.\"\n", + "print\"Also,m2*(he-u2)=m1*he-m1u1.From this equation,we will get an equation for x2.\"\n", + "x2=((50*628)-(50*97.16)-(432391*0.02564))/((432391*3.2647)+(50*472.98)) #quality of ammonia\n", + "x2=round(x2,6)\n", + "v2=0.02564+(3.2647*x2) #final specific volume in ft^3/lbm\n", + "v2=round(v2,6)\n", + "m2=V/v2 #final mass of ammonia in lbm\n", + "m=m1-m2 #mass of ammonia withdrawn\n", + "print\" \\n Hence,mass of ammonia withdrawn is\",round(m,1),\"lbm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "m1u1=mf1*uf1+mg1*ug1.If x2 is the quality,then m2=V/v2=2/(0.02564+3.2647*x2) and u2=uf2+x2*ufg2=97.16+3.2647*x2.\n", + "Also,m2*(he-u2)=m1*he-m1u1.From this equation,we will get an equation for x2.\n", + " \n", + " Hence,mass of ammonia withdrawn is 105.3 lbm\n" + ] + } + ], + "prompt_number": 27 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter7.ipynb b/Fundamentals_Of_Thermodynamics/Chapter7.ipynb new file mode 100755 index 00000000..8b49a808 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter7.ipynb @@ -0,0 +1,188 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:eaab49a206212133280afcf75d94d2c8dc077f30ee178c5c537c49bf39ade08a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter7:THE SECOND LAW OF THERMODYNAMICS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7.1:pg-241" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#rate of fuel consumption\n", + "\n", + "W=136*0.7355 #output of automobile engine in kW\n", + "neng=0.3 #thermal efficiency of automobile engine\n", + "Qh=W/neng #energy output of fuel in kW\n", + "Q1=Qh-W #total rate of energy rejected to the ambient\n", + "qh=35000.0 #energy output of fuel in kJ/kg\n", + "m=Qh/qh #rate of fuel consumption in kg/s\n", + "print\"\\n hence,total rate of energy rejected is\",round(Q1),\"kW\" \n", + "print\"\\n and rate of fuel consumption is\",round(m,4),\"kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,total rate of energy rejected is 233.0 kW\n", + "\n", + " and rate of fuel consumption is 0.0095 kg/s\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7.2:pg-243" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#coefficient of performance of refrigerator\n", + "\n", + "Qh=400 #heat rejected to kitchen air in W\n", + "W=150.0 #electrical input power in W\n", + "Q1=Qh-W #rate of energy taken out to cold space in W\n", + "B=Ql/W #coefficicent of performnace of refrigerator\n", + "print\"\\n hence,rate of energy taken out of the cold space is\",round(Q1),\"W\"\n", + "print\"\\n and coefficient of performance of the refrigerator is\",round(B,2)," + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,rate of energy taken out of the cold space is 250.0 W\n", + "\n", + " and coefficient of performance of the refrigerator is 1.67\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7.4:pg-260" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#comparison of ideal carnot heat engine with actual heat engine\n", + "\n", + "Qh=1000.0 #rate of heat transfer to heat engine in kW\n", + "W=450.0 #rate of production of work in kW\n", + "Ql=Qh-W #rate of heat rejected by heat engine in kW\n", + "nthermal=W/Qh #efficiency from the definition of efficiency\n", + "Tl=300 #temperature of surroundings in K\n", + "Th=550.0 #temperature of heat source in Celsius\n", + "ncarnot=1-Tl/(Th+273.15) #efficiency if heat engine is considered to be ideal carnot heat engine\n", + "W2=ncarnot*Qh #rate of work production if heat engine is assumed to be ideal carnot heat engine in kW\n", + "Q12=Qh-W2 #rate of heat rejected by heat engine in kW if heat engine is assumed to be ideal carnot heat engine\n", + "print\"\\n hence,energy discarded to the ambient surroundings iS\",round(Q12,4),\"kw\"\n", + "print\"\\n and the engine efficiency is\",round(ncarnot,4)," + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,energy discarded to the ambient surroundings iS 364.4536 kw\n", + "\n", + " and the engine efficiency is 0.6355\n" + ] + } + ], + "prompt_number": 53 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7.5:pg-261" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#calculating required work\n", + "\n", + "Tl=24+273.15 #room temperature in Kelvins\n", + "Th=35+273.15 #atmospheric temperature in Kelvins\n", + "Ql=4 #rate of heat rejection from room\n", + "B=Tl/(Th-Tl) #coefficient of performance of air conditioner\n", + "W=Ql/B #required work in kW\n", + "print\"\\n hence,the magnitude of reqiured work is\",round(W,2),\"kw\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the magnitude of reqiured work is 0.15 kw\n" + ] + } + ], + "prompt_number": 40 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter7_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter7_6.ipynb new file mode 100755 index 00000000..02425dea --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter7_6.ipynb @@ -0,0 +1,217 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:a60a19bd48510a099eb4483e5176d858019753b734df1f9001e5af0e3bc7fc2e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter7:THE SECOND LAW OF THERMODYNAMICS" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7.1:pg-241" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#rate of fuel consumption\n", + "\n", + "W=136*0.7355 #output of automobile engine in kW\n", + "neng=0.3 #thermal efficiency of automobile engine\n", + "Qh=W/neng #energy output of fuel in kW\n", + "Q1=Qh-W #total rate of energy rejected to the ambient\n", + "qh=35000.0 #energy output of fuel in kJ/kg\n", + "m=Qh/qh #rate of fuel consumption in kg/s\n", + "print\"\\n hence,total rate of energy rejected is\",round(Q1),\"kW\" \n", + "print\"\\n and rate of fuel consumption is\",round(m,4),\"kg/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,total rate of energy rejected is 233.0 kW\n", + "\n", + " and rate of fuel consumption is 0.0095 kg/s\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7.2:pg-243" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#coefficient of performance of refrigerator\n", + "\n", + "Qh=400 #heat rejected to kitchen air in W\n", + "W=150.0 #electrical input power in W\n", + "Q1=Qh-W #rate of energy taken out to cold space in W\n", + "B=Ql/W #coefficicent of performnace of refrigerator\n", + "print\"\\n hence,rate of energy taken out of the cold space is\",round(Q1),\"W\"\n", + "print\"\\n and coefficient of performance of the refrigerator is\",round(B,2)," + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,rate of energy taken out of the cold space is 250.0 W\n", + "\n", + " and coefficient of performance of the refrigerator is 1.67\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7.3:pg-256" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "# temperature at which the pressure go to zero\n", + "\n", + "P1=110.9#pressur at the ice point in kPa\n", + "P2=151.5#pressure at the steam point in kPa\n", + "T1=0#in C\n", + "T2=100#in C\n", + "S=(P2-P1)/(T2-T1)#slope in kPa/C\n", + "T=T1-(P1/S)# absolute ideal gas temperature in C\n", + "print\"\\n hence,the absolute ideal gas temperature is\",round(T,2),\"C\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the absolute ideal gas temperature is -273.15 C\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7.4:pg-260" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#comparison of ideal carnot heat engine with actual heat engine\n", + "\n", + "Qh=1000.0 #rate of heat transfer to heat engine in kW\n", + "W=450.0 #rate of production of work in kW\n", + "Ql=Qh-W #rate of heat rejected by heat engine in kW\n", + "nthermal=W/Qh #efficiency from the definition of efficiency\n", + "Tl=300 #temperature of surroundings in K\n", + "Th=550.0 #temperature of heat source in Celsius\n", + "ncarnot=1-Tl/(Th+273.15) #efficiency if heat engine is considered to be ideal carnot heat engine\n", + "W2=ncarnot*Qh #rate of work production if heat engine is assumed to be ideal carnot heat engine in kW\n", + "Q12=Qh-W2 #rate of heat rejected by heat engine in kW if heat engine is assumed to be ideal carnot heat engine\n", + "print\"\\n hence,energy discarded to the ambient surroundings iS\",round(Q12,4),\"kw\"\n", + "print\"\\n and the engine efficiency is\",round(ncarnot,4)," + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,energy discarded to the ambient surroundings iS 364.4536 kw\n", + "\n", + " and the engine efficiency is 0.6355\n" + ] + } + ], + "prompt_number": 53 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex7.5:pg-261" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#calculating required work\n", + "\n", + "Tl=24+273.15 #room temperature in Kelvins\n", + "Th=35+273.15 #atmospheric temperature in Kelvins\n", + "Ql=4 #rate of heat rejection from room\n", + "B=Tl/(Th-Tl) #coefficient of performance of air conditioner\n", + "W=Ql/B #required work in kW\n", + "print\"\\n hence,the magnitude of reqiured work is\",round(W,2),\"kw\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the magnitude of reqiured work is 0.15 kw\n" + ] + } + ], + "prompt_number": 40 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter8.ipynb b/Fundamentals_Of_Thermodynamics/Chapter8.ipynb new file mode 100755 index 00000000..b1b6e75a --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter8.ipynb @@ -0,0 +1,452 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:e95f45030ec153dab9aa085b0a83755a3b429532b4c58448d37853e1ca968b64" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter8:ENTROPY" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.1:pg-290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#coefficient of performance of refrigerator\n", + "\n", + "Th=60 #temperature at which heat is rejected from R-134a\n", + "Tl=0 #temperature at which heat is absorbed into the R-134a \n", + "s1=1.7262 #specific entropy at 0 Celsius\n", + "s2=s1 #process of state change from 1-2 is isentropic \n", + "s3=1.2857 #specific entropy at 60 celsius\n", + "s4=s3 #process of state change from 3-4 is isentropic\n", + "print\"if Pressure is 1400 kPa,then s=1.7360 kJ/kg-K and if P=1600 kPa,then s=1.7135 kJ/kg-K.Therefore\"\n", + "P2=1400+(1600-1400)*(1.7262-1.736)/(1.7135-1.736) #pressure after compression in kPa\n", + "B=(Th+273.15)/(Th-Tl) #coefficient of performance of refrigerator\n", + "print\" \\n hence,pressure after compression is \",round(P2,1),\"kPa\"\n", + "print\"\\n and coefficient of performance of refrigerator is\",round(B,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "if Pressure is 1400 kPa,then s=1.7360 kJ/kg-K and if P=1600 kPa,then s=1.7135 kJ/kg-K.Therefore\n", + " \n", + " hence,pressure after compression is 1487.1 kPa\n", + "\n", + " and coefficient of performance of refrigerator is 5.55\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.2:pg-290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2 \n", + "#heat transfer in a given process\n", + "\n", + "u1=87.94 #specific internal energy of R-12 at state 1 in kJ/kg\n", + "u2=276.44 #specific internal energy of R-12 at state 2 in kJ/kg\n", + "s1=0.3357 #specific entropy at state 1 in kJ/kg-K\n", + "s2=1.2108 #specific entropy at state 2 in kJ/kg-K\n", + "V=0.001 #volume of saturated liquid in m^3\n", + "v1=0.000923 #specific volume in m^3/kg\n", + "m=V/v1 #mass of saturated liquid in kg\n", + "T=20 #temperature of liquid in celsius\n", + "Q12=m*(T+273.15)*(s2-s1) #heat transfer in kJ to accomplish the process\n", + "W12=m*(u1-u2)+Q12 #work required to accomplish the process\n", + "print\" \\n hence,work required to accomplish the process is\",round(W12,1),\"KJ\"\n", + "print\" \\n and heat transfer is\",round(Q12,1),\"KJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,work required to accomplish the process is 73.7 KJ\n", + " \n", + " and heat transfer is 277.9 KJ\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.3:pg-293" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#entropy change\n", + "import math\n", + "C=4.184 # specific heat of water in kJ/kg-K\n", + "T1=20 #initial temperature of water in celsius\n", + "T2=90 #final temperature of water in celsius\n", + "dS1=C*math.log((T2+273.2)/(T1+273.2)) #change in entropy in kJ/kg-K\n", + "dS2=1.1925-0.2966 #in kJ/kg-K using steam tables\n", + "print\"\\n hence,change in entropy assuming constant specific heat is\",round(dS1,4),\"KJ/kg-k\" \n", + "print\"\\n using steam table is\",round(dS2,4),\"KJ/kg-k\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,change in entropy assuming constant specific heat is 0.8958 KJ/kg-k\n", + "\n", + " using steam table is 0.8959 KJ/kg-k\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.4:pg-295" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#entropy change with different assumptions\n", + "import math\n", + "T1=300 #initial temperature in kelvins\n", + "T2=1500 #final temperature in kelvins\n", + "P1=200.0 #initial pressure in kPa\n", + "P2=150.0 #final pressure in kPa\n", + "R=0.2598 # in kJ/kg-K\n", + "Cp=0.922 #specific heat in kJ/kg-K at constant pressure\n", + "dsT2=8.0649 #in kJ/kg-K\n", + "dsT1=6.4168 #in kJ/kg-K\n", + "dS1=dsT2-dsT1-R*math.log(P2/P1) #entropy change calculated using ideal gas tables\n", + "dS3=Cp*math.log(T2/T1)-R*math.log(P2/P1) #entropy change assuming constant specific heat in kJ/kg-K\n", + "dS4=1.0767*math.log(T2/T1)+0.0747 #entropy change assuming specific heat is constant at its value at 990K\n", + "print\"\\n hence,change in entropy using ideal gas tables is\",round(dS1,4),\"KJ/kg-k\"\n", + "print\"\\n hence,change in entropy using the value of specific heat at 300K is\",round(dS3,4),\"KJ/kg-k\"\n", + "print\"\\n hence,change in entropy assuming specific heat is constant at its value at 900K is \",round(dS4,4),\"KJ/kg-k\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,change in entropy using ideal gas tables is 1.7228 KJ/kg-k\n", + "\n", + " hence,change in entropy using the value of specific heat at 300K is 1.5586 KJ/kg-k\n", + "\n", + " hence,change in entropy assuming specific heat is constant at its value at 900K is 1.8076 KJ/kg-k\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.5:pg-296\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#entropy change\n", + "import math\n", + "Cp=1.004 #specific heat at constant pressure in kJ/kg-K\n", + "R=0.287 #gas constant in kJ/kg-K\n", + "P1=400.0 #initial pressure in kPa\n", + "P2=300.0 #final pressure in kPa\n", + "T1=300 #initial temperature in K\n", + "T2=600 #final temperature in K\n", + "dS1=Cp*math.log(T2/T1)-R*math.log(P2/P1) #entropy change assuming constant specific heat\n", + "s1=6.8693 #specific entropy at T1\n", + "s2=7.5764 #specific entropy at T2\n", + "dS2=s2-s1-R*math.log(P2/P1) #entropy change assuming variable specific heat\n", + "print\"\\n hence,entropy change assuming constant specific heat is\",round(dS1,4),\"KJ/kg-k\" \n", + "print\"\\n and assuming variable specific heat is\",round(dS2,4),\"KJ/kg-k\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,entropy change assuming constant specific heat is 0.7785 KJ/kg-k\n", + "\n", + " and assuming variable specific heat is 0.7897 KJ/kg-k\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.6:pg-297" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#work done by air\n", + "import math\n", + "T1=600 #initial temperature of air in K\n", + "P1=400.0 #intial pressure of air in kPa\n", + "P2=150.0 #final pressure in kPa\n", + "u1=435.10 #specific internal energy at temperature T1 in kJ/kg\n", + "sT1=7.5764 #specific entropy at temperature T1 in kJ/kg-K\n", + "R=0.287 #gas constant in kJ/kg-K\n", + "ds=0\n", + "sT2=ds+sT1+R*math.log(P2/P1) #specific entropy at temperature T2 in kJ/kg-K\n", + "print\"we know the values of s and P for state 2.So,in order to fully determine the state,we will use steam table\"\n", + "T2=457 #final temperature in K\n", + "u2=328.14 #specific internal energy at temperature T2 in kJ/kg\n", + "w=u1-u2 #work done by air in kJ/kg\n", + "print\"\\n hence,work done by air is\",round(w,4),\"KJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "we know the values of s and P for state 2.So,in order to fully determine the state,we will use steam table\n", + "\n", + " hence,work done by air is 106.96 KJ/kg\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.7:pg-300" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#work and heat transfer\n", + "\n", + "P2=500 #final pressure in cylinder in kPa\n", + "P1=100 #initial pressure in cylinder in kPa\n", + "T1=20+273.2 #initial temperature inside cylinder in Kelvins\n", + "n=1.3 \n", + "T2=(T1)*(P2/P1)**((n-1)/n) #final temperature inside cylinder in K\n", + "R=0.2968 #gas constant in kJ/kg-K\n", + "w12=R*(T2-T1)/(1-n) #work in kJ/kg\n", + "Cvo=0.745 #specific heat at constant volume in kJ/kg-K\n", + "q12=Cvo*(T2-T1)+w12 #heat transfer in kJ/kg\n", + "print\" \\n hence,work done is\",round(w12,2),\"KJ/kg\" \n", + "print\"\\n and heat transfer are\",round(q12,1),\"KJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,work done is -130.47 KJ/kg\n", + "\n", + " and heat transfer are -32.2 KJ/kg\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.8:pg-308" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#calculating increase in entropy\n", + "\n", + "m=1 #mass of saturated water vapour\n", + "sfg=6.0480 #in kJ/K\n", + "T=25 #temperature of surrounding air in celsius\n", + "dScm=-m*sfg #change in entropy of control mass in kJ/K\n", + "hfg=2257.0 #in kJ/kg\n", + "Qtosurroundings=m*hfg #heat transferred to surroundings in kJ\n", + "dSsurroundings=Qtosurroundings/(T+273.15) #in kJ/K\n", + "dSnet=dScm+dSsurroundings #net increase in entropy in kJ/K\n", + "print\" hence,net increase in entropy of water plus surroundings is \",round(dSnet,3),\"KJ/k\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " hence,net increase in entropy of water plus surroundings is 1.522 KJ/k\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.9:pg-309" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#entropy generation\n", + "\n", + "Qout=1.0 #value of heat flux generated by 1kW of electric power\n", + "T=600.0 #temperature of hot wire surface in K\n", + "Sgen=Qout/T #entropy generation in kW/K\n", + "print\"\\n hence,entropy generation is\",round(Sgen,5),\"KW/k\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,entropy generation is 0.00167 KW/k\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.10:pg-310" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#Determiining the entropy generated\n", + "\n", + "B=4.0#COP of air conditioner\n", + "W=10.0 #power input of air conditioner in kW\n", + "Qh=B*W #in kW\n", + "Ql=Qh-W #in kW\n", + "Thigh=323 #in Kelvin\n", + "Tlow=263 #in Kelvin\n", + "SgenHP=(Qh*1000/Thigh)-(Ql*1000/Tlow) #in W/K\n", + "Tl=281 # in K\n", + "Th=294 #in K\n", + "SgenCV1=Ql*1000/Tlow-Ql*1000/Tl #in W/K\n", + "SgenCV2=Qh*1000/Th-Qh*1000/Thigh #in W/K\n", + "SgenTOT=SgenCV1+SgenCV2+SgenHP #in W/K\n", + "print\" \\n Hence,Total entropy generated is\",round(SgenTOT,1),\"W/k\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " Hence,Total entropy generated is 29.3 W/k\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter8_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter8_6.ipynb new file mode 100755 index 00000000..dce4d1fa --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter8_6.ipynb @@ -0,0 +1,444 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:79711d3b5ce866eb594601c655e2c85bdace3e8f861ba88d25f2b6f7e8d8655f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter8:ENTROPY" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.1:pg-290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#coefficient of performance of refrigerator\n", + "\n", + "Th=60 #temperature at which heat is rejected from R-134a\n", + "Tl=0 #temperature at which heat is absorbed into the R-134a \n", + "s1=1.7262 #specific entropy at 0 Celsius\n", + "s2=s1 #process of state change from 1-2 is isentropic \n", + "s3=1.2857 #specific entropy at 60 celsius\n", + "s4=s3 #process of state change from 3-4 is isentropic\n", + "print\"if Pressure is 1400 kPa,then s=1.7360 kJ/kg-K and if P=1600 kPa,then s=1.7135 kJ/kg-K.Therefore\"\n", + "P2=1400+(1600-1400)*(1.7262-1.736)/(1.7135-1.736) #pressure after compression in kPa\n", + "B=(Th+273.15)/(Th-Tl) #coefficient of performance of refrigerator\n", + "print\" \\n hence,pressure after compression is \",round(P2,1),\"kPa\"\n", + "print\"\\n and coefficient of performance of refrigerator is\",round(B,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "if Pressure is 1400 kPa,then s=1.7360 kJ/kg-K and if P=1600 kPa,then s=1.7135 kJ/kg-K.Therefore\n", + " \n", + " hence,pressure after compression is 1487.1 kPa\n", + "\n", + " and coefficient of performance of refrigerator is 5.55\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.2:pg-290" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2 \n", + "#heat transfer in a given process\n", + "\n", + "u1=87.94 #specific internal energy of R-12 at state 1 in kJ/kg\n", + "u2=276.44 #specific internal energy of R-12 at state 2 in kJ/kg\n", + "s1=0.3357 #specific entropy at state 1 in kJ/kg-K\n", + "s2=1.2108 #specific entropy at state 2 in kJ/kg-K\n", + "V=0.001 #volume of saturated liquid in m^3\n", + "v1=0.000923 #specific volume in m^3/kg\n", + "m=V/v1 #mass of saturated liquid in kg\n", + "T=20 #temperature of liquid in celsius\n", + "Q12=m*(T+273.15)*(s2-s1) #heat transfer in kJ to accomplish the process\n", + "W12=m*(u1-u2)+Q12 #work required to accomplish the process\n", + "print\" \\n hence,work required to accomplish the process is\",round(W12,1),\"KJ\"\n", + "print\" \\n and heat transfer is\",round(Q12,1),\"KJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,work required to accomplish the process is 73.7 KJ\n", + " \n", + " and heat transfer is 277.9 KJ\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.3:pg-293" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#entropy change\n", + "import math\n", + "C=4.184 # specific heat of water in kJ/kg-K\n", + "T1=20 #initial temperature of water in celsius\n", + "T2=90 #final temperature of water in celsius\n", + "dS1=C*math.log((T2+273.2)/(T1+273.2)) #change in entropy in kJ/kg-K\n", + "dS2=1.1925-0.2966 #in kJ/kg-K using steam tables\n", + "print\"\\n hence,change in entropy assuming constant specific heat is\",round(dS1,4),\"KJ/kg-k\" \n", + "print\"\\n using steam table is\",round(dS2,4),\"KJ/kg-k\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,change in entropy assuming constant specific heat is 0.8958 KJ/kg-k\n", + "\n", + " using steam table is 0.8959 KJ/kg-k\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.4:pg-295" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#entropy change with different assumptions\n", + "import math\n", + "T1=300 #initial temperature in kelvins\n", + "T2=1500 #final temperature in kelvins\n", + "P1=200.0 #initial pressure in kPa\n", + "P2=150.0 #final pressure in kPa\n", + "R=0.2598 # in kJ/kg-K\n", + "Cp=0.922 #specific heat in kJ/kg-K at constant pressure\n", + "dsT2=8.0649 #in kJ/kg-K\n", + "dsT1=6.4168 #in kJ/kg-K\n", + "dS1=dsT2-dsT1-R*math.log(P2/P1) #entropy change calculated using ideal gas tables\n", + "dS3=Cp*math.log(T2/T1)-R*math.log(P2/P1) #entropy change assuming constant specific heat in kJ/kg-K\n", + "dS4=1.0767*math.log(T2/T1)+0.0747 #entropy change assuming specific heat is constant at its value at 990K\n", + "print\"\\n hence,change in entropy using ideal gas tables is\",round(dS1,4),\"KJ/kg-k\"\n", + "print\"\\n hence,change in entropy using the value of specific heat at 300K is\",round(dS3,4),\"KJ/kg-k\"\n", + "print\"\\n hence,change in entropy assuming specific heat is constant at its value at 900K is \",round(dS4,4),\"KJ/kg-k\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,change in entropy using ideal gas tables is 1.7228 KJ/kg-k\n", + "\n", + " hence,change in entropy using the value of specific heat at 300K is 1.5586 KJ/kg-k\n", + "\n", + " hence,change in entropy assuming specific heat is constant at its value at 900K is 1.8076 KJ/kg-k\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.5:pg-296\n" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#entropy change\n", + "import math\n", + "Cp=1.004 #specific heat at constant pressure in kJ/kg-K\n", + "R=0.287 #gas constant in kJ/kg-K\n", + "P1=400.0 #initial pressure in kPa\n", + "P2=300.0 #final pressure in kPa\n", + "T1=300 #initial temperature in K\n", + "T2=600 #final temperature in K\n", + "dS1=Cp*math.log(T2/T1)-R*math.log(P2/P1) #entropy change assuming constant specific heat\n", + "s1=6.8693 #specific entropy at T1\n", + "s2=7.5764 #specific entropy at T2\n", + "dS2=s2-s1-R*math.log(P2/P1) #entropy change assuming variable specific heat\n", + "print\"\\n hence,entropy change assuming constant specific heat is\",round(dS1,4),\"KJ/kg-k\" \n", + "print\"\\n and assuming variable specific heat is\",round(dS2,4),\"KJ/kg-k\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,entropy change assuming constant specific heat is 0.7785 KJ/kg-k\n", + "\n", + " and assuming variable specific heat is 0.7897 KJ/kg-k\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.6:pg-297" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#work done by air\n", + "import math\n", + "T1=600 #initial temperature of air in K\n", + "P1=400.0 #intial pressure of air in kPa\n", + "P2=150.0 #final pressure in kPa\n", + "u1=435.10 #specific internal energy at temperature T1 in kJ/kg\n", + "sT1=7.5764 #specific entropy at temperature T1 in kJ/kg-K\n", + "R=0.287 #gas constant in kJ/kg-K\n", + "ds=0\n", + "sT2=ds+sT1+R*math.log(P2/P1) #specific entropy at temperature T2 in kJ/kg-K\n", + "print\"we know the values of s and P for state 2.So,in order to fully determine the state,we will use steam table\"\n", + "T2=457 #final temperature in K\n", + "u2=328.14 #specific internal energy at temperature T2 in kJ/kg\n", + "w=u1-u2 #work done by air in kJ/kg\n", + "print\"\\n hence,work done by air is\",round(w,4),\"KJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "we know the values of s and P for state 2.So,in order to fully determine the state,we will use steam table\n", + "\n", + " hence,work done by air is 106.96 KJ/kg\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.7:pg-300" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#work and heat transfer\n", + "\n", + "P2=500 #final pressure in cylinder in kPa\n", + "P1=100 #initial pressure in cylinder in kPa\n", + "T1=20+273.2 #initial temperature inside cylinder in Kelvins\n", + "n=1.3 \n", + "T2=(T1)*(P2/P1)**((n-1)/n) #final temperature inside cylinder in K\n", + "R=0.2968 #gas constant in kJ/kg-K\n", + "w12=R*(T2-T1)/(1-n) #work in kJ/kg\n", + "Cvo=0.745 #specific heat at constant volume in kJ/kg-K\n", + "q12=Cvo*(T2-T1)+w12 #heat transfer in kJ/kg\n", + "print\" \\n hence,work done is\",round(w12,2),\"KJ/kg\" \n", + "print\"\\n and heat transfer are\",round(q12,1),\"KJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " hence,work done is -130.47 KJ/kg\n", + "\n", + " and heat transfer are -32.2 KJ/kg\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.8:pg-308" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#calculating increase in entropy\n", + "\n", + "m=1 #mass of saturated water vapour\n", + "sfg=6.0480 #in kJ/K\n", + "T=25 #temperature of surrounding air in celsius\n", + "dScm=-m*sfg #change in entropy of control mass in kJ/K\n", + "hfg=2257.0 #in kJ/kg\n", + "Qtosurroundings=m*hfg #heat transferred to surroundings in kJ\n", + "dSsurroundings=Qtosurroundings/(T+273.15) #in kJ/K\n", + "dSnet=dScm+dSsurroundings #net increase in entropy in kJ/K\n", + "print\" hence,net increase in entropy of water plus surroundings is \",round(dSnet,3),\"KJ/k\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " hence,net increase in entropy of water plus surroundings is 1.522 KJ/k\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.9:pg-309" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#entropy generation\n", + "\n", + "Qout=1.0 #value of heat flux generated by 1kW of electric power\n", + "T=600.0 #temperature of hot wire surface in K\n", + "Sgen=Qout/T #entropy generation in kW/K\n", + "print\"\\n hence,entropy generation is\",round(Sgen,5),\"KW/k\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,entropy generation is 0.00167 KW/k\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex8.10:pg-310" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#Determiining the entropy generated\n", + "\n", + "B=4.0#COP of air conditioner\n", + "W=10.0 #power input of air conditioner in kW\n", + "Qh=B*W #in kW\n", + "Ql=Qh-W #in kW\n", + "Thigh=323 #in Kelvin\n", + "Tlow=263 #in Kelvin\n", + "SgenHP=(Qh*1000/Thigh)-(Ql*1000/Tlow) #in W/K\n", + "Tl=281 # in K\n", + "Th=294 #in K\n", + "SgenCV1=Ql*1000/Tlow-Ql*1000/Tl #in W/K\n", + "SgenCV2=Qh*1000/Th-Qh*1000/Thigh #in W/K\n", + "SgenTOT=SgenCV1+SgenCV2+SgenHP #in W/K\n", + "print\" \\n Hence,Total entropy generated is\",round(SgenTOT,1),\"W/k\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " Hence,Total entropy generated is 29.3 W/k\n" + ] + } + ], + "prompt_number": 16 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter9.ipynb b/Fundamentals_Of_Thermodynamics/Chapter9.ipynb new file mode 100755 index 00000000..c1f858fc --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter9.ipynb @@ -0,0 +1,519 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7638f00c0629ff24b9e3c96e6eb43a103a0583de57d4e01375fbb8aa638bef10" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter9:SECOND-LAW ANALYSIS FOR A CONTROL VOLUME" + ] + }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ex9.1:pg-336" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#work done by steam\n", + "\n", + "hi=3051.2 #initial specific heat of enthalpy of steam in kJ/kg\n", + "si=7.1228 #initial specific entropy of steam in kJ/kg-K\n", + "Pe=0.15 #final pressure in MPa\n", + "se=si #specific entropy in final state in kJ/kg-K\n", + "sf=1.4335 #in kJ/kg-K\n", + "sfg=5.7897 #in kJ/kg-K\n", + "vi=50.0 #velocity with which steam enters turbine in m/s\n", + "ve=200.0 #velocity with which steam leaves the turbine in m/s\n", + "xe=(se-sf)/sfg #quality of steam in final state\n", + "hf=467.1 #in kJ/kg\n", + "hfg=2226.5 #in kJ/kg\n", + "he=hf+xe*hfg #final specific heat of enthalpy of steam in kJ/kg\n", + "w=hi+vi**2/(2*1000)-he-ve**2/(2*1000) #work of steam for isentropic process in kJ/kg\n", + "print\"\\n hence, work per kilogram of steam for this isentropic process is\",round(w,1),\"KJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, work per kilogram of steam for this isentropic process is 377.5 KJ/kg\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.2:pg-337" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#exit velocity of steam from nozzle\n", + "\n", + "hi=3051.2 #initial specific heat of enthalpy in kJ/kg\n", + "si=7.1228 #initial specific entropy in kJ/kg-K\n", + "se=si #final specific entropy \n", + "Pe=0.3 #final pressure in MPa\n", + "print\"from steam table,various properties at final state are\"\n", + "he=2780.2 #final specific heat of enthalpy in kJ/kg-K\n", + "Te=159.1 #final temperature in celsius\n", + "vi=30.0 #velocity with which steam enters the nozzle in m/s\n", + "ve=((2*(hi-he)+(vi**2/1000))*1000)**0.5 #final velocity of steam with which it exits in m/s\n", + "print\"\\n hence,exit velocity of the steam from the nozzle is\",round(ve),\"m/s\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "from steam table,various properties at final state are\n", + "\n", + " hence,exit velocity of the steam from the nozzle is 737.0 m/s\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.3:pg-340" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#violation of second law\n", + "\n", + "print\"from R-134a tables\"\n", + "se=1.7148 #specific entropy in final state in kJ/kg-K\n", + "si=1.7395 #initial specific entropy in kJ/kg-K \n", + "print\"therefore,se=si.The process described involves a violation of the second law and thus would be impossible.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "from R-134a tables\n", + "therefore,se=si.The process described involves a violation of the second law and thus would be impossible.\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.4:pg-340" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#calculating required specific work\n", + "\n", + "Cp=1.004 #specific heat of air at constant pressure in kJ/kg-K\n", + "Ti=290 #initial temperature in kelvins\n", + "Pi=100 #initial pressure in kPa\n", + "Pe=1000 #final pressure in kPa\n", + "k=1.4 \n", + "Te=Ti*(Pe/Pi)**((k-1)/k) #final temperature in kelvins\n", + "we=Cp*(Ti-Te) #required specific work in kJ/kg\n", + "print\"\\n hence,specific work required is\",round(we),\"kJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,specific work required is -271.0 kJ/kg\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.5:pg-342" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#entropy generation\n", + "\n", + "h1=2865.54 #specific heat of enthalpy at state 1 in kJ/kg\n", + "h2=83.94 #specific heat of enthalpy at state 2 in kJ/kg\n", + "h3=2725.3 #specific heat of enthalpy at state 3 in kJ?kg\n", + "s1=7.3115 #specific entropy at state 1 in kJ/kg-K\n", + "s2=0.2966 #specific entropy at state 2 in kJ/kg-K\n", + "s3=6.9918 #specific entropy at state 3in kJ/kg-K\n", + "m1=2 #mass flow rate at state 1 in kg/s\n", + "m2=m1*(h1-h3)/(h3-h2) #mass flow rate at state 2 in kg/s\n", + "m3=m1+m2 #mass flow rate at state 3 in kg/s\n", + "Sgen=m3*s3-m1*s1-m2*s2 #entropy generation in the process\n", + "print\"\\n hence,entropy generated in this process is \",round(Sgen,3),\"kW/K\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,entropy generated in this process is 0.072 kW/K\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.6:pg-344" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#work required to fill the tank\n", + "import math\n", + "T1=17+273 #initial temperature of tank in Kelvins\n", + "sT1=6.83521 #specific entropy in kJ/kg-K\n", + "R=0.287 #gas constant in kJ/kg-K\n", + "P1=100 #initial pressure in kPa\n", + "P2=1000 #final pressure in kPa\n", + "sT2=sT1+R*math.log(P2/P1) #specific entropy at temperature T2 in kJ/kg-K\n", + "T2=555.7 #from interplotation \n", + "V1=0.04 #volume of tank in m^3\n", + "V2=V1 #final volume is equal to initial volume\n", + "m1=P1*V1/(R*T1) #initial mass of air in tank in kg\n", + "m2=P2*V2/(R*T2) #final mass of air in tank in kg\n", + "Min=m2-m1 #in kg\n", + "u1=207.19 #initial specific heat of enthalpy in kJ/kg\n", + "u2=401.49 #final specific heat of enthalpy in kJ/kg\n", + "hin=290.43 #in kJ/kg\n", + "W12=Min*hin+m1*u1-m2*u2 #work required to fill the tank in kJ\n", + "print\"\\n hence,the total amount of work required to fill the tank is\",round(W12,1),\"kJ\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the total amount of work required to fill the tank is -31.9 kJ\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.7:pg-347" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#work required to pump water isentropically \n", + "\n", + "P1=100 #initial pressure in kPa\n", + "P2=5000 #final pressure in kPa\n", + "v=0.001004 #specific volume in m^3/kg\n", + "w=v*(P2-P1) #work required to pump water isentropically\n", + "print\"\\n hence,work required to pump water isentropically is \",round(w,2),\"kJ/kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,work required to pump water isentropically is 4.92 kJ/kg\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.8:pg-348" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#Velocity in exit flow\n", + "\n", + "print\"From Steam Tables, for liquid water at 20 C\"\n", + "vf=0.001002 #in m^3/kg\n", + "v=vf\n", + "Pi=300 #Line pressure in kPa\n", + "Po=100 #in kPa\n", + "Ve=(2*v*(Pi-Po)*1000)**0.5 #velocity in the exit flow\n", + "print\" \\n Hence, an ideal nozzle can generate upto \",round(Ve),\"m/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From Steam Tables, for liquid water at 20 C\n", + " \n", + " Hence, an ideal nozzle can generate upto 20.0 m/s\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.9:pg-351" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#Rate of Entropy Generation\n", + "\n", + "print\"From R-410a tables,we get\"\n", + "hi=280.6 #in kJ/kg\n", + "he=307.8 #in kJ/kg\n", + "si=1.0272 #in kJ/kg\n", + "se=1.0140 #in kJ/kg\n", + "m=0.08 #flow rate of refrigerant in kg/s\n", + "P=3 #electrical power input in kW\n", + "Qcv=m*(he-hi)-P #in kW\n", + "To=30 #in Celsius\n", + "Sgen=m*(se-si)-Qcv/(To+273.2) #rate of entropy generation \n", + "print\"\\n Hence,the rate of entropy generation for this process is\",round(Sgen,5),\"kW/K\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From R-410a tables,we get\n", + "\n", + " Hence,the rate of entropy generation for this process is 0.00166 kW/K\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.10:pg-353" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#turbine efficiency\n", + "\n", + "hi=3051.2 #initial specific heat of enthalpy in kJ/kg\n", + "si=7.1228 #initial specific entropy in kJ/kg-K\n", + "sf=0.7548 #in kJ/kg-K\n", + "sfg=7.2536 #in kJ/kg-K\n", + "ses=si #final specific entropy is same as the initial\n", + "xes=(si-sf)/sfg #quality of steam when it leaves the turbine\n", + "hf=225.9 #in kJ/kg\n", + "hfg=2373.1 #in kJ/kg\n", + "hes=hf+xes*hfg #final specific heat of enthalpy in kJ/kg\n", + "ws=hi-hes #work output of turbine calculated ideally in kJ/kg\n", + "wa=600 #actual work output of turbine in kJ/kg\n", + "nturbine=wa/ws #efiiciency of turbine \n", + "print\"\\n hence,efficiency of the turbine is\",round(nturbine*100,1),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,efficiency of the turbine is 80.9 %\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.11:pg-355" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 11\n", + "#turbine inlet pressure\n", + "import math\n", + "hi=1757.3 #initial specific heat of enthalpy of air in kJ/kg\n", + "si=8.6905 #initial specifc entropy of airin kJ/kg-K\n", + "he=855.3 #final specific heat of enthalpy of air in kJ/kg\n", + "w=hi-he #actual work done by turbine in kJ/kg\n", + "n=0.85 #efficiency of turbine \n", + "ws=w/n #ideal work done by turbine in kJ/kg\n", + "hes=hi-ws #from first law of isentropic process\n", + "Tes=683.7 #final temperature in kelvins from air tables\n", + "ses=7.7148 #in kJ/kg-K\n", + "R=0.287 #gas constant in kJ/kg-K\n", + "Pi=100/math.e**((si-ses)/-R) #turbine inlet pressure in kPa\n", + "print\"\\n hence,turbine inlet pressure is\",round(Pi),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,turbine inlet pressure is 2995.0 kPa\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.12:pg-357" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 12\n", + "#required work input\n", + "\n", + "Pe=150.0 #final pressure of air in kPa\n", + "Pi=100.0 #initial presure of air in kPa\n", + "k=1.4\n", + "Ti=300.0 #initial temperature of air in kelvis\n", + "Tes=Ti*(Pe/Pi)**((k-1)/k) #from second law\n", + "ws=1.004*(Ti-Tes) #from first law of isentropic process\n", + "n=0.7 #efficiency of automotive supercharger \n", + "w=ws/n #real work input in kJ/kg\n", + "Te=Ti-w/1.004 #temperature at supercharger exit in K\n", + "print\"\\n hence,required work input is \",round(w),\"kJ/kg\"\n", + "print\"\\n and exit temperature is \",round(Te,1),\"K\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,required work input is -53.0 kJ/kg\n", + "\n", + " and exit temperature is 352.6 K\n" + ] + } + ], + "prompt_number": 44 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/Chapter9_6.ipynb b/Fundamentals_Of_Thermodynamics/Chapter9_6.ipynb new file mode 100755 index 00000000..db80c9d5 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter9_6.ipynb @@ -0,0 +1,588 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:14f50faeadc2ed8de4732f59bac3e49ea9db1041eaf016b1692117fea4d3a511" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter9:SECOND-LAW ANALYSIS FOR A CONTROL VOLUME" + ] + }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ex9.1:pg-336" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#work done by steam\n", + "\n", + "hi=3051.2 #initial specific heat of enthalpy of steam in kJ/kg\n", + "si=7.1228 #initial specific entropy of steam in kJ/kg-K\n", + "Pe=0.15 #final pressure in MPa\n", + "se=si #specific entropy in final state in kJ/kg-K\n", + "sf=1.4335 #in kJ/kg-K\n", + "sfg=5.7897 #in kJ/kg-K\n", + "vi=50.0 #velocity with which steam enters turbine in m/s\n", + "ve=200.0 #velocity with which steam leaves the turbine in m/s\n", + "xe=(se-sf)/sfg #quality of steam in final state\n", + "hf=467.1 #in kJ/kg\n", + "hfg=2226.5 #in kJ/kg\n", + "he=hf+xe*hfg #final specific heat of enthalpy of steam in kJ/kg\n", + "w=hi+vi**2/(2*1000)-he-ve**2/(2*1000) #work of steam for isentropic process in kJ/kg\n", + "print\"\\n hence, work per kilogram of steam for this isentropic process is\",round(w,1),\"KJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence, work per kilogram of steam for this isentropic process is 377.5 KJ/kg\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.2:pg-337" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#exit velocity of steam from nozzle\n", + "\n", + "hi=3051.2 #initial specific heat of enthalpy in kJ/kg\n", + "si=7.1228 #initial specific entropy in kJ/kg-K\n", + "se=si #final specific entropy \n", + "Pe=0.3 #final pressure in MPa\n", + "print\"from steam table,various properties at final state are\"\n", + "he=2780.2 #final specific heat of enthalpy in kJ/kg-K\n", + "Te=159.1 #final temperature in celsius\n", + "vi=30.0 #velocity with which steam enters the nozzle in m/s\n", + "ve=((2*(hi-he)+(vi**2/1000))*1000)**0.5 #final velocity of steam with which it exits in m/s\n", + "print\"\\n hence,exit velocity of the steam from the nozzle is\",round(ve),\"m/s\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "from steam table,various properties at final state are\n", + "\n", + " hence,exit velocity of the steam from the nozzle is 737.0 m/s\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.2E:pg-339" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2E\n", + "#exit velocity of steam from nozzle\n", + "\n", + "hi=1279.1 #initial specific heat of enthalpy in Btu/lbm\n", + "si=1.7085 #initial specific entropy in Btu/lbm R\n", + "se=si #final specific entropy \n", + "Pe=40 #final pressure in lbf/in^2\n", + "he=1193.9 #final specific heat of enthalpy in Btu/lbm\n", + "Te=314.2 #final temperature in F\n", + "vi=100.0 #velocity with which steam enters the nozzle in ft/s\n", + "ve=((2*((hi-he)+(vi**2/(32.17*778)))*(32.17*778)))**0.5 #final velocity of steam with which it exits in ft/s\n", + "print\"\\n hence,exit velocity of the steam from the nozzle is\",round(ve),\"ft/s\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,exit velocity of the steam from the nozzle is 2070.0 ft/s\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.3:pg-340" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#violation of second law\n", + "\n", + "print\"from R-134a tables\"\n", + "se=1.7148 #specific entropy in final state in kJ/kg-K\n", + "si=1.7395 #initial specific entropy in kJ/kg-K \n", + "print\"therefore,se=si.The process described involves a violation of the second law and thus would be impossible.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "from R-134a tables\n", + "therefore,se=si.The process described involves a violation of the second law and thus would be impossible.\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.4:pg-340" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#calculating required specific work\n", + "\n", + "Cp=1.004 #specific heat of air at constant pressure in kJ/kg-K\n", + "Ti=290 #initial temperature in kelvins\n", + "Pi=100 #initial pressure in kPa\n", + "Pe=1000 #final pressure in kPa\n", + "k=1.4 \n", + "Te=Ti*(Pe/Pi)**((k-1)/k) #final temperature in kelvins\n", + "we=Cp*(Ti-Te) #required specific work in kJ/kg\n", + "print\"\\n hence,specific work required is\",round(we),\"kJ/kg\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,specific work required is -271.0 kJ/kg\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.4E:pg-341" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4E\n", + "#calculating required specific work\n", + "\n", + "Cp=0.24 #specific heat of air at constant pressure in Btu/lbm R\n", + "Ti=520 #initial temperature in R\n", + "Pi=14.7 #initial pressure in lbf/in^2\n", + "Pe=147 #final pressure in lbf/in^2\n", + "k=1.4 \n", + "Te=Ti*(Pe/Pi)**((k-1)/k) #final temperature in R\n", + "we=Cp*(Ti-Te) #required specific work in Btu/lbm\n", + "print\"\\n hence,specific work required is\",round(we,2),\"Btu/lbm\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,specific work required is -116.15 Btu/lbm\n" + ] + } + ], + "prompt_number": 34 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.5:pg-342" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#entropy generation\n", + "\n", + "h1=2865.54 #specific heat of enthalpy at state 1 in kJ/kg\n", + "h2=83.94 #specific heat of enthalpy at state 2 in kJ/kg\n", + "h3=2725.3 #specific heat of enthalpy at state 3 in kJ?kg\n", + "s1=7.3115 #specific entropy at state 1 in kJ/kg-K\n", + "s2=0.2966 #specific entropy at state 2 in kJ/kg-K\n", + "s3=6.9918 #specific entropy at state 3in kJ/kg-K\n", + "m1=2 #mass flow rate at state 1 in kg/s\n", + "m2=m1*(h1-h3)/(h3-h2) #mass flow rate at state 2 in kg/s\n", + "m3=m1+m2 #mass flow rate at state 3 in kg/s\n", + "Sgen=m3*s3-m1*s1-m2*s2 #entropy generation in the process\n", + "print\"\\n hence,entropy generated in this process is \",round(Sgen,3),\"kW/K\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,entropy generated in this process is 0.072 kW/K\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.6:pg-344" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#work required to fill the tank\n", + "import math\n", + "T1=17+273 #initial temperature of tank in Kelvins\n", + "sT1=6.83521 #specific entropy in kJ/kg-K\n", + "R=0.287 #gas constant in kJ/kg-K\n", + "P1=100 #initial pressure in kPa\n", + "P2=1000 #final pressure in kPa\n", + "sT2=sT1+R*math.log(P2/P1) #specific entropy at temperature T2 in kJ/kg-K\n", + "T2=555.7 #from interplotation \n", + "V1=0.04 #volume of tank in m^3\n", + "V2=V1 #final volume is equal to initial volume\n", + "m1=P1*V1/(R*T1) #initial mass of air in tank in kg\n", + "m2=P2*V2/(R*T2) #final mass of air in tank in kg\n", + "Min=m2-m1 #in kg\n", + "u1=207.19 #initial specific heat of enthalpy in kJ/kg\n", + "u2=401.49 #final specific heat of enthalpy in kJ/kg\n", + "hin=290.43 #in kJ/kg\n", + "W12=Min*hin+m1*u1-m2*u2 #work required to fill the tank in kJ\n", + "print\"\\n hence,the total amount of work required to fill the tank is\",round(W12,1),\"kJ\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,the total amount of work required to fill the tank is -31.9 kJ\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.7:pg-347" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#work required to pump water isentropically \n", + "\n", + "P1=100 #initial pressure in kPa\n", + "P2=5000 #final pressure in kPa\n", + "v=0.001004 #specific volume in m^3/kg\n", + "w=v*(P2-P1) #work required to pump water isentropically\n", + "print\"\\n hence,work required to pump water isentropically is \",round(w,2),\"kJ/kg\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,work required to pump water isentropically is 4.92 kJ/kg\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.8:pg-348" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#Velocity in exit flow\n", + "\n", + "print\"From Steam Tables, for liquid water at 20 C\"\n", + "vf=0.001002 #in m^3/kg\n", + "v=vf\n", + "Pi=300 #Line pressure in kPa\n", + "Po=100 #in kPa\n", + "Ve=(2*v*(Pi-Po)*1000)**0.5 #velocity in the exit flow\n", + "print\" \\n Hence, an ideal nozzle can generate upto \",round(Ve),\"m/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From Steam Tables, for liquid water at 20 C\n", + " \n", + " Hence, an ideal nozzle can generate upto 20.0 m/s\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.9:pg-351" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 9\n", + "#Rate of Entropy Generation\n", + "\n", + "print\"From R-410a tables,we get\"\n", + "hi=280.6 #in kJ/kg\n", + "he=307.8 #in kJ/kg\n", + "si=1.0272 #in kJ/kg\n", + "se=1.0140 #in kJ/kg\n", + "m=0.08 #flow rate of refrigerant in kg/s\n", + "P=3 #electrical power input in kW\n", + "Qcv=m*(he-hi)-P #in kW\n", + "To=30 #in Celsius\n", + "Sgen=m*(se-si)-Qcv/(To+273.2) #rate of entropy generation \n", + "print\"\\n Hence,the rate of entropy generation for this process is\",round(Sgen,5),\"kW/K\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From R-410a tables,we get\n", + "\n", + " Hence,the rate of entropy generation for this process is 0.00166 kW/K\n" + ] + } + ], + "prompt_number": 29 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.10:pg-353" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 10\n", + "#turbine efficiency\n", + "\n", + "hi=3051.2 #initial specific heat of enthalpy in kJ/kg\n", + "si=7.1228 #initial specific entropy in kJ/kg-K\n", + "sf=0.7548 #in kJ/kg-K\n", + "sfg=7.2536 #in kJ/kg-K\n", + "ses=si #final specific entropy is same as the initial\n", + "xes=(si-sf)/sfg #quality of steam when it leaves the turbine\n", + "hf=225.9 #in kJ/kg\n", + "hfg=2373.1 #in kJ/kg\n", + "hes=hf+xes*hfg #final specific heat of enthalpy in kJ/kg\n", + "ws=hi-hes #work output of turbine calculated ideally in kJ/kg\n", + "wa=600 #actual work output of turbine in kJ/kg\n", + "nturbine=wa/ws #efiiciency of turbine \n", + "print\"\\n hence,efficiency of the turbine is\",round(nturbine*100,1),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,efficiency of the turbine is 80.9 %\n" + ] + } + ], + "prompt_number": 32 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.11:pg-355" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 11\n", + "#turbine inlet pressure\n", + "import math\n", + "hi=1757.3 #initial specific heat of enthalpy of air in kJ/kg\n", + "si=8.6905 #initial specifc entropy of airin kJ/kg-K\n", + "he=855.3 #final specific heat of enthalpy of air in kJ/kg\n", + "w=hi-he #actual work done by turbine in kJ/kg\n", + "n=0.85 #efficiency of turbine \n", + "ws=w/n #ideal work done by turbine in kJ/kg\n", + "hes=hi-ws #from first law of isentropic process\n", + "Tes=683.7 #final temperature in kelvins from air tables\n", + "ses=7.7148 #in kJ/kg-K\n", + "R=0.287 #gas constant in kJ/kg-K\n", + "Pi=100/math.e**((si-ses)/-R) #turbine inlet pressure in kPa\n", + "print\"\\n hence,turbine inlet pressure is\",round(Pi),\"kPa\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,turbine inlet pressure is 2995.0 kPa\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex9.12:pg-357" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 12\n", + "#required work input\n", + "\n", + "Pe=150.0 #final pressure of air in kPa\n", + "Pi=100.0 #initial presure of air in kPa\n", + "k=1.4\n", + "Ti=300.0 #initial temperature of air in kelvis\n", + "Tes=Ti*(Pe/Pi)**((k-1)/k) #from second law\n", + "ws=1.004*(Ti-Tes) #from first law of isentropic process\n", + "n=0.7 #efficiency of automotive supercharger \n", + "w=ws/n #real work input in kJ/kg\n", + "Te=Ti-w/1.004 #temperature at supercharger exit in K\n", + "print\"\\n hence,required work input is \",round(w),\"kJ/kg\"\n", + "print\"\\n and exit temperature is \",round(Te,1),\"K\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " hence,required work input is -53.0 kJ/kg\n", + "\n", + " and exit temperature is 352.6 K\n" + ] + } + ], + "prompt_number": 44 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/README.txt b/Fundamentals_Of_Thermodynamics/README.txt new file mode 100755 index 00000000..f9822be5 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/README.txt @@ -0,0 +1,10 @@ +Contributed By: abhishek chauhan +Course: btech +College/Institute/Organization: ABES Engineering College Ghaziabad +Department/Designation: electronics & communication engg +Book Title: Fundamentals Of Thermodynamics +Author: B. Claus And R. E. Sonntag +Publisher: Wiley India Pvt. Ltd., New Delhi +Year of publication: 2010 +Isbn: 978-81-265-2152-4 +Edition: 7 \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/chapter10.ipynb b/Fundamentals_Of_Thermodynamics/chapter10.ipynb new file mode 100755 index 00000000..e985ae83 --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/chapter10.ipynb @@ -0,0 +1,474 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:498eddefb3635fb861c09bdd97718d2b72fb04f4d3b083cedbf9f6de28a92b4e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter10:IRREVERSIBILITY AND AVAILABILITY" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.1:pg-386" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 1\n", + "#Calculating reversible work\n", + "#Form the Steam Tables,the inlet and the exit state properties are \n", + "\n", + "hi=171.95 #initial specific heat of enthalpy in kJ/kg\n", + "si=0.5705 #initial specific entropy in kJ/kg-K\n", + "se=2.1341 #final specific entropy in kJ/kg-K\n", + "he=765.34 #final specific heat of enthalpy in kJ/kg-K\n", + "m=5 #mass flow rate of feedwater in kg/s\n", + "q1=900/m #heat added by one of the sources in kJ/kg\n", + "q2=he-hi-q1 #second heat transfer in kJ/kg\n", + "To=25+273.3 #Temp. of the surroundings in K\n", + "T1=100+273.2 #temp. of reservoir of one of the source in K\n", + "T2=200+273.2 #temp. of reservoir of second source in K\n", + "wrev=To*(se-si)-(he-hi)+q1*(1-To/T1)+q2*(1-To/T2) #reversible work in kJ/kg\n", + "print\"\\n Hence, the irreversibility is\",round(wrev),\"kJ/kg\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " Hence, the irreversibility is 62.0 kJ/kg\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.2:pg-387" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2\n", + "#Calculating reversible work\n", + "#Form the Steam Tables,the inlet and the exit state properties are\n", + "\n", + "hi=298.6 #initial specific heat of enthalpy in kJ/kg\n", + "si=6.8631 #initial specific entropy in kJ/kg-K\n", + "se=7.4664 #final specific entropy in kJ/kg-K\n", + "he=544.7 #final specific heat of enthalpy in kJ/kg-K\n", + "q=-50 #heat lost to surroundings in kJ/kg\n", + "w=hi-he+q #work in kJ/kg\n", + "To=25+273.2 #Temp. of the surroundings in K\n", + "P1=100 #Pressure of ambient air in kPa\n", + "P2=1000 #Final pressure of air after compression in kPa\n", + "R=0.287 #Universal gas constant in kJ/kg-K\n", + "wrev=To*(se-si-R*log(P2/P1))-(he-hi)+q*(1-To/To)#reversible work for the given change of state in kJ/kg\n", + "i=wrev-w #irreversibility in kJ/kg\n", + "print\"\\n Hence,the irreversibility is\",round(i,1),\"kJ/kg\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " Hence,the irreversibility is 32.8 kJ/kg\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.2E:pg-388" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 2E\n", + "#Calculating reversible work\n", + "#Form the Steam Tables,the inlet and the exit state properties are\n", + "\n", + "hi=129.18 #initial specific heat of enthalpy in Btu/lbm\n", + "si=1.6405 #initial specific entropy in Btu/lbm R\n", + "se=1.7803 #final specific entropy in Btu/lbm R\n", + "he=231.20 #final specific heat of enthalpy in Btu/lbm\n", + "q=-22 #heat lost to surroundings in Btu/lbm\n", + "w=hi-he+q #work in Btu/lbm\n", + "To=539.7 #Temp. of the surroundings in R\n", + "P1=14.7 #Pressure of ambient air in lbf/in^2\n", + "P2=150 #Final pressure of air after compression in lbf/in^2\n", + "R=0.06855 #Universal gas constant in Btu/lbm R\n", + "wrev=To*(se-si-R*log(P2/P1))-(he-hi)+q*(1-To/To)#reversible work for the given change of state in Btu/lbm\n", + "i=wrev-w #irreversibility in Btu/lbm\n", + "print\"\\n Hence,the irreversibility is\",round(i,2),\"Btu/lbm\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " Hence,the irreversibility is 11.52 Btu/lbm\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.3:pg-390" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 3\n", + "#Calculating reversible work and irreversibility\n", + "#Form the Steam Tables at state 1\n", + "\n", + "u1=1243.5 #initial specific internal energy in kJ/kg\n", + "s1=4.4819 #initial specific entropy in kJ/kg-K\n", + "v1=28.895 #initial specific volume in m^3/kg\n", + "v2=2*v1 #final specific volume in kg/m^3\n", + "u2=u1 #initial specific internal energy in kJ/kg\n", + "#These two independent properties, v2 and u2 , fix state 2.The final temp. is calculated by interplotation using the data for T2=5C and v2,x=0/3928 and u=948.5 kJ/kg. For T2=10C and v2, x=0.5433 and u=1317 kJ/kg\n", + "T2=9.1+273.2 #final temp. in K\n", + "x2=0.513 #quality in final state\n", + "s2=4.644 #final specific entropy in kJ/kg\n", + "V1=1 #volume of part of A in m^3\n", + "m=V1/v1 #mass flow rate in kg/s\n", + "To=20+273.2 #Room temperature in K\n", + "Wrev=To*m*(s2-s1) #reversible work in kJ\n", + "I=Wrev #irreversibility of the process\n", + "print\"\\n The irreversibility is\",round(I,3),\"kJ\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " The irreversibility is 1.645 kJ\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.4:pg-391" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 4\n", + "#calculating the final mass in the tank and the irreversibility in the process\n", + "#From the ammonia tables, the initial and line state properties are\n", + "\n", + "V=1#volume of the rigid tank in m^3\n", + "v1=0.6995#initial specific volume in m^3/kg\n", + "u1=1369.5#initial specific internal energy in kJ/kg\n", + "s1=5.927#initial specific entropy in kJ/kg K\n", + "h1=134.41#initial specific heat of enthalpy in kJ/kg\n", + "si=0.5408#in kJ/kg K\n", + "m1=V/v1#initial mass in kg\n", + "x2=0.007182\n", + "v2=(0.001534 + x2 * 0.41684)#in m^3/kg\n", + "v2=round(v2,7)\n", + "s2=0.5762#final specific entropy in kJ/kg\n", + "m2=V/v2#the final mass in kg\n", + "mi=m2-m1#in kg\n", + "mi=round(mi,3)\n", + "T=293.15# in K\n", + "S2gen=(m2*s2-m1*s1-mi*si)#in kJ/kg\n", + "S2gen=round(S2gen,3)\n", + "Icv=T*S2gen#in kJ\n", + "print\"\\n the final mass is \",round(m2,2),\"kg\"\n", + "print\"\\n the irreversiblity is\",round(Icv,3),\"kJ\"\n", + "\n", + "\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " the final mass is 220.86 kg\n", + "\n", + " the irreversiblity is 34.885 kJ\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.5:pg-396" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 5\n", + "#calculating the availability per kilogram of the steam entering and at both points at which steam leaves the turbine,\n", + "#the isentropic efficiency,the second-law efficiency for this process\n", + "#For the ideal isentropic turbine,\n", + "\n", + "h0=104.9#in kJ/kg\n", + "s0=0.3674#entropy at state0 in kJ/kgK\n", + "m1=30#mass at state1 in kg\n", + "phi1=1109.6#in kJ/kg\n", + "h1=3115.3#enthalpy at state1 in kJ/kg\n", + "m2=5#mass at state2 in kg\n", + "phi2=755.3#in kJ/kg\n", + "h2=2855.4#enthalpy at state2 For the actual turbine in kJ/kg\n", + "m3=25#mass at state3 in kg\n", + "phi3=195.0#in kJ/kg\n", + "S2s=6.7428#entropy in kJ/kg K at state2\n", + "x2s=(6.7428-1.8606)/4.906# dryness factor at state2 \n", + "x2s=round(x2s,4)\n", + "h2s=640.2+(x2s*2108.5)#entropy at state2 for the ideal isentropic turbine\n", + "S3s=6.7428#entropy in kJ/kg K\n", + "x3s=(6.7428-0.7549)/7.2536# dryness factor at state3\n", + "x3s=round(x3s,4)\n", + "h3s=225.9+(x3s*2373.1)#enthalpy in kJ/kg\n", + "h3=2361.8#enthalpy at state3 For the actual turbine in kJ/kg\n", + "Ws=(m1*h1-m2*h2s-m3*h3s)#workdone for the ideal isentropic turbine in kW\n", + "W=(m1*h1-m2*h2-m3*h3)#workdone For the actual turbine in kW\n", + "W2=(m1*phi1-m2*phi2-m3*phi3)#workdone for the second ideal isentropic turbine in kW\n", + "eta1=W/Ws#The isentropic efficiency\n", + "eta2=W/W2#he second-law efficiency\n", + "print\"\\n the workdone for the ideal isentropic turbine is \",round(Ws),\"kW\"\n", + "print\"\\n the workdone for the actual turbine is \",round(W),\"kg\"\n", + "print\"\\n the workdone for the second ideal isentropic turbine is \",round(W2),\"kW\"\n", + "print\"\\n the isentropic efficiency is \",round(eta1,3)\n", + "print\"\\n the second-law efficiency is \",round(eta2,3)\n", + "#The answer of the x2s in the book is wrong.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " the workdone for the ideal isentropic turbine is 25145.0 kW\n", + "\n", + " the workdone for the actual turbine is 20137.0 kg\n", + "\n", + " the workdone for the second ideal isentropic turbine is 24637.0 kW\n", + "\n", + " the isentropic efficiency is 0.801\n", + "\n", + " the second-law efficiency is 0.817\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.6:pg-399" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 6\n", + "#calculate the second-law efficiency for this process and the irreversibility per kilogram of water evaporated\n", + "\n", + "he1=2950#enthalpy in kJ/kg\n", + "hi1=632.2#enthalpy in kJ/kg\n", + "he2=599.5#enthalpy in kJ/kg\n", + "hi2=1199#enthalpy in kJ/kg\n", + "#r=mp/mh\n", + "r=(he1-hi1)/(hi2-he2)#the ratio of the mass flow of water\n", + "T0=298.15#in K\n", + "S1=1.8418#entropy at state1 in kJ/kgK\n", + "S2=7.0384#entropy at state2 in kJ/kgK\n", + "S3=7.8751#entropy at state3 in kJ/kgK\n", + "S4=7.3173#entropy at state4 in kJ/kgK\n", + "#phi=phi2-phi1\n", + "phi=(he1-hi1)-T0*(S2-S1)#The increase in availability of the water is, per kilogram of water in kJ/kg\n", + "#w=(mp2/mh2)*(phi3-phi4)\n", + "w=r*((hi2-he2)-T0*(S3-S4))#The decrease in availability of the products, per kilogram of water in kJ/kg\n", + "eta=phi/w#the second-law efficiency\n", + "#i=I/mh\n", + "i=phi+w#the process irreversibility per kilogram of water in kJ/kg\n", + "#e=I2/mh2\n", + "e=(T0*(S2-S1)+(T0*r*(S4-S3)))#The total irreversibility in kJ/kg\n", + "print\"\\n the second law efficiency is \",round(eta,3)\n", + "print\"\\n the total irreversibility is \",round(e,2),\"kJ/kg\"\n", + "\n", + "\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " the second law efficiency is 0.459\n", + "\n", + " the total irreversibility is 906.38 kJ/kg\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.7:pg-403" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 7\n", + "#calculate the heater\u2019s second-law efficiency\n", + "\n", + "h0=104.87#enthalpy in kJ/kg\n", + "s0=0.3673#entropy in kJ/kg K\n", + "h1=171.97#in kJ/kg\n", + "he=765.25#in kJ/kg\n", + "s1=0.5705#in kJ/kg K\n", + "T0=298.2#in C\n", + "se=2.1341#in kJ/kg K\n", + "shi1=(h1-h0)-T0*(s1-s0)#in kJ/kg\n", + "shie=(he-h0)-T0*(se-s0)#in kJ/kg\n", + "T1=373.2#in C\n", + "T2=473.2#in C\n", + "q1=180#heat at state1 in kJ\n", + "q2=413.28#heat at state2 in kJ\n", + "phisource1=(1-T0/T1)*q1#in kJ/kg\n", + "phisource2=(1-T0/T2)*q2#in kJ/kg\n", + "phisource=phisource1+phisource2#in kJ/kg\n", + "Icv=phisource+shi1-shie#in kJ/kg\n", + "eta2law=(phisource-Icv)/phisource#the heater\u2019s second-law efficiency\n", + "print\"\\n the heater\u2019s second-law efficiency is\",round(eta2law,2)\n", + "\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " the heater\u2019s second-law efficiency is 0.67\n" + ] + } + ], + "prompt_number": 53 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex10.8:pg-404" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#example 8\n", + "#calculate any heat transfer downward, and follow the flux of exergy, and find the exergy destruction in the process.\n", + "Qout=500.0#in W\n", + "Qin=500.0#in W\n", + "Tsurf=1000.0#in K\n", + "T0=298.15#in K\n", + "Sgen1=Qout/Tsurf#in W/K\n", + "phides=(T0*Sgen1)#in W\n", + "phitrans=((1-T0/Tsurf)*Qout)#in W\n", + "Ttop=500#in K\n", + "Sgen2=(Qout/Ttop)-(Qin/Tsurf)#in W/K\n", + "Te=phitrans-phides-((1-T0/Ttop)*Qout)#the exergy destruction in the process\n", + "print\"\\n the exergy destruction in the process is\",round(Te)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + " the exergy destruction in the process is 0.0\n" + ] + } + ], + "prompt_number": 77 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/Fundamentals_Of_Thermodynamics/screenshots/heat_transfer_6.png b/Fundamentals_Of_Thermodynamics/screenshots/heat_transfer_6.png new file mode 100755 index 00000000..c7a00e18 Binary files /dev/null and b/Fundamentals_Of_Thermodynamics/screenshots/heat_transfer_6.png differ diff --git a/Fundamentals_Of_Thermodynamics/screenshots/reversible_work_6.png b/Fundamentals_Of_Thermodynamics/screenshots/reversible_work_6.png new file mode 100755 index 00000000..d4cf4f76 Binary files /dev/null and b/Fundamentals_Of_Thermodynamics/screenshots/reversible_work_6.png differ diff --git a/Fundamentals_Of_Thermodynamics/screenshots/velocity_6.png b/Fundamentals_Of_Thermodynamics/screenshots/velocity_6.png new file mode 100755 index 00000000..1533cad6 Binary files /dev/null and b/Fundamentals_Of_Thermodynamics/screenshots/velocity_6.png differ -- cgit