Professional Documents
Culture Documents
from Lectures
Liquid Storage Tank
wi
V = Ah
wo
Standing assumptions
Constant liquid density
Constant cross-sectional area A
Other possible assumptions
Steady-state operation
Outlet flow rate w0 known function of liquid level h
Mass Balance
Mass balance on tank
d ( Ah) dh
wi w0 A wi w0
dt dt
in out
accumulation
Steady-state operation: 0 wi w0 w0 wi
Valve characteristics
Linear wo Cv h Nonlinear wo Cv h
d ( V )
0 qi q qi q
dt
Component balance
A k B
d (VC A )
r kC A qi C Ai qC A kC AV
dt
dC A q
(C Ai C A ) kC A C A (0) C A0
dt V
Assumptions
Pure reactant A in feed stream
Perfect mixing
Constant liquid volume
Constant physical properties (, k)
Isothermal operation
Plug-Flow Chemical Reactor
z A k B
r kC A
Assumptions
Pure reactant A in feed stream
Perfect plug flow
Steady-state operation
Isothermal operation
Constant physical properties (, k)
Plug-Flow Chemical Reactor cont.
z
Overall mass balance
Component balance
( q) z ( q ) z z 0 (qC A ) z (qC A ) z z kC A Az 0
Mass in Mass out A in A out A consumed
(q ) z (q ) z z q (C A ) z (C A ) z z
lim 0 lim kC A 0
z 0 A z
z 0
z
dq q dC A
0 kC A 0
A dz
dz q dC A
qi q0 q kC A 0 C A (0) C Ai
A dz
Continuous Biochemical Reactor
Agitator
1 1
Linear ODE solution:
C A (t ) (1) 1t ( 2 ) 2 t 0 2t 1 t
y (t ) c1x e c2 x e c1 e c2 e
C B (t ) 1 1
Isothermal Batch Reactor cont.
Linear ODE solution:
C A (t ) 0 2 t 1 t
y (t ) c1 e c2 e
C B (t ) 1 1
Apply initial conditions:
C A (0) 0 1 10
y (0) c1 c2
C B (0) 1 1 0
Formulate matrix problem:
0 1 c1 10 c1 10
1 1 c 0
c 10
2 2
Solution:
C A (t ) 0 2 t 1 t 10e t
C (t ) 10 e 10 e 2t t
B 1 1
10 e 10 e
Isothermal CSTR
Nonlinear ODE model
dC A q
2A B
k
(C Af C A ) 2kC A2 f (C A )
dt V
V 2
C A2 C A 2 0
1 12 (4)(1)(2) 1 3
CA 1
(2)(1) 2
Isothermal CSTR cont.
Linearize about steady-state point:
dC A' f
f (C A ) C A'
dt C A CA
0
'
dC A
[C A (2)(2)(0.5)C A ]C A 3C A
' '
dt
Steady-state equations
m S
DX ( S ) X 0 (S )
KS S
1
D( S 0 S ) (S ) X 0
YX / S
1 m S 1 m X m XS
a21 0.375 a22 D 3.529
YX / S K S S YX / S K S S K S S
2
Stability Analysis
Matrix representation
X dx 0 1.472
x x Ax
S dt 0.375 3.529
Eigenvalues (units h-1)
1.472
A I 1 0.164 1 3.365
0.375 3.529
Conclusion
Non-trivial steady state is asymptotically stable
Result holds locally near the steady state
Washout Steady State
Steady state: S Si 20 g/L X 0 g/L
Linear model coefficients (units h-1)
max S
a11 D 0.303 a12 0
KS S
1 max S 1 max X max
X S
a21 1.132 a22 D 0.15
YX / S KS S YX / S KS S K S 2
S
Eigenvalues (units h)
0.303 0
A I 1 0.303 1 0.15
1.132 0.15
Conclusion
Washout steady state is unstable
Suggests that non-trivial steady state is globally stable
Gaussian Quadrature Example
Analytical solution
5 5
e
1x 1x
2
dx 2e 2
21.067545
1 1
Variable transformation
2 x ( a b) 1
t 2 x 32 x 2t 3
ba
Approximate solution
5 1 1 t3
e dx e 2dt 2 e
1x 1 ( 2 t 3)
2 2 2
dt
1 1 1
1
t 32 0.77459 3 2 0 3 2 0.77459 3 2
e dt (0.55555)e (0.88889)e (0.55555)e 10.533346
1
5
e
1x
2
dx 2(10.533346) 21.066691
1
0 L
A k B
z r kC A
q dC A
kC A 0 C A (0) C Ai
A dz
q C A ( z n 1 ) C A ( z n )
kC A ( z n 1 ) 0
A z
1
C A ( z n 1 ) C A ( z n ) C A ( z0 ) C Ai
1 kAz q
N
1
C A ( L) C A ( z N ) C Ai
1 kAz q
Plug-Flow Reactor Example cont.
Analytical solution
kA
C A ( L) C Ai exp L
q
Numerical solution
N N
1 1
C A ( L) C Ai C Ai
1 kAz q 1 kAL Nq
Convergence formula
N
1
lim e a
N 1 a N
Convergence of numerical solution
N
1 kA
lim C Ai C Ai exp L
N
1 kA L Nq q
Matlab Example
Isothermal CSTR model
dC A q
2A B
k
(C Af C A ) 2kC A2 f (C A )
dt V
Cao = 2; f = q/V*(Caf-Ca(i))-
2*k*Ca(i)^2;
q = 2;
Ca(i+1)= Ca(i)+h*f;
V = 2; end
Caf = 2; plot(t,Ca)
k = 0.5; ylabel('Ca (g/L)')
t(1) = 0; xlabel('Time (min)')
Ca(1) = Cao; axis([0,2,0.75,2.25])
Euler Solution
>> iso_cstr_euler
2.2
1.8
1.6
CA (g/L)
1.4
1.2
0.8
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (min)
Solution with Matlab Function
function f = iso_cstr(x) >> xss = fsolve(@iso_cstr,2)
Cao = 2; xss = 1.0000
q = 2; >> df = @(t,x) iso_cstr(x);
V = 2; >> [t,x] = ode23(df,[0,2],2);
Caf = 2; >> plot(t,x)
k = 0.5; >> ylabel('Ca (g/L)')
Ca = x(1); >> xlabel('Time (min)')
f(1) = q/V*(Caf-Ca)-2*k*Ca^2; >> axis([0,2,0.75,2.25])
Matlab Function Solution
2.2
2 Euler
Matlab
1.8
1.6
Ca (g/L)
1.4
1.2
0.8
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (min)
CSTR Example
Van de Vusse reaction
A r1 B r2 C r1 k1C A r2 k 2C B
2 A r3 D r3 k3C A2
CSTR model
dC A q
(C Ai C A ) k1C A 2k3C A2 f1 (C A , C B ) C A (0) C A0
dt V
dC B q
C B k1C A k 2C B f 2 (C A , C B ) C B ( 0) C B 0
dt V
Forward Euler
q 2
C A,n 1 C A,n hf1 (C A,n , C B ,n ) C A,n h (C Ai C A,n ) k1C A,n 2k3C A,n C A, 0 C A 0
V
q
C B ,n 1 C B ,n hf 2 (C A,n , C B ,n ) C B ,n h C B ,n k1C A,n k 2C B ,n CB,0 CB 0
V
Stiff System Example
CSTR model: A B C
dC A q dC B q
(C Ai C A ) k1C A C B k1C A k 2C B
dt V dt V
Homogeneous system: C A' (t ) C A (t ) C A C B' (t ) C B (t ) C B
Ca (g/L)
>> plot(ts,xs(:,1),'r') 1.5
0.005
>> hold
Current plot held
0
>> plot(ts,xs(:,2),'r') 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (min)
>> ylabel('Cb (g/L)')
>> xlabel('Time (min)')
>> legend('ode23','ode23s')
Binary Flash Unit
Schematic diagram Assumptions
Saturated liquid feed
V, y
Vapor Perfect mixing
Negligible heat losses
Negligible vapor holdup
F, xF Negligible energy
Feed
Q accumulation
Heat
H Constant heat of
vaporization
L, x
Liquid Constant relative
volatility
Vapor-liquid equilibrium
x
y
1 ( 1) x
Model Formulation
Mass balance
dH
F V L
dt
Component balance
d ( Hx)
FxF Vy Lx
dt
d ( Hx) dH dx dx
x H x ( F V L) H
dt dt dt dt
dx
H ( F V L) x FxF Vy Lx F ( xF x) V ( y x)
dt
Model Formulation cont.
Steady-state energy balance
Q
VH v Q V
H v
Index 0 DAE model
dx F Q/H dx
( xF x) ( y x)
dt H H f ( x, y )
x dt
0 y 0 g ( x, y )
1 ( 1) x
Binary Flash Unit Revisited
DAE model
dx F V
( xF x) ( y x)
dt H H
x
0 y
1 ( 1) x
H = 5;
F = 10;
xf = 0.5;
V = 2;
alpha = 10;
xv = x(1);
yv = x(2);
f(1) = F/H*(xf-xv)-V/H*(yv-xv);
f(2) = yv-alpha*xv/(1+(alpha-1)*xv);
f = f';
Matlab Commands
Results for V = 2
>> f = @(x) binary_flash(x);
>> xss = fsolve(f,[1 1],[])
xss = 0.4068 0.8727
>> df = @(t,x) binary_flash(x);
>> M = [1 0; 0 0];
>> options=odeset('Mass',M);
>> [t1,y1]=ode15s(df,[0,10],xss,options);
Change V = 1
>> [t2,y2]=ode15s(df,[0,10],xss,options);
Results for V = 2 and V = 1
0.9
0.85
Liquid
0.8
Vapor
0.75
0.7
Mole Fraction
0.65
0.6
0.55
0.5
0.45
0.4
0 1 2 3 4 5 6 7 8 9 10
Time