0% found this document useful (0 votes)
19 views13 pages

Galerkin-Finite Element Method For The Numerical S

Uploaded by

dreamysky404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views13 pages

Galerkin-Finite Element Method For The Numerical S

Uploaded by

dreamysky404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/224842347

Galerkin-finite element method for the numerical solution of


advection-diffusion equation

Article · March 2011

CITATIONS READS

12 4,732

3 authors:

Dinkar Sharma Dr Ram Jiwari


Lyallpur Khalsa College Jalandhar Indian Institute of Technology Roorkee
35 PUBLICATIONS 201 CITATIONS 71 PUBLICATIONS 1,550 CITATIONS

SEE PROFILE SEE PROFILE

Sheo Kumar
Motilal Nehru National Institute of Technology
10 PUBLICATIONS 77 CITATIONS

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

A numerical algorithm based on modified cubic trigonometric B-spline functions for computational modelling of hyperbolic type
wave equations View project

Lie Symmetry Analysis, Simulation and Lyapunov Stability Analysis of the Hyperbolic Systems View project

All content following this page was uploaded by Dr Ram Jiwari on 03 June 2014.

The user has requested enhancement of the downloaded file.


International Journal of Pure and Applied Mathematics
————————————————————————–
Volume 70 No. 3 2011, 389-399

GALERKIN-FINITE ELEMENT METHOD FOR


THE NUMERICAL SOLUTION OF
ADVECTION-DIFFUSION EQUATION

Dinkar Sharma1 , Ram Jiwari2 § , Sheo Kumar3


1,2,3 Department
of Mathematics
Dr. B.R. Ambedkar National Institute of Technology
Jalandhar, Punjab, 144011, INDIA

Abstract: In this article, Galerkin-finite element method is proposed to


find the numerical solutions of advection-diffusion equation. The equation is
generally used to describe mass, heat, energy, velocity, vorticity etc. As test
problem, three different solutions of advection-diffusion equation are chosen.
Maximum errors norm L∞ are calculated and found that the errors are small
and negligible.

AMS Subject Classification: 65Mxx, 65Nxx


Key Words: finite element method, finite difference method, advection-
diffusion equation

1. Introduction

Consider the one-dimensional advection-diffusion equation


∂U ∂2U ∂U
−λ 2 +α , 0 ≤ x ≤ L, t > 0, (1)
∂t ∂x ∂x
with the initial condition

U (x, 0) = φ(x), 0 ≤ x ≤ L, (2)

and the boundary conditions

Received: March 15, 2011 c 2011 Academic Publications, Ltd.


§ Correspondence author
390 D. Sharma, R. Jiwari, S. Kumar

U (0, t) = f (t), U (L, t) = h(t), t > 0, (3)

where U represents concentration of the pollutant at point x, the advection


coefficient α is the velocity of water flow and λ is the diffusion coefficient.
The advection-diffusion equation is generally used to describe mass, heat,
energy, velocity, and vorticity [13]. The equation has been used as a model
equation in many chemistry and engineering problems such as, thermal pollu-
tion in river systems [3], flow in porous media [9], dispersion of tracers in porous
media [4], the dispersion of dissolved material in estuaries and coastal seas [6],
the intrusion of salt water into fresh water aquifers, the spread of pollutants in
rivers and streams [2], forced cooling by fluids of solid material such as windings
in turbo generators [5], the spread of solute in a liquid flowing through a tube,
long-range transport of pollutants in the atmosphere [17], contaminant disper-
sion in shallow lakes [15], model water transport in soils [14], the absorption of
chemicals into beds [7], etc. Isenberg and Gutfinger used the advection-diffusion
equation to describe heat transfer in a draining film [7]. Mortan has used the
advection-diffusion equation to model some economics and financial forecasting
[10]. Besides this, the equation has great importance in civil engineers and
hydrologists. Thus, the advection-diffusion equation is very interesting linear
partial differential equation from numerical study point of view.
Many researchers have developed numerical techniques to study the numer-
ical solutions of advection-diffusion equation. Celia et al [1] have proposed an
Eulerian-langrangian localized adjoint method for the advection-diffusion equa-
tion. Spalding [16]proposed the hybrid scheme which is a combination of three
straight lines to correlate the exact curve. Kakuda and Tosaka [8]used time
splitting or fractional steps method for advection-diffusion and viscous fluid
flows problems. Nico et al [12] proposed a finite volume upwind scheme for the
solution of the linear advection-diffusion equation with sharp gradients in mul-
tiple dimensions for the solution of advection-diffusion equation while Neubauer
and Bastian [11] used a monotonicity preserving Eulerian-Lagrangian localized
adjoint method for advection-diffusion equations.

2. Semidiscrete Finite Element Models

The semi discrete formulation involves approximation of the spatial variation


of the dependent variable. The first step involves the construction of the weak
form of the given problem over a typical element. In second step, we develop
the finite element model by seeking approximation of the solution.
GALERKIN-FINITE ELEMENT METHOD FOR THE NUMERICAL... 391

2.1. Weak Formulation of the Problem

The weak formulation of the given problem (1) over a typical linear element
(xa , xb ) is given by
Z xb
∂2U
 
∂U ∂U
w(x) −λ 2 +α dx = 0, (4)
xa ∂t ∂x ∂x

where w(x) are arbitrary test functions and may be viewed as the variation in
U (x). After reducing the order of integration, we arrive at the following system
of equations
Z xb  
∂U ∂w ∂U ∂U
w(x) +λ + αw(x) dx = 0. (5)
xa ∂t ∂x ∂x ∂x

2.2. Finite Element Formulation of the Problem

The finite-element model may be obtained from equations (5) by substituting


finite element approximations in the decoupled form
N
X
U (x, t) = Uje (ts )ψje (x), s = 1, 2... . (6)
j=1

Substituting w = ψi (x) and (6) in equation (5) to obtain the ith equation of
the system, we have
      
xb N N N
U dψj  dψi X dψj 
Z
ψi 
X .j X
ψj  + αψi  Uj +λ Uj dx
xa dt dx dx dx
j=1 j=1 j=1

= 0, (7)

N Z xb  Z xb  Z x b  
X dUj dψj dψi dψj
ψi ψj dx +α ψi dx Uj + λ dx Uj
xa dt xa dx xa dx dx
j=1

= 0 (8)

The equation (8) can be written in the matrix form


n o
[M ] U̇ + [K 1 ] {U } + [K 2 ] {U } = 0, (9)
392 D. Sharma, R. Jiwari, S. Kumar

R xb 1 =
R xb dψj
where Mij = xa ψi ψj dx, Kij xa ψi dx dx,
xb
dψi dψj
Z
2
Kij = dx. (10)
xa dx dx

The system (9) can be written as


n o
[M ] U̇ + [K] {U } = 0, (11)

where[K] = [K 1 ] + [K 2 ].
We use the linear piecewise approximation in the space variable and the
Galerkin method to obtain the semi discrete approximation to equation (1)

U e (x, t) = ψi−1 (x) Ui−1 (t) + ψi (x) Ui (t) , (12)

where
x − xi−1 xi − x
ψi−1 (x) = , ψi (x) = . (13)
xi − xi−1 xi − xi−1
We have used the linear piecewise approximation (12) and (13) to find out the
integral in the equation (10). Then, the system (11) become
n o
[M ] U̇ + [K] {U } = 0, (14)

where:
h 21 α  −1 1  λ  1 −1 
[M ] = [ 1 2 ] , [K] = + ,
6 2 −1 1 h −1 1
n o h ˙ i h i
U̇ = Ui−1 , {U } = UUi−1 .
U̇i i

3. Fully Discretized Finite Element Equations

We have the system of ordinary differential equations as follows


n o
[M ] U̇ + [K] {U } = 0, (15)

subject to the initial condition

{U }0 = φ(x) = {U }0 , (16)

where {U }0 denotes the vector of nodal values of U at timet = 0 whereas {U }0


denotes the column of nodal values Uj0 .
GALERKIN-FINITE ELEMENT METHOD FOR THE NUMERICAL... 393

0.06 0.0005
T=1.0
T=1.0 T=3.0
0.05 T=3.0 T=5.0
0.0004
T=5.0

0.04
0.0003

Max. Error
Max Error

0.03

0.0002
0.02

0.0001
0.01

0.00 0.0000

0 2 4 6 8 0 2 4 6 8

X X

Figure 1: Maximum errors in Ex- Figure 2: Maximum errors in Ex-


ample 1 for λ = 0 (purely advection ample 1 for λ = 0.1 (purely advec-
equation) at different time tion equation) at different time

As applied to a vector of time derivatives of the nodal values the weighted


average of approximation on the equation (15), we have
{U }s+1 − {U }s
 
[M ] + θ[K] {U }s+1 + (1 − θ)[K] {U }s = 0. (17)
∆t
The equation (17) can be written in simple form as
([M ] + ∆tθ[K]) {U }s+1 = [M ] {U }s − ∆t (1 − θ) [K] {U }s . (18)
The algebraic system (18) is solved by Gauss elimination method by taking
Crank-Nicolson Scheme i.e θ = 12 in equation (18).

4. Numerical Experiment and Discussion

In this section, we have studied three test examples to check the accuracy of
the proposed numerical scheme.

Example 1. In the first test example, the advection-diffusion equation (1)


is considered with domain [0, 9] and the analytical solution
−(x − x0 − αt)2
 
U (x, t) = 10 exp . (19)
2ρ2
394 D. Sharma, R. Jiwari, S. Kumar

T x Num Sol Exact Sol Max Error


0.5 1.5 9.99991 9.99993
4.5 9.99970 9.99971 1.43479
7.5 9.99819 9.99821
1.0 1.5 9.99968 9.99971
4.5 9.99989 9.99993 4.30570
7.5 9.99881 9.99885
3.0 1.5 9.99930 9.99935
4.5 9.99993 10.0000 4.45166
7.5 9.99928 9.99935

Table 1: Comparison of numerical and analytic solutions of Example 1


for α = 0.5, λ = 0.1 with maximum absolute error

The initial and boundary conditions are taken from the analytical solution
(19). We have considered ρ = 264m, α = 0.5m/s and x0 = 2. In this example,
we have considered two cases. In the first case, we study the purely advection
equation by taking λ = 0.In second case, we take advection-diffusion equation.
Figure 1 depicts the absolute errors at different time for first case. Table 1
shows the comparison of numerical and analytic solutions at different time and
x with maximum absolute error for the second case. Figure 2 shows the absolute
errors for the second case. The Table 1 and Figures 1-2 show that the proposed
method has good accuracy.

Example 2. In the second test, the analytical solution of equation (1) is


given by
∞ ∞
Px Px
!
e L −1 4πe L sinh(P/2) X Px X
U (x, t) = 100 + Am + 2πe 2L Bm , (20)
eP − 1 eP − 1
m=1 m=1

where:
m  mπx 
Am = (−1)m sin e−λm t ,
βm L
   
m m P mP  mπx 
e−λm t ,
−P
Bm = (−1) 1+ e 2 + 2 sin
βm βm βm L

with
p2 α2 m2 π 2 λ
βm = + (mπ)2 and λm = + ,
4 4λ L2
GALERKIN-FINITE ELEMENT METHOD FOR THE NUMERICAL... 395

100
T=0.0 0.25
T=3.0
T=5.0
80
T=10.0 0.20
T=15.0
T=0.5
T=20.0

Numerical Solution
Numerical Solution

60 0.15

40 0.10

T=0.4
0.05
20

0.00
0
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

X X

Figure 3: Numerical solution of Ex- Figure 4: Numerical solution of Ex-


ample 2 for α = 0.1, λ = 0.01 at ample 3 for α = 1.0, λ = 0.01 at
different time different time

T x Num Sol Exact Sol Max Error


3.0 0.25 6.19441 6.19505
0.50 22.34930 22.3500 6.4125
0.75 46.15160 46.15206
5.0 0.25 2.72582 2.72601
0.50 11.69460 11.69100 3.6142
0.75 30.63180 30.63030
10.0 0.25 0.46021 0.46009
0.50 2.60798 2.60830 3.2890
0.75 12.78790 12.7904

Table 2: Comparison of numerical and analytic solutions of Example 1


for α = 0.1, λ = 0.01 with maximum absolute error

where P = αLλ is the Peclet number.


In the numerical experiment, we have considered the initial and boundary
conditions U (x, 0) = 100x
L and U (0, t) = 0, U (L, t) = 100 with L = 1.0m,
2
α = 0.1m/s, λ = 0.01m /s.
In Table 2, a comparison is made between the analytical solutions and the
numerical solution with maximum absolute error. The Figure 3 shows the
behavior of the numerical solutions at different time and from figure it is clear
396 D. Sharma, R. Jiwari, S. Kumar

0.25

0.20

0.20

T=0.7 0.15
0.15
Numerical solution

Numerical solution
T=1.0

T=0.6 0.10
0.10 T=0.9

0.05
0.05 T=0.8

0.00 0.00

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

X X

Figure 5: Numerical solution of Ex- Figure 6: Numerical solution of Ex-


ample 3 for α = 1.0, λ = 0.01 at ample 3 for α = 1.0, λ = 0.01 at
different time different time

0.15

0.10
T=1.5
Numerical solution

0.05

T=2.0

0.00

0.0 0.2 0.4 0.6 0.8 1.0

Figure 7: Numerical solution of Example 3 for α = 1.0, λ = 0.01 at


different time

that as the time increase the profile behavior of the wave decreases.

Example 3. The analytical solution of the equation (1) in the region


GALERKIN-FINITE ELEMENT METHOD FOR THE NUMERICAL... 397

bounded by 0 ≤ x ≤ 1 is given by

−(x − 0.5 − t)2


 
0.025
U (x, t) = √ exp . (21)
0.000625 + 0.02t (0.00125 + 0.04t)

The initial and boundary conditions are taken from the analytical solution.
The values of advection and diffusion coefficients are chosen by α = 1.0, λ =
0.01.The Figures 4-7 show the behavior of numerical solutions at different times.

5. Conclusion

In this article, Galerkin-finite element method is proposed to find the numerical


solutions of advection-diffusion equation. In the solution procedure, the first
step is to make weak formulation and then develop finite element formulation.
Lastly, weighted average is used for fully discretization. As test problem, three
different solutions of advection-diffusion equation are chosen. Maximum errors
norm L∞ are calculated and found that the errors are small. Also, a comparison
of numerical and analytical solutions is made and found that the proposed
scheme has good accuracy.

6. Acknowledgment

One of the authors Dinkar Sharma thankfully acknowledges the financial assis-
tance provided by MHRD India.

References

[1] M.A. Celia, T.F. Russell, I. Herrera, R.E. Ewing, An Eulerian-langrangian


localized adjoint method for the advection-diffusion equation, Advances in
Water Resources, 13 (1990), 187-206.

[2] P.C. Chatwin, C.M. Allen, Mathematical models of dispersion in rivers


and estuaries, Ann. Rev. Fluid Mech., 17 (1985), 119-149.

[3] M.H. Chaudhry, D.E. Cass, J.E. Edinger, Modelling of unsteady-flow water
temperatures, J. Hydraul. Eng., 109, No. 5 (1983),657-669.
398 D. Sharma, R. Jiwari, S. Kumar

[4] Q.N. Fattah, J.A. Hoopes, Dispersion in anisotropic homogeneous porous


media, J. Hydraul. Eng., 111 (1985), 810-827.

[5] C.R. Gane, P.L. Stephenson, An explicit numerical method for solving
transient combined heat conduction and convection problems, Int. J. Nu-
mer. Meth. Eng., 14 (1979), 1141-1163.

[6] F.M. Holly, J.M. Usseglio-Polatera, Dispersion simulation in two-


dimensional tidal flow, J. Hydraul Eng., 111 (1984), 905-926.

[7] J. Isenberg, C. Gutfinger, Heat transfer to a draining film, Int. J. Heat


Transf., 16 (1972), 505-512.

[8] K. Kakauda, N. Tosaka, Boundary element analysis of viscous flow prob-


lems using the time splitting method, Advances in Water Resources (1990)
87-93.

[9] N. Kumar, Unsteady flow against dispersion in finite porous media, J.


Hydrol., 63 (1988), 345-358.

[10] K.W. Morton, Numerical Solution of Convection-Advection Equation,


Chapman and Hall, London (1996).

[11] T. Neubauer, P. Bastian, On a monotonicity preserving Eulerian-


Lagrangian localized adjoint method for advection-diffusion equations,
Adv. Wat. Res., 28, No. 12 (2005), 1292-1309.

[12] F.B. Nico, F. Brissaud, V. Guinot, A finite volume upwind scheme for the
solution of the linear advection-diffusion equation with sharp gradients in
multiple dimension, Advances in Water Resources, 30, No. 9 (2007), 2002-
2025.

[13] B.J. Noye, Numerical Solution of Partial Differential Equations, Lecture


Notes (1990).

[14] J.Y. Parlarge, Water transport in soils, Ann. Rev. Fluids Mech., 2 (1980),
77-102.

[15] J.R. Salmon, J.A. Liggett, R.H. Gallager, Dispersion analysis in homoge-
nous lakes, Int. J. Numer. Meth. Eng., 15 (1980), 1627-1642.

[16] D.B. Spalding, A novel finite difference formulation for differential expres-
sions involving in both first and second derivatives, International Journal
for Numerical Methods in Engineering, 4 (1972), 551-559.
GALERKIN-FINITE ELEMENT METHOD FOR THE NUMERICAL... 399

[17] Z. Zlatev, R. Berkowicz, L.P. Prahm, Implementation of a variable step-


size variable formula in the time-integration part of a code for treatment
of long-range transport of air pollutants, J. Comput. Phys., 55 (1984),
278-301.
400

View publication stats

You might also like