Sie sind auf Seite 1von 15

Indian Institute of Technology Kanpur

Homework Assignment 1

AE675: Introduction to Finite


Element Method
Author:
Siddhartha Srivastava

March 17, 2015

Roll Number:
10327715

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

Contents
1 Introduction
1.1 Beam Problem . . . . . . . . . . .
1.2 Weak Formulation . . . . . . . . .
1.3 hp version . . . . . . . . . . . . . .
1.4 ZienkiewiczZhus patch recovery .
2 FEM analysis
2.1 Patch Test . . . . . . . . . . . .
2.2 p version . . . . . . . . . . . . .
2.3 h version . . . . . . . . . . . . .
2.4 Jumps and Discontinuities . . .
2.4.1 Point Loads . . . . . . .
2.4.2 Material Discontinuities
2.5 Recovered Derivative . . . . . .
2.6 Complex Simulations . . . . . .

.
.
.
.
.
.
.
.

3 Conclusion

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.

2
2
2
2
3

.
.
.
.
.
.
.
.

3
3
4
4
7
8
8
9
11
14

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

Introduction

The finite element method is a powerful tool for solving differential equations. The
method can easily deal with complex geometries and higher-order approximations of
the solution. The idea is to divide the domain into elements and seek a polynomial
approximations to the unknown functions on each element. The method glues these
piece-wise approximations together to find a global solution.

1.1

Beam Problem

Figure 1: Beam under axial loading


On imposing force equilibrium on a small box in the domain we get
dEA du
dx
ku = f : 0 < x < 1
dx
with Boundary conditions specified at x = 0, 1

1.2

(1)

Weak Formulation

The weak formulation of the above problem can be found by multiplying a weight
function to the strong form and integrating the equation using integration by parts.
We get the final form of weak form as:


1
Z 1
Z 1
du
du dv
+ kuv dx =
f vdx + (EA )v
(2)
EA
dx dx
dx
0
0
0

1.3

hp version

hp-FEM is a general version of the finite element method (FEM), based on piecewisepolynomial approximations that employs elements of variable size (h) and polynomial degree (p). The finite element method converges exponentially fast when the

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

mesh is refined using a suitable combination of h-refinements (dividing elements into


smaller ones) and p-refinements (increasing their polynomial degree).This exponential convergence provides a great platform for developing adaptive codes. In the
next section we will see examples of h and p version of FEM separately.

1.4

ZienkiewiczZhus patch recovery

ZienkiewiczZhus patch recovery method or the ZZ recovery method uses the nodal
averaging method to obtain recovered stresses and compared stresses interpolated
from the recovered stresses with those computed from the finite element solution at
the quadrature points to find the error in the numerical solution. Thus it provides
a 1 level higher order approximation (better fit) for the derivatives.

FEM analysis

In this section a brief analysis of the h and p version of the FEM as well recovery
method of derivative is presented.

2.1

Patch Test

Consider the following example of beam under axial loading for testing the validity
of code as well as well as for understanding few properties of FEM based solutions
Let the distributed loading f be given as
f = 12x2

(3)

with boundary conditions defined as:


u(0) = 0
u0 (1) = 0

(4)

On analytically solving the strong form and applying the Boundary conditions we
get,
u = x4 4x
(5)

AE675: Introduction to Finite Element Method

2.2

Siddhartha Srivastava

p version

For p version analysis of the problem mentioned in the section 2.1, we take a single
element and vary the p i.e. order of approximation of the finite element solution.
Please note that for this version of code higher order lagrange shape functions are
used.
0
p=1
p=2
p=3
p=4
exact

0.5

Displacement

1.5

2.5

3.5

0.1

0.2

0.3

0.4

0.5
0.6
Position (x)

0.7

0.8

0.9

Figure 2: FEM Solution


From figure 2 and 3 it can seen that the FEM solution for fourth order approximation
matches with the exact solution to the problem which is the expected outcome. This
can be verified by figure 4 where the error p = 4 is 0.
Please also note that on performing an exponential curve fit on the error data, we
get that error decays as following
error = 5.262e1.607p

2.3

(6)

h version

For h version analysis of the problem given in 2.1, we now take different number
of elements while keeping the order of approximation constant as 1. The value of

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

0
p=1
p=2
p=3
p=4
exact solution

0.5
1
1.5

du/dx

2
2.5
3
3.5
4
4.5
5

0.1

0.2

0.3

0.4

0.5
0.6
Position(x)

0.7

0.8

0.9

Figure 3: First derivative of FEM solution


1.4

1.2
Curve Fit:
error=5.262*exp(1.607*p)
1

error

0.8

0.6

0.4

0.2

1.5

2
2.5
3
Order of approximation (p)

3.5

Figure 4: Errors for different orders of approximation


the solution as well as the gradients are evaluated at the gauss-legendre integration
points
Please note from figure 5 the solution seems to start converging from 8 elements
onwards. Similar results can be said for the gradient data presented in figure 6. The
value of the derivatives start to shrink towards the exact solution with increasing
number of elements.
Figure 7 shows the error estimated for different number of elements. In h version
of finite element method, the error is bounded from lower side by the equation

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

FEM Solutions
0
nelem=1
nelem=2
nelem=4
nelem=8
nelem=16
nelem=32

0.5

Function Value

1.5

2.5

3
0

0.1

0.2

0.3

0.4

0.5
0.6
Xvalues

0.7

0.8

0.9

0.9

Figure 5: FEM Solution for p=1


Derivative
0
nelem=1
nelem=2
nelem=4
nelem=8
nelem=16
nelem=32
Exact Solution

0.5
1

du/dx

1.5
2
2.5
3
3.5
4

0.1

0.2

0.3

0.4

0.5
0.6
Position (x)

0.7

0.8

Figure 6: First derivative of FEM solution for p=1


keh k >= cP N . For this example the value of p is 1 therefore rather than estimating
the lower bound, an exponential decay law of the error is estimated which is given
by error = .9874e0.6463N

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

0.7
0.6

Estimated error
Exponential Fit

error

0.5
0.4
0.3
0.2
0.1
0

10

15
20
Number of elements

25

30

35

Figure 7: Errors for different number of elements for p=1


Error estimation for p=2
0.14
Exponential Decay law
Estimated Error

0.12

Lower Bound of form C*2N

Error

0.1
0.08
0.06
0.04
0.02
0

10

15
20
Number of Elements

25

30

35

Figure 8: Errors for different number of elements for p=2


Similarly repeating this exercise for p=2 yields an exponential decay law of error =
.604e1.608N as shown in figure 8. Also note that the error is bounded by keh k >=
0.07 2N (solved Using trial and error). It is also evident from the decay laws that
the convergence rate for p=2 is faster than that of p=1.

2.4

Jumps and Discontinuities

Jumps and Discontinuities in the stress can be caused either by application of point
loads or by discontinuities in material properties.

AE675: Introduction to Finite Element Method

2.4.1

Siddhartha Srivastava

Point Loads

Consider the following example where a point load of 1 unit is acting at x=0.5.
Assume no other force is acting on the body. Since f = 0, u must be piece-wise
linear in x. Therefore as seen in section 2.2 a piecewise linear function can exactly
solve the problem. The jump in the stresses can be evaluated by
EA

du
du
|x EA |x+ = Q
dx
dx

(7)

The exact solution for the problem can be written as




x
: 0 x < 0.5
0.5 : 0.5 x 1

1 : 0 x < 0.5
0 : 0.5 x 1

u(x) =
and,
du
=
dx

FEM Solutions

0.6
0.5

u(x)

0.4
0.3
0.2
0.1
0

0.1

0.2

0.3

0.4

0.5
0.6
Position(x)

0.7

0.8

0.9

Figure 9: FEM Solution for p=1


It is evident from figure 9 that the FEM solution is equal to the exact solution.
Although note that since the data points are evaluated at the gauss legendre integration point the jump in the derivative in figure 10 may appear to be slanted.
2.4.2

Material Discontinuities

This is another way by which discontinuities may appear in stresses. A jump in


material data like EA can cause jump at the jump at the discontinuity in material.

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

Derivative

du/dx

0.8

0.6

0.4

0.2

0.1

0.2

0.3

0.4

0.5
0.6
Position(X)

0.7

0.8

0.9

Figure 10: First derivative of FEM solution for p=1


Imposing force equilibrium on small element around material discontinuity yields:
du
du
)|x = (EA )|x+
(8)
dx
dx
Consider a case where only a unit point load acts on the right boundary and variation
of EA is as given below:

1 : 0 x < 0.5
EA(x) =
2 : 0.5 x 1
(EA

The exact solution for the problem can be found out to be:

u(x) =

x
: 0 x < 0.5
0.5 (0.5 + x) : 0.5 x 1

and,
du
=
dx

1
: 0 x < 0.5
0.5 : 0.5 x 1

It is evident from figure 11 and figure 12 that the FEM solutions are exact. Further
figure 12 shows jump in stress at material discontinuity at x = 0.5.

2.5

Recovered Derivative

As discussed in section 1.4, ZZ Recovery method is a method for approximating


the derivative with one order higher polynomial. This technique is successfully
implemented in the code.

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

FEM Solutions
0.8
0.7
0.6

u(x)

0.5
0.4
0.3
0.2
0.1
0

0.1

0.2

0.3

0.4

0.5
0.6
Position(X)

0.7

0.8

0.9

0.9

Figure 11: FEM Solution for p=1


Derivative

du/dx

0.8

0.6

0.4

0.2

0
0

0.1

0.2

0.3

0.4

0.5
Xvalues

0.6

0.7

0.8

Figure 12: First derivative of FEM solution for p=1


To test this module let us take the examples given in section 2.1. f is a 2nd order polynomial therefore stress is a 3rd order polynomial. Now let us approximate
stress with 2nd order polynomial i.e. let us approximate u with a 2nd and 3rd order
polynomial and 2 elements.
On analyzing figure 13 it was found that the recovered derivative for 2nd order
approximation of u which will be of 3rd order is closer to exact derivative but the
FEM solution for the 3rd order derivative is even closer to the exact solution which
is what we expect from the best approximation property of FEM.
Let us further analyze the problems mentioned in section 2.4.1 and section 2.4.1.
Figure 14 and Figure 15 shows that on doing a ZZ recovery on an originally exact

10

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

Derivative
0
0.5
p=2
Derivative
Recovered derivative
p=3
exact solution

du/dx

1.5
2
2.5
3
3.5
4
4.5

0.1

0.2

0.3

0.4

0.5
0.6
Position(x)

0.7

0.8

0.9

Figure 13: First derivative of FEM solution for p=1


Derivative

du/dx

0.8
0.6
0.4
0.2
0
0.2

0.1

0.2

0.3

0.4

0.5
0.6
Position(X)

0.7

0.8

0.9

Figure 14: First derivative of FEM solution for p=1


solution, the accuracy of the solution is lost. This is due to the fact that ZZ recovery
brings smoothening which can mollify the jumps present in the solution.

2.6

Complex Simulations

The code provides platform for complex simulations like multiple point loads, piecewise polynomial/sinusoidal elastic properties, spring stiffness and distributed forces.
It also provides options different boundary conditions (Dirichlet, Neumann and
Robin).
To test their applicability, let us take one such complex problem. Let the distributed

11

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

Derivative
1.2

du/dx

0.8

0.6

0.4

0.2

0
0

0.1

0.2

0.3

0.4

0.5
Xvalues

0.6

0.7

0.8

0.9

Figure 15: First derivative of FEM solution for p=1


loading f be given as

1 + x + x2 + x3 + x4
: 0 x < 0.5
f (x) =
1 + sin(x pi/L) + cos(x pi/L) : 0.5 x 1

EA(x) =

k(x) =

1+
: 0 x < 0.5
1 + x : 0.5 x 1

1+
: 0 x < 0.5
1 + x : 0.5 x 1

and a point load of unit value at x = 0.5,


with boundary conditions defined as:
u(0) = 0
u(1) = 0
Let us solve this problem with 4th order approximation of polynomial in 2 subdomains with 10 elements in each of them.
As clear from figure 16 and figure 16, the code efficiently handles complex inputs
and give intuitive results as we can see in following forms: 1. Boundary conditions
are satisfied. 2. Continuous value of u. 3. Jump in the value of derivative at x=0.5

12

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

FEM Solutions
1.2
1
0.8

u(x)

0.6
0.4
0.2
0
0.2

0.1

0.2

0.3

0.4

0.5
0.6
Position (X)

0.7

0.8

0.9

Figure 16: First derivative of FEM solution for p=1


Derivative

du/dx

10
8

FEM Solutions

Recovered derivative

4
2
0
2
4
0

0.1

0.2

0.3

0.4

0.5
0.6
Xvalues

0.7

0.8

0.9

Figure 17: First derivative of FEM solution for p=1


We also see some non-intuitive and interesting outcomes from this result. Due to use
of higher order inputs, 4th order polynomial is an under-approximation due to which
we see gibbs phenomenon occuring at roughly 10% of length. We also see gibbs
phenomenon in the recovered derivative which hints that even 5th order polynomial
is an under-approximation to the problem.

13

AE675: Introduction to Finite Element Method

Siddhartha Srivastava

Conclusion

It was evident from the examples covered that even a simple 1D beam problem
presents challenging issues in numerical simulations. Discussions presented in examples cater some of these issues. As per the arguments presented even with a
benchmarked code and post processing tools in place, the results should be evaluated with an observant eye.

14

Das könnte Ihnen auch gefallen