Reactor Technology Project 1
Reactor Technology Project 1
Reactor technology
Project 1
April 1, 2014
Contents
1 Objectives 4
2 Initial Information 4
3 Differential Equations 4
3.1 Species Mass Balance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2 Energy Balance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.3 Momentum Balance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Called functions 5
4.1 Heat Capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4.2 Enthalpy of Reaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.3 Rate of Reaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.4 Friction Factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.5 Ideal Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.6 Ideal Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.7 Derivative of Pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.8 Derivative of Partial Pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.9 Derivative of Temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.10 Derivative of Velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.11 Reactor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.12 Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5 Construction in MATLAB 21
5.1 The Main File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.1 Declaring the variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.1.3 Calculation and Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6 Results 25
2
5.2 main.m continued . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.3 main.m continued . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.4 main.m continued . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3
1 Objectives
In this project, two reactions for the combustion and oxidization of sulfur and sulfur dioxide are studied:
S + O2 → SO2 (1.1)
1
SO2 + 2 O2 → SO3 (1.2)
The first reaction is carried out in a furnace where sulfur is burned, while the second reaction takes place
in a multi-tube reactor. One of these tubes will be modelled in detail, to look closer at pressure profile,
temperature profile, gas velocity profile, as well as the partial pressures and mole fractions of each component.
2 Differential Equations
The differential equations for mass, energy and momentum are given below. These are solved using a
numerical method as discussed in Sec. ??, and solved in MATLAB as discussed in Sec. ?? and Sec. ??.
The complete species mass balance is given in Eq. 3.1 below. This equation is used to derive the expressions
for the velocity profile and the partial pressure profiles in the reactor.
∂ cj
+ ∇ · (cj u∗ ) = ∇ · (Dj ∇cj ) + Ri (2.1)
∂t
where the terms represent change of concentration with time, convective transport, molecular diffusion and
the reaction rate, respectively. In this case plug flow is assumed with steady state and no dispersion so the
species mass balance is simplified to
d(u∗z cj )
= νj rρbulk
c (2.2)
dz
Where cj is the concentration of component j ∈ {SO2 , O2 , SO3 , N2 }, u∗z is the mole averaged velocity in the
z-direction, r is the reaction rate of the oxidation (2.2) and ρbulk is the density of the gas in the bulk phase.
By summing over all components to obtain the total mass balance, Eq. (3.3) is obtained
d(u∗z ctot ) X d(u∗z cj ) X
= = rρbulk
c νj (2.3)
dz j
dz j
du∗
By using the ideal gas law, differentiating Eq. (3.3) and solving for dz ,
z
Eq. (??) is obtained
du∗z RT bulk X u∗ dT u∗ dp
= rρc νj + z − z (2.4)
dz p j
T dz p dz
Eq. (3.5) is used to describe the partial pressure profiles in the reactor.
4
2.2 Energy Balance
The complete energy balance is given in Eq. 3.6 below. This equation is used to derive the expression for
the temperature profile in the reactor.
X ∂T X X
ρj cp,j + ρj cp,j uT · ∇T = ∇ · (λ∇T ) − ∆HRi Ri + Q (2.6)
j
∂t j i
where the terms represent change of heat with time, advective transport, heat transport by conduction, heat
effect of the chemical reactions and radiation heat flux, respectively. Assuming steady state, neglecting the
transient and conductive terms and only considering heat flow in axial direction, the equation is simplified
to Eq. 3.7
X dT U
uz ρj cp,j = −∆HRi rSO2 ρbulk − 4 (T − Ta ) (2.7)
j
dz dt
where cp,j is the heat capacity of component j, ∆HRi is the enthalpy of reaction, U is the overall heat
transfer coefficient, dt is the tube diameter, T and Ta is the temperatures inside and outside the tubes,
respectively. Eq. (3.7) is used to describe the temperature profile in the reactor.
dp f ρu2
=− (2.8)
dz dt
where dp
dz is the derivative of pressure with respect to z, f is the friction factor, ρg is the gas density, u is the
fluid velocity and dt is the tube diameter. This expression is using the mass averaged velocity rather than
the mole average velocity, but we assume that they are almost equal in this project.
The friction factor is given in Eq. 3.9 as a function of void fraction, , and the Reynold’s number of the
particle, NRe .
1− 5/6 1 −
f= 3 1.75 + 4.2NRe (2.9)
NRe
3 Numerical method
In this project, the MATLAB solver ode45 is used to solve the differantial equations. The solver is based on
an explicit Runge-Kutta (4,5) formula, the Dormand-Prince pair[?]. It is a one-step solver—in computing
y(tn ), it needs only the solution at the immediately preceding time point, y(tn−1 ). In general, ode45 is
regarded by MathWorks (the company behind MATLAB) as “(...)the best function to apply as a first try for
most problems.”[?]
If the problem had been sufficiently stiff, the ode15s would have been the solver of choice. This solver is
also used in the case of DAEs. A stiff problem will consist of several processes, at least one of which will
have a (relatively) very small time constant.
In this case, it is verified that the use of ode45 is computationally more efficient than the use of ode15s.
By using tic/toc in MATLAB, the runtime is found to be ∼ 1 s and ∼ 2 s, respectivly. This is regarded as
evidence that the system in question is not particularly stiff, and that ode45 is the most suitable solver.
5
4 MATLAB functions
10 % cp,i = α + β T + γ T 2
11 cp =[30.178+42.452e-3*temperature-18.218e-6*temperature^2; % [J mol−1 K−1 ]
12 23.995+17.507e-3*temperature-6.628e-6*temperature^2; % [J mol−1 K−1 ]
13 35.634+71.722e-3*temperature-31.539e-6*temperature^2; % [J mol−1 K−1 ]
14 26.159+6.615e-3*temperature-2.889e-7*temperature^2]; % [J mol−1 K−1 ]
15 end
6
4.2 Enthalpy of Reaction
7
4.3 Rate of Reaction
8
Program code 4.5: getEquilibriumConstant.m
1 function kp = getEquilibriumConstant(temperature)
2 %% Equilibrium Constant
3 % Calculates the equlibrium constant for the reaction:
4 % SO2 + 12 O2 → SO3
5 % at a given temperature
6 % Input:
7 % temperature: The temperature, T [K]
8 % Output:
9 % kp: The equilibrium constant, Kp
10
22 % Friction factor,
f
1− 5/6 1−
23 % f = 3 1.75 + 4.2NRe N Re
24 f = ((1-void)/(void.^3))*(1.75+(4.2*re^(5/6))*(1-void)/re);
25 end
9
Program code 4.7: getReynolds.m
1 function re = getReynolds(density, velocity, diameter, viscosity)
2 %% Reynold’s number
3 % Calculates the Reynolds Number for flow in a pipe or tube, using the fluid
4 % density, flow velocity, characteristic diameter and dynamic fluid
5 % viscosity
6 % Input:
7 % density: The density of the gas, ρg [kg m−3 ]
8 % velocity: The velocity of the gas, uz [m s−1 ]
9 % diameter: The diameter of the particles, dp [m]
10 % viscosity: The dynamic viscosity of the gas, µ [kg s−1 m−1 ]
11 % Output:
12 % re: The Reynold’s number, NRe
13
14 % NRe = udρµ
15 re = density*velocity*diameter/viscosity;
16 end
MT p
14 % ρ = mass
RT
15 rho = molarMass’*pressure/(r*temperature); % [kg m−3 ]
16 end
10
4.6 Ideal Velocity
24 % Velocity uz = nRT
Ac p
25 vel = n*r*temperature/(area*p); % [m s−1 ]
26 end
11
4.7 Derivative of Pressure
21 % Friction factor, f
22 f = getFrictionFactor(void, density, velocity, diameter, viscosity);
23
12
4.8 Derivative of Partial Pressure
dp duz dT
26 % = RTu ν T ρcat r − upz + Tp
dz z dz dz
27 dp = r*temperature/velocity * nu’ * rhoCat * reactionRate - ...
28 pressure/velocity * velocityDerivative + ...
29 pressure/temperature * temperatureDerivative; % [Pa m−1 ]
30 end
31
13
4.9 Derivative of Temperature
dT
30 % = uRT
zp
T rρcat (−∆ rx H) − 4U
dt (T − Toutside )
dz
31 dT = r*temperature/(velocity*heatCapacity’*pressure) * ...
32 (reactionRate*rhoCat*(-reactionEnthalpy) - ...
33 4*heatTransferCoefficient/tubeDiameter * ...
34 (temperature-ambientTemperature)); % [K m−1 ]
35 end
14
4.10 Derivative of Velocity
26 % Total pressure, p
27 pressure = sum(pressure);
28
duz uz dT dp
32 % = RTp ρcat rν + T dz − upz
dz dz
33 du = r*temperature./pressure*rhoCat*reactionRate*nu+ ...
34 velocity/temperature*temperatureDerivative - ...
35 velocity/sum(pressure)*pressureDerivative; % [s−1 ]
36 end
4.11 Reactor
15
7 % Input:
8 % x: The state
9 % x(1) is the temperature
10 % x(2) is the velocity
11 % x(3:6) is the partial pressures
12 % par: The parameters as a struct
13 % rhoCat: The density of the catalysator, ρcat [kg m−3 ]
14 % nu: The stoichiometric coefficients, ν
15 % u: The overall heat transfer coefficient, U [J s−1 m−2 K−1 ]
16 % r0: The radius of the tube, r0 [m]
17 % dp: The diameter of the particles, dp [m]
18 % tOutside: The temperature outside, Toutside [K]
19 % void: The void fraction,
20 % viscosity: The dynamic viscosity, µ [kg m−1 s−1 ]
21 % mMass: The molar masses, Mmass [kg mol−1 ]
22 %% Extracting parameters
23 rhoCat = par.rhoCat;
24 nu = par.nu;
25 heatTransferCoefficient = par.u;
26 tubeDiameter = 2*par.r0;
27 particleDiameter = par.dp;
28 ambientTemperature = par.tOutside;
29 void = par.void;
30 viscosity = par.mu;
31 molecularMass = par.mMass;
32
33 %% Extracting states
34 temperature = x(1);
35 velocity = x(2);
36 pressure = x(3:end);
37
38 %% Calculations
39 reactionRate = getReactionRate(temperature, pressure);
40 reactionEnthalpy = getReactionEnthalpy(temperature);
41 heatCapacity = getHeatCapacity(temperature);
42 density = getIdealDensity(pressure, molecularMass, temperature);
43
44 %% Derivatives;
45 pressureDerivative = getPressureDerivative(void,...
46 density,...
47 velocity,...
48 particleDiameter,...
49 viscosity);
50
51 temperatureDerivative = getTemperatureDerivative(temperature,...
52 velocity,...
53 pressure,...
54 rhoCat,...
55 heatTransferCoefficient,...
56 tubeDiameter,...
57 ambientTemperature,...
58 reactionRate,...
59 reactionEnthalpy,...
60 heatCapacity);
16
61
62 velocityDerivative = getVelocityDerivative(temperature,...
63 pressure,...
64 rhoCat,...
65 nu,...
66 velocity,...
67 reactionRate,...
68 temperatureDerivative,...
69 pressureDerivative);
70
71 partialPressureDerivative = getPartialPressureDerivative(temperature,...
72 velocity,...
73 nu,...
74 rhoCat,...
75 pressure,...
76 reactionRate,...
77 velocityDerivative,...
78 temperatureDerivative);
79 % Return the derivatives
80 dx = [temperatureDerivative;
81 velocityDerivative;
82 partialPressureDerivative];
83 end
4.12 Plots
14
20 if length(speciesList) < 4
21 color = {’k’,’r’,’b’};
22 else
23 color = jet(length(speciesList));
24 end
25
26 molelims = [0 max(max(moleFraction(:,1:length(speciesList))))];
27
17
28 % Plot each species
29 for i = 1:length(speciesList)
30 % Generating legend
31 legendString{i} = [’$\ce{’ speciesList{i} ’}$’];
32
33 % Plot pressure
34 h = figure(i);
35 plot(x,partialPressure(:,i),’k’,’LineWidth’,2);
36 xlabel(’$z$ [m]’);
37 ylabel([’$p_{\ce{’ speciesList{i} ’}}$ [Pa]’]);
38 xlim([min(x) max(x)]);
39 ylim(ylims);
40 matlabfrag([speciesList{i} ’_pressure’ suffix],’handle’,h);
41 close(h);
42
71
72 end %for
73
74 hPressure = figure(length(speciesList)+1);
75 xlabel(’$z$ [m]’);
76 ylabel(’$p$ [Pa]’);
77 legend(legendString, ’Location’, ’Best’);
78 xlim([min(x) max(x)]);
79 ylim(ylims);
80 matlabfrag([’partialpressure’ suffix],’handle’,hPressure);
81 close(hPressure);
18
82
83 hFraction = figure(length(speciesList)+2);
84 xlabel(’$z$ [m]’);
85 ylabel(’$x$’);
86 legend(legendString, ’Location’, ’Best’);
87 xlim([min(x) max(x)]);
88 ylim(molelims);
89 matlabfrag([’molefraction’ suffix],’handle’,hFraction);
90 close(hFraction);
91 end
13 pressure = sum(pressure,2);
14
15 if nargin < 5
16 h = figure(1);
17 plot(x,pressure,’k’,’LineWidth’,2);
18 xlabel(’$z$ [m]’);
19 ylabel(’$p$ [Pa]’);
20 xlim([min(x) max(x)]);
21 ylim(ylims);
22 else
23 disp(’Not yet implemented’);
24 end
25
26 matlabfrag([’pressure’ suffix],’handle’,h);
27
28 close(h);
29 end
19
Program code 4.17: getPlotTemperature.m
1 function getPlotTemperature(temperature,x,ylims,suffix,t)
2 %% Plot the temperature
3 % Creates a plot of the temperature and saves it as a pdf.
4 % Input:
5 % temperature: The velocity as a matrix where the rows correspond to
6 % the time, and the columns correspond to the spacial
7 % coordinate.
8 % x: The spacial coordinate as a vector.
9 % ylims: Temperature limits.
10 % suffix: A name suffix for the pdf files.
11 % t: The time as a vector (optional)
12
13 if nargin < 5
14 h = figure(1);
15 plot(x,temperature,’k’,’LineWidth’,2);
16 xlabel(’$z$ [m]’);
17 ylabel(’$T$ [K]’);
18 xlim([min(x) max(x)]);
19 ylim(ylims);
20 else
21 disp(’Not yet implemented’);
22 end
23
24 matlabfrag([’temperature’ suffix],’handle’,h);
25
26 close(h);
27 end
20
Program code 4.18: getPlotVelocity.m
1 function getPlotVelocity(velocity,x,ylims,suffix,t)
2 %% Plot the velocity
3 % Creates a plot of the velocity and saves it as a pdf.
4 % Input:
5 % velocity: The velocity as a matrix where the rows correspond to the
6 % time, and the columns correspond to the spacial coordinate.
7 % x: The spacial coordinate as a vector
8 % ylims: Velocity limits
9 % suffix: A name suffix for the pdf files.
10 % t: The time as a vector (optional)
11
12 if nargin < 5
13 h = figure(1);
14 plot(x,velocity,’k’,’LineWidth’,2);
15 xlabel(’$z$ [m]’);
16 ylabel(’$v_z$ $\mathrm{[m s^{-1}]}$’);
17 xlim([min(x) max(x)]);
18 ylim(ylims);
19 else
20 disp(’Not yet implemented’);
21 end
22
23 matlabfrag([’velocity’ suffix],’handle’,h);
24
25 close(h);
26 end
21
5 MATLAB main script
5.1 The Main File
22
5.1.1 Declaring the variables
38 %% Given information
39 % Feed per tube, n0
40 n0 = 0.2149; % [mol s−1 ]
41
42 % Length of reactor, L
43 l = 6.096; % [m]
44
45 % Void fraction,
46 par.void = 0.45;
47
48 % Initial density, ρ0
49 rho0 = 0.865; % [kg m−3 ]
50
51 % Initial pressure, p0
52 p0 = 202650; % [Pa]
53
54 % Diameter of particles, dp
55 par.dp = 0.004572; % [m]
56
57 % Radius of tube, r0
58 par.r0 = 0.0353; % [m]
59
60 % Dynamic viscosity, µ
61 par.mu = 3.7204e-5; % [kg m−1 s−1 ]
62
82 % Stoichiometric matrix, ν
83 par.nu = [-1 -0.5 1 0];
84
23
5.1.2 Initialization
91 % Inlet temperature, T0
92 t0 = [777.78 666.67]; % [K]
93
97 % Inlet state, x0
98 x0 = [t0 ;
99 u0 ;
100 p0 p0];
101
24
5.1.3 Calculation and Plotting
25
6 Results
Fig. 1 displays the change in mole fractions of SO2 , O2 and SO3 with the length of the reactor. As expected
the mole fractions of the reactants, SO2 and O2 , decreases as they are used in the reaction, and the mole
fraction of SO3 increases. For the case with inlet temperature of 666,67 K the mole fraction of SO3 increases
linearly the first 3 m, and then the increase flattens out. For the case with inlet temperature of 777 K the
increase of the mole fraction of SO3 is steeper in the beginning and at about 2 m into the reactor it is
constant. This difference in the two cases is due to the temperature dependency of the reaction rate.
SO2 SO2
0.1 O2 0.1 O2
SO3 SO3
0.09 0.09
0.08 0.08
0.07 0.07
0.06 0.06
x
x
0.05 0.05
0.04 0.04
0.03 0.03
0.02 0.02
0.01 0.01
0 0
0 1 2 3 4 5 6 0 1 2 3 4 5 6
z [m] z [m]
(a) Mole fractions of species with T0 = 666,67 K (b) Mole fractions of species with T0 = 777,78 K
Figure 1: Mole fractions of species. Note that xN2 is omitted for clarity.
As can be seen in Fig. 2, the partial pressures of the reactants decrease and more product is produced along
the reactor tube. The change in partial pressure is large at the tube inlet, and decreases further down the
tube, closer to equilibrium.
×104 ×104
2.5 2.5
SO2 SO2
O2 O2
SO3 SO3
2 2
1.5 1.5
p [Pa]
p [Pa]
1 1
0.5 0.5
0 0
0 1 2 3 4 5 6 0 1 2 3 4 5 6
z [m] z [m]
(a) Partial pressure of species with T0 = 666,67 K (b) Partial pressure of species with T0 = 777,78 K
Figure 2: Partial pressure of species. Note that pN2 is omitted for clarity. Note also that all the partial
pressures are reduced towards the end of the reactor due to drop in total pressure
Fig. 3 shows how the pressure changes along the length of the reactor. When the gas velocity through the
reactor increases, the pressure drops according to Ergun’s equation, (3.8). The linearity of the pressure drop
26
is due to conservation of mass, ρ0 u0 = ρg uz , which makes Ergun’s equation linear. Conservation of mass is
not explicitly used in the modeling, but it is observed that this relationship is valid.
×105 ×105
2.1 2.1
2 2
1.9 1.9
1.8 1.8
1.7 1.7
p [Pa]
p [Pa]
1.6 1.6
1.5 1.5
1.4 1.4
1.3 1.3
1.2 1.2
0 1 2 3 4 5 6 0 1 2 3 4 5 6
z [m] z [m]
(a) Total pressure in the reactor with T0 = 666,67 K (b) Total pressure in the reactor with T0 = 777,78 K
The reactor temperature profile can be seen in Fig. 4. At the reactor tube inlet the temperature is high due
to the reaction being exothermic and rate of reaction being a function of concentration, which is high at the
inlet. The reaction continues to heat up the reactor tube until a temperature hotspot at 1,70 m and 0,32 m
of Thotspot = 738,86 K and Thotspot = 863,09 K for low and high initial temperature, respectively. From here,
the reactor cooling exceeds heat of reaction and the temperature decreases and stabilizes.
880 880
860 860
840 840
820 820
800 800
780 780
T [K]
T [K]
760 760
740 740
720 720
700 700
680 680
660 660
0 1 2 3 4 5 6 0 1 2 3 4 5 6
z [m] z [m]
(a) Temperature profile in the reactor with T0 = 666,67 K (b) Temperature profile in the reactor with T0 = 777,78 K
27
The velocity profile in the reactor is shown in Fig. 5. At the reactor tube inlet the temperature is high,
which causes an increase in velocity as expected from the assumption of ideal gas. Further down the tube is
cooled, which causes the velocity to drop, before the pressure drop causes a further increase in velocity.
2.4 2.4
2.3 2.3
2.2 2.2
2.1 2.1
vz [ms−1 ]
vz [ms−1 ]
2 2
1.9 1.9
1.8 1.8
1.7 1.7
1.6 1.6
1.5 1.5
1.4 1.4
0 1 2 3 4 5 6 0 1 2 3 4 5 6
z [m] z [m]
(a) Velocity profile in the reactor with T0 = 666,67 K (b) Velocity profile in the reactor with T0 = 777,78 K
28
References
[1] Jakobsen, Hugo A., Fixed Bed Reactors - lecture notes in TKP4145. Department of Chemical Engineering,
NTNU. Spring 2011.
[2] Dormand, J. R. and P. J. Prince, A family of embedded Runge-Kutta formulae, J. Comp. Appl. Math.,
Vol. 6, 1980, pp. 19–26.
[4] Ergun, S.,Fluid flow through packed columns, Chemical Engineering Progress, 48 (2), 89-94
29