Example 3.2.12 Diffusion with a Second Order Reaction

Diffusion with a second order reaction (example 3.2.1) is considered here again. The dimensionless concentration is governed by:

=Φ (3.2.34)

with the boundary condition

(0)=0(3.2.35)

and

y(1)=1 (3.2.36)

The effectiveness factor of the pellet is given by

η= (1) (3.2.37)

For a given value of Φ, equation (3.2.34) can be solved for the boundary conditions ((3.2.35) and (3.2.36)). Once the numerical solution is obtained the effectiveness factor can be calculated using equation (3.2.37). It is of interest to plot the effectiveness factor as a function of Φ. For this purpose, one can solve the boundary value problem for different values of Φ and predict the effectiveness factor. Alternatively, this problem can be solved as an initial value problem. For convenience, the transformation X = Φx is introduced. The boundary value problem changes as:

= y2(3.2.38)

with the boundary conditions:

(0)=0 (3.2.39)

and

y(Φ)=1 (3.2.40)

The effectiveness factor of the pellet is given by

η= (3.2.41)

We know that for low values of Φ, the concentration at the center y(0) is close to 1. For high values of Φ, y(0) approaches zero. We take the concentration at the center as

y(0)=y0 (3.2.42)

where y0 varies between 0 and 1. Next equation (3.2.38) is solved with two initial conditions given by equations (3.2.39) and (3.2.42). This is solved as an initial value problem. The stop condition illustrated in chapter 2.2.5 is used to find the value of X for which equation (3.2.40) is satisfied. That is, equation (3.2.38) is integrated with the initial conditions given by equation (3.2.39) and (3.2.40) until y(X) becomes 1. The corresponding value of X gives the value for Φ. Once Φ is found, the effectiveness factor is found using equation (3.2.41). This procedure is illustrated in the following Maple program.

> | restart:

> | with(plots):

> | eq:=diff(y(X),X$2)=y(X)^2;

| (1)

The initial conditions for y and its derivative are provided:

> | IC:=D(y)(0)=0,y(0)=0.1;

| (2)

> | sol:=dsolve({eq,D(y)(0)=0,IC},{y(X)},type=numeric,abserr=1e-10,stiff=true,stop_cond=[y(X)-1]);

| (3)

The solution is evaluated for large values of X. The solution stops at 6.95.

> | g1:=sol(1000);

Warning, cannot evaluate the solution further right of 6.9564589, stop condition #1 violated

| (4)

The value for Φ is obtained as:

> | Phi1:=rhs(g1[1]);

| (5)

The derivative at X = Φ is given by:

> | dydX1:=rhs(g1[3]);

| (6)

The effectiveness factor is calculated as:

> | eta1:=dydX1/Phi1;

| (7)

The solution obtained is plotted as:

> | odeplot(sol,[X,y(X)],0..10000,thickness=4,axes=boxed,title="Figure Exp. 2.2.23.");

Warning, cannot evaluate the solution further right of 6.9564590, stop condition #1 violated

We can ask Maple to not print the warning about the violation of stop conditions using the following command:

> | _Env_dsolve_nowarnstop := true;

| (8)

Different initial guesses for y0 ranging from 1e - 4 to 0.999 are chosen.

> | Y0:=[1e-4,1e-3,1e-2,seq(i/40.,i=1..39),0.999];

| (9)

> | M:=nops(Y0);

| (10)

A 'for loop' is written to find the corresponding values of Φ and effectiveness factors.

> | for i from 1 to M do Sol[i]:=dsolve({eq,D(y)(0)=0,y(0)=Y0[i]},{y(X)},type=numeric,stiff=true,abserr=1e-12,stop_cond=[y(X)-1]);;od:

> | for i to M do g[i]:=Sol[i](100000):od:

> | for i to M do Phi[i]:=rhs(g[i][1]);od:

> | for i to M do dydX[i]:=rhs(g[i][3]);od:

> | for i to M do eta[i]:=dydX[i]/Phi[i];od:

A loglogplot is made:

> | loglogplot([seq([Phi[i],eta[i]],i=1..M)],axes=boxed,title="Figure Exp. 3.2.24.",thickness=4,labels=[Phi,eta],color=red);

We observe that the effectiveness factor remains close to 1 until Φ=1 and then decreases with Φ.

> |