summaryrefslogtreecommitdiff
path: root/Basic_Engineering_Thermodynamics_by_A._Venkatesh/ch5.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Basic_Engineering_Thermodynamics_by_A._Venkatesh/ch5.ipynb')
-rwxr-xr-xBasic_Engineering_Thermodynamics_by_A._Venkatesh/ch5.ipynb476
1 files changed, 476 insertions, 0 deletions
diff --git a/Basic_Engineering_Thermodynamics_by_A._Venkatesh/ch5.ipynb b/Basic_Engineering_Thermodynamics_by_A._Venkatesh/ch5.ipynb
new file mode 100755
index 00000000..82c29562
--- /dev/null
+++ b/Basic_Engineering_Thermodynamics_by_A._Venkatesh/ch5.ipynb
@@ -0,0 +1,476 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7f13a6535713e6dd307350b25e55b55427f77dbef3f6f6422a5890eea0412625"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : First Law of Thermodynamics for Control Volumes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1 Page No : 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "Q = -24.; \t\t\t#KJ/kg\n",
+ "\n",
+ "p1 = 5e5; \t\t\t#N/m**2\n",
+ "t1 = 227.; \t\t\t#\u00b0C\n",
+ "V1 = 50.; \t\t\t#m/s\n",
+ "v1 = 0.78; \t\t\t#m**3/kg\n",
+ "\n",
+ "p2 = 1e5; \t\t\t#N/m**2\n",
+ "t2 = 57.; \t\t\t#\u00b0C\n",
+ "V2 = 100.; \t\t\t#m/s\n",
+ "v2 = 0.97; \t\t\t#m**3/kg\n",
+ "\n",
+ "g = 9.81; \t\t\t#m/s**2 \t\t\t#acceleration due to gravity\n",
+ "\n",
+ "delta_z = -5; \t\t\t#m \n",
+ "Cv = 0.7; \t\t\t#KJ/kg \n",
+ "delta_u = Cv*(t2 - t1); \t\t\t#KJ/kg \t\t\t#change in internal energy \t\t\t#u2-u1\n",
+ "\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "delta_h = delta_u + (p2*v2 - p1*v1)*.001; \t\t\t#KJ/kg \t\t\t#change in enthalpy \t\t\t#h2-h1\n",
+ "\n",
+ "W_x = Q - (delta_h + (V2**2 - V1**2)/2*.001 + g*delta_z*.001); \t\t\t#kJ/kg \t\t\t#Work Output\n",
+ "\n",
+ "print \"Work output = %.1f KJ/kg\"%(W_x);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work output = 384.3 KJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 Page No : 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\t\t\t\n",
+ "# Variables\n",
+ "m = 5000./3600 \t\t\t# kg/s \t\t\t# flow rate\n",
+ "W_x = 550. \t\t\t# KJ/s \t\t\t#power developed by turbine\n",
+ "Q = 0. \t \t\t#Heat loss is negligible\n",
+ "\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "#Part (a)\n",
+ "print \"Parta\"\n",
+ "V1 = 0. \t\t\t# m/s \t\t\t#inlet velocity\n",
+ "V2 = 360. \t\t\t# m/s \t\t\t#exit velocity\n",
+ "g = 9.81 \t\t\t# m/s**2\n",
+ "delta_z = 0. \t\t\t#m \t\t\t#z2-z1\n",
+ "\n",
+ "delta_h = ((Q-W_x)/m)-g*delta_z*.001-((V2**2-V1**2)/2000) \t\t\t#KJ/Kg \t\t\t#change in enthalpy\n",
+ "print \"Change in enthalpy = %.2f KJ/kg\"%(delta_h)\n",
+ "\n",
+ "#Part (a)\n",
+ "print \"Partb\"\n",
+ "V1 = 60. \t\t\t# m/s \t\t\t#inlet velocity\n",
+ "V2 = 360. \t\t\t# m/s \t\t\t#exit velocity\n",
+ "g = 9.81 \t\t\t# m/s**2\n",
+ "delta_z = 0. \t\t\t#m \t\t\t#z2-z1\n",
+ "\n",
+ "delta_h = ((Q-W_x)/m)-g*delta_z*.001-((V2**2-V1**2)/2000) \t\t\t#KJ/Kg \t\t\t#change in enthalpy\n",
+ "print \"Change in enthalpy = %.2f KJ/kg\"%(delta_h)\n",
+ "\n",
+ "# note : rounding off error"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Parta\n",
+ "Change in enthalpy = -460.80 KJ/kg\n",
+ "Partb\n",
+ "Change in enthalpy = -459.00 KJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3 Page No : 122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "mA = 0.8 \t\t\t# kg/s \t\t\t#flow rate of stream A\n",
+ "pA = 15e5 \t\t\t# N/m**2 \t\t\t#Pressure of stream A\n",
+ "tA = 250. \t\t\t#\u00b0C \t\t\t#temperature of stream A\n",
+ "\n",
+ "mB = 0.5 \t\t\t# kg/s \t\t\t#flow rate of stream B\n",
+ "pB = 15e5 \t\t\t# N/m**2 \t\t\t#Pressure of stream B\n",
+ "tB = 200. \t\t\t#\u00b0C \t\t\t#temperature of stream B\n",
+ "\n",
+ "Q = 0. \t\t\t#No heat loss\n",
+ "\n",
+ "p1 = 10e5 \t\t\t# N/m**2 \t\t\t#pressure supply of chamber\n",
+ "t2 = 30. \t\t\t#\u00b0C \t\t\t#exhaust air temperature from turbine\n",
+ "\n",
+ "Cv = 0.718 \t\t\t# KJ/kgK \t\t\t#heat capacity at constant volume\n",
+ "Cp = 1. \t\t\t# KJ/kgK \t\t\t#heat capacity at constant pressure\n",
+ "\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "#Part(a)\n",
+ "print \"Part a\"\n",
+ "t1 = ((mA*Cp*tA)+(mB*Cp*tB))/((mA*Cp)+(mB*Cp)) \t\t\t# \u00b0C \t\t\t#the temperature of air at inlet to the turbine\n",
+ "print \"The temperature of air at inlet to the turbine = %.2f \u00b0C\"%(t1);\n",
+ "\n",
+ "#Part(b)\n",
+ "print \"Part b\"\n",
+ "WT = -1*(mA+mB)*Cp*(t2-t1) \t\t\t# \u00b0kW \t\t\t#power developed by turbine\n",
+ "print \"Power developed by turbine = %.0f kW\"%(WT);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part a\n",
+ "The temperature of air at inlet to the turbine = 230.77 \u00b0C\n",
+ "Part b\n",
+ "Power developed by turbine = 261 kW\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 Page No : 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "d1 = 0.15 \t\t\t#m \t\t\t#inlet diameter\n",
+ "m = 4000./3600 \t\t\t# kg/s \t\t\t#flow rate\n",
+ "v1 = 0.285 \t\t\t#m**3/kg \t\t\t#specific volume at entry\n",
+ "d2 = 0.25 \t\t\t#m \t\t\t#exit diameter\n",
+ "v2 = 15. \t\t\t# m**3/kg \t\t\t#specific volume at exit\n",
+ "\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "\n",
+ "A1 = math.pi*d1**2/4 \t\t\t#m**2 \t\t\t#inlet cross sectional area\n",
+ "A2 = math.pi*d2**2/4 \t\t\t# m**2 \t\t\t# exit cross sectional area\n",
+ "print \"Inlet cross sectional area A1)= %.5f m**2\"%(A1);\n",
+ "print \"Exit cross sectional area A2)= %.4f m**2\"%(A2);\n",
+ "\n",
+ "V1 = m*v1/A1 \t\t\t#m/s \t\t\t#inlet velocity\n",
+ "V2 = m*v2/A2 \t\t\t#m/s \t\t\t#exit velocity\n",
+ "\n",
+ "print \"Inlet velocity = %.1f m/s\"%(V1);\n",
+ "print \"Exit velocity = %.1f m/s\"%(int(V2));\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inlet cross sectional area A1)= 0.01767 m**2\n",
+ "Exit cross sectional area A2)= 0.0491 m**2\n",
+ "Inlet velocity = 17.9 m/s\n",
+ "Exit velocity = 339.0 m/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.5 Page No : 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "p1 = 10.\t\t\t#bar \t\t\t#inlet pressure\n",
+ "t1 = 300. \t\t\t#\u00b0C \t\t\t#inlet temperature\n",
+ "\n",
+ "p2 = 0.1 \t\t\t#bar \t\t\t#exit pressure\n",
+ "Cp = 1. \t\t\t#kJ/kgK \t\t\t# heat capacity at constant pressure\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "#Adiabatic process\n",
+ "delta_h = 0 \t\t\t#change in enthalpy\n",
+ "t2 = delta_h/Cp + t1\n",
+ "print \"Temperature of air after throttling = %.0f \u00b0C\"%(t1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature of air after throttling = 300 \u00b0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.6 Page No : 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "p1 = 1e5 \t\t\t# N/m**2 \t\t\t#inlet pressure\n",
+ "v1 = 0.08 \t\t\t#m**3/kg \t\t\t# specific volume at inlet\n",
+ "p2 = 7e5 \t\t\t# N/m**2 \t\t\t#exit pressure\n",
+ "v2 = 0.016 \t\t\t# m**3/kg \t\t\t#specific volume at exit\n",
+ "u1 = 48. \t\t\t# kJ/kg \t\t\t# internal energy at inlet\n",
+ "u2 = 200. \t\t\t# kJ/kg \t\t\t# internal energy at exit\n",
+ "Q = -120. \t\t\t# kJ/kg \t\t\t# heat loss\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "Wc = ((u2 - u1) + (p2*v2 - p1*v1)*.001 - Q)*-1 \t\t\t# kJ/kg \t\t\t# work input to compressor\n",
+ "print \"Work input to compressor Wc) = %.1f kJ/kg\"%(Wc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work input to compressor Wc) = -275.2 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.7 Page No : 128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# variables\n",
+ "mh = 9.45 \t\t\t# kg/s \t\t\t# flow rate of steam\n",
+ "h_h2 = 140. \t\t\t# kJ/kg \t\t\t# enthalpy of condensate\n",
+ "h_h1 = 2570. \t\t\t# kJ/kg \t\t\t# inlet enthalpy of steam\n",
+ "t1 = 25. \t\t\t# \u00b0C \t\t\t#inlet temperature of cooling water\n",
+ "t2 = 36. \t\t\t# \u00b0C \t\t\t#exit temperature of cooling water\n",
+ "c = 4.189 \t\t\t# kJ/kg deg \t\t\t# specific heat of water\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "mc = -1*(mh*(h_h2-h_h1))/(c*(t2-t1)) \t\t\t# kg/s \t\t\t#mass flow rate of cooling water\n",
+ "print \"Mass flow rate of cooling water = %.2f kg/s\"%(mc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass flow rate of cooling water = 498.35 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.8 Page No : 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# variables\n",
+ "mh = 9.45 \t\t\t# kg/s \t\t\t# flow rate of steam\n",
+ "h_h2 = 140. \t\t\t# kJ/kg \t\t\t# enthalpy of condensate\n",
+ "h_h1 = 2570. \t\t\t# kJ/kg \t\t\t# inlet enthalpy of steam\n",
+ "t1 = 25. \t\t\t# \u00b0C \t\t\t#inlet temperature of cooling water\n",
+ "t2 = 36. \t\t\t# \u00b0C \t\t\t#exit temperature of cooling water\n",
+ "c = 4.189 \t\t\t# kJ/kg deg \t\t\t# specific heat of water\n",
+ "fractionalheatloss = 0.1 \t\t\t# fractional heat loss\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "mc = -1*((1-fractionalheatloss)*mh*(h_h2-h_h1))/(c*(t2-t1)) \t\t\t# kg/s \t\t\t#mass flow rate of cooling water\n",
+ "print \"Mass flow rate of cooling water = %.1f kg/s\"%(mc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass flow rate of cooling water = 448.5 kg/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.9 Page No : 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# variables\n",
+ "V1 = 300 \t\t\t#m/s \t\t\t#inlet air velocity\n",
+ "t2 = 100 \t\t\t#\u00b0C \t\t\t#exit air temperature\n",
+ "V2 = 15 \t\t\t#m/s \t\t\t#exit air velocity\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "t1 = t2 + .001*(V2**2 - V1**2)/2 \t\t\t# \u00b0C \t\t\t#inlet air temperature\n",
+ "print \"Inlet air temperature = %.1f \u00b0C\"%(t1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inlet air temperature = 55.1 \u00b0C\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.10 Page No : 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "m1 = 0.8 \t\t\t#kg \t\t\t#initial mass of air\n",
+ "p1 = 150. \t\t\t#kPa \t\t\t#initial pressure of air\n",
+ "T1 = 300. \t\t\t#K \t\t\t#initial temperature of air\n",
+ "p_p = 600. \t\t\t#kPa \t\t\t#pressure of air in pipe\n",
+ "T_p = 330. \t\t\t#K \t\t\t# temperature of air in pipe\n",
+ "\n",
+ "\t\t\t\n",
+ "# Calculations and Results\n",
+ "m2T2 = (p_p/p1)*T1*m1\n",
+ "m2 = ((0.718*(m2T2/m1-T1))/(331.65)*m1)+m1 \t\t\t#kg \t\t\t#final mass of air\n",
+ "print \"Mass of air entering in vessel = %.4f kg\"%(m2-m1)\n",
+ "T2 = m2T2/m2 \t\t\t#K \t\t\t#Temperature of air in vessel\n",
+ "print \"Temperature of air in vessel = %.0f K\"%(T2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of air entering in vessel = 1.5588 kg\n",
+ "Temperature of air in vessel = 407 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file