summaryrefslogtreecommitdiff
path: root/Thermodynamics:_A_Core_Course/CH4.ipynb
blob: f0aec6884d42ec1e85f6aefada708df198f2eef9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4:Defining Thermodynamic State:The State Postulate"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1,Page no:51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 4.1\n",
      "\n",
      "#to find the mass of substance present in liquid and vapour phase \n",
      "#Variable declaration\n",
      "M=2.5 \t\t\t\t#mass of the substance[Kg]\n",
      "x=0.6 \t\t\t\t#mass fraction for vapour phase \n",
      "P=7 \t\t\t\t#pressure [atm]\n",
      "T=438 \t\t\t\t#temperature[K]\n",
      "\n",
      "#Calculation\n",
      "Ml=(1-x)*M \t\t\t#mass fraction of liquid phase[Kg]\n",
      "Mg=x*M \t\t\t\t#mass fraction of vapour phase[Kg]\n",
      "#Result\n",
      "print\"M(liquid phase)=\",Ml,\"Kg\\nM(vapour phase)=\",Mg,\"Kg\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "M(liquid phase)= 1.0 Kg\n",
        "M(vapour phase)= 1.5 Kg\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2,Page no:51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 4.2\n",
      "\n",
      "#to find the total volume occupied by  the mixture \n",
      "#Variable declaration\n",
      "Vl=0.0177 \t\t\t#specific volume of saturated liquid[m3/Kg]\n",
      "Vg=4.43 \t\t\t#specific volume of saturated vapour[m3/Kg]\n",
      "P=7 \t\t\t\t#pressure[atm]\n",
      "T=438 \t\t\t\t#temperature[K]\n",
      "x=0.6 \t\t\t\t#fraction of vapour phase\n",
      "M=2.5 \t\t\t\t#mass of the substance[Kg]\n",
      "\n",
      "#Calculation\n",
      "V=((1-x)*Vl+x*Vg)*M \t\t#total volume occupied [m3]\n",
      "#result\n",
      "print\"Total volume occupied =\",round(V,2),\"m^3\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Total volume occupied = 6.66 m^3\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3,Page no:51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 4.3\n",
      "\n",
      "#to find the total internal energy of the mixture\n",
      "#Variable declaration\n",
      "M=2.5 \t\t\t\t#mass of a substance[Kg]\n",
      "x=0.6 \t\t\t\t#fraction of vapour phase \n",
      "Ug=1105.0 \t\t\t#specific internal energy of saturated vapour[J/Kg]\n",
      "Ul=298.0 \t\t\t\t#specific internal energy of saturated liquid[J/Kg] \n",
      "#Calculation\n",
      "U=M*((1-x)*Ul+x*Ug) \n",
      "#Result\n",
      "print\"The total internal energy of the mixture =\",U,\"J\"\n",
      "print\"\\nNOTE:In textbook,it is wrongly calculated as 1950 J\"\n",
      " "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total internal energy of the mixture = 1955.5 J\n",
        "\n",
        "NOTE:In textbook,it is wrongly calculated as 1950 J\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}