diff options
Diffstat (limited to 'Thermodynamics/Chapter3.ipynb')
-rwxr-xr-x | Thermodynamics/Chapter3.ipynb | 456 |
1 files changed, 456 insertions, 0 deletions
diff --git a/Thermodynamics/Chapter3.ipynb b/Thermodynamics/Chapter3.ipynb new file mode 100755 index 00000000..f35af800 --- /dev/null +++ b/Thermodynamics/Chapter3.ipynb @@ -0,0 +1,456 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2adb5810f77a16f36c057b0df75843c0d900b3354a62e4e4e5a6c4e231a86e5c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3:PROPERTIES OF A PURE SUBSTANCE"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.1, Page No:77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "\n",
+ "V=0.01; # Volume of water in a rigid vessel in m^3\n",
+ "m=4.5; # Mass of water+ steam in a rigid vessel in kg\n",
+ "T=35; # Temperature of water in a rigid vessel in degree celcius\n",
+ "#Calculation\n",
+ "\n",
+ "# (a) \n",
+ "v=V/m; # specific volume of water\n",
+ "# From steam table\n",
+ "vf=0.001006; vg=25.22; # specific volume in m^3/kg\n",
+ "x=(v-vf)/(vg-vf); # Quality of steam\n",
+ "x1=1-x; # Quality of water\n",
+ "mg=x*m; # Mass of steam\n",
+ "mf=x1*m; # Mass of water\n",
+ "#Result for (a)\n",
+ "\n",
+ "print \"(a).\\n\",\"Quality of steam in a rigid vessel = \",x,\"\\nQuality of water in a rigid vessel = \",x1\n",
+ "print \"Mass of steam in a rigid vessel = \",round(mg,8),\"kg\\n\",\"Mass of water in a rigid vessel = \",round(mf,9),\"kg\\n\"\n",
+ "# (b)\n",
+ "#Result for (b)\n",
+ "\n",
+ "vc=0.003155; # Crictical volume for water in m^3/kg\n",
+ "print \"(b).\\n\",\"The level of liquid water will rise in the vessel. Since v < vc and refer figure 3.21\\n\"\n",
+ "# (c) \n",
+ "#Result for (c)\n",
+ "\n",
+ "print \"(c)\\n\",\"The final temperature after heating is 370.04 oC. Because it is constant volume process and refer figure 3.21\\n\"\n",
+ "# (d) \n",
+ "#Calculation for (d)\n",
+ "\n",
+ "m1=0.45; # Mass of water in kg\n",
+ "v1=V/m; # specific volume of water\n",
+ "#Result for (d)\n",
+ "\n",
+ "print\"(d).\\n\", \"Level of liquid drops to bottom (v1 > vc). Temperature on reaching saturation state is 298.5 oC and refer figure 3.21\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).\n",
+ "Quality of steam in a rigid vessel = 4.82264368762e-05 \n",
+ "Quality of water in a rigid vessel = 0.999951773563\n",
+ "Mass of steam in a rigid vessel = 0.00021702 kg\n",
+ "Mass of water in a rigid vessel = 4.499782981 kg\n",
+ "\n",
+ "(b).\n",
+ "The level of liquid water will rise in the vessel. Since v < vc and refer figure 3.21\n",
+ "\n",
+ "(c)\n",
+ "The final temperature after heating is 370.04 oC. Because it is constant volume process and refer figure 3.21\n",
+ "\n",
+ "(d).\n",
+ "Level of liquid drops to bottom (v1 > vc). Temperature on reaching saturation state is 298.5 oC and refer figure 3.21\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2, Page No:79 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration for (a)\n",
+ "# (a) Ammonia 26 oC and 0.074 m^3/kg\n",
+ "# From saturation table of ammonia at 26 oC\n",
+ "v=0.074; # specific volume of ammonia in m^3/kg\n",
+ "vf=0.001663; vg=0.1245; # specific volume of ammonia in m^3/kg\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "x=(v-vf)/(vg-vf); # Quality of vapour since v<vg\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a) Ammonia 26 oC and 0.074 m^3/kg\\n\",\"The Quality of ammonia = \",round(x,3)\n",
+ "\n",
+ "#Variable declaration for (b)\n",
+ "# (b).Ammonia 550kPa and 0.31m^3/kg\n",
+ "# From saturation table of ammonia at 550 kPa\n",
+ "v=0.31; # specific volume of ammonia in m^3/kg\n",
+ "vg=0.23; # specific volume of ammonia in m^3/kg\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# v > vg . Since from superheated table by interpolation for 550kPa and v\n",
+ "T=82.1; # Temperature of ammonia in degree celcius\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).Ammonia 550kPa and 0.31m^3/kg\\n\",\"Temperature of ammonia = \",T,\"oC\\n\"\n",
+ "\n",
+ "#Variable declaration for (c)\n",
+ "# (c).Freon 12, 0.35MPa and 0.036 m^3/kg\n",
+ "# From saturation table of Freon 12 at 0.35MPa\n",
+ "v=0.036; # specific volume of Freon 12 in m^3/kg\n",
+ "vf=0.000722; vg=0.049329; # specific volume of Freon 12 in m^3/kg\n",
+ "\n",
+ "#Calculation for (c)\n",
+ "x=(v-vf)/(vg-vf); # Quality of vapour since v<vg\n",
+ "\n",
+ "#Result for (c)\n",
+ "print \"(c).Freon 12, 0.35MPa and 0.036 m^3/kg\\n\",\"The Quality of Freon 12 = \",round(x,2)\n",
+ "\n",
+ "#Variable declaration for (d)\n",
+ "# (d).Methane 0.5MPa and 1.0 m^3/kmol\n",
+ "v=1; # specific volume of Methane in m^3/kmol\n",
+ "# From table at 0.5 MPa molar values are\n",
+ "vf=0.04153; vg=2.007; # specific volume of Methane in m^3/kmol\n",
+ "\n",
+ "#Calculation for (d)\n",
+ "x=(v-vf)/(vg-vf); # Quality of vapour since v<vg\n",
+ "\n",
+ "#Result for (d)\n",
+ "print \"\\n(d).Methane 0.5MPa and 1.0 m^3/kmol\",\"\\nThe Quality of Methane = \",round(x,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Ammonia 26 oC and 0.074 m^3/kg\n",
+ "The Quality of ammonia = 0.589\n",
+ "\n",
+ "(b).Ammonia 550kPa and 0.31m^3/kg\n",
+ "Temperature of ammonia = 82.1 oC\n",
+ "\n",
+ "(c).Freon 12, 0.35MPa and 0.036 m^3/kg\n",
+ "The Quality of Freon 12 = 0.73\n",
+ "\n",
+ "(d).Methane 0.5MPa and 1.0 m^3/kmol \n",
+ "The Quality of Methane = 0.4877\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3, Page No:83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "V=300; # Volume of air in the room in m^3\n",
+ "p=1; # Atmospheric pressure in bar\n",
+ "T=25; # Temperature of air in Degree Celcius\n",
+ "R=287; # Characteristic constant of Air in J/kg k\n",
+ "\n",
+ "#Calculation\n",
+ "m=(p*10**5*V)/(R*(T+273)); # Ideal gas equation\n",
+ "\n",
+ "#Result\n",
+ "print \"Mass of air in room = \",round(m,2),\"kg\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mass of air in room = 350.0 kg\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4, Page No:84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "D=20; # Diameter of the sphere in cm\n",
+ "m=2.54; # Mass of gas filled in sphere in gram\n",
+ "p=10; # Pressure of gas in bar\n",
+ "T=25; # Temperature of gas in Degree Celcius\n",
+ "R=8.3144*10**3; # Universal gas constant in J/kmol K\n",
+ "\n",
+ "#Calculation\n",
+ "V=(3.14*(D*10**-2)**3)/16; # Volume of das in sphere in m^3\n",
+ "M=(m*10**-3*R*(T+273))/(p*10**5*V); # Molecular weight of the gas\n",
+ "\n",
+ "#Result\n",
+ "print \"Molecular weight of the gas = \",round(M,3),\"\\nTherefore gas in sphere is Helium (unless mixture of two or more gases)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Molecular weight of the gas = 4.008 \n",
+ "Therefore gas in sphere is Helium (unless mixture of two or more gases)\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5, Page No:85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "p2=2.5; # Pressure of air in the cylinder in bar\n",
+ "T1=430; # Temperature of air in cylinder in Degree Celcius\n",
+ "V1=1.2; # Volume of cylinder in m^3\n",
+ "V2=0.6; # Volume of cylinder upto end stops in m^3\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "# (a) Temperature of air when the piston reaches the stops\n",
+ "T2=(T1+273)*(V2/V1); # constant pressure process\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Temperature of air when the piston reaches the stops = \",round(T2,1),\"K\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b) The pressure of air when its temperature equals to 25 oC\n",
+ "T3=25; #Room temperature in Degree Celcius\n",
+ "p3=p2*((T3+273)/T2); # constant volume process\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n(b).The pressure of air when its temperature equals to 25 oC = \",round(p3,2),\"bar\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Temperature of air when the piston reaches the stops = 351.5 K\n",
+ "\n",
+ "(b).The pressure of air when its temperature equals to 25 oC = 2.12 bar\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7, Page No:92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "p=6000; # Pressure of nitrogen gas in kPa\n",
+ "T=150; # Temperature of nitrogen gas in kelvin\n",
+ "V=250; # Volume of tank in litres\n",
+ "R_1=8.3143; # Universal gas constant in kJ/kmol K\n",
+ "M=28.1013; # Molecular mass\n",
+ "\n",
+ "#Calculation for (a)\n",
+ "# (a).Beattie - Bridgeman equation of state\n",
+ "# Constants for nitrogen gas\n",
+ "c=4.2*10**4; Ao=136.2315; a=0.02617; Bo=0.05046; b=-0.00691;\n",
+ "# By substituting these values in the following equation \n",
+ "# p=(R_1*T/v^2)*(1-(c/(vT^3)))*(v+Bo*(1-(b/v)))-(Ao/v^2*(1-(a/v)))\n",
+ "# By trial and error we get\n",
+ "v=0.1222; # specific volume in m^3/kmol\n",
+ "m=(M*V/1000)/v; # Mass of nitrogen gas\n",
+ "\n",
+ "#Result for (a)\n",
+ "print \"(a).Beattie - Bridgeman equation of state\",\"\\nMass of nitrogen gas = \",round(m,2),\"kg\"\n",
+ "print \"specific volume of nitrogen gas = \",round(v,4),\"m^3/kmol\"\n",
+ "\n",
+ "#Calculation for (b)\n",
+ "# (b).Nitrogen tables\n",
+ "# From property table of nitrogen fas\n",
+ "v=0.004413; # specific volume in m^3/kg\n",
+ "m=(V/1000)/v; # Mass of nitrogen gas\n",
+ "\n",
+ "#Result for (b)\n",
+ "print \"\\n\\n(b).Nitrogen tables\",\"\\nMass of nitrogen gas = \",round(m,2),\"kg\",\"\\nspecific volume of nitrogen gas = \",round(v,6),\"m^3/kg\"\n",
+ "\n",
+ "#Calculation for (c)\n",
+ "# (c).Ideal gas equation of state\n",
+ "m=(p*V/1000)/(R_1*T/M); #Mass of nitrogen gas\n",
+ "\n",
+ "#Result for (c)\n",
+ "print \"\\n\\n(c).Ideal gas equation of state\",\"\\nMass of nitrogen gas = \",round(m,2),\"kg\"\n",
+ "\n",
+ "#Calculation for (d)\n",
+ "# (d).Generalized compressibility chart\n",
+ "# The crictical properties for nitrogen gas \n",
+ "Tc=126.2; # Temperature in kelvin\n",
+ "Pc=3.349; # Pressure in MPa\n",
+ "# Reduced properties are\n",
+ "Pr=p/Pc; Tr=T/Tc;\n",
+ "z=0.6; # From chart\n",
+ "m=(p*V/1000)/(z*R_1*T/M); #Mass of nitrogen gas\n",
+ "\n",
+ "#Result for (d)\n",
+ "print \"\\n\\n(d).Generalized compressibility chart\",\"\\nMass of nitrogen gas = \",round(m,2),\"kg\"\n",
+ "\n",
+ "#Result for (e)\n",
+ "#(e).Arrangement the methods in order of percentage error\n",
+ "print \" \\n\\n(e).Arrangement the methods in order of percentage error : \"\n",
+ "print \"Nitrogen tables\",\"\\nBeattie - Bridgeman equation of state\",\"\\nGeneralized compressibility chart\",\"\\nIdeal gas equation of state\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a).Beattie - Bridgeman equation of state \n",
+ "Mass of nitrogen gas = 57.49 kg\n",
+ "specific volume of nitrogen gas = 0.1222 m^3/kmol\n",
+ "\n",
+ "\n",
+ "(b).Nitrogen tables \n",
+ "Mass of nitrogen gas = 56.65 kg \n",
+ "specific volume of nitrogen gas = 0.004413 m^3/kg\n",
+ "\n",
+ "\n",
+ "(c).Ideal gas equation of state \n",
+ "Mass of nitrogen gas = 33.8 kg\n",
+ "\n",
+ "\n",
+ "(d).Generalized compressibility chart \n",
+ "Mass of nitrogen gas = 56.33 kg\n",
+ " \n",
+ "\n",
+ "(e).Arrangement the methods in order of percentage error : \n",
+ "Nitrogen tables \n",
+ "Beattie - Bridgeman equation of state \n",
+ "Generalized compressibility chart \n",
+ "Ideal gas equation of state\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8, Page No:97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "T=-58.7; #Normal boling point of CF3Br in Degree Celcius\n",
+ "Tc=340.9; # Crictical temperature of CF3Br in K\n",
+ "pc=4.05; # Crictical pressure of CF3Br in MPa\n",
+ "M=148.9; # Moleclar mass of CF3Br\n",
+ "p=1.01325*10**5; # Atmospheric pressure in N/m^2\n",
+ "R1=8314.4; # Universal gas constant in J/kmol K\n",
+ "R=R1/M; # Gas constant of CF3Br\n",
+ "\n",
+ "#Calculation\n",
+ "a=(0.42748*R**2*Tc**2.5)/(pc*10**6); # Constant of Redlich-Kwong equation of state\n",
+ "b=(0.08664*R*Tc)/(pc*10**6); # Constant of Redlich-Kwong equation of state\n",
+ "vi=(R*(T+273))/p; # Ideal gas volume for assigning initial value\n",
+ "# By substituting these values in the Redlich-Kwong equation of state \n",
+ "vi_1=(R*(T+273)/p)+b-((a/(p*(273+T)**0.5*vi))*((vi-b)/(vi+b))); #and solving it by trial and error method we get\n",
+ "\n",
+ "#Result\n",
+ "print \"Saturated vapour volume = \",round(vi_1,5),\"m^3/kg (roundoff error)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturated vapour volume = 0.1145 m^3/kg (roundoff error)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |