Академический Документы
Профессиональный Документы
Культура Документы
from Lectures
Liquid Storage Tank
wi
V = Ah
wo
Standing assumptions
» Constant liquid density r
» 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 ( rAh) dh
wi w0 rA 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 (VC A )
r kCA qi C Ai qC A kCAV
dt
dC A q
(C Ai C A ) kCA C A (0) C A0
dt V
Assumptions
» Pure reactant A in feed stream
» Perfect mixing
» Constant liquid volume
» Constant physical properties (r, k)
» Isothermal operation
Plug-Flow Chemical Reactor
z Ak
B
r kCA
Assumptions
» Pure reactant A in feed stream
» Perfect plug flow
» Steady-state operation
» Isothermal operation
» Constant physical properties (r, k)
Plug-Flow Chemical Reactor cont.
z
Overall mass balance Component balance
(q) z (q) z Dz q (C A ) z (C A ) z Dz
0 lim kCA 0
lim Dz 0 A Dz
Dz 0
Dz
q dC A
dq kCA 0
0 A dz
dz q dC A
qi q0 q kCA 0 C A (0) C Ai
A dz
Continuous Biochemical Reactor
Agitator
Yield coefficients
» Biomass/substrate: YX/S = -DX/DS
» Product/substrate: YP/S = -DP/DS
» Product/biomass: YP/X = DP/DX
» Assumed to be constant
Substrate limited growth
mm S
m (S )
KS S
1 1
Linear ODE solution:
C A (t ) (1) 1t ( 2 ) 2t 0 2t 1 t
y (t ) c1x e c2 x e c1 e c2 e
CB (t ) 1 1
Isothermal Batch Reactor cont.
Linear ODE solution:
C A (t ) 0 2t 1 t
y(t ) c1 e c2 e
CB (t ) 1 1
Apply initial conditions:
C A (0) 0 1 10
y (0) c1 c2
CB (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 2t 1 t 10e t
C (t ) 101e 101e 2t t
B 10e 10e
Isothermal CSTR
Nonlinear ODE model
dC A q
2A
B
k
(C Af C A ) 2kCA2 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
dX
DX mX
dt
dP
DP qX
dt
1 mm S 1 m m X m m XS
a21 0.375 a22 D 3.529
YX / S KS 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)
m max S
a11 D 0.303 a12 0
KS S
1 m max S 1 m max X m max XS
a21 1.132 a22 D 0.15
YX / S KS S YX / S K S S K S S
2
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
Ak
B
z r kCA
q dC A
kCA 0 C A (0) C Ai
A dz
q C A ( z n 1 ) C A ( z n )
kCA ( z n 1 ) 0
A Dz
1
C A ( z n 1 ) C A ( z n ) C A ( z0 ) C Ai
1 kADz q
N
1
C A ( L) C A ( z N ) C Ai
1 kADz 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 kADz 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
Bk
(C Af C A ) 2kCA2 f (C A )
dt V
V = 2; Ca(i+1)= Ca(i)+h*f;
Caf = 2; end
k = 0.5; plot(t,Ca)
>> iso_cstr_euler
2.2
1.8
1.6
C (g/L)
A
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 k2CB
2A
r3
D r3 k3C A2
CSTR model
dC A q
(C Ai C A ) k1C A 2k3C A2 f1 (C A , CB ) C A (0) C A0
dt V
dCB q
CB k1C A k 2CB f 2 (C A , CB ) CB (0) CB 0
dt V
Forward Euler
q 2
C A,n 1 C A,n hf1 (C A,n , CB ,n ) C A,n h (C Ai C A,n ) k1C A,n 2k3C A,n C A,0 C A0
V
q
CB ,n 1 CB ,n hf 2 (C A,n , CB ,n ) CB ,n h CB ,n k1C A,n k 2CB ,n CB,0 CB 0
V
Stiff System Example
CSTR model: A B C
dC A q dCB q
(C Ai C A ) k1C A CB k1C A k 2C B
dt V dt V
Homogeneous system: C A' (t ) C A (t ) C A CB' (t ) CB (t ) CB
dC A' q ' dCB' q '
C A k1C A' CB k1C A' k2CB'
dt V dt V
C A' (t ) dy ' 2 0
y ' (t ) ' y ' Ay '
C B (t ) dt 1 201
1 2 2 201
Explicit Solution
Forward Euler
dC A'
2C A' C A' ,n 1 C A' ,n h(2C A' ,n )
dt
dCB'
C A' 201CB' CB' ,n 1 CB' ,n h(C A' ,n 201CB' ,n )
dt
First iterative equation
C A' ,n 1 C A' ,n h(2C A' ,n ) (1 2h)C A' ,n C A' ,n (1 2h) n C A' ,0
0 h 12 well behaved
2 h 1
1
oscillator y but stable
h 1 oscillator y and unstable
Second iterative equation
CB' ,n 1 CB' ,n h(C A' ,n 201CB' ,n ) CB' ,n (1 2h) n hC A' ,0 (1 201h) n CB' ,0
0 h 2011
well behaved
1
201 h 201
2
oscillator y but stable
h 201
2
oscillator y and unstable
Implicit Solution
Backward Euler
dC A'
2C A' C A' ,n 1 C A' ,n h(2C A' ,n 1 )
dt
dCB'
C A' 201CB' CB' ,n1 CB' ,n h(C A' ,n 1 201CB' ,n1 )
dt
First iterative equation
1
C '
A, n 1 C '
h(2C ) C
'
A, n 1
'
C '
(1 2h) n
A, n A, n
A, 0
h 0 well behaved
(1 2h) n 1 (1 201h) n
B ,n B ,n A, 0 B,0
h 0 well behaved
Matlab Solution
function f = stiff_cstr(x) >> xo = fsolve(@stiff_cstr,[1 1])
Cai = 2; xo = 1.0000 0.0050
qV = 1; >> df = @(t,x) stiff_cstr(x);
k1 = 1; >> [t,x] = ode23(df,[0,2],[2 0]);
k2 = 200; >> [ts,xs] = ode23s(df,[0,2],[2 0]);
Ca = x(1); >> size(t)
Cb = x(2); ans = 173 1
f(1) = qV*(Cai-Ca)-k1*Ca; >> size(ts)
f(2) = -qV*Cb+k1*Ca-k2*Cb; ans = 30 1
f = f';
Matlab Solution cont.
>> subplot(2,1,1)
>> plot(t,x(:,1))
>> hold 2
ode23
Current plot held ode23s
Ca (g/L)
>> plot(ts,xs(:,1),'r') 1.5
>> ylabel('Ca (g/L)')
>> ylabel('Ca (g/L)')
1
>> xlabel('Time (min)') 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (min)
>> legend('ode23','ode23s')
0.01
>> subplot(2,1,2) ode23
ode23s
>> plot(t,x(:,2))
Cb (g/L)
0.005
>> hold
Current plot held
>> plot(ts,xs(:,2),'r') 0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
>> ylabel('Cb (g/L)') Time (min)
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
VDH v Q V
DH v
Index 0 DAE model
dx F Q/H
( xF x) ( y x) dx
f ( x, y )
dt H DH
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