Page 1
Modelling steam methane reforming in a fixed bedreactor
using orthogonal collocation
Kasper Linnestad
Department of Chemical EngineeringNorwegian University of Science and Technology
December 3, 2014
Kasper Linnestad Reactor modelling December 3, 2014 1 / 36
Page 2
Outline
1 Theory
2 Governing equations
3 Implementation
4 Results
5 Conclusion
Kasper Linnestad Reactor modelling December 3, 2014 2 / 36
Page 3
Outline
1 TheoryWeighted residuals methodCollocation pointsOrthogonal collocation method
2 Governing equations
3 Implementation
4 Results
5 Conclusion
Kasper Linnestad Reactor modelling December 3, 2014 3 / 36
Page 4
TheoryWeighted residuals method
General problem
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(z, r)
Approximation
f(z, r) ≈Pz∑
jz=0
Pr∑
jr=0
ajz ,jr ljz(z)ljr(r)
Residual
R(z, r) = L{f(z, r)
}− g(z, r)
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Kasper Linnestad Reactor modelling December 3, 2014 4 / 36
Page 5
TheoryWeighted residuals method
General problem
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(z, r)
Approximation
f(z, r) ≈Pz∑
jz=0
Pr∑
jr=0
ajz ,jr ljz(z)ljr(r)
Residual
R(z, r) = L{f(z, r)
}− g(z, r)
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Kasper Linnestad Reactor modelling December 3, 2014 4 / 36
Page 6
TheoryWeighted residuals method
General problem
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(z, r)
Approximation
f(z, r) ≈Pz∑
jz=0
Pr∑
jr=0
ajz ,jr ljz(z)ljr(r)
Residual
R(z, r) = L{f(z, r)
}− g(z, r)
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Kasper Linnestad Reactor modelling December 3, 2014 4 / 36
Page 7
TheoryWeighted residuals method
General problem
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(z, r)
Approximation
f(z, r) ≈Pz∑
jz=0
Pr∑
jr=0
ajz ,jr ljz(z)ljr(r)
Residual
R(z, r) = L{f(z, r)
}− g(z, r)
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Kasper Linnestad Reactor modelling December 3, 2014 4 / 36
Page 8
TheoryWeighted residuals method
General problem
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(z, r)
Approximation
f(z, r) ≈Pz∑
jz=0
Pr∑
jr=0
ajz ,jr ljz(z)ljr(r)
Residual
R(z, r) = L{f(z, r)
}− g(z, r)
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i 6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Kasper Linnestad Reactor modelling December 3, 2014 4 / 36
Page 9
TheoryWeighted residuals method
General problem
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(z, r)
Approximation
f(z, r) ≈Pz∑
jz=0
Pr∑
jr=0
ajz ,jr ljz(z)ljr(r)
Residual
R(z, r) = L{f(z, r)
}− g(z, r)
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i 6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Kasper Linnestad Reactor modelling December 3, 2014 4 / 36
Page 10
TheoryWeighted residuals method
General problem
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(z, r)
Approximation
f(z, r) ≈Pz∑
jz=0
Pr∑
jr=0
ajz ,jr ljz(z)ljr(r)
Residual
R(z, r) = L{f(z, r)
}− g(z, r)
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i 6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Kasper Linnestad Reactor modelling December 3, 2014 4 / 36
Page 11
TheoryCollocation points
Legendre polynomials∫ 1
−1Ln(x)Lm(x) dx = 0, m 6= n
Collocation points
Lm(xi) = 0, ∀i ∈ {0, . . . ,m}
−1 −0.5 0 0.5 1−2
0
2
xLm(x)
Kasper Linnestad Reactor modelling December 3, 2014 5 / 36
Page 12
TheoryCollocation points
Legendre polynomials∫ 1
−1Ln(x)Lm(x) dx = 0, m 6= n
Collocation points
Lm(xi) = 0, ∀i ∈ {0, . . . ,m} −1 −0.5 0 0.5 1−2
0
2
xLm(x)
Kasper Linnestad Reactor modelling December 3, 2014 5 / 36
Page 13
TheoryOrthogonal collocation method
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i 6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Inserted
R(ziz , rir) = 0, ∀ iz ∈ {0, . . . ,Pz}ir ∈ {0, . . . ,Pr}
System of equations
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(zb, rb)
Linearisation
Af = b
Kasper Linnestad Reactor modelling December 3, 2014 6 / 36
Page 14
TheoryOrthogonal collocation method
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i 6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Inserted
R(ziz , rir) = 0, ∀ iz ∈ {0, . . . ,Pz}ir ∈ {0, . . . ,Pr}
System of equations
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(zb, rb)
Linearisation
Af = b
Kasper Linnestad Reactor modelling December 3, 2014 6 / 36
Page 15
TheoryOrthogonal collocation method
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i 6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Inserted
R(ziz , rir) = 0, ∀ iz ∈ {0, . . . ,Pz}ir ∈ {0, . . . ,Pr}
System of equations
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(zb, rb)
Linearisation
Af = b
Kasper Linnestad Reactor modelling December 3, 2014 6 / 36
Page 16
TheoryOrthogonal collocation method
Minimize residuals by∫R(z, r)wi(z, r) dz dr = 0, ∀i
Orthogonal collocation uses
ajz ,jr = f(zjz , rjr)
ln(x) =
P∏
i=0i 6=n
x− xixn − xi
wi(z, r) = δ(z − ziz)δ(r − rir)
Inserted
R(ziz , rir) = 0, ∀ iz ∈ {0, . . . ,Pz}ir ∈ {0, . . . ,Pr}
System of equations
L{f(z, r)
}= g(z, r)
B{fb(zb, rb)
}= gb(zb, rb)
Linearisation
Af = b
Kasper Linnestad Reactor modelling December 3, 2014 6 / 36
Page 17
TheoryLinearisation
Example function
f(ψ) = ψ2 + ψ exp (−ψ)
Fixed-point (Picard-iteration)
f(ψ) ≈(ψ? + exp
(−ψ?
))ψ
solves f(ψ) = 3 in 114 iterations
Taylor (Newton-Raphson-iteration)
f(ψ) ≈ f(ψ?) +∂f
∂ψ
∣∣∣ψ?
(ψ − ψ?
)
solves f(ψ) = 3 in 8 iterations
Kasper Linnestad Reactor modelling December 3, 2014 7 / 36
Page 18
TheoryLinearisation
Example function
f(ψ) = ψ2 + ψ exp (−ψ)
Fixed-point (Picard-iteration)
f(ψ) ≈(ψ? + exp
(−ψ?
))ψ
solves f(ψ) = 3 in 114 iterations
Taylor (Newton-Raphson-iteration)
f(ψ) ≈ f(ψ?) +∂f
∂ψ
∣∣∣ψ?
(ψ − ψ?
)
solves f(ψ) = 3 in 8 iterations
Kasper Linnestad Reactor modelling December 3, 2014 7 / 36
Page 19
TheoryLinearisation
Example function
f(ψ) = ψ2 + ψ exp (−ψ)
Fixed-point (Picard-iteration)
f(ψ) ≈(ψ? + exp
(−ψ?
))ψ
solves f(ψ) = 3 in 114 iterations
Taylor (Newton-Raphson-iteration)
f(ψ) ≈ f(ψ?) +∂f
∂ψ
∣∣∣ψ?
(ψ − ψ?
)
solves f(ψ) = 3 in 8 iterations
Kasper Linnestad Reactor modelling December 3, 2014 7 / 36
Page 20
Outline
1 Theory
2 Governing equationsContinuity equationEnergy equationSpecies mass balanceErgun’s equationInitial and boundary conditions
3 Implementation
4 Results
5 Conclusion
Kasper Linnestad Reactor modelling December 3, 2014 8 / 36
Page 21
Governing equationsFixed bed reactor
z
r
Kasper Linnestad Reactor modelling December 3, 2014 9 / 36
Page 22
Governing equationsSteam methane reforming
Assumptions
Pseudo-homogeneousEfficiency factor = 10−3
Reactions
CH4 + H2O = CO + 3 H2
CO + H2O = CO2 + H2
CH4 + 2 H2O = CO2 + 4 H2
Kasper Linnestad Reactor modelling December 3, 2014 10 / 36
Page 23
Governing equationsContinuity equation
General form
∂ρ
∂t+∇ · (ρu) = 0
Simplified
∂ρuz∂z
= 0
Linearised
ρ?∂uz∂z
+ uz∂ρ?
∂z︸ ︷︷ ︸⇒Auz
= 0︸︷︷︸⇒buz
Kasper Linnestad Reactor modelling December 3, 2014 11 / 36
Page 24
Governing equationsContinuity equation
General form
∂ρ
∂t+∇ · (ρu) = 0
Simplified
∂ρuz∂z
= 0
Linearised
ρ?∂uz∂z
+ uz∂ρ?
∂z︸ ︷︷ ︸⇒Auz
= 0︸︷︷︸⇒buz
Kasper Linnestad Reactor modelling December 3, 2014 11 / 36
Page 25
Governing equationsContinuity equation
General form
∂ρ
∂t+∇ · (ρu) = 0
Simplified
∂ρuz∂z
= 0
Linearised
ρ?∂uz∂z
+ uz∂ρ?
∂z︸ ︷︷ ︸⇒Auz
= 0︸︷︷︸⇒buz
Kasper Linnestad Reactor modelling December 3, 2014 11 / 36
Page 26
Governing equationsEnergy equation
General form
ρcp
(∂T
∂t+ u · ∇T
)= −∇ · q−∆rxH
Simplified
ρcpuz∂T
∂z=λeff
r
∂
∂r
(r∂T
∂r
)−∆rxH
Linearised
ρ?c?pu?z
∂T
∂z︸ ︷︷ ︸⇒AT
= λeff,?
(1
r
∂T
∂r+∂2T
∂r2
)
︸ ︷︷ ︸⇒AT
−∆rxH?
︸ ︷︷ ︸⇒bT
Kasper Linnestad Reactor modelling December 3, 2014 12 / 36
Page 27
Governing equationsEnergy equation
General form
ρcp
(∂T
∂t+ u · ∇T
)= −∇ · q−∆rxH
Simplified
ρcpuz∂T
∂z=λeff
r
∂
∂r
(r∂T
∂r
)−∆rxH
Linearised
ρ?c?pu?z
∂T
∂z︸ ︷︷ ︸⇒AT
= λeff,?
(1
r
∂T
∂r+∂2T
∂r2
)
︸ ︷︷ ︸⇒AT
−∆rxH?
︸ ︷︷ ︸⇒bT
Kasper Linnestad Reactor modelling December 3, 2014 12 / 36
Page 28
Governing equationsEnergy equation
General form
ρcp
(∂T
∂t+ u · ∇T
)= −∇ · q−∆rxH
Simplified
ρcpuz∂T
∂z=λeff
r
∂
∂r
(r∂T
∂r
)−∆rxH
Linearised
ρ?c?pu?z
∂T
∂z︸ ︷︷ ︸⇒AT
= λeff,?
(1
r
∂T
∂r+∂2T
∂r2
)
︸ ︷︷ ︸⇒AT
−∆rxH?
︸ ︷︷ ︸⇒bT
Kasper Linnestad Reactor modelling December 3, 2014 12 / 36
Page 29
Governing equationsSpecies mass balance
General form
∂ρωi∂t
+∇ · (ρuωi) = −∇ · ji +Ri
Simplified
∂ρuzωi∂z
=Deff
r
∂
∂r
(rρ∂ωi∂r
)−Ri
Linearised
ρ?u?z∂ωi∂z
+ ωiu?z
∂ρ?
∂z+ ρ?ωi
∂u?z∂z︸ ︷︷ ︸
⇒Aωi
= R?i︸︷︷︸⇒bωi
+
Deff,?
(ρ?
r
∂ωi∂r
+∂ρ?
∂r
∂ωi∂r
+ ρ?∂2ωi∂r2
)
︸ ︷︷ ︸⇒Aωi
Kasper Linnestad Reactor modelling December 3, 2014 13 / 36
Page 30
Governing equationsSpecies mass balance
General form
∂ρωi∂t
+∇ · (ρuωi) = −∇ · ji +Ri
Simplified
∂ρuzωi∂z
=Deff
r
∂
∂r
(rρ∂ωi∂r
)−Ri
Linearised
ρ?u?z∂ωi∂z
+ ωiu?z
∂ρ?
∂z+ ρ?ωi
∂u?z∂z︸ ︷︷ ︸
⇒Aωi
= R?i︸︷︷︸⇒bωi
+
Deff,?
(ρ?
r
∂ωi∂r
+∂ρ?
∂r
∂ωi∂r
+ ρ?∂2ωi∂r2
)
︸ ︷︷ ︸⇒Aωi
Kasper Linnestad Reactor modelling December 3, 2014 13 / 36
Page 31
Governing equationsSpecies mass balance
General form
∂ρωi∂t
+∇ · (ρuωi) = −∇ · ji +Ri
Simplified
∂ρuzωi∂z
=Deff
r
∂
∂r
(rρ∂ωi∂r
)−Ri
Linearised
ρ?u?z∂ωi∂z
+ ωiu?z
∂ρ?
∂z+ ρ?ωi
∂u?z∂z︸ ︷︷ ︸
⇒Aωi
= R?i︸︷︷︸⇒bωi
+
Deff,?
(ρ?
r
∂ωi∂r
+∂ρ?
∂r
∂ωi∂r
+ ρ?∂2ωi∂r2
)
︸ ︷︷ ︸⇒Aωi
Kasper Linnestad Reactor modelling December 3, 2014 13 / 36
Page 32
Governing equationsErgun’s equation
General form
dp
dz= −f ρu
2z
dp
Linearised
dp
dz︸︷︷︸⇒Ap
= −f? ρ?(u?z)
2
dp︸ ︷︷ ︸⇒bp
Kasper Linnestad Reactor modelling December 3, 2014 14 / 36
Page 33
Governing equationsErgun’s equation
General form
dp
dz= −f ρu
2z
dp
Linearised
dp
dz︸︷︷︸⇒Ap
= −f? ρ?(u?z)
2
dp︸ ︷︷ ︸⇒bp
Kasper Linnestad Reactor modelling December 3, 2014 14 / 36
Page 34
Governing equationsInitial and boundary conditions
Velocity
uz(z = 0, r)︸ ︷︷ ︸⇒Auz
= uz,inlet︸ ︷︷ ︸⇒buz
Temperature
T (z = 0, r)︸ ︷︷ ︸⇒AT
= Tinlet︸ ︷︷ ︸⇒bT
∂T
∂r
∣∣∣∣∣r=0︸ ︷︷ ︸
⇒AT
= 0︸︷︷︸⇒bT
λeff,? ∂T
∂r
∣∣∣∣∣r=R︸ ︷︷ ︸
⇒AT
= −U?(T ?(r = R)− Ta)︸ ︷︷ ︸⇒bT
Pressure
p(z = 0, r)︸ ︷︷ ︸⇒Ap
= pinlet︸︷︷︸⇒bp
Mass fractions
ωi(z = 0, r)︸ ︷︷ ︸⇒Aωi
= ωi,inlet︸ ︷︷ ︸⇒bωi
∂ωi∂r
∣∣∣∣∣r=0︸ ︷︷ ︸
⇒Aωi
= 0︸︷︷︸⇒bωi
∂ωi∂r
∣∣∣∣∣r=R︸ ︷︷ ︸
⇒Aωi
= 0︸︷︷︸⇒bωi
Kasper Linnestad Reactor modelling December 3, 2014 15 / 36
Page 35
Governing equationsInitial and boundary conditions
Velocity
uz(z = 0, r)︸ ︷︷ ︸⇒Auz
= uz,inlet︸ ︷︷ ︸⇒buz
Temperature
T (z = 0, r)︸ ︷︷ ︸⇒AT
= Tinlet︸ ︷︷ ︸⇒bT
∂T
∂r
∣∣∣∣∣r=0︸ ︷︷ ︸
⇒AT
= 0︸︷︷︸⇒bT
λeff,? ∂T
∂r
∣∣∣∣∣r=R︸ ︷︷ ︸
⇒AT
= −U?(T ?(r = R)− Ta)︸ ︷︷ ︸⇒bT
Pressure
p(z = 0, r)︸ ︷︷ ︸⇒Ap
= pinlet︸︷︷︸⇒bp
Mass fractions
ωi(z = 0, r)︸ ︷︷ ︸⇒Aωi
= ωi,inlet︸ ︷︷ ︸⇒bωi
∂ωi∂r
∣∣∣∣∣r=0︸ ︷︷ ︸
⇒Aωi
= 0︸︷︷︸⇒bωi
∂ωi∂r
∣∣∣∣∣r=R︸ ︷︷ ︸
⇒Aωi
= 0︸︷︷︸⇒bωi
Kasper Linnestad Reactor modelling December 3, 2014 15 / 36
Page 36
Governing equationsInitial and boundary conditions
Velocity
uz(z = 0, r)︸ ︷︷ ︸⇒Auz
= uz,inlet︸ ︷︷ ︸⇒buz
Temperature
T (z = 0, r)︸ ︷︷ ︸⇒AT
= Tinlet︸ ︷︷ ︸⇒bT
∂T
∂r
∣∣∣∣∣r=0︸ ︷︷ ︸
⇒AT
= 0︸︷︷︸⇒bT
λeff,? ∂T
∂r
∣∣∣∣∣r=R︸ ︷︷ ︸
⇒AT
= −U?(T ?(r = R)− Ta)︸ ︷︷ ︸⇒bT
Pressure
p(z = 0, r)︸ ︷︷ ︸⇒Ap
= pinlet︸︷︷︸⇒bp
Mass fractions
ωi(z = 0, r)︸ ︷︷ ︸⇒Aωi
= ωi,inlet︸ ︷︷ ︸⇒bωi
∂ωi∂r
∣∣∣∣∣r=0︸ ︷︷ ︸
⇒Aωi
= 0︸︷︷︸⇒bωi
∂ωi∂r
∣∣∣∣∣r=R︸ ︷︷ ︸
⇒Aωi
= 0︸︷︷︸⇒bωi
Kasper Linnestad Reactor modelling December 3, 2014 15 / 36
Page 37
Governing equationsInitial and boundary conditions
Velocity
uz(z = 0, r)︸ ︷︷ ︸⇒Auz
= uz,inlet︸ ︷︷ ︸⇒buz
Temperature
T (z = 0, r)︸ ︷︷ ︸⇒AT
= Tinlet︸ ︷︷ ︸⇒bT
∂T
∂r
∣∣∣∣∣r=0︸ ︷︷ ︸
⇒AT
= 0︸︷︷︸⇒bT
λeff,? ∂T
∂r
∣∣∣∣∣r=R︸ ︷︷ ︸
⇒AT
= −U?(T ?(r = R)− Ta)︸ ︷︷ ︸⇒bT
Pressure
p(z = 0, r)︸ ︷︷ ︸⇒Ap
= pinlet︸︷︷︸⇒bp
Mass fractions
ωi(z = 0, r)︸ ︷︷ ︸⇒Aωi
= ωi,inlet︸ ︷︷ ︸⇒bωi
∂ωi∂r
∣∣∣∣∣r=0︸ ︷︷ ︸
⇒Aωi
= 0︸︷︷︸⇒bωi
∂ωi∂r
∣∣∣∣∣r=R︸ ︷︷ ︸
⇒Aωi
= 0︸︷︷︸⇒bωi
Kasper Linnestad Reactor modelling December 3, 2014 15 / 36
Page 38
Outline
1 Theory
2 Governing equations
3 ImplementationJuliaUnder-relaxationSegregated approachCombined approachCoupled approach
4 Results
5 Conclusion
Kasper Linnestad Reactor modelling December 3, 2014 16 / 36
Page 39
ImplementationJulia
Open-source
Just-in-time compilation
Constant global variables
Pass by reference (!)
Easy to call programs written in other languages (Fortran, C, Python)
Kasper Linnestad Reactor modelling December 3, 2014 17 / 36
Page 40
ImplementationUnder-relaxation
Trial-and-error
ωi and T
T = γTT + (1− γT )T ?
γT = γω = 5 · 10−2
Kasper Linnestad Reactor modelling December 3, 2014 18 / 36
Page 41
ImplementationSegregated approach
T
ωi
||R||2 < tol
uz
p
||R||2 < tol
Update
Initial guess
||R||2 < tol
Kasper Linnestad Reactor modelling December 3, 2014 19 / 36
Page 42
ImplementationCombined approach
Coupled mass fractions and temperature
Aω1 0 · · ·0 Aω2 0 · · ·0 · · · . . .
I I · · · I 00 · · · AT
ω1
ω2...
ωCO
T
=
bω1
bω2
...1bT
Coupled velocity, density and pressureAuz 0 0
0 I −diag(
M?
RT?
)
0 0 Ap
uzρp
=
buz0bp
Kasper Linnestad Reactor modelling December 3, 2014 20 / 36
Page 43
ImplementationCombined approach
Coupled mass fractions and temperature
Aω1 0 · · ·0 Aω2 0 · · ·0 · · · . . .
I I · · · I 00 · · · AT
ω1
ω2...
ωCO
T
=
bω1
bω2
...1bT
Coupled velocity, density and pressureAuz 0 0
0 I −diag(
M?
RT?
)
0 0 Ap
uzρp
=
buz0bp
Kasper Linnestad Reactor modelling December 3, 2014 20 / 36
Page 44
ImplementationCoupled approach
Fully coupled system of equations
Aω1 0 · · ·0 Aω2 0 · · ·0 · · · . . .
I I · · · I 0 · · ·0 · · · AT 0 · · ·0 · · · Auz 0 0
0 · · · I −diag(
M?
RT?
)
0 · · · Ap
ω1
ω2...
ωCO
Tuzρp
=
bω1
bω2
...1bTbuz0bp
Kasper Linnestad Reactor modelling December 3, 2014 21 / 36
Page 45
Outline
1 Theory
2 Governing equations
3 Implementation
4 ResultsProfilesRun-timeHindsights
5 Conclusion
Kasper Linnestad Reactor modelling December 3, 2014 22 / 36
Page 46
ResultsVelocity
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.01.8
2
2.2
2.4
2.6
2.8
3
3.2
3.4
3.6
3.8
z [m]
uz
[ ms−
1]
Axial velocity in the reactor
r = 0,00m
r = 1,01 · 10−3m
r = 5,19 · 10−3m
r = 1,21 · 10−2m
r = 2,08 · 10−2m
r = 3,02 · 10−2m
r = 3,89 · 10−2m
r = 4,58 · 10−2m
r = 5,00 · 10−2m
r = 5,10 · 10−2m
Kasper Linnestad Reactor modelling December 3, 2014 23 / 36
Page 47
ResultsVelocity
0.00
0.01
0.02
0.03
0.04
0.05 01
23
45
67
2
2.5
3
3.5
r [m] z [m]
uz
[ ms−
1]
Velocity in the reactor
Kasper Linnestad Reactor modelling December 3, 2014 23 / 36
Page 48
ResultsPressure
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.02.76 · 106
2.78 · 106
2.80 · 106
2.82 · 106
2.84 · 106
2.86 · 106
2.88 · 106
2.90 · 106
z [m]
p[Pa]
Pressure in the reactor
Kasper Linnestad Reactor modelling December 3, 2014 24 / 36
Page 49
ResultsTemperature
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0750
800
850
900
950
1,000
1,050
1,100
z [m]
T[K]
Temperature in the reactor
r = 0,00m
r = 1,01 · 10−3m
r = 5,19 · 10−3m
r = 1,21 · 10−2m
r = 2,08 · 10−2m
r = 3,02 · 10−2m
r = 3,89 · 10−2m
r = 4,58 · 10−2m
r = 5,00 · 10−2m
r = 5,10 · 10−2m
Kasper Linnestad Reactor modelling December 3, 2014 25 / 36
Page 50
ResultsTemperature
0.00
0.01
0.02
0.03
0.04
0.05 01
23
45
67
800
900
1,000
r [m] z [m]
T[K]
Temperature in the reactor
Kasper Linnestad Reactor modelling December 3, 2014 25 / 36
Page 51
ResultsHydrogen
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.00.000
0.050
0.100
0.150
0.200
0.250
0.300
0.350
0.400
0.450
z [m]
xH
2
Mole fraction of H2 in the reactor
r = 0,00m
r = 1,01 · 10−3m
r = 5,19 · 10−3m
r = 1,21 · 10−2m
r = 2,08 · 10−2m
r = 3,02 · 10−2m
r = 3,89 · 10−2m
r = 4,58 · 10−2m
r = 5,00 · 10−2m
r = 5,10 · 10−2m
Kasper Linnestad Reactor modelling December 3, 2014 26 / 36
Page 52
ResultsMethane
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.00.040
0.060
0.080
0.100
0.120
0.140
0.160
0.180
0.200
0.220
z [m]
xCH
4
Mole fraction of CH4 in the reactor
r = 0,00m
r = 1,01 · 10−3m
r = 5,19 · 10−3m
r = 1,21 · 10−2m
r = 2,08 · 10−2m
r = 3,02 · 10−2m
r = 3,89 · 10−2m
r = 4,58 · 10−2m
r = 5,00 · 10−2m
r = 5,10 · 10−2m
Kasper Linnestad Reactor modelling December 3, 2014 27 / 36
Page 53
ResultsCarbon dioxide
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.00.000
0.010
0.020
0.030
0.040
0.050
0.060
z [m]
xCO
2
Mole fraction of CO2 in the reactor
r = 0,00m
r = 1,01 · 10−3m
r = 5,19 · 10−3m
r = 1,21 · 10−2m
r = 2,08 · 10−2m
r = 3,02 · 10−2m
r = 3,89 · 10−2m
r = 4,58 · 10−2m
r = 5,00 · 10−2m
r = 5,10 · 10−2m
Kasper Linnestad Reactor modelling December 3, 2014 28 / 36
Page 54
ResultsSteam
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.00.350
0.400
0.450
0.500
0.550
0.600
0.650
0.700
0.750
z [m]
xH
2O
Mole fraction of H2O in the reactor
r = 0,00m
r = 1,01 · 10−3m
r = 5,19 · 10−3m
r = 1,21 · 10−2m
r = 2,08 · 10−2m
r = 3,02 · 10−2m
r = 3,89 · 10−2m
r = 4,58 · 10−2m
r = 5,00 · 10−2m
r = 5,10 · 10−2m
Kasper Linnestad Reactor modelling December 3, 2014 29 / 36
Page 55
ResultsCarbon monoxide
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.00.000
0.010
0.020
0.030
0.040
0.050
0.060
0.070
z [m]
xCO
Mole fraction of CO in the reactor
r = 0,00m
r = 1,01 · 10−3m
r = 5,19 · 10−3m
r = 1,21 · 10−2m
r = 2,08 · 10−2m
r = 3,02 · 10−2m
r = 3,89 · 10−2m
r = 4,58 · 10−2m
r = 5,00 · 10−2m
r = 5,10 · 10−2m
Kasper Linnestad Reactor modelling December 3, 2014 30 / 36
Page 56
ResultsNitrogen
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.00.031
0.032
0.033
0.034
0.035
0.036
0.037
0.038
0.039
0.040
0.041
z [m]
xN
2
Mole fraction of N2 in the reactor
r = 0,00m
r = 1,01 · 10−3m
r = 5,19 · 10−3m
r = 1,21 · 10−2m
r = 2,08 · 10−2m
r = 3,02 · 10−2m
r = 3,89 · 10−2m
r = 4,58 · 10−2m
r = 5,00 · 10−2m
r = 5,10 · 10−2m
Kasper Linnestad Reactor modelling December 3, 2014 31 / 36
Page 57
ResultsRun-time
Solution method Run-time [s]
Finite-difference & ode15s (Matlab) 1.8Collocation – segregated 129.9Collocation – combined 51.1Collocation – coupled 52.0Collocation – coupled & SparseMatrixCSC 14.8
Kasper Linnestad Reactor modelling December 3, 2014 32 / 36
Page 58
ResultsHindsight
Non-dimensional equations
Sparse matrices
Higher collocation point density near inlet
Linearise with Newton
Iterative matrix solvers (CG, GMRES)
Kasper Linnestad Reactor modelling December 3, 2014 33 / 36
Page 59
Outline
1 Theory
2 Governing equations
3 Implementation
4 Results
5 Conclusion
Kasper Linnestad Reactor modelling December 3, 2014 34 / 36
Page 60
Conclusion
FDM with ode15sFastSimpleAutomatic step-size controlNo support for boundary conditions in z
Orthogonal collocation
SlowNot as simple (but not that hard)Supports boundary conditions in zEasy differentiation (Kronecker product)Trial and error for relaxation factorsGlobal index notationCollocation points must be given beforehand
Kasper Linnestad Reactor modelling December 3, 2014 35 / 36
Page 61
Questions?
Kasper Linnestad Reactor modelling December 3, 2014 36 / 36