Download as pdf or txt
Download as pdf or txt
You are on page 1of 65

Weighted Residual Formulation

Prof. P. Seshu 1
What is FEM
• General technique for solving partial differential equations

• The partial differential equations are transformed into algebraic


equations which can be solved using digital computers

• Algebraic equations are cast into matrix form to allow ease of


computer programming.

• The essence of the finite element method is to break large, complex


geometry into smaller interconnected components called "elements".

Prof. P. Seshu 2
Contd…
• Each element has a function which is assumed to satisfy the
required differential equations over the volume of the element

• The more elements you have the better the answers (usually)

• The idea is similar to what we discussed in interpolation – instead


of using a single, high degree polynomial curve fit; better to use
several lower degree (spline) curve fits

Prof. P. Seshu 3
Finite Element Formulation
• Finite element analysis is versatile because of the common
features in the mathematical formulation of seemingly different
physical problems.

• Many problems can be represented by partial differential


equations.

• In some cases, the same type of partial differential equation (e.g.


the two dimensional Laplace /Poisson equation) can represent a
large number of physical problems e.g. ground water seepage,
torsion of bars, heat flow etc.

Prof. P. Seshu 4
Finite Element Formulation Starting from a
Governing Differential Equation

Prof. P. Seshu 5
WEIGHTED RESIDUAL METHOD

General problem is described in the form of


• a differential equation (DE) in domain 
• prescribed boundary conditions (BC) on the
boundary .
Steps for finding approximate solution to DE.
Step-1 Assume a trial solution to the problem. For a one
dimensional problem, trial solution may be as
follows:
f(x) = c0 + c1 x + c2 x2 + ….

Prof. P. Seshu 6
WEIGHTED RESIDUAL METHOD

Assumed function may not satisfy DE within the domain


 and/or the BCs on .
In the context of finite element method, trial solutions
are such that they satisfy the applicable boundary
conditions
Step-2 Substitute the assumed function in the DE ,
applying the BCs of problem & find the “domain
residual”
Step-3 Determine the unknown parameters ( c0, c1, c2 ….)
in the assumed trial function so as to make these
residuals as low as possible.

Prof. P. Seshu 7
Example 1
2
d f df
2
 p0 f (0)  0 ( L)  0
dx dx
Let f ( x )  c0  c1 x  c2 x 2

df d2 f
 c1  2c2 x 2
 2c2
dx dx
If c2 = p/2, the assumed
Substitute solution satisfies the d.e and
Re sidual , R  2c2  p  0 b.c

Prof. P. Seshu Scientist-in-Charge, CSIR C-MMACS; Professor, IIT Bombay 8


Example 2

Governing DE and BCs are given by,

d 4v
EI 4
 q0  0
dx

d 2v
(0)  0
v (0) = 0, dx 2

d 2v
v (L) = 0, 2
( L)  0
dx

Prof. P. Seshu 9
WEIGHTED RESIDUAL METHOD
Step 1 – Assume a trial solution:

Let v(x)  c1 sin ( x / L)

This one parameter trial solution satisfies all b.c.

Step 2 – Find the domain residual:

Rd = c1 (/L)4 (EI) sin ( x /L) – q0

Step 3 – Minimise the residual:

Domain residual is varying from point to point within the


domain! Only one coefficient has to be determined !!

Prof. P. Seshu 10
WR Method - Point Collocation Technique

Residuals can be set to zero at chosen points within the domain.

Number of points being equal to the number of coefficients in the trial


function that need to be determined.

Residual might be unduly large at some other points within the domain.
Therefore residual must be “minimised” over the entire domain rather
than setting it identically zero at only selected few points.

Prof. P. Seshu 11
Point Collocation Method

Make Rd = 0 at x = L/4, i.e.

c1 (/L)4 (EI) sin ( / 4) – q0 = 0

Therefore
2 q0 L4
c1 =
 4 EI
Resulting trial solution is -

v̂ (x) = 2 q0 L4 x
sin
 4
EI L

Prof. P. Seshu 12
Point Collocation Technique

Transverse Displacement

Prof. P. Seshu 13
Two – term trial solution

WE CAN IMPROVE OUR TRIAL SOLUTION BY ADDING ONE MORE TERM TO THE SINE
SERIES I.E.,

v (X)  v (X) = C1 SIN ( X / L) + C3 SIN (3 X / L)

DOMAIN RESIDUAL

RD = C1 (/L)4 (EI) SIN ( X / L) + C3 (3/L)4 (EI) SIN (3 X / L) - q0

TWO CONSTANTS TO BE FOUND (C1 and C3)

SET THE RESIDUAL ZERO AT TWO SELECTED POINTS

Prof. P. Seshu 14
Prof. P. Seshu 15
Key Idea – 1: Solution by Weighted Residual Technique

minimise Rd in an overall sense

For the problem at hand, we will formulate this technique as:


L
0
Wi ( x) Rd ( x) dx  0
where Wi(x) are weighting functions.

Choose as many weighting functions as necessary to generate the


required number of equations for the solution of the undetermined
coefficients in the trial function.

Prof. P. Seshu 16
Galerkin W-R Method

Galerkin (1915) W(x) same as the trial functions themselves.

Let v(x)  c1 sin (x / L)

The domain residual,

Rd = c1 (/L)4 (EI) sin (x / L) – q0

Using Galerkin procedure,


L    x     4 x 
0 sin  L  
  
c1   EI sin
  L  L
 q  dx  0


W ( x) Rd ( x )

Prof. P. Seshu 17
Galerkin W-R Method

  x x
4
L L
 dx  
2
  EIc1 sin q sin dx
 L 0 L 0 L
Therefore, c1 = 0.013071q0L4 / EI.

q0 L4 x
vˆ( x)  0.013071 sin
EI L

Prof. P. Seshu 18
Galerkin Weighted residual solution vs exact solution
14
SOM
12
Galerkin Solution
10
deflection

8
6
4
2
0
0 0.2 0.4 0.6 0.8 1
normalised X location
The error in v(x) at the mid–span is just 0.38%.

Prof. P. Seshu 19
General Weighted Residual Technique

 Trial function should satisfy the BCs of the problem.

 Trial solution is assumed as follows:

f(x) = (x) + ci Ni(x)

where (x) and Ni(x) are fully known functions of x, pre–selected such
that the boundary conditions are satisfied by f(x),

 Weighting functions to be Wi(x) =  f/ ci = Ni(x)

Prof. P. Seshu 20
Key Idea – 2: Weak Form of W-R statement
• By carrying out integration by parts of general WR
statement, reduce the continuity requirement on the trial
function assumed in the solution.
2
• Example : Let Governing DE be: K1 u2  K 2 x  0
d
dx
with BCs u (0) = 0, du =0
dx x  L
• Let û be the trial solution assumed. Substituting in DE,

d 2uˆ
Rd  K1 2  K 2 x
dx

Prof. P. Seshu 21
Weak Form of W-R statement

With W(x) as the weighting function we have, WR statement,

L  d 2uˆ 
0 W ( x)  K1 dx 2  K 2 x  dx  0
L d 2uˆ L
0 W ( x) K1 dx2 dx  0 W ( x) K 2 x dx  0
L  duˆ  L
0 W ( x) d  K1 dx   0 W ( x) K 2 x dx  0
We Know that, integration by parts,
 
uv 

 u dv    v du

 (uv )   (uv)    v du
Prof. P. Seshu 22
Weak Form of W-R statement
• By performing integration by parts for our problem,
L
 duˆ  L  duˆ  dW L

W ( x) K1 dx  
0

0  K1


dx  dx
dx  
0
W ( x) K 2 x dx  0

• Writing K1 duˆ = P above equation becomes


dx
L duˆ dW L
W ( L) PL  W (0) P0   K 1 dx   W ( x) K 2 x dx  0
0 dx dx 0

• Continuity requirement on u(x) has gone down.

• Natural BCs are explicitly defined in WR statement.

• Trial functions have to satisfy only essential BCs.

Prof. P. Seshu 23
Weak Form of W-R statement
Equivalent Representation of a Problem Statement
Differential Weighted Residual Weak form
equation Statement

d 2u  d 2uˆ  L duˆ dW L
 dx   W K 2 x dx
L
K1 2  K 2 x  0  W  1 2
K  K 2  dx  0
x K1
dx 0
 dx 
0 dx dx 0

subject to subject to û(0) = 0 subject to


u(0) = 0 û(0) = 0
du duˆ W(0) = 0
K1 ( L)  0 K1 ( L)  0
dx dx

Prof. P. Seshu 24
Weak Form of W-R statement

• Back to Example Problem, let

u(x)  û(x) = c1x + c2x2

• Then we have

dû/dx = c1 + 2c2 x ,

W1 = x , W2 = x2 ,

dW1/dx = 1, dW2/dx = 2x

• We observe that û(0) = 0, W1(0) = 0 and W2(0) = 0 as


required.

Prof. P. Seshu 25
Weak Form of W-R statement

• Weak form w.r.t W1 ,

L L
 0
( K1 ) (c1  2c2 x) (1) dx  0
( x) ( K 2 x) dx

K1 (c1L  c2 L2 )  K 2 L3 / 3

Prof. P. Seshu 26
Weak Form of W-R statement

• Weak form w.r.t W2 ,


L L
 0
( K1 ) (c1  2c2 x)(2 x) dx  
0
( x 2 )( K 2 x) dx

 c1 L2  4c2 L3  K 2 L4
K1  
 3  4

Prof. P. Seshu 27
Weak Form of W-R statement

• Solving the two equations, we have

7 K 2 L2 K2 L
c1  , c2  
12 K1 4 K1

• Thus the û(x) is given as:

K2 L
uˆ ( x)  (7 xL  3 x 2 )
12 K1

Prof. P. Seshu 28
Comparison of DE, WR & Weak forms
• If û(x) is the exact solution, then the weighted residual
form is implicitly satisfied for any and every weighting
function W(x).

• WR statement is equivalent only to the DE and does not


account for BCs. Trial solution should satisfy all the BCs
and it should be differentiable as many times as required
in the original DE.

Prof. P. Seshu 29
Comparison of DE, WR & Weak forms

• The weighting functions W(x) can in principle be any non-


zero, integrable function. By choosing “n” different weighting
functions, generate necessary “n” equations for
determination of coefficients ci (i = 1,2,,n) in the trial
solution field assumed.

Prof. P. Seshu 30
Comments on Weak Form (WF)
• In WF, continuity demand on trial function u has gone down
and that on the weighting function W has increased.

• Even order DE can be transformed into WF, having equal


continuity demand on trial solution function and the
weighting function.

Prof. P. Seshu 31
Comments on Weak Form (WF)
• Only essential BCs have to be satisfied by the trial solution
of the WF equation as natural BCs are taken into account
while forming WF.

• Weighting function should satisfy the homogeneous part


(i.e., u = 0) of the prescribed essential BCs.

• Much wider choice of trial solution functions is possible


with weak form as continuity demanded has gone down

Prof. P. Seshu 32
Key Idea 3: Piecewise Approximation

Piece-wise Continuous Trial Function Solution of Weak Form

• Trial function chosen was a single composite function, valid over the
entire solution domain.

• W–R method is essentially a process of “curve fitting” and is best done


"piece–wise" == the more the number of pieces, the better the fit

Prof. P. Seshu 33
f(x)

f(x)

f(x)

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Prof. P. Seshu 34
Approximation Using One Straight Line Segment
f(x) and one-line segment

f(x)
f(x)

1
one-line

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Prof. P. Seshu 35
Approximation Using Two Line Segments
Two-line segment approximation

f(x)

f(x)
0.5
tw o-line

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Prof. P. Seshu 36
Approximation Using Four Line Segments
Four-line segment approximation

f(x)

f(x)
0.5
four-line

0
0 0.5 1

Prof. P. Seshu 37
Approximation Using Eight Line Segments
eight line segment approximatuion

f(x)

f(x)
0.5
eight-line

0
0 0.5 1

x
Prof. P. Seshu 38
Two Quadratic Segment Approximation
Two-quadratic segment approximation

f(x)

f(x)
0.5
tw o-quadratic

0
0 0.5 1

Prof. P. Seshu 39
Piecewise Approximation

 One–line segment approximation


f(X)  X = f(0.5)*2X (0 < X < 1)

 Two–line segment approximation


f(X)  f(0.5)*2X (0 < X < 0.5)
f(X)  f(0.5) + (X – 0.5) (0.5 < X < 1)

 Four–line segment approximation


f(X)  f(0.25)*4X (0 < X < 0.25)
f(X)  f(0.25) + (X–0.25) (0.25 < X < 0.5)
f(X)  f(0.5) + (X–0.5) (0.5 < X < 0.75)
f(X)  f(0.75) + (X−0.75) (0.75 < X < 1)

Prof. P. Seshu 40
Piecewise Approximation - Use of local coordinate frames

We define a local
coordinate x with
the origin fixed at
the left end of
each sub–domain.

Prof. P. Seshu 41
Piecewise Approximation
 Two line segment approximation (with  = L/2 = 1/2)
f(x)  [ 1 – (x/) ] f(0) + [ x/ ] f(0.5) (0 < x < )
f(x)  [ 1 – (x/) ] f(0.5) + [ x/ ] f(1) (0 < x < )

 Four line segment approximation (with  = L/4 = 1/4)


f(x)  [ 1 – (x/) ] f(0) + [ x/ ] f(0.25) (0 < x < )
f(x)  [ 1 – (x/) ] f(0.25) + [ x/ ] f(0.5) (0 < x < )
f(x)  [ 1 – (x/) ] f(0.5) + [ x/ ] f(0.75) (0 < x < )
f(x)  [ 1 – (x/) ] f(0.75) + [ x/ ] f(1) (0 < x < )

f(x)  [ 1 – (x/) ] fk-1 + [ x/ ] fk (0 < x <  = L/n)

Prof. P. Seshu 42
Piecewise Approximation – Shape Functions

[ 1 – (x/) ] and [ x/ ] used


in our interpolation are
called “interpolation
functions” or “shape
functions”

Prof. P. Seshu 43
Piecewise Approximation – Shape Functions

Contribution of a given fk to
the value of the function
at any point P within the
domain 0<X<L.

Prof. P. Seshu 44
Piecewise Curve Fit – One Dimensional Case
Actual
variation
Shape f5
f6 f7
Function f4 f8 f9 f10
f3 f11
f2

f1

1 2 3 4 5 6 7 8 9 10

Whole Domain
Prof. P. Seshu 45
Piecewise Curve Fit – Two Dimensional Case

Whole Domain

Prof. P. Seshu 46
Evaluation of Weighted Residual

  W ( x) R ( x) dx
L l
 0
Wi ( X ) Rd ( X ) dX 
1
0 i d

n == the number of segments/pieces


Thus we evaluate over each segment and then sum up
Shape functions over each segment are same/similar and
hence calculations become repetitive – easily programmed
Segments can be of different length
Shape function need not be same for all segments

Prof. P. Seshu 47
Essence of Finite element method

• Evaluate the sub-domain level contributions to the weighted residual by


merely computing the integral  Wi(x) Rd(x) dx or its weak form, just
once for the kth sub–domain

• Build–up the entire coefficient matrices [A] & {b} by appropriately


placing these sub–domain level contributions in the appropriate rows
and columns.

• Solve the (n+1) algebraic equations to determine the unknowns viz.,


function values fk at the ends of the sub–domains.

• This is the essence of the Finite element method.

Prof. P. Seshu 48
Finite Element Method

• Each of the sub–domains is called a “finite element” – to be


distinguished from the “differential element” used in continuum
mechanics.

• The ends of the sub–domain are referred to as the “nodes” of the


element.

• Later on we see elements with nodes not necessarily located at only


the ends e.g. an element can have mid–side nodes, internal nodes
etc.

• The unknown function values fk at the ends of the sub–domains are


known as the “nodal degrees of freedom (d.o.f) ”.

Prof. P. Seshu 49
Finite Element Formulation

• A general finite element can admit the function values as well as


its derivatives as nodal d.o.f.

• The sub-domain level contributions to the weak form are typically


referred to as “element level equations”.

• The process of building-up the entire coefficient matrices [A] &


{b} is known as the process of “assembly” i.e. assembling or
appropriately placing the individual element equations to
generate the system level equations.

Prof. P. Seshu 50
Finite Element Formulation

Example
d 2T  P
k 2
 q    h(T  T )
dx  Ac 

The Weighted Residual statement can be written as follows :

L  d 2T P 
0 W  k dx2  q   Ac  h(T  T )  dx  0
 

Prof. P. Seshu 51
Finite Element Formulation

Weak form -- integration by parts

P
L
 dT  L dW dT L L
Wk dx   0 k dx dx dx  0 Wq dx  0 W  A  h(T  T ) dx  0
0  c

P
L
L dW dT L L L P  dT 
0 k dx dx dx  0 W  Ac  hT dx  0 Wq dx 0 W Ac h(T ) dx  Wk 
 dx  0

Prof. P. Seshu 52
Finite Element Formulation

The weak form, for a typical mesh of "n" finite elements, can be written as

n  
  dW dT     

n
P P  dT
 hT dx      W  q 

 0 k dx   W hT  dx  Wk  
k 1  dx dx 0 Ac  k 1 
0
 Ac   dx  0 

Prof. P. Seshu 53
Finite Element Formulation

 x  x
T ( x)  1   k
T    Tk 1 x dW1 1
   W1  1  ,  
 dx 

dT Tk 1  Tk x dW2 1
 W2  , 
dx   dx 

Prof. P. Seshu 54
Finite Element Formulation

LHS 1st Term:


k  1 1 Tk 
   
  1 1 Tk 1 

LHS 2nd Term: With W1,

 x  P   x  x  Ph 
 2 Tk  Tk 1 

0     Ac     k    k 1  dx
1  h 1  T  T 
6 Ac

Prof. P. Seshu 55
Finite Element Formulation

With W2,

  x  P   x x  Ph 
 Tk  2 Tk 1 
0     Ac  h 1    Tk   Tk 1  dx = 6 Ac

Putting together and Rearranging LHS 2nd Term:

Ph   2 1  Tk 
   
6 Ac 1 2  Tk 1 

Prof. P. Seshu 56
Finite Element Formulation

RHS 1st term RHS 2nd term

 P   / 2  Q0 
 q0  hT     
 Ac   / 2   
Q

Element level equations


k  1 1 Ph  2 1   Tk   Ph   / 2 Q0 
        q0  T    
  1 1  6 Ac 
1 2   Tk 1   Ac   / 2  Q 

Prof. P. Seshu 57
Example: Temperature distribution in a pin–fin

One element solution

 200  1 1 ( ) (0.001) (20) (0.05)  2 1   T1 


       
 0.05  1 1  (6) ( ) (0.0005) 2
1 2   T2 

From the boundary conditions, we


( ) (0.001) (20) 0.025  Qwall 

have, T1 = 3000C, Qtip = 0. Thus  (30)  
  
we get, T2 = 198.75 oC. ( ) (0.0005) 2  0.025   tip 
Q 
Prof. P. Seshu 58
Pin Fin Example
Two element solution

  1 1 0  2 1 0 
 200      T1 
 ( ) (0.001) (20) (0.025)  
 1 2 1  1 4 1   T2 
 0.025   (6) ( ) (0.0005) 2
   T 
  0 1 1   0 1 2    3

0.0125 Qwall 
( ) (0.001) (20)    
 (30)  0.025 
  0 
( ) (0.0005) 2
0.0125 Q 
   tip 

Prof. P. Seshu 59
Pin Fin Example
Four element solution
  1 1 0 0 0 2 1 0 0 0 
      T1 
  1 2 1 0 0 1 4 1 0 0   
   ( ) (0.001) (20) (0.0125)    T2 
 200  0 1 2 1 0  0 1 4 1 0  T3 
 0.0125   (6) ( ) (0.0005) 2    T 
 0 0 1 2 1  0 0 1 4 1   4
      T5 
  0 0 0 1 1  0 0 0 1 2  
 
0.00625 Qwall 
0.0125   
   0 
( ) (0.001) (20)  
 (30)  0.0125    0 
( ) (0.0005) 2 0.0125   0 
   
0.00625 Qtip 

Prof. P. Seshu 60
Pin Fin Example
Exact solution

 cosh m ( L  x) 
T ( x)  T  (Twall  T )  
 cosh mL 

hP
m 
k Ac

Prof. P. Seshu 61
Pin Fin Example - Comparison of exact and Finite Element
solution

pin fin temperature distribution


300 exact solution
one element
250
two element
200
temperature (C)

150

100

50

0
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05
axial location (m )

Prof. P. Seshu 62
Comparison of exact and 10 element solution

Pin Fin Temperature Distribution -- 10 Element Solution


300 exact solution

Ten element
Temperature (C)

0
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05
Axial Location

Prof. P. Seshu 63
Finite Element Formulation

Procedure for FEA starting from a given DE:

• Write down the Weighted Residual statement.

• Perform integration by parts for even distribution of differentiation

between the field variable and the weighting function and develop the

weak form of the W–R statement.

• Re-write the weak form as a summation over “n” elements.

• Define finite element i.e. geometry of the element, its nodes, nodal d.o.f.

Prof. P. Seshu 64
Finite Element Formulation

• Derive the shape or interpolation functions. Use these as the weighting


functions also.

• Compute the element level equations by substituting these in the weak


form.

• For a given topology of finite element mesh, build–up the system equations
by assembling together element level equations.

• Substitute the prescribed boundary conditions and solve for the unknowns.

Prof. P. Seshu 65

You might also like