summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_J._P._Holman/ch7.ipynb
diff options
context:
space:
mode:
authorhardythe12015-06-11 17:31:11 +0530
committerhardythe12015-06-11 17:31:11 +0530
commit79c59acc7af08ede23167b8455de4b716f77601f (patch)
tree2d6ff34b6f131d2671e4c6b798f210b3cb1d4ac7 /Thermodynamics_by_J._P._Holman/ch7.ipynb
parentdf60071cf1d1c18822d34f943ab8f412a8946b69 (diff)
downloadPython-Textbook-Companions-79c59acc7af08ede23167b8455de4b716f77601f.tar.gz
Python-Textbook-Companions-79c59acc7af08ede23167b8455de4b716f77601f.tar.bz2
Python-Textbook-Companions-79c59acc7af08ede23167b8455de4b716f77601f.zip
add books
Diffstat (limited to 'Thermodynamics_by_J._P._Holman/ch7.ipynb')
-rwxr-xr-xThermodynamics_by_J._P._Holman/ch7.ipynb373
1 files changed, 373 insertions, 0 deletions
diff --git a/Thermodynamics_by_J._P._Holman/ch7.ipynb b/Thermodynamics_by_J._P._Holman/ch7.ipynb
new file mode 100755
index 00000000..906a386e
--- /dev/null
+++ b/Thermodynamics_by_J._P._Holman/ch7.ipynb
@@ -0,0 +1,373 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:718f559da4ae2a13e9c934b6162f71a824de61441f47a14a1f58cca792ea40ff"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7 :\n",
+ "equations of state and general\n",
+ "thermodynamic relations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1 pg : 158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "T1 = 1160. \t\t\t#R\n",
+ "h1 = 281.14 \t\t\t#B/lbm\n",
+ "Pr1 = 21.18 \n",
+ "P2 = 30. \t\t\t#psia\n",
+ "P1 = 100. \t\t\t#psia\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "Pr2 = Pr1*P2/P1\n",
+ "T2 = 833. \t\t\t#R\n",
+ "h2 = 199.45 \t\t\t#B/lbm\n",
+ "dh = h2-h1\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"Change in enthalpy = %.2f B/lbm\"%(dh)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in enthalpy = -81.69 B/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2 pg : 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variables\n",
+ "T2 = 860. \t\t\t#R\n",
+ "phi1 = 0.78767\n",
+ "phi2 = 0.71323\n",
+ "P2 = 30. \t\t\t#psia\n",
+ "P1 = 100. \t\t\t#psia\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "dS = phi2-phi1- 53.35/778 *math.log(P2/P1)\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"Net change of entropy = %.5f B/lbm R\"%(dS)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Net change of entropy = 0.00812 B/lbm R\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3 pg : 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "T1 = 540. \t\t\t#R\n",
+ "T2 = 960. \t\t\t#R\n",
+ "h2 = 231.06 \t\t\t#B/lbm\n",
+ "h1 = 129.06 \t\t\t#B/lbm\n",
+ "cp = 0.24\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "W = h2-h1\n",
+ "dh = cp*(T2-T1)\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"Change in enthalpy = %.1f B/lbm\"%(dh)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in enthalpy = 100.8 B/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4 pg : 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\t\t\t\n",
+ "# Variables\n",
+ "T1 = 420. \t\t\t#R\n",
+ "T2 = 380. \t\t\t#R\n",
+ "hig = 1221.2\n",
+ "P1 = 0.0019\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "lnp = hig*778*(1/T1 - 1/T2)/85.6\n",
+ "pra = math.exp(lnp)\n",
+ "P2 = pra*P1\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"Final pressure = %.3e psia\"%(P2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Final pressure = 1.177e-04 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5 pg : 170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "pc = 482.\t\t\t#psia\n",
+ "Tc = 227. \t\t\t#R\n",
+ "vc = 1.44 \t\t\t#ft**3/lbm mol\n",
+ "P = 600. \t\t\t#psia\n",
+ "T = 310. \t\t\t#R\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "Pr = P/pc\n",
+ "Tr = T/Tc\n",
+ "Z = 0.83\n",
+ "v = Z*55.12*T/(P*144)\n",
+ "rho = 1/v\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"Density = %.1f lbm/ft**3\"%(rho)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density = 6.1 lbm/ft**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6 pg : 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "T = -150.+460 \t\t\t#R\n",
+ "v = 0.6 \t\t \t#ft**3/lbm\n",
+ "vc = 1.44\n",
+ "Tc = 227. \t \t\t#R\n",
+ "Pc = 482. \t\t\t#psia\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "vr = v/vc\n",
+ "Tr = T/Tc\n",
+ "Pr = 1.75\n",
+ "P = Pr*Pc\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"Final pressure = %d psia\"%(P)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Final pressure = 843 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.7 pg : 177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "Tc = 344. \t\t\t#R\n",
+ "Pc = 673. \t\t\t#psia\n",
+ "P1 = 20. \t\t\t#psia\n",
+ "P2 = 500. \t\t\t#psia\n",
+ "M = 16.\n",
+ "T = 560. \t\t\t#R\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "pr1 = P1/Pc\n",
+ "pr2 = P2/Pc\n",
+ "Tr = T/Tc\n",
+ "dh2 = 0.65*Tc\n",
+ "dsp = 0.35 \t\t\t#B/lbm mol R\n",
+ "dsp2 = 0.018-dsp- 1545/778 *math.log(P2/P1)\n",
+ "W = dh2-dsp2*T\n",
+ "W2 = W/M\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"Work per pound mass = %d B/lbm\"%(W2)\n",
+ "\n",
+ "#The answer is a bit different due to rounding off error. check using calculator.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Work per pound mass = 138 B/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.8 pg : 179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "P = 1000. \t \t\t#psia\n",
+ "T1 = 100. + 460 \t\t\t#R\n",
+ "T2 = 800. + 460 \t\t\t#R\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "pc = 1070. \t\t\t#psia\n",
+ "Tc = 548. \t\t\t#R\n",
+ "pr1 = P/pc\n",
+ "Tr1 = T1/Tc\n",
+ "Tr2 = T2/Tc\n",
+ "M = 44.\n",
+ "h1 = 4235.8 \t\t\t#B/lbm mol\n",
+ "h2 = 11661 \t\t\t#B/lbm mol\n",
+ "h2bar = 3.5 \t\t\t#B/lbm mol\n",
+ "h1bar = 0.48 \t\t\t#B/lbm mol\n",
+ "dhbar = Tc*(h2bar-h1bar) + h2-h1\n",
+ "Q = dhbar/M\n",
+ "cp = 0.202 \t\t\t#B/lbm F\n",
+ "Q2 = cp*(T2-T1)\n",
+ "Error = (Q-Q2)/Q\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"Error in calculation = %d percent\"%(Error*100)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Error in calculation = 31 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file