summaryrefslogtreecommitdiff
path: root/Thermodynamics_An_Engineering_Approach/Chapter12.ipynb
diff options
context:
space:
mode:
authorhardythe12015-04-07 15:58:05 +0530
committerhardythe12015-04-07 15:58:05 +0530
commit92cca121f959c6616e3da431c1e2d23c4fa5e886 (patch)
tree205e68d0ce598ac5caca7de839a2934d746cce86 /Thermodynamics_An_Engineering_Approach/Chapter12.ipynb
parentb14c13fcc6bb6d01c468805d612acb353ec168ac (diff)
downloadPython-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.gz
Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.tar.bz2
Python-Textbook-Companions-92cca121f959c6616e3da431c1e2d23c4fa5e886.zip
added books
Diffstat (limited to 'Thermodynamics_An_Engineering_Approach/Chapter12.ipynb')
-rwxr-xr-xThermodynamics_An_Engineering_Approach/Chapter12.ipynb262
1 files changed, 262 insertions, 0 deletions
diff --git a/Thermodynamics_An_Engineering_Approach/Chapter12.ipynb b/Thermodynamics_An_Engineering_Approach/Chapter12.ipynb
new file mode 100755
index 00000000..c181d0f6
--- /dev/null
+++ b/Thermodynamics_An_Engineering_Approach/Chapter12.ipynb
@@ -0,0 +1,262 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12: Thermodynamic Property Relations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-1 ,Page No.652"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#from Table A-17\n",
+ "#cp value approximately by replacing the differentials\n",
+ "h1=305.22;#in kJ/kg\n",
+ "T1=305;#in K\n",
+ "h2=295.17;#in kJ/kg\n",
+ "T2=295;#in K\n",
+ "\n",
+ "#calculations\n",
+ "#from the given equation we can calculate\n",
+ "cp=(h1-h2)/(T1-T2);\n",
+ "print'the cp of air at 300 K %f kJ/ kg - K'%round(cp,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the cp of air at 300 K 1.005000 kJ/ kg - K\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-2 ,Page No.654"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "dT=302-300;#differnce in final and intial temperatures of air in K\n",
+ "dv=0.87-0.86;#differnce in final and intial volumnes of air in m^3/kg\n",
+ "T=(302+300)/2;#average temp in K\n",
+ "v=(0.87+0.86)/2;#average volumne in m^3/kg\n",
+ "\n",
+ "#constants used\n",
+ "R=0.287;#in kJ/kg-K\n",
+ "\n",
+ "#calculations\n",
+ "#using eq 12-3 by diffrentiating P= R*T/v\n",
+ "dP= R*dT/v - R*T*dv/v**2;\n",
+ "print'the change in the pressure of air %f kPa'%round(dP,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the change in the pressure of air -0.491000 kPa\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-5 ,Page No.659"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given data\n",
+ "T=20+273.15;#temperature of refrigerant in K\n",
+ "\n",
+ "#from Table A\u201311\n",
+ "vf=0.0008161;#in m^3/kg\n",
+ "vg=0.035969;#in m^3/kg\n",
+ "\n",
+ "#calculations\n",
+ "#using Eq 12-22\n",
+ "# hfg= T*vfg*(dP/dT)sat\n",
+ "#(dP/dT)sat b/w 24 C - 16 C \n",
+ "dPT=(646.18-504.58)/(24-16);#dP/dT ; values from Table A\u201311\n",
+ "vfg=vg-vf;\n",
+ "hfg=T*vfg*dPT;\n",
+ "print'the value of the enthalpy of vaporization of refrigerant-134a %f kJ/kg'%round(hfg,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the value of the enthalpy of vaporization of refrigerant-134a 182.400000 kJ/kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-6 ,Page No.660"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import exp\n",
+ "\n",
+ "#given data\n",
+ "T2=-50+460.0;#temperature of refrigerant-134a on R \n",
+ "\n",
+ "#constants\n",
+ "R=0.01946;#in Btu/lbm\n",
+ "\n",
+ "#from Table A-11E\n",
+ "T1=-40+460.0;#converted into R from F\n",
+ "P1=7.432;\n",
+ "hfg=97.100;\n",
+ "\n",
+ "#calcualation\\\n",
+ "#using Equation 12\u201324\n",
+ "#ln(P2/P1)= hfg/R *(1/T1 - 1/T2)\n",
+ "P2=P1*exp(hfg/R *(1/T1 - 1/T2));\n",
+ "print'the saturation pressure of refrigerant-134a %f psia'%round(P2,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the saturation pressure of refrigerant-134a 5.560000 psia\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 12-11 ,Page No.373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import log\n",
+ "\n",
+ "#given data\n",
+ "T1=220;#intial temperature in K\n",
+ "P1=5;#intial pressure in MPa\n",
+ "T2=300;#final temperature in K\n",
+ "P2=10;#final pressure in MPa\n",
+ "\n",
+ "#constants used\n",
+ "Ru=8.314;#on kJ/kmol- K\n",
+ "\n",
+ "#from Table A\u20131\n",
+ "Tcr=154.8;\n",
+ "Pcr=5.08;\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "#part - a\n",
+ "print('part - a');\n",
+ "#by assuming ideal-gas behavior\n",
+ "#from Table A\u201319\n",
+ "h1=6404;\n",
+ "h2=8736;\n",
+ "s2=205.213;\n",
+ "s1=196.171;\n",
+ "h21i=h2-h1;#h2 - h1 ideal\n",
+ "s21i=(s2-s1)-Ru*log(P2/P1);#s2 - s1 ideal\n",
+ "print'the enthalpy change %i kJ/kmol'%round(h21i);\n",
+ "print'the entropy change %f kJ/kmol-K'%round(s21i,2);\n",
+ "\n",
+ "#part - b\n",
+ "print('part - b');\n",
+ "#by accounting for the deviation from ideal-gas behavior\n",
+ "TR1=T1/Tcr;\n",
+ "Pr1=P1/Pcr;\n",
+ "#from the generalized charts at each state\n",
+ "Zh1=0.53;\n",
+ "Zs1=0.25;\n",
+ "TR2=T2/Tcr;\n",
+ "Pr2=P2/Pcr;\n",
+ "#from the generalized charts at each state\n",
+ "Zh2=0.48;\n",
+ "Zs2=0.20;\n",
+ "h21=h21i-Ru*Tcr*(Zh2-Zh1);\n",
+ "s21=s21i-Ru*(Zs2-Zs1);\n",
+ "print'the enthalpy change %i in kJ/kmol'%round(h21);\n",
+ "print'the entropy change %f kJ/kmol-K'%round(s21,2);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "part - a\n",
+ "the enthalpy change 2332 kJ/kmol\n",
+ "the entropy change 3.280000 kJ/kmol-K\n",
+ "part - b\n",
+ "the enthalpy change 2396 in kJ/kmol\n",
+ "the entropy change 3.690000 kJ/kmol-K\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file