1 suggestions for solving project 3. 2 in this project you are asked to extend the pseudo-...

13
1 Suggestions for solving Project 3

Upload: lester-griffin

Post on 19-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

1

Suggestions for solving Project 3

Page 2: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

2

In this project you are asked to extend the pseudo-homogeneous model you made in Project 2 to a heterogeneous model. That is, you should include two extra ODEs for the calculation of the processes occurring within the catalyst pellets.

The reactions take place on the active sites within the pores of the particles, hence there will be heat- and mass transfer between the gas in the bulk and the catalyst particles.

Page 3: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

3

The implementation in MATLAB is similar to that of the pseudo-homogeneous model, but in addition, the equations for the particles must be solved.

The equations for the bulk gas in the reactor should still be integrated in the axial direction by use of ode15s, but in addition to the discretized equations for radial dispersion and conduction in the reactor the particle equations have to be solved in each point of the reactor calculations.

Page 4: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

4

The pellet equations are discretized and the resulting set of algebraic equations is solved by the fsolve function in MATLAB. The subroutines dss020 and dss042 can be used to approximate the radial derivatives both for the reactor- and pellet equations.

First you have to derive the governing equations comprising a set of differential and algebraic equations on mass basis. The pellet equations should be formulated in spherical coordinates, but due to symmetry only the r-coordinate is considered.

Page 5: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

5

fsolve function

Once you obtain the equations for the pellet, you will need to solve, at each radial discretization point of the reactor, for the values of temperature and compositions at the surface of a pellet.

You’ll have a set of algebraic, nonlinear equations.

How to solve it with fsolve?Let’s look at the arguments of the function:

Page 6: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

6

fsolve function

The arguments are:

x=fsolve(@fun,x0,options)

x value of the solution after convergence. @fun function handle, where fun is the name of the file with the problem.x0 initial guess for x.options allows optional criteria like setting

tolerances or displaying statistics.

Page 7: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

7

fsolve function: Example

Example & solution: Solve for the temperature profile inside a spherical pellet.

BCs:

Page 8: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

8

fsolve function: Example

and

where ξ is the radial direction inside the pellet.Consider the following parameters constant:

Page 9: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

9

fsolve function: Example

Neglect advection and assume steady-state:

Expanding the laplacian in spherical coordinates and keeping only the radial part:

Now let’s take a look at the code in Matlab

Page 10: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

10

fsolve function: Exampleglobal n k_cat h % n % Discretization inside the pellet% k_cat % Particle conductivity [W/m.K]% h % Convection heat transfer coefficient [W/m^2.K]% Tbulk % Temperature outside the pellet [K] % Define the xi-coordinate at the beginningxi1=1e-10; xi2=0.0173; Dxi=(xi2-xi1)/(n-1); xi=(xi1:Dxi:xi2)'; %%% For each radial point i in the reactor: % Estimate the temperature profile within the pelletTbulk=T(i);Tin=Tbulk*ones(n,1);V0=Tin; Options = optimset('Display','iter','TolFun',1e-10);% Give to fsolve the mass fractions W on point i in the radial% discretization of the reactor and the pressure P[V] = fsolve(@particle,V0,Options,Tbulk,W(i,:),P);

Page 11: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

11

fsolve function: Examplefunction Res_Teq=particle(V,Tbulk,W,P)global n k_cat xi h eps rho_cat T(:,1)=V; for i=1:n; yp(i,:) = convert(W(i,:)); end %Reaction rate and heat of the reaction[RXRATE,DELTAHr] = reaction(T,yp,P); % Calculate first derivativedTdxi1=dss020(xi(1),xi(n),n,T,1)'; % 2nd derivative: Newmann at xi(1) and Dirichlet at xi(n)dTdxi2=dss042(xi(1),xi(n),n,T,dTdxi1,2,1)'; % T equation:Res_Teq=k_cat*(2*dTdxi1+xi.*dTdxi2)-xi.*DELTAHr; % Boundary ConditionsRes_Teq(1,1)=dTdxi1(1,1);Res_Teq(n,1)=h/k_cat*(T(n,1)-Tbulk)+dTdxi1(n,1); end

Page 12: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

12

Suggestions

Notice that the function needs to be written equated to zero in the file called by fsolve:

The function optimset allows to set preferences for fsolve, analog to odeset for ode15. Check out the Matlab help to find out all the specifiable parameters possible.

Page 13: 1 Suggestions for solving Project 3. 2 In this project you are asked to extend the pseudo- homogeneous model you made in Project 2 to a heterogeneous

13

Suggestions

In your code, you will utilize the function reaction.m, available on it’s learning to compute the reaction rates inside each pellet, here supposed constant for simplicity.

In addition to the routines given for Project 2, a new one is now obtained:masscoef.m. Is a function that computes the binary diffusivities and the mass transfer coefficients for the different species within the pellet.