summaryrefslogtreecommitdiff
path: root/Diffusion:_Mass_Transfer_In_Fluid_Systems_by_E._L._Cussler/ch3.ipynb
blob: 021dcb1ecbae54cbf449e992887fe39a06e37061 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:ab52cce732e12a0e71bfc86859a378d615e77ef1015baf1adf5f96434945a12a"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3 : Diffusion in Concentrated Solutions"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2.4 pg : 64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#variables\n",
      "D = 0.1 \t# cm**2/sec\n",
      "l = 10. \t# cm\n",
      "C10 = 1.\n",
      "C1l = 0\n",
      "C1 = 0.5\n",
      "\n",
      "# calculations\n",
      "V1 = (D/l)*(C10 - C1l)/C1 \t# Cm/sec\n",
      "V2 = -V1\n",
      "M1 = 28 \n",
      "M2 = 2\n",
      "omeg1 = C1*M1/(C1*M1 + C1*M2)\n",
      "omeg2 = C1*M2/(C1*M1 + C1*M2)\n",
      "V = omeg1*V1 + omeg2*V2\n",
      "\n",
      "# results\n",
      "print \"The mass average velocity is %.5f cm/s\"%(V)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mass average velocity is 0.01733 cm/s\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3.1 pg : 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "\n",
      "#initialization of variables\n",
      "# At 6 degree centigrade\n",
      "p1sat = 37. \t# Vapor pressure of benzene in mm Hg\n",
      "p = 760. \t    # atmospheric pressure in mm Hg\n",
      "y1l = 0.\n",
      "y10 = p1sat/p\n",
      "n1byDcbyl = math.log((1-y1l)/(1-y10))\t# because flux n1 = D*c/l * ln(1-y11/1-y10)\n",
      "n2byDcbyl = y10-y1l \t# Flux calculated assuming dilute solution as n1 = Dc/l*(y10-y1l)\n",
      "err1 = ((n1byDcbyl-n2byDcbyl)/n2byDcbyl)*100 \t# Percentage error\n",
      "print \"The error in measurement at 6 degree centigrade is %.1f percent\"%(err1)\n",
      "\n",
      "# At 60 degree centigrade\n",
      "p1sat = 395. \t# Vapor pressure of benzene in mm Hg\n",
      "p = 760.     \t# atmospheric pressure in mm Hg\n",
      "y1l = 0\n",
      "y10 = p1sat/p\n",
      "n1byDcbyl = math.log((1-y1l)/(1-y10))\t# because flux n1 = D*c/l * ln(1-y11/1-y10)\n",
      "n2byDcbyl = y10-y1l \t# Flux calculated assuming dilute solution as n1 = Dc/l*(y10-y1l)\n",
      "err1 = ((n1byDcbyl-n2byDcbyl)/n2byDcbyl)*100 \t# Percentage error\n",
      "print \" The error in measurement at 60 degree centigrade is %.1f percent\"%(err1)\n",
      "\n",
      "# note : book hasn't shown answers."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The error in measurement at 6 degree centigrade is 2.5 percent\n",
        " The error in measurement at 60 degree centigrade is 41.1 percent\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}