diff options
Diffstat (limited to 'Elements_of_Thermodynamics_and_heat_transfer/Chapter_8.ipynb')
-rwxr-xr-x | Elements_of_Thermodynamics_and_heat_transfer/Chapter_8.ipynb | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/Elements_of_Thermodynamics_and_heat_transfer/Chapter_8.ipynb b/Elements_of_Thermodynamics_and_heat_transfer/Chapter_8.ipynb new file mode 100755 index 00000000..d35614c2 --- /dev/null +++ b/Elements_of_Thermodynamics_and_heat_transfer/Chapter_8.ipynb @@ -0,0 +1,142 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:efb3cb597d2918b83a867fe2c379b3952acba398aec14a9edf762b5c40043583"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 - Second and third law topics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the value of dp/ds at constant volume\n",
+ "#Initialization of variables\n",
+ "P=500 #psia\n",
+ "T=700. #F\n",
+ "J=778.\n",
+ "#calculations\n",
+ "dpds=1490 *144/J\n",
+ "#results\n",
+ "print '%s %d %s' %(\"dp by ds at constant volume =\",dpds,\" F/ft^3/lbm\")\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": [
+ "dp by ds at constant volume = 275 F/ft^3/lbm\n",
+ "The answer is a bit different due to rounding off error in textbook\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the thermal efficiency\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "cp=0.25 #Btu/lbm R\n",
+ "T0=520. #R\n",
+ "T1=3460. #R\n",
+ "#calculations\n",
+ "dq=cp*(T0-T1)\n",
+ "ds=cp*math.log(T0/T1)\n",
+ "dE=dq-T0*ds\n",
+ "eta=dE/dq*100.\n",
+ "#results\n",
+ "print '%s %.1f %s' %(\"Thermal efficiency =\",eta,\"percent\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal efficiency = 66.5 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the Loss of available energy\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "cp=0.25 #Btu/lbm R\n",
+ "T0=520. #R\n",
+ "T1=3460. #R\n",
+ "dG=21069. #Btu/lbm\n",
+ "dH=21502. #Btu/lbm\n",
+ "#calculations\n",
+ "dq=cp*(T0-T1)\n",
+ "ds=cp*math.log(T0/T1)\n",
+ "dE=dq-T0*ds\n",
+ "eta=dE/dq\n",
+ "dw=eta*dH\n",
+ "de=-dG+dw\n",
+ "#results\n",
+ "print '%s %d %s' %(\"Loss of available energy =\",de,\"Btu/lbm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Loss of available energy = -6774 Btu/lbm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |