{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 3: Properties of Pure Substances" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-1 ,Page No.128" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Given values\n", "m=50;#mass in kg\n", "T=90;#temperature in C\n", "\n", "#Values from Table A-4\n", "P=70.183;#in kPa\n", "v=0.001036;#in m^3/kg\n", "\n", "#Calculation\n", "V=m*v;#equating dimensions\n", "print'pressure is %f kPa'%round(P,3);\n", "print'total volumne of tank becomes %f m^3'%round(V,4)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "pressure is 70.183000 kPa\n", "total volumne of tank becomes 0.051800 m^3\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-2 ,Page No.128" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Given values\n", "V=2.0;#volumne of saturated water vapor in ft^3\n", "P=50.0;#pressure in psia\n", "\n", "#Values from Table A-5E\n", "T=280.99;#in F\n", "v=8.5175;#in ft^3/lbm\n", "\n", "#caluclation\n", "m=V/v;#dimension analysis\n", "print'Temperature inside cylinder %f F'%round(T,2);\n", "print'mass of vapour inside cylinder %f lbm'%round(m,3);\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Temperature inside cylinder 280.990000 F\n", "mass of vapour inside cylinder 0.235000 lbm\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-3 ,Page No.128" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Constants used\n", "Hfg=2257.5;#enthalpy of vaporization in kJ/kg\n", "\n", "#Given values\n", "m=200.0/1000;#mass converting in kg\n", "P=100;#Pressure at which process takes place in kPa\n", "\n", "#Values from Table A-5\n", "vg=1.6941;#specific vol of sat liq\n", "vf=0.001043;#specific vol of vapor\n", "\n", "#Caluclation\n", "vfg=vg-vf;\n", "V=m*vfg;\n", "print'the volume change %f m^3'%round(V,4);\n", "E=m*Hfg;\n", "print'amount of energy transferred to the water %f kJ'%round(E,1)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the volume change 0.338600 m^3\n", "amount of energy transferred to the water 451.500000 kJ\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-4 ,Page No.131" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Given values\n", "mt=10#mass of water in kg\n", "mf=8;#mass of water in liquid form in kg\n", "T=90;#temperature in C\n", "\n", "#Values from Table A-4\n", "P=70.183;#in kPa\n", "vf=0.001036;#in m^3\n", "vg=2.3593;#in m^3\n", "\n", "#Caluclation\n", "mg=mt-mf;\n", "V=mf*vf+mg*vg;# V= Vg + Vf\n", "print'the volume of the tank %f m^3'%round(V,2);\n", "print'the pressure in the tank %f kPa'%round(P,3)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the volume of the tank 4.730000 m^3\n", "the pressure in the tank 70.183000 kPa\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-5 ,Page No.131" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Given values\n", "m=4;#mass of refrigerant-134a in kg\n", "V=80.0/1000;#volumne converting into m^3\n", "P=160;#pressure in kPa\n", "\n", "#Values from Table A-12\n", "vf=0.0007437;\n", "vg=0.12348;\n", "T=-15.60;\n", "hf=31.21;\n", "hfg=209.90;\n", "\n", "#Caluclations\n", "v=V/m;\n", "#vg>v>vf therefore it is a saturated mix\n", "#hence temp will same as saturation temp\n", "print'the temperature %f celcius'%round(T,2)\n", "x=(v-vf)/(vg-vf);#x=vg/vfg i.e the dryness fraction\n", "print'the quality is %f'%round(x,3);\n", "h=hf+x*hfg;\n", "print'the enthalpy of the refrigerant %f kJ/kg'%round(h,1);\n", "mg=x*m;\n", "Vg=mg*vg;\n", "print'the volume occupied by the vapor phase %f m^3'%round(Vg,4)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the temperature -15.600000 celcius\n", "the quality is 0.157000\n", "the enthalpy of the refrigerant 64.100000 kJ/kg\n", "the volume occupied by the vapor phase 0.077500 m^3\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-7 ,Page No.133" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Given values\n", "P=0.5;#pressure in MPa\n", "h=2890.0;#enthaply in kJ/kg\n", "\n", "#from Table A\u20136\n", "#at P=0.5 MPa\n", "T1=200.0;\n", "h1=2855.8;\n", "T2=250;\n", "h2=2961.0;\n", "# we need linear interpolation \n", "\n", "#calculatiom\n", "#by interpolation we can say that\n", "#h=h1+(T-T1)/(T2-T1)*(h2-h1)\n", "#we have to find T\n", "T=(h-h1)/(h2-h1)*(T2-T1)+T1;\n", "print'temperature of water %f celcius'%round(T,1)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "temperature of water 216.300000 celcius\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-8 ,Page No.134" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Given values\n", "T=80;#temperature of compressed liquid water in C\n", "P=5;#pressure in KPa\n", "\n", "#from Table A\u20137\n", "#at compressed liq given conditions\n", "u=333.82;\n", "\n", "#from Table A-4\n", "#at saturation\n", "usat=334.97;\n", "\n", "#calcualtion\n", "e=(usat-u)/u*100;\n", "print'internal energy of compressed liquid water using data from the compressed liquid table %f kJ/kg '%round(u,2);\n", "print'internal energy of compressed liquid water using saturated liquid data %f kJ/kg '%round(usat,2);\n", "print'the error involved %f the second case'%round(e,2)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "internal energy of compressed liquid water using data from the compressed liquid table 333.820000 kJ/kg \n", "internal energy of compressed liquid water using saturated liquid data 334.970000 kJ/kg \n", "the error involved 0.340000 the second case\n" ] } ], "prompt_number": 18 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-9 ,Page No.135" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#part a\n", "print('Part a');\n", "\n", "#given values\n", "P=200;#in KPa\n", "x=0.6;\n", "\n", "#from Table A-5\n", "T=120.21;\n", "uf=504.50;\n", "ufg=2024.6;\n", "\n", "#calcualtions\n", "u=uf+(x*ufg);\n", "print'temperature %f Celcius '%round(T,2);\n", "print'internal energy %f kJ/kg'%round(u,2);\n", "print('saturated liquid\u2013vapor mixture at a pressure of 200 kPa');\n", "\n", "#part b\n", "print('Part b');\n", "\n", "#given values\n", "T=125;#in C\n", "u=1600;#in kJ/kg\n", "\n", "#from Table A\u20134\n", "uf=524.83;\n", "ug=2534.3;\n", "#ug>u>ufg so its aturated liquid\u2013vapor mixture\n", "P=232.23;\n", "\n", "#calculation\n", "ufg=ug-uf;\n", "x=(u-uf)/ufg;\n", "print'Pressure %f kPa'%round(P,2);\n", "print'x is %f'%round(x,3);\n", "print('saturated liquid\u2013vapor mixture at a temp of 125 of celcius');\n", "\n", "#part c\n", "print('Part c');\n", "\n", "#given values\n", "P=1000;#in kPa\n", "u=2950;#in kJ/kg\n", "\n", "#from Table A\u20136\n", "uf=761.39;\n", "ug=2582.8;\n", "#u>ug so its superheated steam\n", "T=395.2;\n", "\n", "#calculation\n", "print'temperature %f Celcius'%round(T,1);\n", "print('superheated vapor at 1MPa');\n", "\n", "#part d\n", "print('Part d');\n", "\n", "#given values\n", "T=75;#in C\n", "P=100;#in kPa\n", "\n", "#from Table A\u20135\n", "Tsat=151.83;\n", "#T<Tsat so it is a compressed liquid\n", "#the given pressure is much lower than the lowest pressure value in the compressed liquid table i.e 5 MPa\n", "#assuming, the compressed liquid as saturated liquid at the given temperature\n", "\n", "#from Table A-4\n", "u=313.99;\n", "print'Internal energy %f kJ/kg'%round(u,2);\n", "print('the compressed liquid condition');\n", "\n", "#Part e\n", "print('Part e');\n", "\n", "#given values\n", "P=850;#in kPa\n", "x=0;\n", "\n", "#x=0 therefore it is a saturateed liquid condition\n", "#from Table A-5\n", "T=172.94;\n", "u=731.00;\n", "print'temperature %f Celcius'%round(T,2);\n", "print'Internal energy %f kJ/kg'%round(u,2);\n", "print('saturateed liquid condition')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Part a\n", "temperature 120.210000 Celcius \n", "internal energy 1719.260000 kJ/kg\n", "saturated liquid\u2013vapor mixture at a pressure of 200 kPa\n", "Part b\n", "Pressure 232.230000 kPa\n", "x is 0.535000\n", "saturated liquid\u2013vapor mixture at a temp of 125 of celcius\n", "Part c\n", "temperature 395.200000 Celcius\n", "superheated vapor at 1MPa\n", "Part d\n", "Internal energy 313.990000 kJ/kg\n", "the compressed liquid condition\n", "Part e\n", "temperature 172.940000 Celcius\n", "Internal energy 731.000000 kJ/kg\n", "saturateed liquid condition\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-10 ,Page No.139" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#constants used\n", "R=0.287# in kPa m^3/kg K\n", "\n", "#given values\n", "l=4;#dimensions of room in m\n", "b=5;#dimensions of room in m\n", "h=6;#dimensions of room in m\n", "P=100.0;#pressure in kPa\n", "T=25+273.0;#temperature in Kelvin\n", "\n", "#calculation\n", "V=l*b*h;\n", "m=P*V/R/T;\n", "print'the mass of the air %f kg'%round(m,1)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the mass of the air 140.300000 kg\n" ] } ], "prompt_number": 23 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-11 ,Page No.142" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given values\n", "P=1;#pressure in MPa\n", "T=50+273;#tempearture converting into Kelvin\n", "vgiv=0.021796;#specific vol. given in m^3\n", "\n", "#from Table A-1\n", "R=0.0815;\n", "Pcr=4.059;\n", "Tcr=374.2;\n", "\n", "#calculation\n", "\n", "#Part A\n", "v1=R*T/(P*1000);\n", "print'specific volume of refrigerant-134a under the ideal-gas assumption %fm^3/kg'%round(v1,6);\n", "e=(v1-vgiv)/vgiv;\n", "print'an error of %f'%round(e,3);\n", "\n", "#Part B\n", "#determine Z from the compressibility chart, we will calculate the reduced pressure and temperature\n", "Pr=P/Pcr;\n", "Tr=T/Tcr;\n", "#from chart\n", "Z=0.84;\n", "v=Z*v1;\n", "print'specific volume of refrigerant-134a under the generalized compressibility chart %f m^3/kg'%round(v,6);\n", "e=(v-vgiv)/vgiv;\n", "print'an error of %f'%round(e,3);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "specific volume of refrigerant-134a under the ideal-gas assumption 0.026325m^3/kg\n", "an error of 0.208000\n", "specific volume of refrigerant-134a under the generalized compressibility chart 0.022113 m^3/kg\n", "an error of 0.015000\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-12 ,Page No.143" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given values\n", "v=0.51431;\n", "T=600;\n", "\n", "#from Table A-1E\n", "R=0.5956;\n", "Pcr=3200;\n", "Tcr=1164.8;\n", "\n", "#calculation\n", "\n", "#Part A\n", "#from Table A-6E\n", "Pa=1000.0;#in psia\n", "print'from the steam tables %i psia'%Pa;\n", "\n", "#Part B\n", "T=1060;#converted into R from F\n", "Pb=R*T/v;\n", "print'from the ideal-gas equation %i psia'%round(Pb,0);\n", "e=(Pb-Pa)/Pa;\n", "print'treating the steam as an ideal gas would result in an error of %f'%round(e,3)\n", "\n", "#Part C\n", "#calculating the pseudo-reduced specific volume and the reduced temperature\n", "Vr=v/(R*Tcr/Pcr);\n", "Tr=T/Tcr;\n", "#from the compressibility chart\n", "Pr=0.33;\n", "P=Pr*Pcr;\n", "print'from the generalized compressibility chart %i psia'%P\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "from the steam tables 1000 psia\n", "from the ideal-gas equation 1228 psia\n", "treating the steam as an ideal gas would result in an error of 0.228000\n", "from the generalized compressibility chart 1056 psia\n" ] } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-13 ,Page No.147" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Answer of part c-d are having slight difference due to approximation in molar volumne in the textbook which here is caluculated to the approximation of 7 decimal digits\n", "\n", "from math import exp\n", "\n", "#given values\n", "T=175.0;#temperature in C\n", "v=0.00375;#sp. volumne in m^3/kg\n", "Pex=10000;#experimentaion determination\n", "\n", "#from Table A-1\n", "R=0.2968# in kPa m^3/kg K\n", "\n", "#calculating\n", "\n", "#Part-a\n", "P=R*T/v;\n", "print'using the ideal-gas equation of state %i kPa'%(round(P))\n", "e=(P-Pex)/Pex*100;\n", "print'error is %f percent'%e;\n", "\n", "#Part-b\n", "#van der Waals constants from Eq. 3-23\n", "a=0.175;\n", "b=0.00138;\n", "#from van der waal eq.\n", "P=R*T/(v-b)-a/v**2;\n", "print'using the van der Waals equation of state is %i kPa'%(round(P));\n", "e=(P-Pex)/Pex*100;\n", "print'error is %f percent'%e;\n", "\n", "#Part-c\n", "#constants in the Beattie-Bridgeman equation from Table 3\u20134\n", "A=102.29;\n", "B=0.05378;\n", "c=4.2*10**4;\n", "Ru=8.314;#in kPa m^3/kmol K\n", "M=28.013;#molecular weight in kg/mol\n", "vb=M*v;#molar vol.\n", "P=(Ru*T)/(vb**2)*(1-((c)/(vb*T**3)))*(vb+B)-(A/vb**2);\n", "print'using the Beattie-Bridgeman equationis %i kPa'%(round(P));\n", "e=(P-Pex)/Pex*100;\n", "print'error is %f percent'%e;\n", "\n", "#Part-d\n", "#constants of Benedict-Webb-Rubin equation from Table 3\u20134\n", "a=2.54;\n", "b=0.002328;\n", "c=7.379*10**4;\n", "alp=1.272*10**-4;\n", "Ao=106.73;\n", "Bo=0.040704;\n", "Co=8.164*10**5;\n", "gam=0.0053;\n", "P=((Ru*T)/vb)+((Bo*Ru*T)-Ao-Co/T**2)/vb**2+(b*Ru*T-a)/vb**3+(a*alp/vb**6)+(c/((vb**3)*(T**2)))*(1 + (gam/vb**2))*exp(-gam/vb**2);\n", "print'using Benedict-Webb-Rubin equation %i kPa'%(round(P));\n", "e=(P-Pex)/Pex*100;\n", "print'error is %f percent'%e;\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "using the ideal-gas equation of state 13851 kPa\n", "error is 38.506667 percent\n", "using the van der Waals equation of state is 9471 kPa\n", "error is -5.288326 percent\n", "using the Beattie-Bridgeman equationis 10109 kPa\n", "error is 1.092970 percent\n", "using Benedict-Webb-Rubin equation 10004 kPa\n", "error is 0.039256 percent\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3-14 ,Page No.152" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given value\n", "T=25;#air temperature over a lake in C\n", "\n", "#from table 3-1\n", "Psat=3.17;#in kPa\n", "\n", "#calculations\n", "\n", "#Relative Humidity 10%\n", "Pv1=0.1*Psat\n", "#Relative Humidity 80%\n", "Pv2=0.8*Psat\n", "#Relative Humidity 100%\n", "Pv3=1*Psat\n", "\n", "# from table 3-1 Tsat at these Pressures are\n", "T1=-8.0;\n", "T2=21.2;\n", "T3=25.0;\n", "print'with relative humidity 10, temperature is %i in C'%T1\n", "print'with relative humidity 80, temperature is %i in C'%T2\n", "print'with relative humidity 100, temperature is %i in C'%T3\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "with relative humidity 10, temperature is -8 in C\n", "with relative humidity 80, temperature is 21 in C\n", "with relative humidity 100, temperature is 25 in C\n" ] } ], "prompt_number": 15 } ], "metadata": {} } ] }