diff options
Diffstat (limited to 'Introduction_to_flight_by_J_D_Anderson/Appendix_A.ipynb')
-rwxr-xr-x | Introduction_to_flight_by_J_D_Anderson/Appendix_A.ipynb | 517 |
1 files changed, 0 insertions, 517 deletions
diff --git a/Introduction_to_flight_by_J_D_Anderson/Appendix_A.ipynb b/Introduction_to_flight_by_J_D_Anderson/Appendix_A.ipynb deleted file mode 100755 index 352d2566..00000000 --- a/Introduction_to_flight_by_J_D_Anderson/Appendix_A.ipynb +++ /dev/null @@ -1,517 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Appendix A" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 1" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "('Temperature T2 = %.1f K', 556.4270854641527)\n", - "(' Compressor work = %.1f kJ/kg ', 269.2999938060093)\n", - "(' Temperature T3 = %.1f K', 1373.2)\n", - "(' Temperature T4 = %.1f K', 711.24546295203)\n", - "(' Turbine work = %.1f kJ/kg', 664.6023551961619)\n", - "(' Net work = %.1f kJ/kg', 395.30236139015256)\n", - "(' Thermal Efficiency of cycle = %.1f percent', 48.205253207687875)\n" - ] - } - ], - "source": [ - "# -*- coding: utf8 -*-\n", - "from __future__ import division\n", - "#Example: 12.1\n", - "''' '''\n", - "\n", - "#Variable Declaration: \n", - "\n", - "\n", - "\t\t#1-Inlet for compressor\n", - "\t\t#2-Exit for compressor\n", - "\t\t#T-Temperature at a state\n", - "\t\t#P-Pressure at a state\n", - "T1 = 288.2\t\t#K\n", - "P2 = 1000\t\t#kPa\n", - "P1 = 100\t\t#kPa\n", - "k = 1.4\n", - "T2 = T1*(P2/P1)**(1-1/k)\t\t#K\n", - "Cp = 1.004\t\t#Specific heat at constant pressure in kJ/kg\n", - "wc = Cp*(T2-T1)\t\t#compressor work in kJ/kg\n", - "print ('Temperature T2 = %.1f K',T2)\n", - "print (' Compressor work = %.1f kJ/kg ',wc)\n", - "\t\t#3-Turbine Inlet\n", - "\t\t#4-Turbine Exit\n", - "P4 = P1\n", - "P3 = P2\n", - "T3 = 1373.2\t\t#K\n", - "T4 = T3*(P4/P3)**(1-1/k)\t\t#K\n", - "wt = Cp*(T3-T4)\n", - "wnet = wt-wc\n", - "print (' Temperature T3 = %.1f K',T3)\n", - "print (' Temperature T4 = %.1f K',T4)\n", - "print (' Turbine work = %.1f kJ/kg',wt)\n", - "print (' Net work = %.1f kJ/kg',wt-wc)\n", - "\t\t#2-Also high temperature heat exchanger Inlet\n", - "\t\t#3-(-do-) Exit\n", - "qh = Cp*(T3-T2)\t\t#Heat of source in kJ/kg\n", - "\t\t#4-high temp heat exchanger inlet\n", - "\t\t#1-(-do-) Exit\n", - "ql = Cp*(T4-T1)\t\t#Heat of sink in kJ/kg\n", - "nth = wnet/qh\n", - "print (' Thermal Efficiency of cycle = %.1f percent',nth*100)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 2" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "('Temperature T2 = %.1f K', 623.4838568301909)\n", - "(' Compressor work = %.1f kJ/kg ', 336.6249922575117)\n", - "(' Temperature T3 = %.1f K', 1373.2)\n", - "(' Temperature T4 = %.1f K', 810.5386435092256)\n", - "(' Turbine work = %.1f kJ/kg', 564.9120019167375)\n", - "(' Net work = %.1f kJ/kg', 228.28700965922582)\n", - "(' Thermal Efficiency of cycle = %.1f percent', 30.32847854912508)\n" - ] - } - ], - "source": [ - "# -*- coding: utf8 -*-\n", - "from __future__ import division\n", - "#Example: 12.2\n", - "''' '''\n", - "\n", - "#Variable Declaration: \n", - "\t\t#Standard brayton cycle\n", - "\n", - "\n", - "\t\t#Calculation mistake in book\n", - "\t\t#1-Inlet for compressor\n", - "\t\t#2-Exit for compressor\n", - "\t\t#T-Temperature at a state\n", - "\t\t#P-Pressure at a state\n", - "T1 = 288.2\t\t#K\n", - "P2 = 1000\t\t#kPa\n", - "P1 = 100\t\t#kPa\n", - "k = 1.4\n", - "T2s = T1*(P2/P1)**(1-1/k)\t\t#K\n", - "nc = .80\t\t#Compressor Efficiency\n", - "T2 = T1+(T2s-T1)/0.80\n", - "Cp = 1.004\t\t#Specific heat at constant pressure in kJ/kg\n", - "wc = Cp*(T2-T1)\t\t#compressor work in kJ/kg\n", - "print ('Temperature T2 = %.1f K',T2)\n", - "print (' Compressor work = %.1f kJ/kg ',wc)\n", - "\t\t#3-Turbine Inlet\n", - "\t\t#4-Turbine Exit\n", - "P4 = P1\n", - "P3 = P2\n", - "T3 = 1373.2\t\t#K\n", - "T4s = T3*(P4/P3)**(1-1/k)\t\t#K\n", - "nt = 0.85\t\t#turbine Efficiency\n", - "T4 = T3-(T3-T4s)*0.85\n", - "wt = Cp*(T3-T4)\n", - "wnet = wt-wc\n", - "print (' Temperature T3 = %.1f K',T3)\n", - "print (' Temperature T4 = %.1f K',T4)\n", - "print (' Turbine work = %.1f kJ/kg',wt)\n", - "print (' Net work = %.1f kJ/kg',wt-wc)\n", - "\t\t#2-Also high temperature heat exchanger Inlet\n", - "\t\t#3-(-do-) Exit\n", - "qh = Cp*(T3-T2)\t\t#Heat of source in kJ/kg\n", - "\t\t#4-high temp heat exchanger inlet\n", - "\t\t#1-(-do-) Exit\n", - "ql = Cp*(T4-T1)\t\t#Heat of sink in kJ/kg\n", - "nth = wnet/qh\n", - "print (' Thermal Efficiency of cycle = %.1f percent',nth*100)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 3" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "('Thermal efficiency = %.1f percent', 59.42413919202417)\n" - ] - } - ], - "source": [ - "# -*- coding: utf8 -*-\n", - "from __future__ import division\n", - "#Example: 12.3\n", - "''' '''\n", - "\n", - "#Variable Declaration: \n", - "\n", - "\n", - "wnet = 395.2\t\t#kJ/kg from example no 1\n", - "\t\t#Tx = T4\n", - "Tx = 710.8\t\t#K from example no 1\n", - "T3 = 1373.2\t\t#K from example no 1\n", - "Cp = 1.004\t\t#specific heat in kJ/kg \n", - "qh = Cp*(T3-Tx)\n", - "nth = wnet/qh\n", - "print ('Thermal efficiency = %.1f percent',nth*100) " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 4" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "('Isothermal work in compressor = %.1f kJ/kg ', -190.4546418308537)\n", - "(' Isothermal work in turbine = %.1f kJ/kg', 907.4681268637344)\n" - ] - } - ], - "source": [ - "# -*- coding: utf8 -*-\n", - "from __future__ import division\n", - "#Example: 12.4\n", - "''' '''\n", - "from math import log\n", - "#Variable Declaration: \n", - "\n", - "\n", - "R = 0.287\t\t#gas constant \n", - "T1 = 288.2\t\t#compressor temperature K\n", - "T2 = 1373.2\t\t#K turbine temperature K\n", - "\t\t#Pe/Pi = c = 10, Pi/Pe = 1/c from example 12.1\n", - "c = 10\n", - "wc = -R*T1*log(c)\n", - "print ('Isothermal work in compressor = %.1f kJ/kg ',wc)\n", - "wt = -R*T2*log(1/c)\n", - "print (' Isothermal work in turbine = %.1f kJ/kg',wt) " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 5" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "('Velocity of air leaving the nozel = %.0f m/s', 889.4375751001304)\n" - ] - } - ], - "source": [ - "# -*- coding: utf8 -*-\n", - "from __future__ import division\n", - "#Example: 12.5\n", - "''' '''\n", - "from math import sqrt\n", - "#Variable Declaration: \n", - "\n", - "\n", - "\t\t#1-compressor inlet\n", - "\t\t#2-Compressor exit\n", - "\t\t#P-Pressure at given point\n", - "\t\t#T-Temperature at given point\n", - "P1 = 100\t\t#kPa\n", - "P2 = 1000\t\t#kPa\n", - "T1 = 288.2\t\t#K\n", - "T2 = 556.8\t\t#K\n", - "wc = 269.5\t\t#from ex 12.1 work done in compressor in kJ/kg\n", - "\t\t#2-Burner inlet\n", - "\t\t#3-Burner exit\n", - "P3 = 1000\t\t#kPa\n", - "T3 = 1373.2\t\t#K\n", - "\t\t#wc = wt\n", - "Cp = 1.004\t\t#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", - "\t\t#from s4 = s5 and h4 = h5+v2/2 we get\n", - "T5 = 710.8\t\t#K, from second law\n", - "v = sqrt(2*Cp*1000*(T4-T5))\t\t#m/s\n", - "print ('Velocity of air leaving the nozel = %.0f m/s',v)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 6" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "('Coefficient of performance = %.3f ', 1.712857850240205)\n", - "(' Rate at which the air enter the compressor = %.3f kg/s ', 0.013985866348928795)\n" - ] - } - ], - "source": [ - "# -*- coding: utf8 -*-\n", - "from __future__ import division\n", - "#Example: 12.6\n", - "''' '''\n", - "\n", - "#Variable Declaration: \n", - "\n", - "\n", - "\t\t#1-compressor inlet\n", - "\t\t#2-compressor exit\n", - "P1 = 100\t\t#kPa\n", - "P2 = 500\t\t#kPa\n", - "k = 1.4\n", - "rp = P2/P1\n", - "cop = (rp**(1-1/k)-1)**-1\n", - "print ('Coefficient of performance = %.3f ',cop)\n", - "\t\t#3-Expander inlet\n", - "\t\t#4-Expander exit\n", - "P3 = P2\n", - "P4 = P1\n", - "T3 = 288.23\t\t#K, given and fixed\n", - "T4 = T3/(P3/P4)**(1-1/k)\n", - "T1 = 253.2\t\t#K, given\n", - "Cp = 1.004\t\t#Specific heat at cons pressure in kJ/kg\n", - "ql = Cp*(T1-T4)\t\t#heat released in kJ/kg\n", - "P = 1\t\t#power required in kW \n", - "ms = P/ql\t\t#kg/s\n", - "print (' Rate at which the air enter the compressor = %.3f kg/s ',ms) " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 7" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Temperature at compressor exit, T2 = %.1f K 723.925669561\n", - " Pressure at compressor exit, P2 = %.3f MPa 2.51188643151\n", - " Initial Temperature during heat additon process, T3 = %.0f K 3234.38592061\n", - " Initial pressure during heat addition process, P3 = %.3f MPa 11.222713118\n", - " Final temperature during heat addition process, T4 = %.1f K 1287.63222733\n", - " Final pressure during heat addition process, P4 = %.4f MPa 0.446784256534\n", - " Thermal efficiency = %.1f percent 96.0189282945\n", - " Mean effective pressure = %.0f kPa 1455.36957602\n" - ] - } - ], - "source": [ - "# -*- coding: utf8 -*-\n", - "from __future__ import division\n", - "#Example: 12.7\n", - "''' '''\n", - "\n", - "#Variable Declaration: \n", - "\n", - "\n", - "\t\t#1-compressor inlet\n", - "\t\t#2-compressor exit\n", - "P1 = 100\t\t#kPa\n", - "T1 = 288.2\t\t#K\n", - "R = 0.287\t\t#gas constant\n", - "v1 = R*T1/P1\t\t#specific volume at inlet in m**3/kg\n", - "rv = 10\t\t#compression ratio given\n", - "k = 1.4\t\t#constant\n", - "T2 = T1*rv**(k-1)\t\t#K\n", - "print 'Temperature at compressor exit, T2 = %.1f K ',T2\n", - "P2 = P1*rv**k\t\t#kPa\n", - "print ' Pressure at compressor exit, P2 = %.3f MPa ',P2/1000\n", - "v2 = v1/rv\t\t#specific heat at exit in m**3/kg\n", - "\t\t#23-heat addition process\n", - "\t\t#q23 = Cv*(T3-T2) = 1800 kJ/kg given\n", - "q23 = 1800\t\t#kJ/kg heat addition, given\n", - "Cv = 0.717\t\t#specific heat at constant volume in kJ/kg\n", - "T3 = T2+q23/Cv\t\t#K\n", - "print ' Initial Temperature during heat additon process, T3 = %.0f K ',T3\n", - "P3 = P2*(T3/T2)\t\t#kPa\n", - "print ' Initial pressure during heat addition process, P3 = %.3f MPa ',P3/1000\n", - "r = 10\t\t#k = V4/V3 = P3/P4\n", - "T4 = T3*(1/r)**(k-1)\n", - "print ' Final temperature during heat addition process, T4 = %.1f K ',T4\n", - "P4 = P3/r**k\t\t#kPa\n", - "print ' Final pressure during heat addition process, P4 = %.4f MPa ',P4/1000\n", - "nth = 1-1/r**k\t\t#thermal efficiency\n", - "print ' Thermal efficiency = %.1f percent ',nth*100\n", - "q41 = Cv*(T1-T4)\t\t#/heat for process 4-1 in kJ/kg\n", - "wnet = q23+q41\n", - "mep = wnet/(v1-v2)\t\t#effective mean pressure n kPa\n", - "print ' Mean effective pressure = %.0f kPa ',mep" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Example 8" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Temperature at compressor exit, T2 = %.1f K 955.225647797\n", - " Pressure at compressor exit, P2 = %.3f MPa 6.62890803468\n", - " Initial Temperature during heat addition process, T3 = %.0f K 2748.05433306\n", - " Final temperature during heat addition process, T4 = %.0f K 1265.26371322\n", - " Thermal efficiency = %.1f percent 61.0802954233\n", - " Mean effective pressure = %.0f kPa 1399.18182622\n" - ] - } - ], - "source": [ - "# -*- coding: utf8 -*-\n", - "from __future__ import division\n", - "#Example: 12.8\n", - "''' '''\n", - "\n", - "#Variable Declaration: \n", - "\n", - "\n", - "\t\t#1-compressor inlet\n", - "\t\t#2-compressor exit\n", - "P1 = 100\t\t#kPa\n", - "T1 = 288.2\t\t#K\n", - "R = 0.287\t\t#gas constant\n", - "v1 = R*T1/P1\t\t#specific volume at inlet in m**3/kg\n", - "rv = 20\t\t#compression ratio given\n", - "k = 1.4\t\t#constant\n", - "T2 = T1*rv**(k-1)\t\t#K\n", - "print 'Temperature at compressor exit, T2 = %.1f K ',T2\n", - "P2 = P1*rv**k\t\t#kPa\n", - "print ' Pressure at compressor exit, P2 = %.3f MPa ',P2/1000\n", - "v2 = v1/rv\t\t#specific heat at exit in m**3/kg\n", - "\t\t#23-heat addition process\n", - "\t\t#q23 = Cv*(T3-T2) = 1800 kJ/kg given\n", - "q23 = 1800\t\t#kJ/kg heat addition, given\n", - "Cv = .717\n", - "Cp = 1.004\t\t#specific heat at constant pressure in kJ/kg\n", - "T3 = T2+q23/Cp\t\t#K\n", - "print ' Initial Temperature during heat addition process, T3 = %.0f K ',T3\n", - "r = T3/T2\t\t#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 = %.0f K ',T4\n", - "q41 = Cv*(T1-T4)\t\t#/heat for process 4-1 in kJ/kg\n", - "wnet = q23+q41\n", - "mep = wnet/(v1-v2)\t\t#effective mean pressure in kPa\n", - "qh = 1800\t\t#heat transfer in kJ/kg\n", - "nth = wnet/qh\t\t#thermal efficiency\n", - "\n", - "print ' Thermal efficiency = %.1f percent ',nth*100\n", - "print ' Mean effective pressure = %.0f kPa ',mep" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 2", - "language": "python", - "name": "python2" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 2 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.6" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} |