SlideShare a Scribd company logo
1 of 31
The Finite Element Method for
coupled diffusion-reaction equations
Katie Davis
Supervisor: N. Ellis
Contents
β€’ Introduction
β€’ Aims
β€’ Project work and results
β€’ Conclusions
Introduction
The one-dimension diffusion reaction equation can be written
in terms of a dependent variable, 𝑐, as
𝐷
𝑑2
𝑐
𝑑π‘₯2
= π‘˜1 𝑐 + π‘˜0
Where
𝐷 is the coefficient of diffusion
π‘˜1 and π‘˜0 are the reaction terms
𝑐 is gas concentration
Introduction
The finite element method cuts a structure into several elements then reconnects the
elements at nodes that hold the elements back together resulting in sets of
simultaneous algebraic equations. This project uses the finite element method to solve
the diffusion - reaction equation and also to solve the coupled equations:
𝐷1
𝑑2 𝑐1
𝑑π‘₯2
= π‘˜1 𝑐1 𝑐2 + 𝑓1 π‘₯
𝐷2
𝑑2 𝑐2
𝑑π‘₯2
= π‘˜2 𝑐1 𝑐2 + 𝑓2 π‘₯
where 𝑐1 and 𝑐2 are separate gases or liquids.
Aims of the project
The aims of the project are:
β€’ To solve the one-dimension diffusion-reaction equation analytically
β€’ To solve the same equation using the Finite Element method and
compare results with the analytical solutions
β€’ To use the Finite Element method to find the numerical solution of
coupled diffusion-reaction equations
Analytical Solutions for the diffusion –
reaction equation
The solution to the four differential equations associated with the one-
dimension diffusion-reaction equation have been calculated using the
boundary conditions π‘₯ = 1, 𝑐 = 0 and π‘₯ = 0, 𝑐 = 1.
4 separate cases:
π‘˜0 = 0, π‘˜1 > 0
π‘˜0 = 0, π‘˜1 < 0
π‘˜0 β‰  0, π‘˜1 > 0
π‘˜0 β‰  0, π‘˜1 < 0
The first equation to be solved was
𝐷
𝑑2 𝑐
𝑑π‘₯2
βˆ’ π‘˜1 𝑐 = 0, π‘˜1 > 0,
The general solution for this equation is
𝐢 = 𝐴𝑒
π‘˜1
𝐷 π‘₯
+ 𝐡𝑒
βˆ’
π‘˜1
𝐷 π‘₯
and when the boundary conditions are applied, the solutions
are
𝐴 = 1 βˆ’
𝑒
π‘˜1
𝐷
𝑒
π‘˜1
𝐷 βˆ’ 𝑒
βˆ’
π‘˜1
𝐷
,
𝐡 =
𝑒
π‘˜1
𝐷
𝑒
π‘˜1
𝐷 βˆ’ 𝑒
βˆ’
π‘˜1
𝐷
The second equation to be solved was
𝐷
𝑑2 𝑐
𝑑π‘₯2
βˆ’ π‘˜1 𝑐 = 0, π‘˜1 < 0,
The general solution for this equation is
𝐢 = π΄π‘π‘œπ‘ 
π‘˜1
𝐷
π‘₯ + 𝐡𝑠𝑖𝑛
π‘˜1
𝐷
π‘₯
When the boundary conditions were applied, these solutions were
obtained
𝐴 = 1,
𝐡 = βˆ’ cot
π‘˜1
𝐷
After solving the homogeneous equations, the inhomogeneous
equation can now be solved, this is
𝐷
𝑑2 𝑐
𝑑π‘₯2
βˆ’ π‘˜1 𝑐 = π‘˜0, π‘˜0 β‰  0,
for π‘˜1 > 0 and π‘˜1 < 0.
For the case when π‘˜1 > 0, the general solution is
𝐢 = 𝐴𝑒
π‘˜1
𝐷 π‘₯
+ 𝐡𝑒
π‘˜1
𝐷 π‘₯
βˆ’
π‘˜0
π‘˜1
,
When the boundary conditions are applied, the solutions are
𝐡 =
𝑒
π‘˜1
𝐷 1 +
π‘˜0
π‘˜1
βˆ’
π‘˜0
π‘˜1
𝑒
π‘˜1
𝐷 βˆ’ 𝑒
βˆ’
π‘˜1
𝐷
,
𝐴 = 1 βˆ’ 𝐡 +
π‘˜0
π‘˜1
By varying the values of π‘˜0 and π‘˜1 we can see that gas removal takes place in
this reaction, but this model only works for certain values. On the second
graph the curve goes below the π‘₯-axis, this would mean that there is a
negative concentration, which is physically impossible.
The final case to be solved was
𝐷
𝑑2 𝑐
𝑑π‘₯2
βˆ’ π‘˜1 𝑐 = π‘˜0, π‘˜0 β‰  0, π‘˜1 < 0
We can say that the general solution for this equation is
𝐢 = 𝐴 π‘π‘œπ‘ 
βˆ’π‘˜1
𝐷
π‘₯ + 𝐡 sin
βˆ’π‘˜1
𝐷
π‘₯ βˆ’
π‘˜0
π‘˜1
After applying the boundary conditions, the values of A and B
are found to be
𝐴 = 1 +
π‘˜0
π‘˜1
,
𝐡 =
π‘˜0
π‘˜1
π‘π‘œπ‘ π‘’π‘
βˆ’π‘˜1
𝐷
βˆ’ 1 +
π‘˜0
π‘˜1
cot
βˆ’π‘˜1
𝐷
The Finite Element Method for the diffusion
– reaction equation
The finite element method uses three element contribution matrices to
form a global system equation. These matrices are:
1. The element mass matrix
𝑀 𝑗
=
𝐿
6
2 1
1 2
where 𝑗 is the element number and 𝐿 is the element length.
2. The element stiffness matrix
𝐾 𝑗 =
1
𝐿
1 βˆ’1
βˆ’1 1
3. The right hand side vector
𝑓 𝑗
= βˆ’
𝐿
2
1
1
These matrices form the global system equation
𝐷𝐾 + π‘˜1 𝑀 𝑐 = 𝑓
where 𝑐 is a vector of the same order as the total nodes in the system.
MATLAB can be used to solve this equation for 𝑐.
No. of Elements Finite Element Method solution
4 0.329422
8 0.330028
16 0.330178
32 0.330216
64 0.330225
128 0.330228
256 0.330228
512 0.330228
1024 0.330228
2048 0.330228
This table shows values of 𝑐 using π‘˜0 = 1 and π‘˜1 = 1 using an increasing number of
elements. These values can be compared with the analytical solutions and an error term
can be calculated.
No. of elements Exact Solution FEM Solution Error
4 0.330228 0.329442 0.000807
8 0.330228 0.330028 0.000200
16 0.330228 0.330178 0.000050
32 0.330228 0.330216 0.000013
64 0.330228 0.330225 0.000003
128 0.330228 0.330228 0.000001
256 0.330228 0.330228 0.000000
512 0.330228 0.330228 0.000000
1024 0.330228 0.330228 0.000000
2048 0.330228 0.330228 0.000000
This table shows results for π‘˜0 = 1 and π‘˜1 = 1. As the number of elements increases, the
error decreases and the finite element method solution converges to the analytical solution.
The Finite Element Method for the coupled
diffusion – reaction equations
The finite element method can now be used to to solve these coupled diffusion –
reaction equations
𝐷1
𝑑2 𝑝
𝑑π‘₯2
= π‘˜1 𝑝 + π‘˜0
𝐷2
d2q
𝑑π‘₯2
= π‘˜2 π‘ž + π‘˜3
where 𝑝 and π‘ž are separate gases or liquids.
As there are two equations in this system, extra terms need to be added to calculate
values of 𝑝 and π‘ž. The solution of 𝑝 is calculated using the previous solution of π‘ž,
and the solution of π‘ž is found by using the previous value of 𝑝. Alterations must be
made to the element mass matrix to accommodate this change.
When solving for 𝑝, the element mass matrix becomes
𝑀 𝑗 =
𝐿
6
2 1
1 2
π‘žπ‘– 0
0 π‘žπ‘–+1
When solving for π‘ž, the element mass matrix becomes
𝑀 𝑗
=
𝐿
6
2 1
1 2
𝑝𝑖 0
0 𝑝𝑖+1
where 𝑖 denotes the previous solution for 𝑝 and π‘ž, and 𝑖 + 1 represents the current
values of 𝑝 and π‘ž.
Using MATLAB, solutions of 𝑝 and π‘ž at each node for different numbers of
elements can be found.
Node 𝒑 𝒒
1 0.000000 1.000000
2 0.060542 0.815427
3 0.138203 0.647226
4 0.234214 0.496013
5 0.349396 0.362198
6 0.484065 0.245939
7 0.637987 0.147118
8 0.810385 0.065349
9 1.000000 0.000000
This table shows the finite element method solution using eight elements for π‘˜0 = 1, π‘˜1 =
2, π‘˜2 = 1, π‘˜3 = 2.
The results from the table can be displayed graphically. The graph shows that for these π‘˜ values, as the
concentration of 𝑝 increases, the concentration of π‘ž decreases at approximately the same rate. We can also
see the finite element solutions for increasing numbers of elements, taking values from the middle node:
This table shows the finite element solutions, using the same π‘˜ values for an increasing
number of elements. Similar to the single equation, the solutions differ as the number of
elements increases.
No. of Elements FEM Solution for 𝒑 FEM solution for 𝒒
2 0.353536 0.364268
4 0.350266 0.362633
8 0.349396 0.362198
16 0.349176 0.362088
32 0.349121 0.362060
64 0.349107 0.362053
128 0.349103 0.362052
256 0.349102 0.362051
As there is no analytical solution for the coupled equations, a solution is calculated at
a large number of elements and is taken as an exact value. This solution is then
compared to the solution calculated at each number of elements.
Elements 𝒑 exact FEM soln. Error in 𝒑 𝒒 exact FEM soln. Error in 𝒒
2 0.349102 0.349291 0.000189 0.362051 0.362145 0.000094
4 0.349102 0.349149 0.000047 0.362051 0.362075 0.000024
8 0.349102 0.349114 0.000012 0.362051 0.362057 0.000006
16 0.349102 0.349105 0.000003 0.362051 0.362053 0.000001
32 0.349102 0.349103 0.000001 0.362051 0.36051 0.000000
64 0.349102 0.349102 0.000000 0.362051 0.362051 0.000000
128 0.349102 0.349102 0.000000 0.362051 0.362051 0.000000
256 0.349102 0.349102 0.000000 0.362051 0.362051 0.000000
As the number of elements increases, the error term decreases and the finite element
solution converges to the β€˜exact’ solution calculated.
Conclusions
β€’ Gas removal and gas production depends on the signs of the reaction terms.
β€’ The finite element method solutions for the diffusion – reaction equation always
converges to the analytical solution.
β€’ For both the single and coupled diffusion – reaction equations, as the number of elements
doubles, the error term divides approximately by four, this is 𝑂(β„Ž2
) behaviour.

More Related Content

What's hot

2415systems_odes
2415systems_odes2415systems_odes
2415systems_odesBetsy McCall
Β 
CHE 611 Presentation
CHE 611 PresentationCHE 611 Presentation
CHE 611 PresentationDhruv Jain
Β 
Solving radical equations
Solving radical equationsSolving radical equations
Solving radical equationsMelchor Cachuela
Β 
Solution of equations and eigenvalue problems
Solution of equations and eigenvalue problemsSolution of equations and eigenvalue problems
Solution of equations and eigenvalue problemsSanthanam Krishnan
Β 
1 lesson 5 equations with radicals
1 lesson 5 equations with radicals1 lesson 5 equations with radicals
1 lesson 5 equations with radicalsMelchor Cachuela
Β 
Activity coefficient models
Activity coefficient modelsActivity coefficient models
Activity coefficient modelsmasudvalavi
Β 
Bab 1 (1.3 pertidaksamaan linear)
Bab 1 (1.3 pertidaksamaan linear)Bab 1 (1.3 pertidaksamaan linear)
Bab 1 (1.3 pertidaksamaan linear)Novi Cahyaningrum
Β 
DATA TABLE, EQUATION FIT OR INTERPOLATION
DATA TABLE, EQUATION FIT OR INTERPOLATION DATA TABLE, EQUATION FIT OR INTERPOLATION
DATA TABLE, EQUATION FIT OR INTERPOLATION ijcsity
Β 
Linear Algebra
Linear AlgebraLinear Algebra
Linear AlgebralaibaNoor60
Β 
4 ESO Academics - UNIT 05 - SYSTEMS OF EQUATIONS AND INEQUATIONS.
4 ESO Academics - UNIT 05 - SYSTEMS OF EQUATIONS AND INEQUATIONS.4 ESO Academics - UNIT 05 - SYSTEMS OF EQUATIONS AND INEQUATIONS.
4 ESO Academics - UNIT 05 - SYSTEMS OF EQUATIONS AND INEQUATIONS.Gogely The Great
Β 
MAT-314 Relations and Functions
MAT-314 Relations and FunctionsMAT-314 Relations and Functions
MAT-314 Relations and FunctionsKevin Johnson
Β 
Ch.1 lecture a
Ch.1 lecture aCh.1 lecture a
Ch.1 lecture aBrock Banks
Β 
Chapter12stoichiometry 1229099374861225-1
Chapter12stoichiometry 1229099374861225-1Chapter12stoichiometry 1229099374861225-1
Chapter12stoichiometry 1229099374861225-1Daniel Marco
Β 
Linear Systems
Linear SystemsLinear Systems
Linear Systemsdsaunde3
Β 

What's hot (16)

2415systems_odes
2415systems_odes2415systems_odes
2415systems_odes
Β 
CHE 611 Presentation
CHE 611 PresentationCHE 611 Presentation
CHE 611 Presentation
Β 
Solving radical equations
Solving radical equationsSolving radical equations
Solving radical equations
Β 
1 lesson 1 4
1 lesson 1 41 lesson 1 4
1 lesson 1 4
Β 
Solution of equations and eigenvalue problems
Solution of equations and eigenvalue problemsSolution of equations and eigenvalue problems
Solution of equations and eigenvalue problems
Β 
1 lesson 5 equations with radicals
1 lesson 5 equations with radicals1 lesson 5 equations with radicals
1 lesson 5 equations with radicals
Β 
Activity coefficient models
Activity coefficient modelsActivity coefficient models
Activity coefficient models
Β 
Bab 1 (1.3 pertidaksamaan linear)
Bab 1 (1.3 pertidaksamaan linear)Bab 1 (1.3 pertidaksamaan linear)
Bab 1 (1.3 pertidaksamaan linear)
Β 
DATA TABLE, EQUATION FIT OR INTERPOLATION
DATA TABLE, EQUATION FIT OR INTERPOLATION DATA TABLE, EQUATION FIT OR INTERPOLATION
DATA TABLE, EQUATION FIT OR INTERPOLATION
Β 
Linear Algebra
Linear AlgebraLinear Algebra
Linear Algebra
Β 
4 ESO Academics - UNIT 05 - SYSTEMS OF EQUATIONS AND INEQUATIONS.
4 ESO Academics - UNIT 05 - SYSTEMS OF EQUATIONS AND INEQUATIONS.4 ESO Academics - UNIT 05 - SYSTEMS OF EQUATIONS AND INEQUATIONS.
4 ESO Academics - UNIT 05 - SYSTEMS OF EQUATIONS AND INEQUATIONS.
Β 
MAT-314 Relations and Functions
MAT-314 Relations and FunctionsMAT-314 Relations and Functions
MAT-314 Relations and Functions
Β 
Ch.1 lecture a
Ch.1 lecture aCh.1 lecture a
Ch.1 lecture a
Β 
40220140501006
4022014050100640220140501006
40220140501006
Β 
Chapter12stoichiometry 1229099374861225-1
Chapter12stoichiometry 1229099374861225-1Chapter12stoichiometry 1229099374861225-1
Chapter12stoichiometry 1229099374861225-1
Β 
Linear Systems
Linear SystemsLinear Systems
Linear Systems
Β 

Viewers also liked

109 Use Of Fem In Composites Presentation 1
109 Use Of Fem In Composites Presentation 1109 Use Of Fem In Composites Presentation 1
109 Use Of Fem In Composites Presentation 1Michael Armbruster
Β 
MS_Thesis_Presentation
MS_Thesis_PresentationMS_Thesis_Presentation
MS_Thesis_PresentationPrashant Kumar
Β 
Mechanistic aspects of C-C cross coupling reaction
Mechanistic aspects of C-C cross coupling reactionMechanistic aspects of C-C cross coupling reaction
Mechanistic aspects of C-C cross coupling reactionRashmi Gaur
Β 
Pd catalyzed C-C Coupling reactions- a short introduction (Nobel Prize 2010)
Pd catalyzed C-C Coupling reactions- a short introduction (Nobel Prize 2010)Pd catalyzed C-C Coupling reactions- a short introduction (Nobel Prize 2010)
Pd catalyzed C-C Coupling reactions- a short introduction (Nobel Prize 2010)SonamVSancheti
Β 
Coupling reactions 2
Coupling reactions 2Coupling reactions 2
Coupling reactions 2Zaid Najah
Β 
Organic Chemistry Chapter 21 Klein
Organic Chemistry Chapter 21 KleinOrganic Chemistry Chapter 21 Klein
Organic Chemistry Chapter 21 KleinSarah Davies
Β 
C-C Cross Coupling Reactions in Organic chemistry by Anthony crasto
C-C Cross Coupling Reactions in Organic chemistry by Anthony crastoC-C Cross Coupling Reactions in Organic chemistry by Anthony crasto
C-C Cross Coupling Reactions in Organic chemistry by Anthony crastoAnthony Melvin Crasto Ph.D
Β 

Viewers also liked (8)

109 Use Of Fem In Composites Presentation 1
109 Use Of Fem In Composites Presentation 1109 Use Of Fem In Composites Presentation 1
109 Use Of Fem In Composites Presentation 1
Β 
MS_Thesis_Presentation
MS_Thesis_PresentationMS_Thesis_Presentation
MS_Thesis_Presentation
Β 
Fem presentation
Fem presentationFem presentation
Fem presentation
Β 
Mechanistic aspects of C-C cross coupling reaction
Mechanistic aspects of C-C cross coupling reactionMechanistic aspects of C-C cross coupling reaction
Mechanistic aspects of C-C cross coupling reaction
Β 
Pd catalyzed C-C Coupling reactions- a short introduction (Nobel Prize 2010)
Pd catalyzed C-C Coupling reactions- a short introduction (Nobel Prize 2010)Pd catalyzed C-C Coupling reactions- a short introduction (Nobel Prize 2010)
Pd catalyzed C-C Coupling reactions- a short introduction (Nobel Prize 2010)
Β 
Coupling reactions 2
Coupling reactions 2Coupling reactions 2
Coupling reactions 2
Β 
Organic Chemistry Chapter 21 Klein
Organic Chemistry Chapter 21 KleinOrganic Chemistry Chapter 21 Klein
Organic Chemistry Chapter 21 Klein
Β 
C-C Cross Coupling Reactions in Organic chemistry by Anthony crasto
C-C Cross Coupling Reactions in Organic chemistry by Anthony crastoC-C Cross Coupling Reactions in Organic chemistry by Anthony crasto
C-C Cross Coupling Reactions in Organic chemistry by Anthony crasto
Β 

Similar to FEM Presentation

Research Presentation Spring 2008
Research Presentation Spring 2008Research Presentation Spring 2008
Research Presentation Spring 2008alblumberg21
Β 
Consistency of linear equations in two and three variables
Consistency of linear equations in two and three variablesConsistency of linear equations in two and three variables
Consistency of linear equations in two and three variablesAamlan Saswat Mishra
Β 
4 ESO Academics - UNIT 04 - EQUATIONS AND INEQUATIONS
4 ESO Academics - UNIT 04 - EQUATIONS AND INEQUATIONS4 ESO Academics - UNIT 04 - EQUATIONS AND INEQUATIONS
4 ESO Academics - UNIT 04 - EQUATIONS AND INEQUATIONSGogely The Great
Β 
MODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptxMODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptxAlokSingh205089
Β 
A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...Alexander Decker
Β 
1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmr1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmrAdam Lee Perelman
Β 
Receptor kinetics Laplace transform method PDF
Receptor kinetics Laplace transform method PDFReceptor kinetics Laplace transform method PDF
Receptor kinetics Laplace transform method PDFSam Hoare
Β 
Perturbation methods last
Perturbation methods lastPerturbation methods last
Perturbation methods lastSabir Ahmed
Β 
Linear equations
Linear equationsLinear equations
Linear equationsSergioRios103
Β 
How to Solve Linear Equation with the help of Liner Equation Calculator?
How to Solve Linear Equation with the help of Liner Equation Calculator?How to Solve Linear Equation with the help of Liner Equation Calculator?
How to Solve Linear Equation with the help of Liner Equation Calculator?Maria Wilson
Β 
Systems of Linear Algebra
Systems of Linear AlgebraSystems of Linear Algebra
Systems of Linear AlgebraAyesha Arshad
Β 
Approximate Solution of a Linear Descriptor Dynamic Control System via a non-...
Approximate Solution of a Linear Descriptor Dynamic Control System via a non-...Approximate Solution of a Linear Descriptor Dynamic Control System via a non-...
Approximate Solution of a Linear Descriptor Dynamic Control System via a non-...IOSR Journals
Β 
Optimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsOptimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsSantiagoGarridoBulln
Β 
BKS-MidsemPPT.pptx
BKS-MidsemPPT.pptxBKS-MidsemPPT.pptx
BKS-MidsemPPT.pptxdr_bhupen
Β 

Similar to FEM Presentation (20)

Research Presentation Spring 2008
Research Presentation Spring 2008Research Presentation Spring 2008
Research Presentation Spring 2008
Β 
On the Analysis of the Finite Element Solutions of Boundary Value Problems Us...
On the Analysis of the Finite Element Solutions of Boundary Value Problems Us...On the Analysis of the Finite Element Solutions of Boundary Value Problems Us...
On the Analysis of the Finite Element Solutions of Boundary Value Problems Us...
Β 
E04 06 3943
E04 06 3943E04 06 3943
E04 06 3943
Β 
Consistency of linear equations in two and three variables
Consistency of linear equations in two and three variablesConsistency of linear equations in two and three variables
Consistency of linear equations in two and three variables
Β 
4 ESO Academics - UNIT 04 - EQUATIONS AND INEQUATIONS
4 ESO Academics - UNIT 04 - EQUATIONS AND INEQUATIONS4 ESO Academics - UNIT 04 - EQUATIONS AND INEQUATIONS
4 ESO Academics - UNIT 04 - EQUATIONS AND INEQUATIONS
Β 
MODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptxMODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptx
Β 
Tema 8
Tema 8Tema 8
Tema 8
Β 
Systems of 3 Equations in 3 Variables
Systems of 3 Equations in 3 VariablesSystems of 3 Equations in 3 Variables
Systems of 3 Equations in 3 Variables
Β 
A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...
Β 
1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmr1 d,2d laplace inversion of lr nmr
1 d,2d laplace inversion of lr nmr
Β 
Receptor kinetics Laplace transform method PDF
Receptor kinetics Laplace transform method PDFReceptor kinetics Laplace transform method PDF
Receptor kinetics Laplace transform method PDF
Β 
math.pptx
math.pptxmath.pptx
math.pptx
Β 
Perturbation methods last
Perturbation methods lastPerturbation methods last
Perturbation methods last
Β 
Linear equations
Linear equationsLinear equations
Linear equations
Β 
How to Solve Linear Equation with the help of Liner Equation Calculator?
How to Solve Linear Equation with the help of Liner Equation Calculator?How to Solve Linear Equation with the help of Liner Equation Calculator?
How to Solve Linear Equation with the help of Liner Equation Calculator?
Β 
Systems of Linear Algebra
Systems of Linear AlgebraSystems of Linear Algebra
Systems of Linear Algebra
Β 
Approximate Solution of a Linear Descriptor Dynamic Control System via a non-...
Approximate Solution of a Linear Descriptor Dynamic Control System via a non-...Approximate Solution of a Linear Descriptor Dynamic Control System via a non-...
Approximate Solution of a Linear Descriptor Dynamic Control System via a non-...
Β 
Optimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsOptimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methods
Β 
Finite Element Methods
Finite Element  MethodsFinite Element  Methods
Finite Element Methods
Β 
BKS-MidsemPPT.pptx
BKS-MidsemPPT.pptxBKS-MidsemPPT.pptx
BKS-MidsemPPT.pptx
Β 

FEM Presentation

  • 1. The Finite Element Method for coupled diffusion-reaction equations Katie Davis Supervisor: N. Ellis
  • 2. Contents β€’ Introduction β€’ Aims β€’ Project work and results β€’ Conclusions
  • 3. Introduction The one-dimension diffusion reaction equation can be written in terms of a dependent variable, 𝑐, as 𝐷 𝑑2 𝑐 𝑑π‘₯2 = π‘˜1 𝑐 + π‘˜0 Where 𝐷 is the coefficient of diffusion π‘˜1 and π‘˜0 are the reaction terms 𝑐 is gas concentration
  • 4. Introduction The finite element method cuts a structure into several elements then reconnects the elements at nodes that hold the elements back together resulting in sets of simultaneous algebraic equations. This project uses the finite element method to solve the diffusion - reaction equation and also to solve the coupled equations: 𝐷1 𝑑2 𝑐1 𝑑π‘₯2 = π‘˜1 𝑐1 𝑐2 + 𝑓1 π‘₯ 𝐷2 𝑑2 𝑐2 𝑑π‘₯2 = π‘˜2 𝑐1 𝑐2 + 𝑓2 π‘₯ where 𝑐1 and 𝑐2 are separate gases or liquids.
  • 5. Aims of the project The aims of the project are: β€’ To solve the one-dimension diffusion-reaction equation analytically β€’ To solve the same equation using the Finite Element method and compare results with the analytical solutions β€’ To use the Finite Element method to find the numerical solution of coupled diffusion-reaction equations
  • 6. Analytical Solutions for the diffusion – reaction equation The solution to the four differential equations associated with the one- dimension diffusion-reaction equation have been calculated using the boundary conditions π‘₯ = 1, 𝑐 = 0 and π‘₯ = 0, 𝑐 = 1. 4 separate cases: π‘˜0 = 0, π‘˜1 > 0 π‘˜0 = 0, π‘˜1 < 0 π‘˜0 β‰  0, π‘˜1 > 0 π‘˜0 β‰  0, π‘˜1 < 0
  • 7. The first equation to be solved was 𝐷 𝑑2 𝑐 𝑑π‘₯2 βˆ’ π‘˜1 𝑐 = 0, π‘˜1 > 0,
  • 8. The general solution for this equation is 𝐢 = 𝐴𝑒 π‘˜1 𝐷 π‘₯ + 𝐡𝑒 βˆ’ π‘˜1 𝐷 π‘₯ and when the boundary conditions are applied, the solutions are 𝐴 = 1 βˆ’ 𝑒 π‘˜1 𝐷 𝑒 π‘˜1 𝐷 βˆ’ 𝑒 βˆ’ π‘˜1 𝐷 , 𝐡 = 𝑒 π‘˜1 𝐷 𝑒 π‘˜1 𝐷 βˆ’ 𝑒 βˆ’ π‘˜1 𝐷
  • 9.
  • 10. The second equation to be solved was 𝐷 𝑑2 𝑐 𝑑π‘₯2 βˆ’ π‘˜1 𝑐 = 0, π‘˜1 < 0, The general solution for this equation is 𝐢 = π΄π‘π‘œπ‘  π‘˜1 𝐷 π‘₯ + 𝐡𝑠𝑖𝑛 π‘˜1 𝐷 π‘₯ When the boundary conditions were applied, these solutions were obtained 𝐴 = 1, 𝐡 = βˆ’ cot π‘˜1 𝐷
  • 11.
  • 12. After solving the homogeneous equations, the inhomogeneous equation can now be solved, this is 𝐷 𝑑2 𝑐 𝑑π‘₯2 βˆ’ π‘˜1 𝑐 = π‘˜0, π‘˜0 β‰  0, for π‘˜1 > 0 and π‘˜1 < 0.
  • 13. For the case when π‘˜1 > 0, the general solution is 𝐢 = 𝐴𝑒 π‘˜1 𝐷 π‘₯ + 𝐡𝑒 π‘˜1 𝐷 π‘₯ βˆ’ π‘˜0 π‘˜1 , When the boundary conditions are applied, the solutions are 𝐡 = 𝑒 π‘˜1 𝐷 1 + π‘˜0 π‘˜1 βˆ’ π‘˜0 π‘˜1 𝑒 π‘˜1 𝐷 βˆ’ 𝑒 βˆ’ π‘˜1 𝐷 , 𝐴 = 1 βˆ’ 𝐡 + π‘˜0 π‘˜1
  • 14. By varying the values of π‘˜0 and π‘˜1 we can see that gas removal takes place in this reaction, but this model only works for certain values. On the second graph the curve goes below the π‘₯-axis, this would mean that there is a negative concentration, which is physically impossible.
  • 15. The final case to be solved was 𝐷 𝑑2 𝑐 𝑑π‘₯2 βˆ’ π‘˜1 𝑐 = π‘˜0, π‘˜0 β‰  0, π‘˜1 < 0
  • 16. We can say that the general solution for this equation is 𝐢 = 𝐴 π‘π‘œπ‘  βˆ’π‘˜1 𝐷 π‘₯ + 𝐡 sin βˆ’π‘˜1 𝐷 π‘₯ βˆ’ π‘˜0 π‘˜1 After applying the boundary conditions, the values of A and B are found to be 𝐴 = 1 + π‘˜0 π‘˜1 , 𝐡 = π‘˜0 π‘˜1 π‘π‘œπ‘ π‘’π‘ βˆ’π‘˜1 𝐷 βˆ’ 1 + π‘˜0 π‘˜1 cot βˆ’π‘˜1 𝐷
  • 17.
  • 18. The Finite Element Method for the diffusion – reaction equation The finite element method uses three element contribution matrices to form a global system equation. These matrices are: 1. The element mass matrix 𝑀 𝑗 = 𝐿 6 2 1 1 2 where 𝑗 is the element number and 𝐿 is the element length.
  • 19. 2. The element stiffness matrix 𝐾 𝑗 = 1 𝐿 1 βˆ’1 βˆ’1 1 3. The right hand side vector 𝑓 𝑗 = βˆ’ 𝐿 2 1 1
  • 20. These matrices form the global system equation 𝐷𝐾 + π‘˜1 𝑀 𝑐 = 𝑓 where 𝑐 is a vector of the same order as the total nodes in the system. MATLAB can be used to solve this equation for 𝑐.
  • 21. No. of Elements Finite Element Method solution 4 0.329422 8 0.330028 16 0.330178 32 0.330216 64 0.330225 128 0.330228 256 0.330228 512 0.330228 1024 0.330228 2048 0.330228 This table shows values of 𝑐 using π‘˜0 = 1 and π‘˜1 = 1 using an increasing number of elements. These values can be compared with the analytical solutions and an error term can be calculated.
  • 22. No. of elements Exact Solution FEM Solution Error 4 0.330228 0.329442 0.000807 8 0.330228 0.330028 0.000200 16 0.330228 0.330178 0.000050 32 0.330228 0.330216 0.000013 64 0.330228 0.330225 0.000003 128 0.330228 0.330228 0.000001 256 0.330228 0.330228 0.000000 512 0.330228 0.330228 0.000000 1024 0.330228 0.330228 0.000000 2048 0.330228 0.330228 0.000000 This table shows results for π‘˜0 = 1 and π‘˜1 = 1. As the number of elements increases, the error decreases and the finite element method solution converges to the analytical solution.
  • 23. The Finite Element Method for the coupled diffusion – reaction equations The finite element method can now be used to to solve these coupled diffusion – reaction equations 𝐷1 𝑑2 𝑝 𝑑π‘₯2 = π‘˜1 𝑝 + π‘˜0 𝐷2 d2q 𝑑π‘₯2 = π‘˜2 π‘ž + π‘˜3 where 𝑝 and π‘ž are separate gases or liquids.
  • 24. As there are two equations in this system, extra terms need to be added to calculate values of 𝑝 and π‘ž. The solution of 𝑝 is calculated using the previous solution of π‘ž, and the solution of π‘ž is found by using the previous value of 𝑝. Alterations must be made to the element mass matrix to accommodate this change. When solving for 𝑝, the element mass matrix becomes 𝑀 𝑗 = 𝐿 6 2 1 1 2 π‘žπ‘– 0 0 π‘žπ‘–+1
  • 25. When solving for π‘ž, the element mass matrix becomes 𝑀 𝑗 = 𝐿 6 2 1 1 2 𝑝𝑖 0 0 𝑝𝑖+1 where 𝑖 denotes the previous solution for 𝑝 and π‘ž, and 𝑖 + 1 represents the current values of 𝑝 and π‘ž. Using MATLAB, solutions of 𝑝 and π‘ž at each node for different numbers of elements can be found.
  • 26. Node 𝒑 𝒒 1 0.000000 1.000000 2 0.060542 0.815427 3 0.138203 0.647226 4 0.234214 0.496013 5 0.349396 0.362198 6 0.484065 0.245939 7 0.637987 0.147118 8 0.810385 0.065349 9 1.000000 0.000000 This table shows the finite element method solution using eight elements for π‘˜0 = 1, π‘˜1 = 2, π‘˜2 = 1, π‘˜3 = 2.
  • 27. The results from the table can be displayed graphically. The graph shows that for these π‘˜ values, as the concentration of 𝑝 increases, the concentration of π‘ž decreases at approximately the same rate. We can also see the finite element solutions for increasing numbers of elements, taking values from the middle node:
  • 28. This table shows the finite element solutions, using the same π‘˜ values for an increasing number of elements. Similar to the single equation, the solutions differ as the number of elements increases. No. of Elements FEM Solution for 𝒑 FEM solution for 𝒒 2 0.353536 0.364268 4 0.350266 0.362633 8 0.349396 0.362198 16 0.349176 0.362088 32 0.349121 0.362060 64 0.349107 0.362053 128 0.349103 0.362052 256 0.349102 0.362051
  • 29. As there is no analytical solution for the coupled equations, a solution is calculated at a large number of elements and is taken as an exact value. This solution is then compared to the solution calculated at each number of elements.
  • 30. Elements 𝒑 exact FEM soln. Error in 𝒑 𝒒 exact FEM soln. Error in 𝒒 2 0.349102 0.349291 0.000189 0.362051 0.362145 0.000094 4 0.349102 0.349149 0.000047 0.362051 0.362075 0.000024 8 0.349102 0.349114 0.000012 0.362051 0.362057 0.000006 16 0.349102 0.349105 0.000003 0.362051 0.362053 0.000001 32 0.349102 0.349103 0.000001 0.362051 0.36051 0.000000 64 0.349102 0.349102 0.000000 0.362051 0.362051 0.000000 128 0.349102 0.349102 0.000000 0.362051 0.362051 0.000000 256 0.349102 0.349102 0.000000 0.362051 0.362051 0.000000 As the number of elements increases, the error term decreases and the finite element solution converges to the β€˜exact’ solution calculated.
  • 31. Conclusions β€’ Gas removal and gas production depends on the signs of the reaction terms. β€’ The finite element method solutions for the diffusion – reaction equation always converges to the analytical solution. β€’ For both the single and coupled diffusion – reaction equations, as the number of elements doubles, the error term divides approximately by four, this is 𝑂(β„Ž2 ) behaviour.