Computational Methods in Chemical Engineering CHEE 390
Project #4
Non-Isothermal Reaction-Diffusion Process
Instructions
This computer project must be completed using MATLAB®. You must work individually and submit a report electronically as a PDF along with all the m-files required to execute your code. All the files must be contained within 1 zip file. Instructions necessary to execute your code must be imbedded as comments in your m-files. In order to submit your assignment, you will click on the reply to all in the project submission email that I will send out approximately 1 week before the assignment is due.
Introduction
You are asked to analyze a non-isothermal reaction-diffusion process between 2 reservoirs. The reservoir on the left, RL, is empty and the reservoir on the right, RR, has a concentration of cAo, see figure 1.
cA(0)=0 cA(L)=cAo T(0)=To T(L)=To
0xL
Figure 1: Schematic of the reaction zone of length L in between 2 reservoirs.
The volumetric heat generation, q ̇, and the rate of consumption of A per unit volume, N ̇ A, is also given in the above figure for the process. E is the activation energy, cA is the concentration of the reacting species, T is the temperature, R is the universal gas constant, ΔHrxn is the heat of reaction and ko is the pre-exponential factor for the Arrhenius equation.
Problem Statement
The two coupled dimensionless differential equations that govern the flow of heat and mass (molar units) in this process are given by the following:
d2c*A =φ2c*e−β/T* (1) dx*2 A
d2T* 2 * −β/T*
dx*2 =φγcAe (2)
c*A is the dimensionless concentration of species A, T* is the dimensionless temperature, and x* is the dimensionless position.
RL
q ̇ = − N ̇ A Δ H r x n N ̇ A = c A k o e − E / R T
RR
E The parameter β = RT
c*A=cA ,T*=T,x*=x cAo To L
ko L2 . The Thiele modulus, φ, is given by φ = √D
o AB
(3a,b,c)
where DAB is the binary diffusion
coefficient. γ = D AB c Ao Δ H rxn and K is the thermal conductivity. KTo
For this project you must:
1) Plot the dimensionless temperature and concentration of species A vs dimensionless position under the following conditions:
a) β = {0.01, 5}, φ = 1 and γ = 15 and discuss the results. Is this case an exothermic or endothermic reaction, explain.
b) β = 0.01, φ= 2 and γ = {5, 15} and discuss the results.
c) φ = 0 and discuss the results.
2) Find the maximum or minimum, if one exits, and the position at which it occurs.
Solution Method
-
Set up a grid of n nodes + 2 for the boundary conditions.
-
Set up a residual vector, rv, which will be a stacked function consisting of n equations for the
mass balance and n equations for the energy balance. These 2n equations will be interlaced into the residual vector which will then have a dimension of 2n x 1, see figure 2. Node [1] is at x*=0 and its value is given by the boundary conditions for each equation at that position, z1 for the concentration and z2 for the temperature. Node [n+2] is at x*=1 and its value is given by the boundary conditions z2n+3 for the concentration and z2n+4 for the temperature. The position of
each node is given by x*j=(j−1)Δx* where j is the node number.
Figure 2: Placement of grid points
In order to implement the finite difference method, you must rewrite equation (1) and (2) using
the central difference equation as demonstrated in class. HINT: You create the rv in a for loop with the independent variables being the vector of unknowns, z! The creation of rv needs to be in a separate function, rv_fun, with inputs: z =[z3, z4,..., z2n+1,z2n+2], boundary conditions [z1, z2, z2n+3, z2n+4], β, φ, γ, and the number of nodes, n.
Report
Each student is required to submit one report and the results that you should obtain for case 3 in the problem statement are given in figure 3. In your report you must discuss the following:
-
Explain the importance of the initial guess in such a technique and give examples of initial guesses that failed to converge and explain why.
-
What is the residual vector and why must it equal 0.
-
Why appending the unknown vectors together to make a single vector [c2, c3,...cn+1, T2, T3,...,
Tn+1] is less efficient than interlacing the unknown vectors together to make a single vector [c2,
T2, c3, T3,..., cn+1, Tn+1]. Hint: What does the Jacobian look like in these two scenarios!
-
Finally, compare and discuss the results you obtained from each of the 5 cases.
-
The format of the report should be as follows:
I. II. III. IV. V . VI.