Example 2.3.14 Graetz Problem - Finite Difference Solution

The Graetz problem (heat or mass transfer) in cylindrical coordinates with parabolic velocity profile is solved here. The governing equation for the eigenfunction is[15] [8]

+ (3.2.52)

with the boundary conditions:

(3.2.53)

and

=0 (3.2.54)

Equation (3.2.52) is a second order equation with two boundary conditions (equations (3.2.53) and (3.2.54). In equation (3.2.52), λ is the eigenvalue. To solve for the eigenvalue an additional boundary condition has to be used. For this purpose, y at x = 0 is arbitrarily set to 1:

=1 (3.2.55)

Next, equation (3.2.52) is discretized using finite differences as in section 3.2.3. This yields N equations for the interior node points. The boundary conditions (equations (3.2.53) and (3.2.54) are converted to finite difference form. This yields two equations. There are a total of N+2 node points including the boundaries. There are N+2 dependent variables (yi,i = 0..N+1). There is an additional variable λ. The additional equation is (3.2.55). Hence, there are N+3 variables (yi,i = 0..N+1 and λ) to be solved from N+3 equations. There are infinite solutions for the differential equation (3.2.52). Hence, there are multiple solutions for the system of finite difference equations. This example is solved in Maple below:

> | restart:

> | with(plots):

> | N:=6;

| (1)

> | L:=1;

| (2)

> | eq:=diff(y(x),x$2)+1/x*diff(y(x),x)+lambda^2*(1-x^2)*y(x);

| (3)

> | bc1:=diff(y(x),x);

| (4)

> | bc2:=y(x)-0;

| (5)

The additional boundary condition is entered here:

> | bc3:=y(x)-1;

| (6)

The central difference expressions for the second and first derivatives are

> | d2ydx2:=(y[m+1]-2*y[m]+y[m-1])/h^2;

| (7)

> | dydx:=(y[m+1]-y[m-1])/2/h;

| (8)

Three point forward and backward difference expressions for the derivative are:

> | dydxf:=(-y[2]+4*y[1]-3*y[0])/(2*h);

| (9)

> | dydxb:=(y[N-1]-4*y[N]+3*y[N+1])/(2*h);

| (10)

The governing equation in finite difference form is:

> | Eq[m]:=subs(diff(y(x),x$2)=d2ydx2,diff(y(x),x)=dydx,y(x)=y[m],x=m*h,eq);

| (11)

The boundary conditions in finite difference form are:

> | Eq[0]:=subs(diff(y(x),x)=dydxf,y(x)=y[0],bc1);

| (12)

> | Eq[N+1]:=subs(diff(y(x),x)=dydxb,y(x)=y[N+1],bc2);

| (13)

A 'for loop' can be written for the interior node points as

> | for i to N do Eq[i]:=subs(m=i,Eq[m]);od;

| (14)

The additional equation for the eigenvalue is:

> | Eqeig:=subs(diff(y(x),x)=dydxf,y(x)=y[0],bc3);

| (15)

> | h:=L/(N+1);

| (16)

The finite difference equations are stored in eqs:

> | eqs:=seq(eval(subs(Phi=1,Eq[i])),i=0..N+1),Eqeig;

| (17)

The dependent variables are stored in vars:

> | vars:=seq(y[i],i=0..N+1),lambda;

| (18)

These variables are solved as:

> | fsolve({eqs},{vars});

| (19)

Since there are multiple solutions, one has to provide the range for the dependent variables. The dependent variable y varies between 0 and 1 and the eigenvalue is solved in the range of 0.4.

> | vars:=seq(y[i]=-1..1,i=0..N+1),lambda=0..4;

| (20)

The solution obtained in stored in sol[1] and plotted:

> | sol[1]:=fsolve({eqs},{vars});

| (21)

> | assign(sol[1]):

The first eigenvalue is given by:

> | l[1]:=lambda;

| (22)

The first eigenfunction is plotted here:

> | plot([seq([i*h,y[i]],i=0..N+1)],thickness=4,axes=boxed,labels=[x,y]);

> | p[1]:=plot([seq([i*h,y[i]],i=0..N+1)],thickness=4,axes=boxed,labels=[x,y]):

> | for i from 0 to N+1 do unassign('y[i]'):od:

> | unassign('lambda'):

> | M:=4;

| (23)

The next three eigenvalues are found by changing the range in increments of 4:

> | for j from 2 to M do

> | vars:=seq(y[i]=-1..1,i=0..N+1),lambda=l[j-1]+1..l[j-1]+4;

> | sol[j]:=fsolve({eqs},{vars});

> | assign(sol[j]):

> | l[j]:=lambda;

> | p[j]:=plot([seq([i*h,y[i]],i=0..N+1)],thickness=4,title="Figure Exp. 3.2.30.",axes=boxed,labels=[x,y]):

> | for i from 0 to N+1 do unassign('y[i]'):od:

> | unassign('lambda'):

> | od:

The first four eigenvalues are:

> | print(seq(l[i],i=1..M));

| (24)

Even after using N = 30 interior node points we get only two digit accuracy with the exact solution. In addition, we observe more errors for higher eigenvalues than for the lower eigenvalues.

> | display({seq(p[i],i=1..M)});

> |