summaryrefslogtreecommitdiff
path: root/Chemical_Reaction_Engineering/ch16.ipynb
blob: f90f61a47f254e805f0e6b3ec11c8d6bcf9c1778 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 16 Earliness of Mixing, Segregation, and RTD"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16.1 pageno : 358"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math \n",
      "from scipy.integrate import quad \n",
      "\n",
      "# Variables\n",
      "Co = 1.\n",
      "k = 1.\n",
      "t = 1.      #given\n",
      "\n",
      "# Calculations and Results\n",
      "C1 = (-1+math.sqrt(1-4*t*(-Co)))/2*t;\n",
      "#For the plug flow reactor\n",
      "#t = 1/k(1/C2-1/C1)\n",
      "C2 = C1/(1+k*t*C1);\n",
      "print \" Conversion for flow scheme A is %.3f\"%(C2)\n",
      "\n",
      "#For plug flow\n",
      "C3 = Co/(1+k*t*Co);\n",
      "#For mixed flow reactor\n",
      "C4 = (-1+math.sqrt(1-4*t*(-C3)))/2*t;\n",
      "print \" Conversion for flow scheme B is %.3f\"%(C4)\n",
      "\n",
      "#Using exit age distribution fn for 2 equal plug-mixed flow reactor system,umath.sing fig 12.1\n",
      "t_bar = 2.\n",
      "in_ = 1000.\n",
      "\n",
      "def f3(t): \n",
      "\t return (2/t_bar)*(math.exp(1-2*t/t_bar))/(1+Co*k*t)\n",
      "\n",
      "C5 =  quad(f3,t_bar/2,in_)[0]\n",
      "\n",
      "print \" Conversion for flow scheme C,D,E is %.3f\"%(C5)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Conversion for flow scheme A is 0.382\n",
        " Conversion for flow scheme B is 0.366\n",
        " Conversion for flow scheme C,D,E is 0.361"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}