# Comparison between results of solution of Burgers’ equation and Laplace’s equation by Galerkin and least-square finite element methods

## Abstract

In this research, two equations are considered as examples of hyperbolic and elliptic equations. In addition, two finite element methods are applied for solving of these equations. The purpose of this research is the selection of suitable method for solving each of two equations. Burgers’ equation is a hyperbolic equation. This equation is a pure advection (without diffusion) equation. This equation is one-dimensional and unsteady. A sudden shock wave is introduced to the model. This wave moves without deformation. In addition, Laplace’s equation is an elliptical equation. This equation is steady and two-dimensional. The solution of Laplace’s equation in an earth dam is considered. By solution of Laplace’s equation, head pressure and the value of seepage in the directions *X* and *Y* are calculated in different points of earth dam. At the end, water table is shown in the earth dam. For Burgers’ equation, least-square method can show movement of wave with oscillation but Galerkin method can not show it correctly (the best method for solving of the Burgers’ equation is discrete space by least-square finite element method and discrete time by forward difference.). For Laplace’s equation, Galerkin and least square methods can show water table correctly in earth dam.

## Keywords

Earth dam Elliptical equations Hyperbolic equations Numerical methods Shock wave The Burgers’ equation The Laplace’s equation## Introduction

Finite element method is a powerful numerical method for solving very complex differential equations. Finite difference method, finite volume method and boundary element method are especial forms of finite element method. Finite element method can consider complex boundaries and domains. Finite element method classifies to two types (calculus variation principles and weighted residual methods). Galerkin finite element method and least square finite element method are weighted residual methods.

Bateman (1915) developed Burgers’ equation and Burgers (1948) utilized this equation in turbulent model. Cole (1951) and Hopf (1950) solved this equation analytically by Fourier series. They considered simple initial conditions. Jiang and Carey (1988) applied least square finite element method for solution of Burgers’ equation. They discretized time domain by finite difference method. Öziş et al. (2003) used Galerkin finite element method for solving of Burgers’ equation. They utilized two-nodded elements. They considered initial and boundary conditions of Hopf and Cole problem and discretized time domain by forward differences. In addition, Dogan (2004) used Galerkin finite element method for solving Burgers’ equation but he approximated time domain by Crank–Nicolson method. De Maerschalck and Gerritsma (2005) utilized least-squares spectral element method for solving of one-dimensional and pure advection Burgers’ equation. Kumar and Mehra (2005) separated Burgers’ equation to advection and diffusion terms and solved it by wavelet-Taylor Galerkin method in two phases, while Roig (2007) applied third- and fourth-order Taylor–Galerkin schemes for this purpose. He developed two new Taylor–Galerkin schemes for maintaining the accuracy properties and improving the stability restrictions in convection–diffusion. In addition, Dag et al. (Dag et al. 2006) solved Burgers’ equation by least-square finite element method and quadratic B-spline finite element method. They showed that results of least-square finite element method are more accurate. Zhang et al. (2009) utilized element-free characteristic Galerkin method (EFCGM) for solving of one-dimensional and two-dimensional Burgers’ equation. They considered different viscosity and fully explicit scheme for discretization of time domain. They compared results of their method to results of analytic method. In addition, Zhang et al. (2010) developed a new numerical method, which is based on the coupling between variation multi-scale method and mesh-free methods for 2D Burgers’ equation with various values of Reynolds number. Their method was stable for high Reynolds number. In recent years, Mukundan and Awasthi (2015) presented new efficient numerical techniques for solving one-dimensional quasi-linear Burgers’ equation. They used a non-linear Cole–Hopf transformation, therefore, the Burgers’ equation is reduced to one-dimensional diffusion equation. The linearized diffusion equation is semi-discretized using method of lines (MOL) which leads to a system of ordinary differential equations in time. Resulting system of ordinary differential equations is solved by backward differentiation formulas (BDF) of order one, two and three. Comparison results with those of exact solution illustrate efficiency of proposed numerical methods, also Shi et al. (2013) applied a new low-order least squares nonconforming characteristics mixed finite element method (MFEM) for solving two-dimensional Burgers’ equation. They used two typical characters of the elements for approximating the velocity and flux variables. Dehghan and Abbaszadeh (2017) utilized proper orthogonal decomposition (POD) meshless and radial basis function generated finite differences (RBF-FD) technique to simulate the shallow water equations. New method reduced CPU time for solving of shallow water equations in comparison with discontinuous Galerkin and finite volume methods. Dehghan et al. (2007) used Adomian–Pade technique (ADM-PADE) and combination of modified Adomian decomposition method and Pade approximation (MADM–PADE) for solving Burgers’ equation. They showed that MADM–PADE is more accurate than ADM–PADE and has faster convergence rate.

Surana and Huels (1989) applied least-square finite element method in an aquifer for calculation of transitivity. They discretized domain to elements that have two, three or four nodes and solved Laplace’s equation. Results of elements with four nodes were more accurate than results of other elements. Thompson and Pinsky (1995) utilized Galerkin least-squares finite element method (GLS) for solving the two-dimensional Helmholtz equation. This equation is a form of Laplace’s equation and makes used of modeling of wave movement. They applied two-dimensional Fourier series. On the other hand, Amini and Nixon (2006) applied multi wavelet Galerkin boundary element for solution of Laplace’s equation. Fu and Jin (2009) developed a model for simulating the unsteady seepage flow through dam, with both saturation and water head as variables to describe the seepage domain. This model provided a relatively simple computing scheme, as compared with traditional methods. In recent years, Dosiyev (2014) developed the combined block–grid method for the highly accurate approximation of the pure second-order derivatives for the solution of Laplace’s equation on a staircase polygon. In addition, Ren et al. (2014) prepared a theoretical analysis of the moving least-squares (MLS) approximation, which belongs to the family of meshless methods. They establish the error estimates for interpolating element-free Galerkin (IEFG) method when it is used for solving Poisson’s equation. Tatari and Dehghan (2005) applied the Adomian decomposition method (ADM) to solve Laplace equation. This method is an accurate method for analytical solutions and numerical approximations of different equations.

In this research, two finite element methods (Galerkin and least square) will apply to solve Burgers’ and Laplace’s equations and the best solution method will be selected for each equation. Reason of selection of these methods is similarity of these methods. Galerkin method is simpler than least-square method but it may not be suitable for solving some equations. In these cases, least-square method can be applied and this research will find these cases. The FORTRAN codes of these methods were written by authors. Because of access to source code of these methods, authors can cause their considered changes for solving of different equations easily. These changes can be related to initial conditions, boundary conditions, parameters of model and size of elements. Other advantages of developed method over other methods (as different finite difference, finite volume and other finite element schemes) are high accuracy and little runtime of developed method. In addition, authors utilized a Pentium IV, 2400 MHz CPU machine.

## The research methodology

Burgers’ equation:

The global form of one-dimensional Burgers’ equation is:

*u*is velocity, \(\overline{u}\) is average of velocity,

*x*is space,

*t*is time, a is left boundary of space,

*b*is right boundary of space and

*r*is diffusion coefficient. Because of using \(\overline{u}\), the form of this equation becomes linear. In this research, r is considered equal to zero and Burgers’ equation is converted to a pure advection equation and it can show shock wave movement. For model space, a two-nodded element (linear element) is used. For discretizing time and space, four methods are applied:

- 1.
Discretizing space by Galerkin finite element method and discretizing time by forward difference.

- 2.
Discretizing space and time by Galerkin finite element method.

- 3.
Discretizing space by least-square finite element method and discretizing time by forward difference.

- 4.
Discretizing space and time by least-square finite element method.

After calculation of value of residual, it multiplies to weight function and below integral must be solved.

*R*is residual,

*N*is weight function, Δx is space step and Δt is time step. By calculating Eq. 2 at each node, the equilibrium equations are derived.

Matrix K and vectors X and F are shown for four methods below.

*Method 1*Discretizing space by Galerkin finite element method and discretizing time by forward difference:

*Method 2*Discretizing space and time by Galerkin finite element method:

*Method 3*Discretizing space by least-square finite element method and discretizing time by forward difference:

*Method 4*Discretizing space and time by least-square finite element method

Laplace’s equation:

The global form of two-dimensional steady Laplace’s equation (seepage equation) is:

*k*

_{ x },

*k*

_{ y }are hydraulic conductivity coefficients in directions

*x*,

*y*, respectively, while

*h*represents head pressure and

*Q*is source or sink term. For discretization of space domain, linear triangular elements (with three nodes) are used. To discretize space, two methods are applied:

- 1.
Discretizing space by Galerkin finite element method.

- 2.
Discretizing space by least-square finite element method.

Matrix K and vectors X and F are shown for two methods below.

*Method 1* Discretizing space by Galerkin finite element method

*A*is the area of element.

*Method 2* Discretizing space by least square finite element method

## Results and discussion

Burgers’ equation:

*X*<2 m, Δ

*t*= 0.01 s, the number of elements = 100 (Δ

*x*= 0.02 m), velocity of downstream boundary = 2 m/s and velocity of upstream boundary = 5 m/s. The results of four methods at

*t*= 0.01 s are shown in Fig. 2.

The used CPU times of full system are 2 and 3 s for Galerkin and least-square finite element methods, respectively (discrete time by forward difference did not increase the used CPU time).

Root mean square error (RMSE) between results of discrete space and time by Galerkin finite element method, discrete space and time by least-square finite element method, discrete space by Galerkin finite element method and discrete time by forward difference, discrete space by least-square finite element method and discrete time by forward difference and results of analytic method are 0.0794, 0.0789, 0.0676 and 0.0376 m, respectively.

### *Example 1*

*X*<10 m, Δ

*t*= 1 s, the number of elements = 100 (Δ

*x*= 0.1 m), velocity of downstream (

*x*= 3) = 0.1 m/s and velocity of upstream (

*x*= 3) = 0.3 m/s. The results of discrete space by least-square finite element method and discrete time by forward difference are shown below for different times (Fig. 3).

The execution time of full system is 4 s.

### *Example 2*

*x*= 0.2 m). Comparison between results of two states is shown in Fig. 4.

The used CPU time of full system is 1 s for 50 elements.

Laplace’s equation:

Methods of solution of this equation (Galerkin and least-square finite element methods) are suitable and their results are similar. Their results have no numerical oscillations. This subject is shown by several examples.

### *Example 1*

*k*

_{ x }=

*k*

_{ y }= 0.00001 m/s and

*Q*= 0. Results of numerical method are shown in Figs 5, 6, 7 and Table 1.

Comparison between calculated water table by numerical method (fine elements and coarse elements)

| Water table in fine elements (m) | Water table in coarse elements (m) | Difference between water tables (cm) |
---|---|---|---|

21 | 8.81 | 7.88 | 93 |

30 | 5.69 | 5.31 | 38 |

39 | 3.03 | 2.96 | 7 |

45 | 2 | 1.96 | 4 |

54 | 1.5 | 1.52 | −2 |

The execution times of full system are 4 and 7 s for coarse and fine elements, respectively. For Galerkin and least-square finite element methods, this time is equal (because this problem is steady state).

### *Example 2*

*k*

_{ x }≠

*k*

_{ y }). Characteristics of this problem are: upstream head = 8 m, downstream head = 2 m,

*k*

_{ x }= 0.001 m/s,

*k*

_{ y }= 10

^{−8}m/s and Q = 0. Results of numerical method are shown at Fig. 8.

The used CPU times of full system are 7 s. For Galerkin and least-square finite element methods, this time is equal.

### *Example 3*

*k*

_{ x }=

*k*

_{ y }= 0.001 m/s,

*k*

_{ x }=

*k*

_{ y }= 10

^{−8}m/s for impenetrable core and

*Q*= 0. Results of numerical method are shown in Fig. 9.

The used CPU times of full system are 9 s. For Galerkin and least-square finite element methods, this time is equal.

### *Example 4*

*k*

_{ x }=

*k*

_{ y }= 0.0001 m/s and

*Q*= 0. Results of two methods and those of Wang and Anderson (1982) are shown in the Fig. 10 and Table 2. The execution time of full system is 2 s. For Galerkin and least-square finite element methods, this time is equal.

Comparison between results of two developed methods and results of Wang and Anderson (1982)

Node | Head (m) Wang and Anderson (1982) | Head (m) Galerkin finite element | Head (m) least square finite element |
---|---|---|---|

1 | 4 | 4 | 4 |

2 | 4 | 4 | 4 |

3 | 4 | 4 | 4 |

4 | 4 | 4 | 4 |

5 | 3.72 | 3.72 | 3.72 |

6 | 3.7 | 3.69 | 3.7 |

7 | 3.69 | 3.68 | 3.69 |

8 | 3.69 | 3.68 | 3.69 |

9 | 3.41 | 3.4 | 3.41 |

10 | 3.37 | 3.37 | 3.38 |

11 | 3.36 | 3.36 | 3.36 |

12 | 3.36 | 3.35 | 3.36 |

13 | 3.11 | 3.08 | 3.11 |

14 | 3 | 3 | 3 |

15 | 3 | 3 | 3 |

16 | 3 | 3 | 3 |

RMSE between results of Galerkin finite element method and results of Wang and Anderson (1982) is 0.0094 m and RMSE between results of least-square finite element method and results of Wang and Anderson (1982) is 0.0025 m. Therefore, least-square finite element method is slightly more accurate than Galerkin finite element method.

## Conclusion

The least-square finite element method is a powerful tool for solution of hyperbolic and elliptic equations, while the Galerkin method can not solve hyperbolic equations because developed stiffness matrix by Galerkin method is non-symmetric. In addition, it is observed that discretizing time by forward difference method can improve results of finite element method. By attention to Figs. 4 and 7, accuracy of results of numerical models increases using fine elements. Using fine meshes, the front of wave becomes near to a vertical line (actual state) in solution of Burgers’ equation and water tables of upstream and downstream of dam become near to upstream and downstream head (non-continuity does not occur between water tables of upstream and downstream of dam in point of contact water and dam) in solution of Laplace’s equation. Figure 8 shows that by increasing hydraulic conductivity in a direction water table is converted to a straight line (seepage occurs in direction that hydraulic conductivity is very high).

Figure 9 shows the ability of model for consideration of impenetrable core in earth dam. Impenetrable core lowers water table and decreases the value of seepage.

Although numerical models are suitable tools for solution of differential equations but they can not show actual states very exactly. For example, front shock wave is a vertical line and numerical models cannot show it. For overcoming this problem, new methods must be applied for solution of differential equations. Artificial neural network and optimization models such as genetic algorithm are suitable tools for this purpose.

## References

- Amini S, Nixon SP (2006) Multiwavelet Galerkin boundary element solution of Laplace’s equation. Eng Anal Bound Elem 30(2):116–123. https://doi.org/10.1016/j.enganabound.2005.09.004 CrossRefGoogle Scholar
- Bateman H (1915) Some recent researches on the motion of fluids. Mon Weather Rev 43(4):163–170. https://doi.org/10.1175/1520-0493(1915)43<163:SRROTM>2.0.CO;2
- Burgers JM (1948) A mathematical model illustrating the theory of turbulence. Adv Appl Mech 1:171–199. https://doi.org/10.1016/s0065-2156(08)70100-5 CrossRefGoogle Scholar
- Cole JD (1951) On a quasilinear parabolic equation occurring in aerodynamics. Q Appl Math 9:225–236CrossRefGoogle Scholar
- Dağ I, Irk D, Tombul M (2006) Least-squares finite element method for the advection–diffusion equation. Appl Math Comput 173(1):554–565. https://doi.org/10.1016/j.amc.2005.04.054 Google Scholar
- De Maerschalck B, Gerritsma MI (2005) The use of Chebyshev polynomials in the space-time least-squares spectral element method. Numer Algorithms 38(1–3):173–196. https://doi.org/10.1007/bf02810622 Google Scholar
- Dehghan M, Abbaszadeh M (2017) The use of proper orthogonal decomposition (POD) meshless RBF-FD technique to simulate the shallow water equations. J Comput Phys 351:478–510. https://doi.org/10.1016/j.jcp.2017.09.007 CrossRefGoogle Scholar
- Dehghan M, Hamidi A, Shakourifar M (2007) The solution of coupled Burgers’ equations using Adomian–Pade technique. Appl Math Comput 189(2):1034–1047. https://doi.org/10.1016/j.amc.2006.11.179 Google Scholar
- Dogan A (2004) A Galerkin finite element approach to Burgers’ equation. Appl Math Comput 157(2):331–346. https://doi.org/10.1016/j.amc.2003.08.037 Google Scholar
- Dosiyev AA (2014) The block–grid method for the approximation of the pure second order derivatives for the solution of Laplace’s equation on a staircase polygon. J Comput Appl Math 259(part A):14–23. https://doi.org/10.1016/j.cam.2013.03.022 CrossRefGoogle Scholar
- Fu JF, Jin S (2009) A study on unsteady seepage flow through dam. J Hydrodynam Ser B 21(4):499–504. https://doi.org/10.1016/s1001-6058(08)60176-6 CrossRefGoogle Scholar
- Hopf E (1950) The partial differential equation u
_{t}+ uu_{x}= μ_{XX}. Commun Pur Appl Math 3(3):201–230. https://doi.org/10.1002/cpa.3160030302 CrossRefGoogle Scholar - Jiang BN, Carey GF (1988) A stable least-squares finite element method for non-linear hyperbolic problems. Int J Nnmer Meth Fl 8(8):933–942. https://doi.org/10.1002/fld.1650080805 CrossRefGoogle Scholar
- Kumar BVR, Mehra M (2005) Wavelet-Taylor Galerkin method for the Burgers equation. BIT Numer Math 45(3):543–560. https://doi.org/10.1007/s10543-005-0012-5 CrossRefGoogle Scholar
- Mukundan V, Awasthi A (2015) Efficient numerical techniques for Burgers’ equation. Appl Math Comput 262:282–297. https://doi.org/10.1016/j.amc.2015.03.122 Google Scholar
- Öziş T, Aksan EN, Özdeş A (2003) A finite element approach for solution of Burgers’ equation. Appl Math Comput 139(2–3):417–428. https://doi.org/10.1016/s0096-3003(02)00204-7 Google Scholar
- Ren H, Pei K, Wang L (2014) Error analysis for moving least squares approximation in 2D space. Appl Math Comput 238:527–546. https://doi.org/10.1016/j.amc.2014.04.037 Google Scholar
- Roig B (2007) One-step Taylor–Galerkin methods for convection–diffusion problems. J Comput Appl Math 204(1):95–101. https://doi.org/10.1016/j.cam.2006.04.031 CrossRefGoogle Scholar
- Shi D, Zhou J, Shi D (2013) A new low order least squares nonconforming characteristics mixed finite element method For Burgers’ equation. Appl Math Comput 219(24):11302–11310. https://doi.org/10.1016/j.amc.2013.05.037 Google Scholar
- Surana KS, Huels CR (1989) A least squares finite element solution of the inverse problem of aquifer transmissivity. Comput Struct 31(2):249–268. https://doi.org/10.1016/0045-7949(89)90229-0 CrossRefGoogle Scholar
- Tatari M, Dehghan M (2005) Numerical solution of Laplace equation in a disk using the adomian decomposition method. Phys Scripta 72(5):345–348. https://doi.org/10.1238/Physica.Regular.072a00345 CrossRefGoogle Scholar
- Thompson LL, Pinsky PM (1995) A Galerkin least-squares finite element method for the two-dimensional Helmholtz equation. Int J Numer Meth Eng 38(3):371–397. https://doi.org/10.1002/nme.1620380303 CrossRefGoogle Scholar
- Wang HF, Anderson MP (1982) Introduction to groundwater modeling: finite difference and finite element methods. W.H. Freeman and Company, San Francisco, p 237Google Scholar
- Zhang XH, Ouyang J, Zhang L (2009) Element -free characteristic Galerkin method for Burgers’ equation. Eng Anal Bound Elem 33(3):356–362. https://doi.org/10.1016/j.enganabound.2008.07.001 CrossRefGoogle Scholar
- Zhang L, Ouyang J, Wang X, Zhang X (2010) Variational multiscale element-free Galerkin method for 2D Burgers’ equation. J Comput Phys 229(19):7147–7161. https://doi.org/10.1016/j.jcp.2010.06.004 CrossRefGoogle Scholar

## Copyright information

**Open Access**This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.