summaryrefslogtreecommitdiff
path: root/Thermodynamics_for_Engineers/Chapter_14_4.ipynb
diff options
context:
space:
mode:
authorhardythe12015-04-07 15:58:05 +0530
committerhardythe12015-04-07 15:58:05 +0530
commitc7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131 (patch)
tree725a7d43dc1687edf95bc36d39bebc3000f1de8f /Thermodynamics_for_Engineers/Chapter_14_4.ipynb
parent62aa228e2519ac7b7f1aef53001f2f2e988a6eb1 (diff)
downloadPython-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.tar.gz
Python-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.tar.bz2
Python-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.zip
added books
Diffstat (limited to 'Thermodynamics_for_Engineers/Chapter_14_4.ipynb')
-rwxr-xr-xThermodynamics_for_Engineers/Chapter_14_4.ipynb394
1 files changed, 394 insertions, 0 deletions
diff --git a/Thermodynamics_for_Engineers/Chapter_14_4.ipynb b/Thermodynamics_for_Engineers/Chapter_14_4.ipynb
new file mode 100755
index 00000000..2bdb47a9
--- /dev/null
+++ b/Thermodynamics_for_Engineers/Chapter_14_4.ipynb
@@ -0,0 +1,394 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:57baf6d72b0852fbedefdd618b07a013f83f99bf6037a025a931e79491c28af0"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 - Energies associated with chemical reactions"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the HHV and LHV at constant volume\n",
+ "#Initalization of variables\n",
+ "lhs=8.5 #moles of reactants\n",
+ "rhs=6 #moles of CO2\n",
+ "n=3. #moles of H2O\n",
+ "R=1545. #Universal gas constant\n",
+ "R2=18.016 #molar mass of water\n",
+ "J=778. #Work conversion constant\n",
+ "T=537. #R\n",
+ "T2=1050.4 #R\n",
+ "T3=991.3 #R\n",
+ "Qhp=1417041. #Btu/mol\n",
+ "#calculations\n",
+ "Qhpv=(lhs-rhs)*R*T/J\n",
+ "Qhv=Qhp-Qhpv\n",
+ "hfg=(rhs-n)*R2*T2\n",
+ "Qlp=Qhp-hfg\n",
+ "Qlpv=(lhs-rhs-n)*R/J *T\n",
+ "Qlv=Qlp-Qlpv\n",
+ "Qhlv=(rhs-n)*R2*T3\n",
+ "Qlv3=Qhv-Qhlv\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Higher heating value at constant volume =\",Qhv,\"Btu/mol\")\n",
+ "print '%s %d %s' %(\"\\n Lower heating value at constant pressure =\",Qlp,\"Btu/mol\")\n",
+ "print '%s %d %s' %(\"\\n In case 1,Lower heating value at constant volume =\",Qlv,\" Btu/mol\")\n",
+ "print '%s %d %s' %(\"\\n In case 2,Lower heating value at constant volume =\",Qlv3,\"Btu/mol\")\n",
+ "print '%s' %(\"The answers might differ a bit from textbook due to rounding off error.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Higher heating value at constant volume = 1414374 Btu/mol\n",
+ "\n",
+ " Lower heating value at constant pressure = 1360268 Btu/mol\n",
+ "\n",
+ " In case 1,Lower heating value at constant volume = 1360802 Btu/mol\n",
+ "\n",
+ " In case 2,Lower heating value at constant volume = 1360797 Btu/mol\n",
+ "The answers might differ a bit from textbook due to rounding off error.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 301"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the change in chemical energy during complete combustion and LHV at constant volume\n",
+ "#Initalization of variables\n",
+ "print '%s' %(\"From table 5-4,\")\n",
+ "no=7.5\n",
+ "n1=3.\n",
+ "n2=6.\n",
+ "Q=1360805. #Btu/mol\n",
+ "#calculations\n",
+ "Uo=337+no*85\n",
+ "Uf=n1*104+n2*118\n",
+ "delo= Q-(Uo-Uf)\n",
+ "Uo2=1656+no*402\n",
+ "Uf2=n1*490+n2*570\n",
+ "Qv=Uo2-Uf2+delo\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Change in chemical energy during complete combustion =\",delo,\"Btu/mol\")\n",
+ "print '%s %d %s' %(\"\\n Lower heating value at constant volume =\",Qv,\"Btu/mol\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From table 5-4,\n",
+ "Change in chemical energy during complete combustion = 1360850 Btu/mol\n",
+ "\n",
+ " Lower heating value at constant volume = 1360631 Btu/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the heat removed in the process\n",
+ "#Initalization of variables\n",
+ "print '%s' %(\"From table 5-4,\")\n",
+ "a=1 #moles of C6H6\n",
+ "b=7.5 #moles of O2 in reactant\n",
+ "c=1.875 #moles of excess O2\n",
+ "d=35.27 #moles of N2\n",
+ "e=3 #moles of H2O\n",
+ "flow=40. #lb/min\n",
+ "w=1360850. #Btu/mol\n",
+ "#calculations\n",
+ "U11=a*337\n",
+ "U12=(b+c)*85\n",
+ "U13=d*82\n",
+ "U14=(a+b+c+d)*1066\n",
+ "Ua1=U11+U12+U13+U14\n",
+ "U21=c*2539\n",
+ "U22=d*2416\n",
+ "U23=e*3009\n",
+ "U24=2*e*3852\n",
+ "U25=(c+d+e+2*e)*1985\n",
+ "Ua2=U21+U22+U23+U24+U25\n",
+ "Q=Ua1+w-Ua2\n",
+ "fuel=flow/(6*12+2.*e)\n",
+ "Q2=Q*fuel\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Heat removed =\",Q2,\"Btu/min\")\n",
+ "print '%s' %(\"The answers might differ a bit from textbook due to rounding off error.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From table 5-4,\n",
+ "Heat removed = 615294 Btu/min\n",
+ "The answers might differ a bit from textbook due to rounding off error.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4 - Pg 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the furnace efficiency\n",
+ "#Initalization of variables\n",
+ "rate=10700. #lb/min\n",
+ "t2=97.90 \n",
+ "t1=33.05 \n",
+ "r1=46. #lb/min\n",
+ "#calculations\n",
+ "print '%s' %(\"From steam tables,\")\n",
+ "Hv=1417041.\n",
+ "Qw=rate*(t2-t1)\n",
+ "Q=r1/(12*6+6) *Hv\n",
+ "eff=Qw/Q*100.\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Furnace efficiency =\",eff,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From steam tables,\n",
+ "Furnace efficiency = 83.0 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5 - Pg 306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the thermal efficiency\n",
+ "#Initalization of variables\n",
+ "rate=94. #lb/hr\n",
+ "hp=197. #hp\n",
+ "c=8.\n",
+ "h=18.\n",
+ "Lv=17730. #Btu/hr\n",
+ "H=2368089. #Btu/hr\n",
+ "#calculations\n",
+ "amount=rate*c/12 +h\n",
+ "amount=0.824\n",
+ "Lvv=H-Lv\n",
+ "eff=hp*2544/(amount*Lvv) *100\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Thermal efficiency =\",eff,\" percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal efficiency = 25.88 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6 - Pg 306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the thermal efficiency\n",
+ "#Initalization of variables\n",
+ "rate=94. #lb/hr\n",
+ "hp=197. #hp\n",
+ "c=8.\n",
+ "h=18.\n",
+ "mole=9.\n",
+ "H=2350359. #Btu/hr\n",
+ "#calculations\n",
+ "amount=rate*c/12 +h\n",
+ "amount=0.824\n",
+ "Lvv=H-mole*18.016*1050.4\n",
+ "eff=hp*2544/(amount*Lvv) *100\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Thermal efficiency =\",eff,\"percent\")\n",
+ "print '%s' %(\"The answer in the textbook is a different due to rounding off error\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal efficiency = 27.90 percent\n",
+ "The answer in the textbook is a different due to rounding off error\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7 - Pg 307"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the total available energy\n",
+ "#Initalization of variables\n",
+ "import math\n",
+ "hv=14000. #Btu/lb\n",
+ "ef=0.4\n",
+ "tmin=80. #F\n",
+ "tmid=300. #F\n",
+ "m=13. #lb\n",
+ "c=0.27\n",
+ "tmean=2300. #F\n",
+ "#calculations\n",
+ "heat=ef*hv\n",
+ "Qavail=heat*(tmean-tmin)/(tmean+460)\n",
+ "Q=m*c*(tmean-tmid)\n",
+ "Q2=Q- (tmin+460)*m*c*math.log((tmean+460)/(tmid+460))\n",
+ "tot=Qavail+Q2\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Total available energy =\",tot,\" Btu/lb of fuel\")\n",
+ "print '%s' %(\"The answer is a bit different due to rounding off error in textbook\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total available energy = 9079 Btu/lb of fuel\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 8 - Pg 308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the max amount of work available\n",
+ "#Initalization of variables\n",
+ "print '%s' %(\"From table 14-2,\")\n",
+ "G1=55750. #Btu/mol\n",
+ "co2=-169580. #Btu/mol\n",
+ "h2o=-98290. #Btu/mol\n",
+ "#calculations\n",
+ "G2=6*co2+3*h2o\n",
+ "avail=G1-G2\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Max. amount of work =\",avail,\"Btu/mol\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "From table 14-2,\n",
+ "Max. amount of work = 1368100 Btu/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file