Application of the 2D finite element method to Laplace (Poisson) equation; f xx + f yy = F (x, y) M. R. Hadizadeh Computer Club, Department of Physics and Astronomy, Ohio University 4 Nov. 2013
Domain discretization Global solution domain: D(x, y) discretization : Rectangular Triangular... 2D rectangular elements: I nodes for x domain J nodes for y domain total # of elements: (I 1) (J 1) element (i, j) starts at node i, j and ends at node i + 1, j + 1 The grid steps: x and y
Interpolating polynomials An approximating solution: interpolation polynomials Exact solution can be approximated by approximate solution f (x, y): a sum of a series of interpolating polynomials f (i,j) (x, y), i = 1, 2,..., I 1; j = 1, 2,..., J 1: f (i,j) (x, y): linear interpolating polynomials f 1, f 2, f 3, f 4 : values of f (x, y) @ nodes 1,2,3,4 N 1, N 2, N 3, N 4 : shape functions @ nodes 1,2,3,4 node (i, j) is set to (0, 0): labeled 1 3 other neighbor nodes (i + 1, j), (i + 1, j + 1) and (i, j + 1) are labeled 2, 3, 4
Shape functions: Ni(x,y) N i (x, y) = a 0 + a 1 x + a 2 ȳ + a 3 xȳ x = x/ x, ȳ = y/ y 1 for node i N i (x, y) = 0 for other three nodes j i Example:
Shape functions Solution of a system of linear equations for N 1, N 2, N 3, N 4 : Interpolating polynomial for a rectangular element:
The Galerkin weighted residual approach Substituting approximate solution f (x, y), given by interpolating polynomials, in Laplace (Poisson) equation gives the residual R(x, y): The residual R(x, y) is multiplied by a set of weighting functions W k (x, y), k = 1, 2,..., and integrated over the global solution domain D(x, y) to obtain the weighted residual integral I (f (x, y)), which is equated to zero. For a general weighting function W (x, y): Integration by parts for first two terms:
The Galerkin weighted residual approach The first two terms can be transformed by Stokes theorem: B: outer boundary of the global solution domain D(x, y) n x and n y : components of the unit normal vector to the outer boundary n By considering the definition of flux of f (x, y) crossing the outer boundary B: leads to:
The Galerkin weighted residual approach By considering the discretized global solution domain, the weighted residual integral I (f (x, y)) can be written as: where W (x, y): weight function; it is yet unspecified f (x, y): approximate solution given by interpolating polynomial
The Galerkin weighted residual approach In the Galerkin weighted residual approach, the weighting factors W k (x, y), k = 1, 2, 3, 4, are chosen to be the shape functions N i (x, y), i = 1, 2, 3, 4. Example: W 1 (x, y)
The Galerkin weighted residual approach The weighted residual integral I (f (x, y)) for W 1 (x, y): x = x/ x dx = x d x ȳ = y/ y dy = y dȳ In the following we evaluate the inner and outer integrals.
The Galerkin weighted residual approach Evaluation of inner integral and then integrating on x:
The Galerkin weighted residual approach Final form of inner integral: Substitution in the weighted residual integral I (f (x, y)):
The Galerkin weighted residual approach By following similar steps for outer integral on ȳ: leads to:
The Galerkin weighted residual approach Similar derivation for W 2 = N 2, W 3 = N 3 and W 4 = N 4 : So, we have 4 equations for weighted residual integral I (f (x, y)) = 0, corresponding to weight factors W 1 (x, y), W 2 (x, y), W 3 (x, y), W 4 (x, y) equal to shape functions N 1 (x, y), N 2 (x, y), N 3 (x, y) and N 4 (x, y), related to position of each node (i, j) which was labeled by 1 and its three neighbors labeled by 2, 3 and 4.
The Galerkin weighted residual approach Summary: 1 W 1 (x, y) = N 1 (x, y) I 1 (f (x, y)) = 0 2 W Rect. element (i, j) = 2 (x, y) = N 2 (x, y) I 2 (f (x, y)) = 0 3 W 3 (x, y) = N 3 (x, y) I 3 (f (x, y)) = 0 4 W 4 (x, y) = N 4 (x, y) I 4 (f (x, y)) = 0 Challenge; The node (i, j) which is set to (0, 0) in rectangular element, is in general situation common between 3 other neighbor rectangular elements!
The Galerkin weighted residual approach Next step: assembled nodal equation for node i, j, labeled 0, by combining all of the element equations I i (x, y), i = 1, 2, 3, 4 for surrounded elements (1), (2), (3) and (4), respectively, which correspond to shape functions associated with node 0. Figure 12.16a illustrates the basic element used to derive I i (x, y). (1) I 3 (x, y) x, y = 0 (2) I 4 (x, y) x+, y = 0 (3) I 1 (x, y) x+, y + = 0 (4) I 2 (x, y) x, y = 0 + node 0 in element (1) corresponds to node 3 in basic element node 0 in element (2) corresponds to node 4 in basic element node 0 in element (3) corresponds to node 1 in basic element node 0 in element (4) corresponds to node 2 in basic element
The Galerkin weighted residual approach
The Galerkin weighted residual approach Summing all 4 terms nodal equation for node 0:
The Galerkin weighted residual approach Nine-point finite element approximation: (Nodal equation for node 0) x = x + = x ; y = y + = y x = y = L; F = constant
Application to Laplace (Poisson) Equation
Example: heat transfer problem A thin conductor plate width: w = 10 cm height: h = 15 cm thickness: t = 1 cm 100 sin( πx w ) y = h T (x, y) = 0 other edges A copper alloy conductor width: w = 1 cm height: h = 1.5 cm internal energy generation: T (x, y) = 0 ; four sides Q k = 1000 C cm 2
Example: heat transfer problem; exact solution
Example: heat transfer problem; exact solution
Solution by Finite Difference Solution
Example: heat transfer problem; finite difference solution Taylor series: β = x y β = 1
Example: heat transfer problem; finite difference solution Discretization and using 5-point approximation: A system of linear equations: AT = B
Example: heat transfer problem; finite difference solution Number of linear equations: (N x 2) (N y 2)
Example: heat transfer problem; finite difference solution Comparison between FD results and exact solutions:
Solution by Iterative Methods; The Gauss-Seidel Method
Gauss-Seidel Method Five-point finite difference approximation: The Gauss-Seidel method applied to finite difference approximation of the Laplace equation by adding and subtracting the term f ij to above 5 point approximation and rearranging as follows: Subscript k(0, 1, 2,...); iteration number f k+1 ij : residual in the relation method choices for starting the iteration: k = 0 1 f i,j = 0 for all interior points 2 approximate f i,j by some weighted average of the boundary values 3 construct a solution on a coarser grid, then interpolate for starting values on a finer grid.
Gauss-Seidel Method Various convergence criteria: ɛ is convergence tolerance For each iteration we need to solve a system of linear equations: k = 0 : initial guess F (0) A F (1) = B A F (2) = B...
Example: Gauss-Seidel method for heat diffusion problem Convergence with tolerance 4 10 8 is reached after 40 iterations.
Solution by Iterative Methods; The Successive-Over-Relaxation (SOR) Method
The Successive-Over-Relaxation (SOR) Method The Convergence rate of the Gauss-Seidel relaxation method can be greatly increased by using over-relaxation factor ω as following: The optimum value of over-relation factor ω opt for a rectangular region with Dirichlet boundary condition: I = i max 1, J = j max 1
Example: SOR method for heat diffusion problem Convergence with tolerance 3 10 10 is reached after 20 iterations.
Solution by Finite Element Method; and by using SOR Method
Example: FEM and SOR for heat diffusion problem Nine-point finite element approximation for heat diffusion problem: Application of SOR:
Example: FEM and SOR for heat diffusion problem; Laplace equation Larger error in comparison to FD method with 5-point approximation!
Example: FEM and SOR for heat diffusion problem; Poisson equation Larger error in comparison to FD method with 5-point approximation!
Summary Different methods are used to solve Laplace (Poisson) equation 1 Finite Element (FE): 9-point approximation 2 Finite Difference (FD): 5-point approximation FE method with 9-point approximation has about 10% larger error than FD method with 5-point approximation! Iterative techniques are used to improve the accuracy 1 Gauss-Seidel (GS): convergence with tolerance 10 8 after 40 iterations 2 Successive-Over-Relaxation (SOR): convergence with tolerance 10 10 after 20 iterations SOR leads to much more faster convergence with smaller tolerance. By half iterations than GS, SOR reach even better convergence.