Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Computational Fluid Dynamics of Reactive Flows 2018/2019

Tubular reactor with side injections


Mohamad Abou Dahera
a 10601121, mohamad.abou@mail.polimi.it

Abstract

The study provides a proper affair of comparing the steady state conversion of two different configurations for a two dimensional
tubular reactor problem with a second order reaction, under three distinct approaches to overcome the introduced nonlineraity due
to the reaction rate. In this report we argue about the different results obtained from explicit, linear segregation and operator
splitting approaches to eventually select the most appropriate one for this kind of problem, based on the accuracy and computational
time required. We provide a very in detail analysis of the mathematical formulation and the codes for each approach to be more
clear how would be the implementation of these methods. For the continuity and momentum equation the implemented code is just
the same for all approaches, the difference is only the method applied to solve the species equations. The technique is based on a
finite volume grid and the equations are considered in an unsteady state condition that is ran over an appropriate time interval that
guarantees reaching the steady state. The stopping criterea that indicates reaching steady state is the consistency of the average
product concentration at the output of the reactor throughover the past 5% of the processed time. Tabulated data are provided for
the most interesting flow properties and variables.

1. Introduction
The tubular reactor problem with side injections is one of the most important topics addressed in
chemical reaction engineering in terms of selectivity, reaction control and heat and mass transfer
simultaneously. Even though the addressed case was very simplified tackling a case of single isothermal
reaction, the effect of system hydrodynamics in controlling the reaction and mass transfer modes was
evidently demonstrated. The problem is going to introduce a widened affair of fluid dynamic analysis with
different flow properties by means of applying various boundary conditions for concentrations and
injection velocities distribution. The two analyzed configurations are depicted in figures 1&2 respectively,
configuration-A is based on inlet injection of inert I and side injection of species A & B, all injections are
pure and at a concentration of 1mol/m3, the velocity of side injections would increase along the reactor.
The sole difference in configuration-B is that the velocity of side injection would decrease along the
reactor.

1
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

Alongside the optimum grid size, which ensures a mesh-independent solution, was evaluated based on
accuracy of the obtained concentration profile along the horizontal axis and the required computational
time compared to that corresponding to the values obtained for the finest feasible grid size.

Since, a fully three-dimensional problem will cost highly in case of CPU consuming time and
complexity of geometrical discretization here in this project only a two-dimensional problem has been
considered. Although there is some difference between these two problems, but it would not be devoid of
benefits to analyze a simpler problem first and then delve father into the 3D problem. By doing so, we can
observe how the considered variables are developing within a time interval in a planar coordinate. The
most important features we are going to analyze are the accuracy and stability of the aforementioned
numerical solutions implemented to model this problem. In order to write the equations governing the
system we have to make some simplifying assumptions to be able to derive the Naiver-Stokes equations
and species equations. Derivation of Navier- Stokes equations needs to assume that the fluid flow is in the
laminar region, which means that the flow pattern is layer-layer and the velocity domain is such to avoid
turbulence in the system. Despite that the system would operate after the injections at transient state
Re=2750 but it starts initially at laminar conditions with Reo= 250 so the system would preserve its laminar
behavior, this initial condition is based on the assumption that initially the reactor is filled with inert species
flowing at 0.25 m/s. The density and viscosity of fluid inside the reactor are assumed constant, so we can
assume a constant and uniform kinematic viscosity for fluid and the value given for this property is equal
to 0.001 𝑚/𝑠. In our case all the walls are assumed at rest and the initial velocity fields are identical to the
inlet velocity field that carries the inert species and species existing inside the system are A, B ,C and I
which react as the reaction follows 𝐴 + 𝐵 → 2𝐶 which is bimolecular reaction with the rate function 𝑟 =
𝑘𝐶A𝐶B. Reaction rate is a second order nonlinear function that makes it complicated to derive the
numerical equation for species. Concentration of reaction related species at initial time equals to zero (
CA(𝑡 = 0) = 0, CB ( 𝑡 = 0) = 0, CC( 𝑡 = 0 )= 0) which means that there is no A, B and C inside the reactor
at initial time and CI(t=0)=1 across the whole reactor. Diffusion coefficient of species are equal, uniform
and constant and the value equals to 0.001 𝑚/𝑠. At the injection position the concentration of the injected
species is 1 mol/m3 while those of the rest of species are set to 0.
The geometry of the system is a rectangular prism shaped vessel that will be rectangle in a 2D
configuration and the characteristic length of this vessel is equal to 1 𝑚. The wall thicknesses of the vessel
are considered very small in order to ignore entrance effect, thus we can simplify our boundary condition
to just modifying the concentration and velocity at the same level of internal walls. Actually, in this analysis
the absolute pressure profile of the system is not our aim but only the pressure gradient of the system.

2
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

2. General Approach

The general approach that would be followed in this paper would consist of the following bullet points
mentioned in brief:

• Developing the problem formulation that deals with equations of continuity, momentum and species
equations.

• Developing the corresponding numerical approach for the different approaches employed.

• Optimizing the grid-size used acquired in our results evaluation.

• Hydrodynamics analysis for both configurations.

• Analysis of results from different methods applied on configuration-A.

• Comparison of conversion between both configuration.

• Conclusion.

3. Problem Formulation

In this section, we are going to provide differential equations governing the system and the numerical
modified formulation for continuity, momentum and species equations for explicit, linearization

3
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

segregation and operator splitting methods. The momentum and continuity equations are the same in all
methods, the only difference is in case of species equations.

3.1 Differential Formulation

Before everything, we should derive the correct form of continuity, momentum and species equation in
2D governing the system. The differential formulation will be as follows:

𝝏𝒖 𝝏𝒗
(1) + =𝟎
𝝏𝒙 𝝏𝒚

𝝏𝒖 𝝏𝒖 𝝏𝒖 𝝏𝒑 𝝏𝟐 𝒖 𝝏𝟐 𝒖
(2) 𝝆 + 𝝆 (𝒖 +𝒗 )=− + 𝝁( + )
𝝏𝒕 𝝏𝒙 𝝏𝒚 𝝏𝒙 𝝏𝒙𝟐 𝝏𝒚𝟐

𝝏𝒗 𝝏𝒗 𝝏𝒗 𝝏𝒑 𝝏𝟐 𝒗 𝝏𝟐 𝒗
(3) 𝝆 + 𝝆 (𝒖 +𝒗 )=− + 𝝁( + )
𝝏𝒕 𝝏𝒙 𝝏𝒚 𝝏𝒚 𝝏𝒙𝟐 𝝏𝒚𝟐

𝝏𝑪𝑨 𝝏𝑪𝑨 𝝏𝑪𝑨 𝝏𝟐 𝑪𝑨 𝝏𝟐 𝑪𝑨


(4) + (𝒖 +𝒗 ) = 𝜞( + ) + 𝑹𝑨
𝝏𝒕 𝝏𝒙 𝝏𝒚 𝝏𝒙𝟐 𝝏𝒚𝟐

𝝏𝑪𝑩 𝝏𝑪𝑩 𝝏𝑪𝑩 𝝏𝟐 𝑪𝑩 𝝏𝟐 𝑪𝑩


(5) + (𝒖 +𝒗 ) = 𝜞( + ) + 𝑹𝑩
𝝏𝒕 𝝏𝒙 𝝏𝒚 𝝏𝒙𝟐 𝝏𝒚𝟐

𝝏𝑪𝑪 𝝏𝑪𝑪 𝝏𝑪𝑪 𝝏𝟐 𝑪𝑪 𝝏𝟐 𝑪𝑪


(6) + (𝒖 +𝒗 ) = 𝜞( + ) + 𝑹𝑪
𝝏𝒕 𝝏𝒙 𝝏𝒚 𝝏𝒙𝟐 𝝏𝒚𝟐

𝝏𝑪𝑰 𝝏𝑪𝑰 𝝏𝑪𝑰 𝝏𝟐 𝑪𝑰 𝝏𝟐 𝑪𝑰


(7) + (𝒖 +𝒗 ) = 𝜞( + )
𝝏𝒕 𝝏𝒙 𝝏𝒚 𝝏𝒙𝟐 𝝏𝒚𝟐

Boundary conditions of the equations are:

𝑸𝒐𝒖𝒕
(8) u(0,y,t)=uin=0.25m/s, u(x,0,t)=0, u(x,0.1,t)=0, u( 1,y,t)=uout=
𝑨𝒎𝒂𝒊𝒏

(9) such that 𝑸𝒐𝒖𝒕 = 𝒖𝒊𝒏 + ∑ 𝒗𝒔𝒊𝒅𝒆 (𝒊) ∗ 𝑨𝒔𝒊𝒅𝒆 such that 𝒗𝒔𝒊𝒅𝒆 (𝒊) is the absolute value of side
injections across the reactor and 𝒗𝒔𝒊𝒅𝒆 =[0.25, 0.5, 0.75, 1, 0.25, 0.5, 0.75, 1] for configuration-A
and 𝒗𝒔𝒊𝒅𝒆 =[1, 0.75, 0.5, 0.25, 1, 0.75, 0.5, 0.25] for configuration-B.

(10) v(0.1:0.15,0.1,t)=- 𝒗𝒔𝒊𝒅𝒆 (𝟏), v(0.2:0.25,y,t)=- 𝒗𝒔𝒊𝒅𝒆 (𝟐), v(0.3:0.35,y,t)=- 𝒗𝒔𝒊𝒅𝒆 (𝟑),
v(0.4:0.45,y,t)=- 𝒗𝒔𝒊𝒅𝒆 (𝟒), v(0.15:0.2,0,t)= 𝒗𝒔𝒊𝒅𝒆 (𝟓), v(0.25:0.3,y,t)= 𝒗𝒔𝒊𝒅𝒆 (𝟔),
v(0.35:0.4,y,t)=𝒗𝒔𝒊𝒅𝒆 (𝟕), v(0.45:0.5,y,t)= 𝒗𝒔𝒊𝒅𝒆 (𝟖).

𝝏𝒑 𝝏𝒑
(11) (𝟎, 𝒚, 𝒕) = 𝟎, (𝟏, 𝒚, 𝒕) = 𝟎
𝝏𝒙 𝝏𝒙

𝝏𝒑 𝝏𝒑
(12) (𝒙, 𝟎. 𝟏, 𝒕) = 𝟎, (𝒙, 𝟎, 𝒕) = 𝟎
𝝏𝒙 𝝏𝒙

4
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

For species injections:

(13) 𝑪𝑰 (0.1,y,t)=1 mol/m3, 𝑪𝑨 (0.1:0.15,0.1,t)=1 , 𝑪𝑩 (0.2:0.25,y,t)=1, 𝑪𝑨 (0.3:0.35,y,t)=1


𝑪𝑩 (0.4:0.45,y,t)=1, 𝑪𝑨 (0.15:0.2,0,t)=1, 𝑪𝑩 (0.25:0.3,y,t)=𝟏, 𝑪𝑨 (0.35:0.4,y,t)=1,
𝑪𝑩 (0.45:0.5,y,t)= 𝟏.

In other situations at the boundaries:

𝝏𝑪𝑨 𝝏𝑪𝑩 𝝏𝑪𝑪 𝝏𝑪𝑰


(14) = 𝟎, = 𝟎, = 𝟎, =𝟎
𝝏𝒏 𝝏𝒏 𝝏𝒏 𝝏𝒏

Initial conditions

(15) u(x,y,0)=0.25 m/s, v, 𝑪𝑨, 𝑪𝑩 , 𝑪𝑪 = 𝟎, and 𝑪𝑰 (x,y,0)=1 (initially the reactor filed with
inert species).

3.2 Integral Formulation


For the finite volume, we should implement the integral formulation of the of Navier-Stokes equations
are as the followings:
(16) ∮𝑆 𝒖. 𝒏𝑑𝑆 = 0
𝜕 1
(17) ∫ 𝑢𝑑𝑉 = − ∮𝑆 𝑢𝒖. 𝒏𝑑𝑆 − ∮𝑆 𝑝𝑛𝑥 𝑑𝑆 + 𝑣 ∮𝑠 ∇𝑢. 𝒏𝑑𝑆
𝜕𝑡 𝑉 𝜌

𝜕 1
(18) ∫ 𝑣𝑑𝑉 = − ∮𝑆 𝒗𝒖. 𝒏𝑑𝑆 − ∮𝑆 𝑝𝑛𝑦 𝑑𝑆 + 𝑣 ∮𝑠 ∇𝑣. 𝒏𝑑𝑆
𝜕𝑡 𝑉 𝜌

𝜕
(19) ∫ 𝑪𝑨 𝑑𝑉 = − ∮𝑆 𝑪𝑨 𝒖. 𝒏𝑑𝑆 + Г ∮𝑆 ∇𝑪𝑨 . 𝒏𝑑𝑆 + ∫𝑉 𝑅𝑨 𝑑𝑉
𝜕𝑡 𝑉
𝜕
(20) ∫ 𝑪𝑩 𝑑𝑉 = − ∮𝑆 𝑪𝑩 𝒖. 𝒏𝑑𝑆 + Г ∮𝑆 ∇𝑪𝑩 . 𝒏𝑑𝑆 + ∫𝑉 𝑅𝑩 𝑑𝑉
𝜕𝑡 𝑉
𝜕
(21) ∫ 𝑪𝑪 𝑑𝑉 = − ∮𝑆 𝑪𝑪 𝒖. 𝒏𝑑𝑆 + Г ∮𝑆 ∇𝑪𝑪 . 𝒏𝑑𝑆 + ∫𝑉 𝑅𝑪 𝑑𝑉
𝜕𝑡 𝑉
𝜕
(22) ∫ 𝑪𝑰 𝑑𝑉 = − ∮𝑆 𝑪𝑰 𝒖. 𝒏𝑑𝑆 + Г ∮𝑆 ∇𝑪𝑰 . 𝒏𝑑𝑆 no reaction term in inert equation
𝜕𝑡 𝑉

3.3 Discretized Formulation


As it is mentioned above, the method for velocity fields and pressure fields are the same in the three
adopted approaches. So, we can derive the equations regardless of the species solution method.
To derive the equations, we are considering a staggered grid configuration with the concept of ghost cells
that the pressure fields are centered in the grids and velocities in the borders of the grids as given in
Figure.3. The intermediate mathematical procedures are ignored and only the final formulation is written.

5
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

Figure 3 Finite volume configuration of pressure and velocity fields

• Navier-stokes Equations:
𝑛+1 𝑛+1 𝑛+1 𝑛+1
(23) 𝑢𝑖+ 1 −𝑢 1 +𝑣
,𝑗 𝑖− ,𝑗 𝑖,𝑗+
1 −𝑣
𝑖,𝑗−
1 = 0
2 2 2 2

Figure 4: One finite volume configuration

Equation of x-momentum in FV:


𝑢𝑛+1 𝑛+1
1 −𝑢 1
𝑖+2,𝑗 𝑖+2,𝑗 𝑛 2 𝑛 2 𝑛 𝑛 𝑛 𝑛 1
(24) = − ([𝑢𝑖+1,𝑗 ] − [𝑢𝑖,𝑗 ] + 𝑢𝑖+ 1 1𝑣 1
,𝑗+ 𝑖+ ,𝑗+
1 −𝑢 1 1𝑣 1
𝑖+ ,𝑗− 𝑖+ ,𝑗−
1) +
∆𝑡 ⏟ 2 2 2 2 2 2 2 2

𝐴𝑛 1
𝑖+2,𝑗
𝑛 𝑛
𝑣 𝑛 𝑛 𝑛 𝑛 𝑛
𝑝𝑖+1,𝑗 − 𝑝𝑖,𝑗
(𝑢 3 + 𝑢 1 + 𝑢 1 + 𝑢 1 − 4𝑢 1 ) −


2 𝑖+ ,𝑗
2
𝑖− ,𝑗
2
𝑖+ ,𝑗+1
2
𝑖+ ,𝑗−1
2
𝑖+ ,𝑗
2
⏟ ℎ
𝑛
𝐷𝑖+1/2,𝑗 ∇𝑛
ℎ𝑖 𝑝𝑖,𝑗

6
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

Equation of y-momentum in FV:


𝑣 𝑛+1 𝑛+1
1 −𝑣 1
𝑖+2,𝑗 𝑖+2,𝑗 𝑛 𝑛 2
𝑛 𝑛 2 𝑛 𝑛 1
(25) = − ([𝑣𝑖,𝑗+1 ] − [𝑣𝑖,𝑗 ] + 𝑢𝑖+ 1 1𝑣 1
,𝑗+ 𝑖+ ,𝑗+
1 −𝑢 1 1𝑣 1
𝑖− ,𝑗+ 𝑖− ,𝑗+
1) +
∆𝑡 ⏟ 2 2 2 2 2 2 2 2

𝐴𝑛 1
𝑖,𝑗+2

𝑣𝑛 𝑛 𝑛 𝑛 𝑛 𝑝𝑛
𝑖,𝑗+1
𝑛
−𝑝𝑖,𝑗
(𝑣𝑖,𝑗+3 + 𝑣𝑖,𝑗−1 + 𝑣𝑖+1,𝑗+ 1 + 𝑣𝑖−1,𝑗+1 − 4𝑣𝑖,𝑗+ 1) −

ℎ2
⏟ 2 2 2 2 2

𝑛
𝐷𝑖,𝑗+1/2 ∇𝑛
ℎ𝑖 𝑝𝑖,𝑗

To find the velocity terms that are between the two grids we need an interpolation to help us calculate
the values. In so doing we should substitute the terms
𝑛 𝑛 𝑛 𝑛 𝑛 𝑛 𝑛 𝑛
𝑢𝑖+1,𝑗 , 𝑢𝑖,𝑗 , 𝑣𝑖,𝑗+1 , 𝑣𝑖,𝑗 , 𝑢𝑖+ 1 1𝑣 1
,𝑗+ 𝑖+ ,𝑗+
1, 𝑢 1 1𝑣 1
𝑖+ ,𝑗− 𝑖+ ,𝑗−
1,
2 2 2 2 2 2 2 2
𝑛 𝑛 𝑛 𝑛
and the two terms 𝑢𝑖+1 1𝑣 1
,𝑗+ 𝑖+ ,𝑗+
1, 𝑢 1 1𝑣 1
𝑖− ,𝑗+ 𝑖− ,𝑗+
1 with the frmulation provided below:
2 2 2 2 2 2 2 2

𝑢𝑛 3 +𝑢𝑛 1
𝑛 𝑖+2,𝑗 𝑖+2,𝑗
(26) 𝑢𝑖+1,𝑗 =
2

𝑢𝑛 1 +𝑢𝑛 1
𝑛 𝑖+ ,𝑗 𝑖− ,𝑗
2 2
(27) 𝑢𝑖,𝑗 =
2
𝑢𝑛 1 +𝑢𝑛 1 𝑣 𝑛 1 +𝑣 𝑛 1
𝑛 𝑛 𝑖+2,𝑗 𝑖+2,𝑗+1 𝑖,𝑗+2 𝑖+1,𝑗+2
(28) 𝑢𝑖+ 1 1𝑣 1
,𝑗+ 𝑖+ ,𝑗+
1 =
2 2 2 2
2 2

𝑢𝑛 1 +𝑢𝑛 1 𝑣 𝑛 1 +𝑣 𝑛 1
𝑛 𝑛 𝑖+2,𝑗 𝑖+2,𝑗−1 𝑖,𝑗−2 𝑖+1,𝑗−2
(29) 𝑢𝑖+ 1 1𝑣 1
,𝑗− 𝑖+ ,𝑗−
1 =
2 2 2 2
2 2

𝑣 𝑛 3 +𝑣 𝑛 1
𝑛 𝑖,𝑗+ 𝑖,𝑗+
2 2
(30) 𝑣𝑖,𝑗+1 =
2

𝑣 𝑛 1 +𝑣 𝑛 1
𝑛 𝑖,𝑗+ 𝑖,𝑗−
2 2
(31) 𝑣𝑖,𝑗 =
2

𝑢𝑛 1 +𝑢𝑛 1 𝑣 𝑛 1 +𝑣 𝑛 1
𝑛 𝑛 𝑖+ ,𝑗 𝑖+ ,𝑗+1 𝑖,𝑗+ 𝑖+1,𝑗+
2 2 2 2
(32) 𝑢𝑖+ 1 1𝑣 1
,𝑗+ 𝑖+ ,𝑗+
1 =
2 2 2 2
2 2

𝑢𝑛 1 +𝑢𝑛 1 𝑣 𝑛 1 +𝑣 𝑛 1
𝑛 𝑛 𝑖−2,𝑗 𝑖−2,𝑗+1 𝑖,𝑗+2 𝑖−1,𝑗+2
(33) 𝑢𝑖− 1 1𝑣 1
,𝑗+ 𝑖− ,𝑗+
1 =
2 2 2 2
2 2

• Species Equations

Now we should derive the species equations in the form of Descretized grids. Since, the
discretized form of these equations is dependent to the method implemented for solution, we
postpone it to the next section which is the numerical procedure.

7
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

4. Numerical Procedure

In this part, we are going to explain which method will be used to solve the system of differential
equations. Although the method for solving the Navier-Stokes equations are similar in each part, there
are three different methods explained to solve the species equations. The enclosed codes in this report are
the codes for explicit, linearization segregation and operator splitting. The numerical solution procedure
would be in a manner to first we should determine the initial and boundary conditions for each field and
then solve the Naiver-Stokes equations to determine the velocity and pressure field. By doing so, we can
use the calculated velocity values in the solution for concentrations and then go beyond the next time
step.

4.1. Spatial Discretization

In order to ensure that our solution is mesh independent several discretization were applied to the
rectangular dimension of our reactor and compared in terms of accuracy and required computational time
to the corresponding values obtained using the finest feasible grid, the adopted step values were as
following h= 0.05, 0.025, 0.01, 0.005 [m] in both x and y directions. The finest feasible grid size was
assigned to a value that would guarantee code convergence within 5 min, in our case it was 0.005 m,
finer grid size faced a problem in the convergence of the poisson equation and thus required a higher
computational power of the used laptop, 8 GB Ram and 3.1 GHz. The grid size effect was evaluated
based on the explicit method implementation, the obtained optimum size was then adopted for the rest of
the procedure of approaches. This approach guarantees the consistency of our solution not only spatially
but also with respect to time step since time step was assigned in a manner that is dependent on mesh grid
size in order to satisfy the robustness requirements of our numerical solution.

4.2. Time Step

One of the important points that should be noticed is the size of the time step to take in order to
overcome the issue of solution instability. Because of the various terms exist inside our analysis i.e.
convection, diffusion, reaction, convection and diffusion in species equations we have different limits of
time steps size that we should choose the minimum value among the aforementioned ones. In order to be
more confident, we multiply this minimum value by a safety factor 0<σ<1. The value taken within the
codes is equal to 0.5. The limitation introduced by the reaction is a quite complicated but not so much.
For reaction, the characteristic time is equal to eigenvalues of Jacobian matrix of formation rates which
are explained in the mathematical form below.
𝑗 1 𝜕𝑅𝑖
(34) 𝑡𝐶ℎ𝑒𝑚 = , 𝐽𝑖𝑘 =
|𝜆𝑗 | 𝜕𝐶𝑘

−𝐶𝐵 −𝐶𝐴 0
(35) 𝐽 = [ −𝐶𝑏 −𝐶𝐴 0]
𝐶𝐵 𝐶𝐴 0

The Jacobian matrix rows explain the dependency of reaction rate of species i to all components in
the system and the columns of this matrix explain the dependency of species j to reaction rate of all
components in the system. Eigenvalues of this matrix shows the time characteristics of reaction. The
time characteristic inverse is the time step size introduced by the reaction. As the two-time steps are
infinite we should take the third one as the considered time step size. Since concentrations of species
A and B are changing within time we can see that the reaction time step is not constant during the time
8
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

interval, but that does not mean should change it during our solution. By looking at the concentrations
and the function of reaction time step we can see that the function is increasing when the concentrations
are increasing. So, we can take the initial concentrations as the characteristic for reaction step size,
such an approach is adopted in the explicit method while the two implicit methods don’t require the
characteristic time of reaction in determining the required time step.

(36) 𝜆 = [0, 0, −𝑘(𝐶𝐴 + 𝐶𝐵 )]

1
(37) ∆𝑡𝐶ℎ𝑒𝑚 = [𝑖𝑛𝑓, 𝑖𝑛𝑓, ]
𝑘(𝐶𝐴 +𝐶𝐵 )


(38) ∆𝑡𝐶𝑜𝑛𝑣 = such that 𝑢𝑚𝑎𝑥 = 𝑢𝑜𝑢𝑡
𝑢2 𝑚𝑎𝑥

ℎ2
(39) ∆𝑡𝐷𝑖𝑓𝑓 =

𝑠𝑝 4Γ
(40) ∆𝑡𝐶𝑜𝑛𝑣 =
𝑢2 𝑚𝑎𝑥

𝑠𝑝 ℎ2
(41) ∆𝑡𝐷𝑖𝑓𝑓 =

𝑠𝑝 𝑠𝑝
(42) ∆𝑡 = 𝜎 min(∆𝑡𝐶𝑜𝑛𝑣 , ∆𝑡𝐷𝑖𝑓𝑓 , ∆𝑡𝐶𝑜𝑛𝑣 , ∆𝑡𝐷𝑖𝑓𝑓 , ∆𝑡𝐶ℎ𝑒𝑚 )

By doing so the minimum time step will be equal to 0.000264 s and our time interval which is from t=0
to t = 10s we will discretize the interval in this way. This is value was obtained regardless of the mesh size
since in our case the minimum characteristic time was that corresponding to convection.

4.3. Projection Method for Velocity Pressure Fields

Projection method suggests considering the initial fields given (velocity and pressure) in the problem
and determine the boundary conditions for them. After that we should define a temporary velocity by
considering only the advection diffusion part. Then with solving the Poisson equation of pressure we can
use it to calculate the velocity at next time step. The method for solving poison equation is an iterative
method. So, we have an iteration loop that we should check the error with the previous solution to check
whether convergence is reached. Since, we should use an integer counter in programming, we have to
change the subscripts of the formulations as below.

(43) 𝑢𝑖,𝑗 = 𝑢𝑖+1/2,𝑗


(44) 𝑣𝑖,𝑗 = 𝑣𝑖,𝑗+1/2
By knowing this arrangement, now we are going to derive the temporary velocity formulation for
each grid with advection diffusion terms.
𝑛
(45) 𝑢𝑡𝑖,𝑗 = 𝑢𝑖,𝑗 + 𝑑𝑡(−𝐴𝑛𝑖,𝑗 + 𝐷𝑖,𝑗
𝑛
)
𝑛 𝑛 𝑛
(46) 𝑣𝑡𝑖,𝑗 = 𝑣𝑖,𝑗 + 𝑑𝑡(−𝐴𝑖,𝑗 + 𝐷𝑖,𝑗 )
Thus, with understanding the algorithm, we know the next step is to solve Poisson equation for each
grid. The formula will be as following.

9
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

𝛼+1 𝜊 𝜊 𝜊 𝜊 ℎ
(47) 𝑝𝑖,𝑗 = 𝛽 {(𝑝𝑖+1,𝑗 + 𝑝𝑖−1,𝑗 + 𝑝𝑖,𝑗+1 + 𝑝𝑖,𝑗−1 )− (𝑢𝑡𝑖,𝑗 − 𝑢𝑡𝑖−1,𝑗 + 𝑣𝑡𝑖,𝑗 −
∆𝑡
𝛼
𝑣𝑡𝑖,𝑗−1 )} 𝛾 + (1 − 𝛽)𝑝𝑖,𝑗
In the formula above, based on successive over relaxation method (SOR), there are some
coefficients that should be explained. 𝛽 is the relaxation coefficient for the iterative solutions?
This coefficient helps the solution to converge sooner and prevent the solution from divergence.
By adding this value, we can see that the next guess for pressure will be dependent to previous
pressure guess and the pressure directly calculated with the equation. So, the iterations will be
more relaxed. 𝛾 is the coefficient that shows how the concerned node is dependent to the
sorrounding nodes which means that it declares the number of nodes that the node’s pressure is
1 1
dependent to. By knowing so, 𝛾 for interior nodes is , for edge nodes is and for the corner nodes
4 3
1
is . By calculating the pressure for each gues step, we can calculate velocities at next time step.
2
𝑛+1 ∆𝑡 𝑛 𝑛
(48) 𝑢𝑖,𝑗 = 𝑢𝑡𝑖,𝑗 − (𝑝𝑖+1,𝑗 − 𝑝𝑖,𝑗 )

𝑛+1 ∆𝑡 𝑛 𝑛
(49) 𝑣𝑖,𝑗 = 𝑣𝑡𝑖,𝑗 − (𝑝𝑖,𝑗+1 − 𝑝𝑖,𝑗 )

4.4. Explicit Approach for Species Equations

Completing the velocity-pressure fields calculation in cavity leads us to go through the equations of
concentration developments for each species. Our first approach would be the explicit method that would
solve as a benchmark for comparing performance of the other methods. In this approach we solve
simultaneously the transport and reaction equation of the species based on the values of the preceding time
step. Thus, after assigning the boundary conditions, which would be used without any change in the
implementation of other methods, as specified in equations 8,10 and 13[1] we will solve the following
equation for the internal points, in formulations 𝛼 is the indicator for species.
𝑛+1 𝑛 𝑛+1 𝑛+1 𝑛+1 𝑛+1 𝑛+1 𝑛+1 𝑛+1
𝐶∝,𝑖,𝑗 −𝐶∝,𝑖,𝑗 𝐶𝛼,𝑖+1,𝑗 −𝐶𝛼,𝑖−1,𝑗 𝐶𝛼,𝑖,𝑗+1 −𝐶𝛼,𝑖,𝑗−1 𝐶𝛼,𝑖+1,𝑗 −2𝐶∝,𝑖,𝑗 +𝐶𝛼,𝑖−1,𝑗
(50) = − (𝑢 +𝑣 )+ Γ( +
∆𝑡 2ℎ 2ℎ ℎ2
𝑛+1 𝑛+1 𝑛+1
𝐶𝛼,𝑖,𝑗+1 −2𝐶∝,𝑖,𝑗 +𝐶𝛼,𝑖,𝑗−1 𝑛+1
2 ) + 𝑅𝛼,𝑖,𝑗

It is apparent that the nonlinearity is introduced by the reaction term and this could introduce a lot of
problems for more complex situations, but our code was able to process this equation considering the
stability considerations discussed while choosing the adequate time step. The importance of applying
such an approach when feasible is that it doesn’t involve the assumptions that are made in the implicit
methods and thus improving our ability to depict the reality. Solving the above equation requires an
iterative step starting with initial guess of concentrations at previous time step. However, to overcome
the computationally time consuming In our code we did a further assumption, based on the small time
step acquired, where we assumed the transport and reaction change of concentration with respect to
time could be evaluated on concentration values from previous time step, so our solution is in between
the completely explicit and the operator-splitting method, so our equation becomes as follows:

𝑛+1 𝑛 𝑛 𝑛 𝑛 𝑛 𝑛 𝑛 𝑛
𝐶∝,𝑖,𝑗 −𝐶∝,𝑖,𝑗 𝐶𝛼,𝑖+1,𝑗 −𝐶𝛼,𝑖−1,𝑗 𝐶𝛼,𝑖,𝑗+1 −𝐶𝛼,𝑖,𝑗−1 𝐶𝛼,𝑖+1,𝑗 −2𝐶∝,𝑖,𝑗 +𝐶𝛼,𝑖−1,𝑗
(51) = − (𝑢 +𝑣 ) + Γ( +
∆𝑡 2ℎ 2ℎ ℎ2
𝑛 𝑛 𝑛
𝐶𝛼,𝑖,𝑗+1 −2𝐶∝,𝑖,𝑗 +𝐶𝛼,𝑖,𝑗−1 𝑛
) + 𝑅𝛼,𝑖,𝑗
ℎ2

10
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

4.5. Linearization-Segregation Approach for Species Equations

We are going to develop the numerical discretization for concentration equations with linearization-
segregation approach that helps us to deal with the nonlinear term introduced by reaction. In this method
which is an implicit method, significantly the time step dt doesn’t take into consideration the reaction
characteristic time, we have to couple the concentration of species together by means of considering that
the reaction rate in next time step is a function of previous time step and the terms which relates the rate
derivatives to change of concentration of species involving in the reaction rate. Like other implicit methods
the stability of solution is guaranteed and there is no need for iteration but because of the high number of
algebraic equations that program should solve simultaneously it is more time consuming than the other
procedures. As shown in equation (50) We can see that the only nonlinearity exists in equation is the
reaction rate. We can overcome this problem by coupling the concentrations and relate the rate to the
previous reaction rate.

𝑛+1 𝑛 𝜕𝑅𝛼
(52) 𝑅𝛼,𝑖,𝑗 = 𝑅𝛼,𝑖,𝑗 + ∑𝑁𝑆
𝑘=1
𝑛+1
| (𝐶𝑘,𝑖,𝑗 𝑛
−𝐶𝑘,𝑖,𝑗 )
𝜕𝐶𝑘 𝑖,𝑗

In the equation above, we have notice that the derivation of reaction rate with respect to concentration
should derived analytically with the function and then we should substitute the concentration of nodes. If
we do that, the equation will be a very simple equation as follows. We will use J as the derivative of reaction
rate due to the concentrations. 𝐽𝛼,𝑘 means reaction rate derivative of component 𝛼 due to concentration of
component 𝑘. The formulation is provided for internal nodes which means that 1 < 𝑖 < 𝑛𝑥 + 2, 1 < 𝑗 <
𝑛𝑦 + 2.
𝑢𝑖,𝑗 𝑑𝑡 Γ𝑑𝑡 𝑛+1 𝑢𝑖−1,𝑗 𝑑𝑡 Γ𝑑𝑡 𝑛+1 4Γ𝑑𝑡 𝑛 𝑛+1
(53) (−
⏟ + ) 𝐶𝛼,𝑖+1,𝑗 + (⏟ + ) 𝐶𝛼,𝑖−1,𝑗 + (1
⏟ − − 𝐽𝛼,𝛼 𝑑𝑡) 𝐶𝛼,𝑖,𝑗 +
2ℎ ℎ2 2ℎ ℎ2 ℎ2
𝐴𝑒𝑖,𝑗 𝐴𝑤𝑖,𝑗 𝐴𝑝𝑖,𝑗
𝑣𝑖,𝑗 𝑑𝑡 Γ𝑑𝑡 𝑛+1 𝑣𝑖,𝑗−1 𝑑𝑡 Γ𝑑𝑡 𝑛+1 𝑛 𝑛+1
(−
⏟ + ) 𝐶𝛼,𝑖,𝑗+1 + (⏟ + ) 𝐶𝛼,𝑖,𝑗−1 − ∑𝑘≠𝛼 𝐽⏟
𝛼,𝑘,𝑖,𝑗 𝑑𝑡 𝐶𝑘,𝑖,𝑗 =
2ℎ ℎ2 2ℎ ℎ2
𝐴𝑛𝑖,𝑗 𝐴𝑠𝑖,𝑗 𝑑𝛼𝑘𝑖,𝑗
𝑛 𝑛 𝑛 𝑛
⏟∝,𝑖,𝑗 + 𝑅𝛼,𝑖,𝑗 𝑑𝑡 − ∑𝑘=1 𝐽𝛼,𝑘,𝑖,𝑗 𝐶𝑘,𝑖,𝑗 𝑑𝑡
𝐶
𝑏𝛼𝑖,𝑗

For each of the components we have penta-diagonal subsection because it is a 2D problem, but actually
the configuration of the coefficient matrix will be like figure.5. The index for each coefficient 𝐴𝑖 (𝑖 =
𝑠, 𝑛, 𝑝, 𝑤, 𝑒) explains the position of the grid that is involved in that equation, and also for 𝑑𝛼𝑘 (k =
1, 2, . . . , NS, k ≠ α) it means that how the concentration of species 𝛼 is related to species k in that grid. 𝑏𝛼
is the constants that are determined from previous calculations and are known. By doing so, we may build
a matrix that contains concentration A, B, C and I for each node. The only point that we should consider is
that to create a matrix of coefficients (A) is difficult to work with imp (matrix index) it is better to collect
the data to a single counter like 𝐾 = 𝑗 + (𝑖 − 1) (𝑛𝑥 + 2) that nx and ny are equal to the number of spatial
steps of i and j are respectively the x-step counter and y-step counter. ne is equal to (nx+2) (ny+2). The
initial matrix(A) is characterized by its high sparsity and thus to boost our solution and decrease the
required storage space a pattern (M) was defined that accounts for the sparsity of our system and just
considers the non-zero terms, i.e. the penta-diagonal coefficients. The boundary conditions were
implemented normally in a 2-D form while the internal points are processed according to the following
equations:

11
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

Figure 5 penta-diagonal matrix

(54) ue = u(i,j); uw = u(i-1,j); vn = v(i,j); vs = v(i,j-1);


(55) M(k,k) = 1 + 4*Γ*dt/h/h;
(56) M(k,k+1) = dt*( ue/2/h-Γ/h^2);
(57) M(k,k-1) = dt*(-uw/2/h-Γ/h^2);
(58) M(k,k+nx+2) = dt*( vn/2/h-Γ/h^2);
(59) M(k,k-nx-2) = dt*(-vs/2/h-Γ/h^2);

Then the pattern Mi is assigned to each species such that 𝑀𝛼 =M and then 𝑀𝛼 is modified for reactive
species to account for the reaction contribution.
(60) MA(k,k) = MA(k,k)+dt*𝐽𝐴,𝑘 ;
(61) MB(k,k) = MB(k,k)+dt*𝐽𝐵,𝑘
After that the right-hand side of the equation would be constructed by assigning to it the value of
concentration at the previous time step.
(62) 𝑏𝛼 = 𝐶𝛼,𝑜
In order to account for production of species C the right-hand side would be modified in the
following manner:
(63) 𝑏𝑐 = 𝑏𝑐 + dt ∗ 𝐽𝐶,𝑘
Finally, we can solve the linear system of equations 𝑀𝛼 . 𝐶𝛼 = 𝑏𝛼 as follows

(64) 𝐶𝛼 = 𝑀𝛼 \𝑏𝛼

After that the reshape function is utilized in MATLAB to obtain the corresponding 2-D concentration
matrix, 𝐶𝛼 = reshape(𝐶𝛼 , [nx + 2 ny + 2]);

4.6. Operator Splitting Approach for Species Equations

In this method, we should first separate the advection-diffusion phase to get an intermediate
concentration and then we must consider the reaction phase as another differential equation to
obtain the concentration in the next time step. The advection-diffusion differential equation that
is solved by an explicit, method gives us an intermediate concentration of each finite volume and
we implement an implicit method such as linearization-segregation method to solve the second
part i.e. Reaction differential equation. The procedure will be as follows:
12
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

𝜕𝐶𝛼 ∗,𝑛 𝜕𝐶𝛼 𝜕𝐶𝛼 𝜕2 𝐶𝛼 𝜕2 𝐶𝛼


(65) = − (𝑢 +𝑣 )+ Γ( + )
𝜕𝑡 𝜕𝑥 𝜕𝑦 𝜕𝑥 2 𝜕𝑦 2

𝜕𝐶𝛼 𝑛+1,∗
(66) 𝜕𝑡
= 𝑅𝛼 ∗

Formulation of the first advection-diffusion part will be in way to solve a very simple explicit method,
in order to avoid any complexity of matrices built with implicit methods, since there is a spatial
derivation inside the equation.
∗ 𝑛 𝑛 𝑛 𝑛 𝑛 𝑛 𝑛 𝑛
𝐶∝,𝑖,𝑗 −𝐶∝,𝑖,𝑗 𝐶𝛼,𝑖+1,𝑗 −𝐶𝛼,𝑖−1,𝑗 𝐶𝛼,𝑖,𝑗+1 −𝐶𝛼,𝑖,𝑗−1 𝐶𝛼,𝑖+1,𝑗 −2𝐶∝,𝑖,𝑗 +𝐶𝛼,𝑖−1,𝑗
(67) = − (𝑢 +𝑣 ) + Γ( +
∆𝑡 2ℎ 2ℎ ℎ2
𝑛 𝑛 𝑛
𝐶𝛼,𝑖,𝑗+1 −2𝐶∝,𝑖,𝑗 +𝐶𝛼,𝑖,𝑗−1
2 ) ⇒

∗ 𝑢𝑖,𝑗𝑑𝑡 Γ𝑑𝑡 𝑛 𝑢𝑖−1,𝑗 𝑑𝑡 Γ𝑑𝑡 𝑛 4Γ𝑑𝑡 𝑛


(68) 𝐶∝,𝑖,𝑗 = (− + ) 𝐶𝛼,𝑖+1,𝑗 +( + ) 𝐶𝛼,𝑖−1,𝑗 + (1 − ) 𝐶∝,𝑖,𝑗 +
2ℎ ℎ2 2ℎ ℎ2 ℎ2
𝑣𝑖,𝑗 𝑑𝑡 Γ𝑑𝑡 𝑛 𝑣𝑖,𝑗−1 𝑑𝑡 Γ𝑑𝑡 𝑛
(− + 2 ) 𝐶𝛼,𝑖,𝑗+1 + ( + 2 ) 𝐶𝛼,𝑖,𝑗−1
2ℎ ℎ 2ℎ ℎ
After doing so, we have to use the intermediate concentrations as previous time step concentrations for
solving the second equation, for case of the inert species, I, the value of concentration obtained from solving
the transport step is the one corresponding for the current time step. Based on the simplicity of our reaction
contribution, single reaction with the following rate of reaction 𝑟 = 𝑘𝐶A𝐶B, analytical solution could be
proposed decreasing the error as well as the required computational time compared with adopting a method
similar to that discussed previously in linearization-segregation. The analytical solution is as follows:
∗ ∗
(𝐶𝐴,𝑖,𝑗 −𝐶𝐵,𝑖,𝑗 ) ∗ ∗ ∗
(69) 𝐶𝐴,𝑖,𝑗 = ∗
𝐶𝐴,𝑖,𝑗
valid for 𝐶𝐴,𝑖,𝑗 ≠ 0 𝑎𝑛𝑑 𝐶𝐴,𝑖,𝑗 ≠ 𝐶𝐵,𝑖,𝑗
1− ∗ ∗𝑒𝑥𝑝(−𝑘(𝐶𝐴,𝑖,𝑗∗ −𝐶 ∗ )∗𝑑𝑡
𝐶𝐵,𝑖,𝑗 𝐵,𝑖,𝑗

∗ ∗ ∗ 1
(70) For 𝐶𝐴,𝑖,𝑗 ≠ 0 𝑏𝑢𝑡 𝐶𝐴,𝑖,𝑗 = 𝐶𝐵,𝑖,𝑗 we have 𝐶𝐴,𝑖,𝑗 = 1
𝑘∗𝑑𝑡+ ∗
𝐶 𝐴,𝑖,𝑗
Equation 69 wasn’t utilized in the MATLAB code since equation 68 haven’t faced any problem.
∗ ∗
(71) 𝐶𝐴,𝑖,𝑗 = 𝐶𝐴,𝑖,𝑗 − 𝐶𝐴,𝑖,𝑗 + 𝐶𝐵,𝑖,𝑗
∗ ∗
(72) 𝐶𝐵,𝑖,𝑗 = 𝐶𝐴,𝑖,𝑗 − 𝐶𝐴,𝑖,𝑗 + 𝐶𝐵,𝑖,𝑗
∗ ∗
(73) 𝐶𝐶,𝑖,𝑗 = 𝐶𝐶,𝑖,𝑗 + 2 ∗ (𝐶𝐴,𝑖,𝑗 − 𝐶𝐶,𝑖,𝑗 )
As we can see there is no spatial derivation inside the second equation set of equation 71,72,73. So, the operator
splitting method in this procedure is simpler than the pure linearization-segregation one. In so doing, maybe using this
method is faster than the previous one because of the simpler equation solving in each step.

4.7. Field Reconstruction

Eventually we have found the concentration of each species in every node of finite volume and also the
velocity fields. It is the time to find the value of velocities and concentrations in the same nodes. In order
to do that, we can average concentration of species among the four finite volumes surrounding each node
and the velocities u and v respectively by averaging between two vertical and horizontal velocities
surrounding the same node. These values are used in the graphical representation of data. The formulation
is provided in the following.
(74) 𝑢𝑢(1: 𝑛𝑥 + 1,1: 𝑛𝑦 + 1) = 0.5[𝑢(1: 𝑛𝑥 + 1,2: 𝑛𝑦 + 2) + 𝑢(1: 𝑛𝑥 + 1,1: 𝑛𝑦 + 1)]
(75) 𝑣𝑣(1: 𝑛𝑥 + 1,1: 𝑛𝑦 + 1) = 0.5[𝑣(2: 𝑛𝑥 + 1,1: 𝑛𝑦 + 1) + 𝑣(1: 𝑛𝑥 + 1,1: 𝑛𝑦 + 1)]

13
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

(76) 𝑐𝑐𝛼 (1: 𝑛𝑥 + 1,1: 𝑛𝑦 + 1) = 0.25[𝐶𝛼 (1: 𝑛𝑥 + 1,1: 𝑛𝑦 + 1) +


𝐶𝛼 (1: 𝑛𝑥 + 1,2: 𝑛𝑦 + 2) + 𝐶𝛼 (2: 𝑁𝑥 + 2,1: 𝑁𝑦 + 1) + 𝐶𝛼 (2: 𝑁𝑥 + 2,2: 𝑁𝑦 + 2)]

5. Results

5.1. Step size optimization

As described above it is crucial to obtain the optimum step size. The results of 𝐶𝐶 values along the
horizontal axis for different step sizes are reported in figure 5. It is apparent that after a step size of 0.01m
the solution is mesh-independent, so this step size is adopted, while higher step size lead to many
inaccuracies and even unphysical results.

Figure 5 CC along horizontal axis

5.2. Hydrodynamics of both configuration

The hydrodynamics of both configurations were explored to get a general idea on the system behavior
and velocity vectors evolution. The difference is apparent in velocity build-up even though the output
velocity is the same, but they provide different residence time distribution for the reactive species since the
reactive species. As shown in figure 6 more dense velocity fields would form in case B in an early stage
compared to A, so higher portion of the injected reactants would be provided with higher residence time.

Figure 6: velocity vector feild A(left) & B(right)

14
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

5.3. Comparison of different methods

In our case all the three methods were consistent in terms of the conveyed results but just in the required
computational time. In our case the fastest method was the explicit, this in part due to that the required dt
was dependent on hydrodynamics rather than reaction characteristic time, then followed by operator-
splitting than by linearization-segregation. The results of convergence, final average concentration at the
end and required computational time are reported in Table 1.
Method Convergence of A Convergence of B CC [mol/m3] Cput [s]
Explicit 0.40689 0.40689 0.398371 14.296875
Linearization- 0.406892 0.406892 0.398371 100.4063
segregation
Operator-splitting 0.40836 0.40836 0.399708 14.890625

Table 1 Results obtained from different methods

A depiction of the result from configuration A is provided in Figure 7

Figure 7 Results of configuration A

5.4. Comparison of Results of both configuration

The explicit method was adopted in the data acquisition in case of configuration B, the respective results
are depicted in Figure 8. The reported conversions of A &B are 0.537001 and average outlet concentration
of the product is 0.498627 mol/m3. This increase in performance of configuration-B could be attributed to
the aforementioned difference in hydrodynamic performance between the two configurations.

15
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

Figure 8 Results of configuration B

6. Conclusion

This study was able to demonstrate the effects of step-size on the accuracy of our solution. Moreover, three
different approaches were adopting to solve the species equations for configuration-A and the explicit
approach was significantly faster, but this isn’t the case for more complex situations where the time step is
more apparently dictated by the reaction characteristic time. The reason of configuration B better
performance was attributed to the enhanced residence time of the reactants.

16
Mohamad Abou Daher - Computational Fluid Dynamics of Reactive Flows 2018/2019

References

• A. Cuoci, Computational fluid dynamics of reactive flows 2018-2019.

Appendix A. An example appendix


All the codes and results were provided separately.

17

You might also like