Spline collocation method for solving parabolic PDE's with initial discontinuities: Application to...

11
Compulers and Chemical Engineering Vol. 6. No. 3, pp. H-207. 1982 Printed in Greal Britain. SPLINE COLLOCATION 0098-1354/82/030197-I ISO3.MVO Pergamon Press Ltd. METHOD FOR SOLVING PARABOLIC PDE’S WITH INITIAL DISCONTINUITIES : APPLICATION TO MIXING WITH CHEMICAL REACTION HENRIK PEDERSEN* and MICHAEL TANoFFt Department of Chemical and Biochemical Engineering, Rutgers, The State University, P.O. Box 909, Piscataway, NJ 08854,U.S.A. (Received 29 June 1981; received for publication 18 November 1981) Abstract--A spline collocation method is used to numerically evaluate solutions to nonlinear parabolic partial differential equations where steep gradients characterize the solution profile. A general algorithm is developed that can handle the division of the problem domain into a number of subregions (finite elements) over each of which the solution is found by an orthogonal collocation technique and connected by weak spline conditions. Our method is illustrated by application to a mixing-disguised competitive-consecutive chemical reaction (Ott and Rys, 1975)and is found to be a much more efficient computational technique relative to the previously used methods. Scope-Orthogonal collocation has been used for efficient solution of differential equation models characterizing chemical engineering systems (Villadsen and Stewart, 1967; Fan et al. 1979). An extension of the method that is of great use when steep gradients or discontinuities are present combines orthogonal collocation with a “finite element” or piecewise polynomial (spline) ap- proximation technique (Carey and Finlayson, 1975). This paper presents a general algorithm for solving parabolic partial differential equations that have discontinuous initial value profiles making use of spline collocation methods. Such equations arise, for example, in transient reaction-diffusion problems. The computational approach is designed to be flexible and allows as input to the program the location of region boundaries and the approximation order for the solution in each subregion. Thereby, maximum utilization of any a priori information on the solution characteristics can be realized. The particular application examined in this work involves the solution of parabolic partial differential equations arising in a model of mixing with chemical reaction. On the one hand, the reaction may serve as an indicator of the state of micromixing in a reaction vessel (Klein et al., 1980; Ottino, 1981)or, on the other hand, the mixing may dramatically influence the yields and selectivity of the reaction (Ott and Rys, 1975; Olson and Stout, 1%7; Nagata, 1975). We treat specifically a competitive-consecutive reaction mechanism and show, when all reacting species are mobile, how the relative yield depends on the intrinsic selectivity with mixing parameters derived from a lamellar mixing model (Ottino et af., 1979). Conclusions and SignRIcance-The use of orthogonal collocation and finite elements together in a computational routine has been shown to be expecially effective for solving PPDEs with initial discontinuities. The following four main points summarize our findings: (1) use of spline collocation methods results in an increased accuracy over conventional finite difference techniques as well as global collocation methods for solving discontinuous PPDEs based on a comparison of the relative computation times. As shown in Table 1, the spline collocation method can reduce the error by an order of magnitude over global collocation due to a more efficacious location of the collocation points; (2) the spline collocation computer program developed in this work can be used for a variety of PPDEs and allows one to choose the approximate location of groups of collocation points. In this way, attention can be focused on regions with steep gradients; (3) a lamellar mixing model (Ottino, 1981) has been used to investigate mixing-disguised competitive-consecutive reactions with results similar to those previously obtained by Nabholz et nl., 1977. The computation times have been significantly reducei, however, by making use of the spline collocation procedure; and (4) the extension of this work to higher dimensional problems may be possible with only a slight modification of the basic alogorithm presented in Figs. 3 and 4. Furthermore, the ability to rapidly solve PPDEs is of signilicance where the models are incorporated into parameter estimation routines. It is therefore expected that our analysis will aid in the development of efficient estimation routines as well. *Author to whomcorrespondence shouldbe addressed. tJ. J. Slade Scholar. Present address: Exxon Research and Engineering, FlorhamPark, New Jersey. 197

Transcript of Spline collocation method for solving parabolic PDE's with initial discontinuities: Application to...

Compulers and Chemical Engineering Vol. 6. No. 3, pp. H-207. 1982 Printed in Greal Britain.

SPLINE COLLOCATION

0098-1354/82/030197-I ISO3.MVO Pergamon Press Ltd.

METHOD FOR SOLVING PARABOLIC PDE’S WITH INITIAL

DISCONTINUITIES : APPLICATION TO MIXING WITH CHEMICAL REACTION

HENRIK PEDERSEN* and MICHAEL TANoFFt

Department of Chemical and Biochemical Engineering, Rutgers, The State University, P.O. Box 909, Piscataway, NJ 08854, U.S.A.

(Received 29 June 1981; received for publication 18 November 1981)

Abstract--A spline collocation method is used to numerically evaluate solutions to nonlinear parabolic partial differential equations where steep gradients characterize the solution profile. A general algorithm is developed that can handle the division of the problem domain into a number of subregions (finite elements) over each of which the solution is found by an orthogonal collocation technique and connected by weak spline conditions. Our method is illustrated by application to a mixing-disguised competitive-consecutive chemical reaction (Ott and Rys, 1975) and is found to be a much more efficient computational technique relative to the previously used methods.

Scope-Orthogonal collocation has been used for efficient solution of differential equation models characterizing chemical engineering systems (Villadsen and Stewart, 1967; Fan et al. 1979). An extension of the method that is of great use when steep gradients or discontinuities are present combines orthogonal collocation with a “finite element” or piecewise polynomial (spline) ap- proximation technique (Carey and Finlayson, 1975). This paper presents a general algorithm for solving parabolic partial differential equations that have discontinuous initial value profiles making use of spline collocation methods. Such equations arise, for example, in transient reaction-diffusion problems.

The computational approach is designed to be flexible and allows as input to the program the location of region boundaries and the approximation order for the solution in each subregion. Thereby, maximum utilization of any a priori information on the solution characteristics can be realized.

The particular application examined in this work involves the solution of parabolic partial differential equations arising in a model of mixing with chemical reaction. On the one hand, the reaction may serve as an indicator of the state of micromixing in a reaction vessel (Klein et al., 1980; Ottino, 1981) or, on the other hand, the mixing may dramatically influence the yields and selectivity of the reaction (Ott and Rys, 1975; Olson and Stout, 1%7; Nagata, 1975). We treat specifically a competitive-consecutive reaction mechanism and show, when all reacting species are mobile, how the relative yield depends on the intrinsic selectivity with mixing parameters derived from a lamellar mixing model (Ottino et af., 1979).

Conclusions and SignRIcance-The use of orthogonal collocation and finite elements together in a computational routine has been shown to be expecially effective for solving PPDEs with initial discontinuities. The following four main points summarize our findings: (1) use of spline collocation methods results in an increased accuracy over conventional finite difference techniques as well as global collocation methods for solving discontinuous PPDEs based on a comparison of the relative computation times. As shown in Table 1, the spline collocation method can reduce the error by an order of magnitude over global collocation due to a more efficacious location of the collocation points; (2) the spline collocation computer program developed in this work can be used for a variety of PPDEs and allows one to choose the approximate location of groups of collocation points. In this way, attention can be focused on regions with steep gradients; (3) a lamellar mixing model (Ottino, 1981) has been used to investigate mixing-disguised competitive-consecutive reactions with results similar to those previously obtained by Nabholz et nl., 1977. The computation times have been significantly reducei, however, by making use of the spline collocation procedure; and (4) the extension of this work to higher dimensional problems may be possible with only a slight modification of the basic alogorithm presented in Figs. 3 and 4. Furthermore, the ability to rapidly solve PPDEs is of signilicance where the models are incorporated into parameter estimation routines. It is therefore expected that our analysis will aid in the development of efficient estimation routines as well.

*Author to whom correspondence should be addressed. tJ. J. Slade Scholar. Present address: Exxon Research and Engineering, Florham Park, New Jersey.

197

198 H. PEDERSEN and hi. TANOFF

INTRODUCTION

Nonlinear diferential equations in chemically reactive systems Parabolic partial differential equations, PPDEs, arise in a variety of chemical engineering problems involving reaction and diffusion under transient conditions. When the reaction kinetics are nonlinear, the governing equa- tions must usually be solved by numerical techniques. An especially robust method that has been applied to many examples is to discretize the spatial coordinate, where we will treat here a single spatial dimension, using orthogonal collocation techniques for the boundary value problem and solve the resulting set of coupled first order ordinary differential equations by standard (available) integration techniques (Ferguson and Finlayson, 1970). Finlayson (1971) has also used orthogonal collocation and integration techniques to solve a variety of problems described by PPDEs encountered in the analysis and design of chemical reactors. It has been found that rela- tively low order approximation techniques, using for example only a single collocation point, are sufficient to expose the peculiar features that arise in transient reac- tion problems such as stability of the steady state and parametric sensitivity.

There are available numerous reviews of the ortho- gonal collocation method with a particular emphasis on chemical reaction engineering so that the fundamentals of the technique will not be developed here in any detail (Finlayson, 1972; Villadsen and Michelsen, 1978; Fin- layson, 1980). Rather, we simply point out that in the application of an orthogonal collocation method a series of trial functions that are orthogonal polynomials, typic- ally Jacobi polynomials (Villadsen and Michelsen, 1978), are used to approximate the solution over an entire domain that is in our example the single spatial dimen- sion. The trial function expansion is chosen to satisfy the governing equation with zero residual at N interior col- location points that are fixed as the zeroes of the parti- cular Nth order polynomial use. The accuracy of the method is improved by increasing the order of the poly- nomial N.

The fact that the location of the collocation points are predetermined by the order of the polynomial ap- proximation is a disadvantage, however, when it is known beforehand that the solution may have steep

gradients or discontinuities. In this case, it would be more efficacious to locate the collocation points in the vicinity of the steep gradients rather than increase sub- stantially the order N in order to insure that some points may be in the vicinity of interest. The location of collo- cation points can be realized by carrying out the ortho- gonal collocation method independently on separate subregions and then connecting the regions by a spline technique (Barrodale and Young, 1966) as demonstrated by Carey ad Finlayson (1975). The names “spline collo- cation” (Villadsen and Michelsen, 1978) and “collocation on finite elements” (Finlayson 1974, 1975, 1980; Carey and Finlayson, 1975) have been used in this regard. The combination of a finite element method, that can be used to take advantage of the known behavior of the solution, with orthogonal collocation leads to an extremely ver- satile and powerful technique for handling “difficult” problems involving PPDE’s.

Example application of the method: physico-chemical background

In this report, we utilize a spline collocation technique to solve a particular problem arising in the mixing of chemically reacting fluids that is modeled as a PPDE with a discontinuity in the initial condition. The tech- nique will be developed in a general fashion, however, so that it may be effectively used to handle a larger class of problems.

The importance of micromixing phenomena on the yield and selectivity of chemical reactions has been investigated by Ott and Rys (1973, Pfister et al. (1975), Nabholz et al. (1977) and Nabholz and Rys (1977) in a series of related papers. Selectivity is influenced by diffusion and reaction among small fluid aggregates of initially different chemical species. The selectivity of competitive-consecutive reactions have been experi- mentally measured (Aubry and Villermaux, 1975; Pfister et al., 1975) and can be rationalized using the model of Ott and Rys (1975). Here we will investigate the selec- tivity of a competitive-consecutive reaction using a slightly different model of mixing proposed by Ottino et al. (1979), the lamellar mixing model. During mixing by fluid motion (turbulence), according to the lamellar mix- ing model as well as the description of the mixing process proposed by Beek and Miller (1959), an initially

._._._. ___.___.__-____--.-_-.-.--._-

interface

I ___._-._._.__-._._____._._,-.-.-.-.-.

Fig. 1. Schematic illustration of the lamelalar model for mixing showing distribution of species A and B prior to molecular diffusion. The representative region of the fluid is chosen to go from the centerlines of adjacent lamella

so that the region thickness is S.

Spline collocation method for solving parabolic PDE’s with initial discontinuities 199

unmixed feed to a chemical reactor will distribute into regions (lamella) of uniform composition, Mixing by molecular diffusion then occurs with concomitant chem- ical reaction. The governing equations for this last stage of mixing will be PPDE’s that exhibit a discontinuity in the initial concentration profiles of the reacting species, i.e., steep gradients in the solution profiles. Thereby, the example is especially suited for testing the spline collo- cation method.

TRRORY

Mathematical model The transient diffusion and reaction equation con-

sidered is given by dimensionless form below:

$=$+PR(c) (1)

The rate expression is contained in R(c) where c is the reactant concentration. The dimensionless time t and penetration x variables are defined as

t=$ (2a)

,=g s (2b)

where the. prime superscript indicates the corresponding dimensional quantity. The entire region thickness is given by S as shown in Fig. 1 that presents schematically the lamellar mixing model. The dimensionless reaction modulus is B and D is the diffusion coefficient. For every independent chemical species that participates in the reaction, a separate equation similar to Eq. (1) must be written. The resulting system will, in general, be a cou- pled set of nonlinear PPDE’s. For example, a com- petitive-consecutive reaction described by the mechanism

A + B 1: R; R; = kJC,J[Cr,]

B+R%; R;=kJCJ[CJ

yields the set of equations (see Nomenclature for symbol definition),

~=~-~,RIG, C,) (34

dCB=~-E[p,RrG, Cd+LMMG, Cdl at (W

aCR _ a2CR ar-~+BJWa, Cd-MMG, CR)* (3c)

The initial conditons may be ascertained by reference to Fig. 1. In particular, a characteristic region of the fluid is used that will initially extend from the centerlines of adjacent fluid sheets. Therefore, we may use a “sym- metry boundary condition” on the x domain:

(4)

The initial condition is described by a discontinuity at the species A, B interface and therefore, when the concen- trations are appropriately normalized,

CA=lrCB=0,C8=0;OLx~xX,t=0 (5a)

C,=O,C~=l,C~=O;X,~XC1,f=O (5b)

where the interfacial discontinuity is located at x = x,. The system as given by Eqs. (3)-(T) is thus seen to

depend on parameters B,, B2 and E as well as the location x,.

The equations are integrated to steady state values to obtain the relative yield for the reaction, X,, that is defined as the fraction of E reacted to yield S; i.e.

xs = B,;;,,.d ,o s _ c 22s (6)

reacted R S

where the b_ar denotes average value. Since a mass balance on C, yields, when C,,, is the initial average concentration of A,

c, = (@A‘, - CA) - CR (7)

the relative yield can be expressed in terms of CA and CR as

(8)

Spline collocation method The solution method applied to Eqs. (3)-(T) is an

extension of the orthogonal collocation technique; i.e., the spline collocation procedure. In this way, we are able to handle the steep gradients that characterize short time concentration profies and, in addition, with a relatively low order approximation locate collocation points in the vicinity of the steep gradients even when x, = 0 or x, = 1. The spline collocation technique will be developed for approximating the second derivative at a total of NT interior points as

where ci refers to the concentration of A, B or R at the location Xi. The discretization elements B$j are arrived at as shown below.

As a first step, the domain 0 G x 6 1 is divided into L subregions by placing “spline points” at positions xl where 0 < I < L and x0 = 0 and xL = 1. The regions are chosen freely in order to emphasize the initial dis- continuity. For example, in Fig. 2 a concentration profile is depicted with a discontinuity at x, = 0.6. Spline points are chosen at x1 = 0.5 and x2 = 0.65 in order to highlight the solution in that particular subregion. Subsequently, each subregion is normalized by the transformation

xc/) = (x -x,)/Ax’

where the width of subregion 1 is given by

(10)

Ax’=xl-x1-1. (11)

Within each subregion, we choose independently N’ interior collocation points using standard collocation techniques (Finlayson, 1972) and approximate the

200 H. PEDERSEN and M. TANOFF

0 XI

w X2

LO x3

I 0

NORMALIZED COORDINATE SYSTEMS

I I I as x OS 0.65

ORIGINAL COORDINATE SY!3EM

1 IO

Fig. 2. Relationship between normalized and original coordinate systems for a subdivision of the solution domain into three subregions. Spline points are chosen at 0.5 and 0.65 with a discontinuity illustrated at 0.6. The collocation points are chosen to be 2,4 and 2 in regions 1, 2 and 3, respectively. Note how the collocation points are thereby

densely packed in the vicinity of the discontinuity.

derivatives as

Ni+l

g=& ,& A:ci' (12)

2 I Nl+t

$=A 2 B#. (Ax) i=o

(13)

The boundary conditions as given by Eq. (4) are written for each chemical species A, B and R as

Nl+l

z. A&c,’ (X=0) (14)

A$L+,& (ox= 1) (15)

Additional boundary conditions to connect each subre-

l 3’ ,4ki+,j~j Bx’ j-0

0 = Xl) (17)

for O< I < 15. The concentration at all the boundary locations can now be solved in terms of coefficients Aij and the interior concentration values from Eqs. (14)-(17). In matrix form, we obtain

cRB = V;‘V,c (18)

where the boundary and interior concentration vectors are defined as

CRTs = (Co’C~I+,C~2+,. . .C”,L+,,

CT =(c,‘c*‘. . .c~w*2.. .&L)

The matrices Vz and VI are

(19)

(20)

*. . . .*._ . . . . **.. .... -AL O,NL+I .a.

0 *’ A$+,.0 A~L+I.NL+I

(21)

r 1 a0

-a:r+, ao2 0

gion are the “weak spline” conditions that the function . .

and its derivative (or the concentration and the flux, -a&z+, .*.

respectively) are continuous: v, = . . . . a,

1 . .

-afNf+,‘.. (22)

&+I = CO I+’ (x=x,) 1 0 . . (16)

. .

Spline collocation method for solving parabolic PDE’s with initial discontinuities 201

where the row vectors a,’ and a’kj+l are

a~’ = (A&A&. . .Ai,j) Wa)

aLj+l =(ALj+l,oALj+l,l.. .ALj+l.Ni) Wb)

The approximation for the second derivative, Eq. (13), is given in terms of the interior points (of each region) and all the boundary values as

z $=Be+Ue, (24)

where B is the block diagonal matrix containing the semidiscretizations elements B{j for the interior collo- cation points and U is the corresponding matrix asso- ciated with the boundary collocation points. In parti- cular ,

B=

B’ 0 B2

. . . . . . B’

. . 0 .. BL 1 (25)

u= (26)

The block matrix B’ corresponds to the matrix of B:j values at interior collocation points for region 1 and the row vectors b,,r and bhr+, contain the boundary collo- cation Bij values

bo’ = (B:,B:o.. .B$,N~+,) (274

b’Nr+r = (B:.N~+&N~+,. . .B’N!N~+,). (2%)

Finally, combining Eqs. (18) and (24) gives (see Eq. (9) the approximation for the second derivative at all interior collocation points in terms of the modified semidiscretization matrix, B*, as

J2C T=B*c ax (28)

where

B*=B+W2-‘V,. (29)

The total number of collocation points in the interior domain, NT, is then just the sum of interior points over all regions,

NT=iN’ i=l

The differential equations are converted from PPDE’s to a coupled set of first-order ordinary differential equa- tions. Equations (3) are rewritten at interior collocation

point i as

$ = z BT&‘Bj - E(B,CLm + P2CdRi)

(31b)

with an initial condition as described previously. Note that the semi-discretization element Bfj is evaluated only once for a particular choice of sphne points and ap- proximation order and will, furthermore, be identical for each of the independent chemical species. Therefore, once the parameters are fixed and Btj bound by Eq. (29) the problem is in a form that is standard for a number of available integration packages, e.g. a Runge-Kutta rou- tine or Gear’s method (Forsythe et al., 1977; Byrne et al., 1977).

ALGORITEM

The computer code developed to handle the spline collocation method applied to PPDE’s makes extensive use of global collocation subroutines that are available in Villadsen and Michelsen, 1978. A general routine JCOBI is given there to locate the zeros of a Jacobi polynomial that are the collocation points in a normalized region. A second routine DFOPR is described by Villadsen and Michelsen (1978), to evaluate the discretization elements Aij and Bij at the collocation zeros. AS shown in Fig. 3, these operations are carried out sequentially for each subregion in a routine called SPCOL. After the number of collocation points and the width of the current subre- gion are set, repeated calls to JCOBI and DFOPR are used to construct the matrices VI, V2, U and B (see Eqs. (22), (21), (26) and (25), respectively). In addition, in order to handle approximations to the first derivative that would be necessary in describing diffusion problems within a nonplanar system, the matrices W and A are also evaluated. The matrix W is the counterpart to U in the first derivative approximation as A is to B.

The subroutine SPCOL also performs the matrix operation indicated by Eq. (29) to return the matrix B*. The matrix A* is also returned that is used to ap- proximate the first derivative,

$ = A*c.

The overall program incorporating SPCOL is shown as a flow diagram in Fig. 4. The user inputs information on the number of subregions, the subregion boundaries that are the spline points, the number of collocation points for each subregion, the location of the discontinuity for the initial condition and the parameters associated with the PPDE. After SPCOL sets up the discretization ele- ments and the problem is recast into a form suitable for an integration routine, the inital conditions are set. The problem is then integrated using Gear’s method or a high accuracy Runge-Kutta technique available in the com- puter center IMSL library. Concentration profiles, the relative yield and other quantities of interest are then printed and/or plotted.

CACE Vol. 6. No. 3-4

202 H. PEDERSEN and hf. TANOFF

SPCOL

-3

Fig. 3. Flow diagram of subroutine SPCOL that develops the scmidiscretization elements for the first and second derivatives. Routines JCOBI and DFOPR are from Villadsen and Michelsen (1978). The boxes from top to bottom carry out the following operations: initialize parameters for current subregion:

0 read number of interior collocation points 0 set width (Ax’) of region

evaluate roots and derivatives of Jacobi Polynomials; add inter- polation points at subregion boundaries (0, I)

MAIN

SPCOL

f

STRTR

0 OUTPUT

Fig. 4. Flow diagram of computer program to numerically solve PPDE’s by a spline collocation technique. Routine DGEAR is

from the IMSL package.

Fig. 3 (Co&f). evaluate discretization matrix for first derivative, A;, in current

normalized subregion, including points on subregion boun- daries

transform first derivatives on normalized subregion to actual subregion

evaluate discretization matrix for second derivative, B& in cur- rent normalized subregion, including points on subregion boundaries

transform second derivatives on normalized subregion to actual subregion

remove subregion boundary conditions from A and B matrices and store values in matrices Vr, Vz, U, W

contract A and B matrices to retain derivatives at interior collo- cation points only

form final O.D.E. coefficient matrices for interior collocation points. Boundary condition are included implicitly.

Spline collocation method for solving parabolic PDE’s with initial discontinuities 203

RESULTS AND DISCUSSION

Comparison of ordinary and spline collocation The simple diffusion equation without chemical reac-

tion,

ac a% -=2 at ax (33)

with the “no-flux” boundary conditions and an initial discontinuity in the concentration profile at xX = 0.5 was solved by ordinary and spline collocation techniques. We refer to ordinary collocation as the method that con- siders only a single region whereas the spline collocation method, in this example, worked with two subregions with spline point x, = 0.5 that is also the presumed loca- tion of the discontinuity. An analytical solution to the above equation may be easily found (Crank, 1956) and compared to the results of numerical calculation. The results for this excercise are given in Table 1 that shows the numerical solution at the collocation points, NT = 4, and the percent error for each method. In the spline collocation technique, two points were chosen in each of the two subregions whereas in the ordinary collocation method a total of four interior points were used. It is seen that the accuracy is significantly improved with a low order spline collocation solution relative to the use of a global collocation method. The maximum error at the short time t = 0.1 is only 0.4% in the former case and 4.5% in the latter. From the location of the zeros, i.e. the collocation points, it is seen that the spline technique focuses more clearly on the crucial region about x = 0.5. Furthermore, if the discontinuity were located at points

lower than the value of the smallest zero, or higher, the method of ordinary collocation would not be capable of distinguishing the discontinuity and higher order ap- proximations would be necessary just to insure that at least one point is found on either side of the dis- continuity. This is not the case with a spline technique as already pointed out by Carey and Finlayson (1975). Of course, accurate solutions can always be obtained by increasing the approximation order. We have found, however, that for our computer code, only a slight difference in computation times is seen for the ordinary and spline collocation methods. This is because, although the supplementary equations derived from the spline method look somewhat formidable, the final results are very easy to program and results in an efficient com- putational package, particularly when “maximum” use can be made of available routines such as JCOBI, DFOPR and DGEAR.

Application to mixing with a competitive-consecutive reaction

The reaction and diffusion steps that take place for a competitive-consecutive reaction mechanism have been previously described and the occurrence of steep gradients in the concentration profiles at small reaction times noted. The system of equations governing the transient behavior of the lamellar mixing model are given in Eqs. (3(a-c)). In practice, these equations would be integrated, for a particular choice of parameter values, to obtain the steady state concentrations that can be used to determine the relative yield, an experimentally observ- able quantity. Since an explicit integration routine is used

Table 1. Comparison of ordinary and spline collocation methods for solving Eq. (33). The percent error for each method has been calculated by evaluating the analytical solution at the appropriate collocation point and is shown in

parentheses. The initial discontinuity in the profile is located at x = 0.5.

GLOBAL COI.L@,YzTION

(L - 1, N1 = 4)

distance, x

time, t .0694 .3300 .6700 .9306

0. 0. 0. 1. 1.

.1 .256 (4.51) .373 (1.6*) .627 (1.6t) .744 (4.5%)

.2 .409 (1.2\) .452 (0.7%) .547 (0.7%) .591 (1.2%)

.3 .466 (0.4%) .482 (0.2%) .518 (0.2%) .534 (0.4%)

.4 .487 (0.2%) .493 (0.2%) .507 (0.2%) .513 (0.2%)

.5 .495 (0.2%) .498 .502 .505 (0.2%)

time, t

0.

.l

.2

.3

.4

.5

COWCATION ON FINITE ELEPWTS

(L = 2, x - 0.5, Nl - 2, N2 - 2)

distance, x

.1057 .3943 .6057

0. 0. 1.

.277 (0.4%) .424 (0.2t) .576 (0.2I)

.417 (0.2\) .472 (0.2W .528 (0.2*)

.469 .489 .510

.488 .496 .504

.496 .499 .501

.a943

1.

.723 (0.4s)

.583 (0.41)

.531

.511

.504

204 H. PEDERSEN and M. TANOFF

in our simulations in order to conserve on the com- 0.5 so that equal amounts of A and B are asumed at putation time, it is important that the initially steep f = 0. The parameter values used in the simulation are gradients in concentration profiles be carefully resolved. given in Fii. 5, that also shows the number and location

Figure 5 shows the concentration profiles for species of the collocation points. In this case, three regions with A, B and R at a dimensionless time t =0.015 for a 2,4 and 4 collocation points, respectively, were modeled relatively rapid reaction. The initial discontinuity in the with spline points located at xi = 0.45 and x2 = 0.70. It is concentration profiles, see Figure 1, was chosen at x = seen that the solution changes rapidly over small dis-

m

i oa- a

i

ii

0.6-

N’ = 2 / \ N2=4 /\ N3=,_j 4

DIMENSKINLESS DISTANCE, x

Fig. 5. Concentration protiles for chemical species participating in a consecutivecompetive reaction mechanism. The parameter values are given in the figure. The initial discontinuity in the concentration profiles was at x = 0.5.

The location of spline collocation points is shown along the bottom of the figure.

0.6

DIMENSIONLESS DISTANCE, x

Fig. 6. Time dependence of the species B concentration profile when the initial step change (discontinuity) was at 0.5. The parameter values in the figure correspond to those presented in Fire 5.

Spline collocation method for solving parabolic PDE’s with initial discontinuities 205

tances indicating the importance of carefully locating the initially as a “reaction front” and then levels off towards collocation points. By varying the spline coordinates and a uniform zero value throughout the region. The location number of collocation points in each subregion as well as of collocation points with a significant density at x > 0.5 the total number of collocation points it is possible to is needed to accurately evaluate the solution. obtain some indication on the accuracy of the solution. As eluded to earlier, the importance of carefully locat-

At dimensionless times less than 0.015 the profiles are ing collocation points is more critical when the initial even more steeply contoured, particularly for species B discontinuity is positioned near one of the region boun- that is consumed in two reaction steps. The transient daries. Figure 7 shows the concentration profiles for behavior of species I3 concentration profile is depicted in species A and R at t = 0.005 under the conditions Fig. 6 for the same parameter values and approximation detailed in Fig. 5 and 6 except that the initial dis- order as in Fig. 5. It is seen that for rapid reactions of the continuity is shifted to x = 0.9. The high density of points type simulated here, the concentration profile moves in the critical area where the concentration profiles are

t = 0.005

p, = 1000

&a 50 E = IO

COLLOCATION 002

,WINT

I I I I 0.2 0.4 0.6 08 LO0

DIMENSIONLESS DISTANCE, x

Fig. 7. Concentration profiles calculated for an initial discontinuity at x = 0.9. The solid line is the result of a spline method with spline points and collocation points given in the figure and the dashed line is the result of an ordinary

collocation method. The parameter values are presented in Figure 5.

Oo.01 1 I I I 1 I I I I I I

0.1 1.0 IO too

INTRINSIC SELECTIVITY, B2 / 8,

Fig. 8. Relative yield for a competitive-consecutive chemical reaction as a function of the intrinsic selectivity. The initial discontinuity in the concentration profiles was located at x = 0.5.

206 H. PEDERSEN and M. TANOFF

steep is apparent for the spline collocation method. A significantly higher order approximation is required for ordinary collocation to obtain the same density of points in the critical area and thereby obtain an accurate approximation to the solution profiles. The final average concentration for species A and R predicted by the ordinary collocation method with ten collocation points was determined to be in error by about 8% whereas the spline collocation method gave the solution accurate to within 0.1% with a to&f of ten collocation points as found by higher and higher order approximations. The computation times were 0.9 CPU sets and 1.5 CPU sets (see PRECISION) for the ordinary and spline methods, respectively, to integrate to t = 0.005. This is sufficient to obtain the stationary solution since B is essentially zero throughout the region at this value of the dimensionless time.

A complete set of calculations for the competitive- consecutive reaction mechanism has also been carried out to determine the relative yield X, as a function of the intrinsic selectivity, &/pl. The result is shown in Fig. 8 for a value E = 10, B1 = 10 and the initial discontinuity at x = 0.5. The entire curve can be generated by evaluating the semidiscretization elements for the spline method only once and then integrating the equations to steady state for different sets of parameter values. The total com- putation time to go from intrinsic selectivities between 0.001 and 10. was about 30sec on an IBM 370/168 computer. This is a substantial improvement over the numerical methods used by Ott and Rys (1973) who solved a similar, although simpler, model. They report computation times on a CDC 6400/6500 computer be- tween 2 and 5 min for each parameter set.

PRECLSlONANDCOMPUTATIONALINFORMATlON

All calculations were performed using single precision arithmetic on an IBM 3701168 computer. Subroutine packages that were incorporated into our program in- cluded the listings given in Villadsen and Michelsen (1978) for ordinary collocation procedures and in- tegration routines DVERK and DGEAR from the IMSL (International Mathematical and Statistical Libraries, Inc.) library, Version 8. In the calculations shown in Figs. 5-8 it was found that a significant portion of the computational effort is in the integration steps, parti- cularly for “slow” reactions.

Our package for the spline collocation method allows for a total of 10 collocation points and a maximum of 4 subregions. This may be easily changed, however. The program listing is available from the author on request.

Acknowledgement-This work was supported in part by a grant from the Donors of the Petroleum Research Fund. administered by the American Chemical Society.

A” Ali; A

b B

B&B

c, c D E

k,, kz

NOMENCLATURE

row vector defined in Eqs. (23a, b) chemical species semidiscretization element for first derivative in

region I, matrix of semidiscretization elements A, row vector defined in Eqs. (27a, b) chemical species semidiscretization element for second derivative in

region 1, matrix of semidiscretization elements Bij dimensionless concentration diffusion coefficient, m*/s initial mol ratio of species A and B rate constants for second order reactions, m’/mol/s

L number of subregions N, NT number of interior collocation points, total number

of interior collocation points R reaction rate expression, chemical species S chemical species t dimensionless time

U matrix of discretization elements Ai and Aiu~+, Vi, V2 matrices of discritization elements defined’in Eq.

(21), Eq. (22) W matrix of discretization elements BB and B$+t x dimensionless thickness or penetration distance

X, overall yield of B to form S, Eq. (6)

Greek symbols B reaction modulus for a second order reaction

BI k,[G,l~*/D PZ kJ’&l~*lD 6 lamella composite thickness

Ax subregion dimensionless thickness

Superscripts

I T *

Subscripts A, B, R, S

i,i

R; x

dimensional quantity average value region number transpose of a vector or matrix modified semidiscretization element

chemical species indices for semidiscretization element initial t = 0 value region boundary discontinuity

REFERENCES

1. C. Aubry L J. Villermaux, Representation due melange im- parfait de deux courants de reactifs dans un reacteur agite continu. C/rem. Engng Sci. 30,457 (1975).

2. I. Barrodale & A. Young, A note on numerical procedures for approximation by spline functions. Compuf. J. 9, 318 (1966).

3. J. Beek, Jr. & R. S. Miller, Turbulent transport in chemical reactors. Chem. Engng Prog. Symp. Ser. 55,*33 (1959).

4. G. A. Byrne, A. Hindmarsh, K. R. Jackson & H. G. Brown, A comparison of two ODE codes: GEAR and EPISODE. Comput. Chem. Engng 1, 133 (1977).

5. G. F. Carey & B. A. Finlayson, Orthogonal collocation on finite elements. Chem. Engng Sci. 30, 587 (1975).

6. J. Crank, The Mathematics of Difusion. Oxford University Press, London (1956).

7. L. T. Fan, G. K. C. Chen & L. E. Erickson, Efficiency and utility of collocation methods in solving the performance equations of flow chemical reactors with axial dispersion. Chem. Engng Sci 26,379 (1971).

8. N. B. Ferauson & B. A. Finlavson. Transient chemical reac- tion analysis by orthogonal collocation. C/rem. Engng 1. 1, 327 (1970).

9. B. A. Finlayson, Packed bed reactor analysis by orthogonal collocation. Chem. Engng Sci. 26, 1081 (1971).

10. B. A. Finlayson, The Method of Weighted Residuals and Variational Princivles, DO. 97-150. Academic Press. New York (1972). _ __

11. B. A. Finlayson, Orthogonal collocation in chemical reaction engineering. Cat. Rev. -Sci. Engng 10, 69 (1974).

12. B. A. Finlayson, Weighted residual methods and their rela- tion to finite element methods in flow problems. In Finite Ele- ments in J&ids (Edited by R. H. Gallagher, J. T. Oden, C. Taylor, and 0. C. Zienkiwicz), Vol. 2, pp. l-29. Wiley, New York (1975).

13. B. A. Finlayson, Nonlinear Analysis in Chemical Engineer- ing. McGraw-Hill, New York (1980).

Spline collocation method for solving parabolic PDE’s with initial discontinuities 207

14. G. E. Forsythe, A. Malcolm & C. B. Moler, Computer 20. Methods for Mathematical Computations. Prentice-Hall, Englewood Cliffs (1977).

15. J. P. Klein, R. David & J. Villermaux, Interpretation of 21. experimental liquid phase micromixing phenomena in a con- tinuous stirred reactor with short residence times. Ind. Engng Chem. Fundl., 19, 373 (1980). 22.

16. F. Nabholz, R. J. Ott & P. Rys, Chemical selectivities dis- guised by mass diffusion. III. A comparison of two versions of a simple model of mixing-disguised reactions in solution. 23. Helv. Chim. Acta, 60,2926 (1977).

17. F. Nabholz & P. Rys, Chemical selectivities disguised by mass diffusion. IV. Mixing-disguised nitrations of aromatic 24. compounds with nitronium salts. Helv. Chim. Acta, 60, 2937 (1977).

18. S. Nagata, Mixing, Principles and Applications. pp. 298-334, Wiley, New York (1975). 25.

19. J. H. Olson & L. E. Stout, Jr., Mixing and chemical reac- tions. In Mixing, Theory and Practice (Edited by V. W. Uhl and J. B Gray) pp. 115-168. Academic Press, New York (1967).

R. J. Ott & P. Rys, Sorption-diffusion in heterogeneous systems. Part 5. A general dilTusion/immobilization model, Trans. Faraday Soc.r69, 1694 (1973). R. J. Ott & P. Rvs. Chemical selectivities disnuised bv mass diffusion. I. A simple model of mixingdisgui&d reactions in solution. Helv. Chim. Acta, 58,2074 (1975). J. M. Ottino, W. E. Ranz & C. W. Macosko, A lamellar model for analysis of liquid-liquid mixing. Chem. Engng Sci. 34,877 (1979). J. M. Ottino, Efficiency of mixing from data on fast reactions in multi-jet reactors and stirred tanks. AIChE I. 27, 184 (1981). F. Pfister, P. Rys & H.Zollinger, Chemical selectivities dis- guised by mass diffusion. II. Mixing-disguised nitrations of aromtic comoounds with nitronium salts. Helv. Chim. Acta. 58,2893 (1975). J. Villadsen & hf. Michelsen, Solution of Diferential Equa- tion Models by Polynomial Approximations. Prentice-Hall, Englewood Cliffs, New Jersey (1978).