You are on page 1of 18

24/12/2011

FEM Background

A very simple finite element problem...


k1 = 6 N/m

u1

p= 2 N

k3 = 4 N/m

k2 = 4 N/m

u3

u2

-k1(u3-u1)

We can write a force balance on each node:

Constraint Force

k1(u3-u1)

-k2(u2-u1)

k3(u3-u2)

-k3(u3-u2)
Node 3

c
k2(u2-u1)

Node 2

Node 1

24/12/2011

Write the force balance as three equations:


k1(u3-u1) + k2(u2-u1) = c
k2(u2-u1) - k3(u3-u2) = 0
k1(u3-u1) + k3(u3-u2) = p
However, we now have three equations in four unknowns, c, u1, u2, u3
But we also have a constraint, u1=0

k1(u3 - 0 ) + k2(u2 - 0 ) = c
k2(u2 - 0 ) - k3(u3 - u2) = 0
k1(u3 - 0 ) + k3(u3 - u2) = p

Constraint Equations

Algebra

(k2)u2 +
(k1)u3 = c
(k2+k3)u2 + (-k3)u3 = 0
(-k3)u2 + (k1+k3)u3 = p
System Equations

Three equations, three


unknowns: c,u2, u3

Can now solve the problem


(k2)u2 +
(k1)u3 = c
(k2+k3)u2 + (-k3)u3 = 0
(-k3)u2 + (k1+k3)u3 = p

k2
k 2 k3
k
3

u
k1 2 c
u3
k3 u2 0

k1 k3 u3 p

Solve the system


equations first

Ku=b

u=K-1b

u2 0.125

u3 0.250

Can also solve the


constraint equations,
if desired
0.125
4 6
2
0
.250

k1= 6 N/m
k2=k3= 4 N/m
p=2 N

24/12/2011

Linear and nonlinear problems


A linear problem must have all three of these properties:
1) Applying zero loads results in a zero solution
2) Doubling the magnitude of the load doubles the magnitude of the solution
3) Changing the sign of the load changes only the sign of the solution
solution

solution

load

Linear

load

Non-Linear

What makes a problem non-linear?

Material properties that depend upon the solution, k(u)


Loads that depend upon the solution, b(u)

k, b

u
Linear

k(u), b(u)

k(u), b(u)

u
Weakly Non-linear

k(u), b(u)

u
Strongly Non-linear

u
Outrageously
Non-linear

There are no clear distinctions


between these three cases

24/12/2011

Not all non-linear problems have a (unique) solution


solution

solution

load

No solution

load

No unique solution

Two very simple finite element examples


k = 4 N/m

k = exp(u) N/m
p=2N

p=2N

Force balance on node:

Force balance on node:

f (u) = p - ku = 0
f (u) = 2 - 4 u = 0

f (u) = p ku=0
f (u) = 2 - exp(u) u = 0

f (u)

f (u)

usolution 0.853

usolution= 0.5
u

24/12/2011

First, solve the linear problem


Algorithm:

f (u) = 2 - 4 u = 0

1) Start at a point, e.g. u0 = 0


2) Find the slope, f(u0)

f (u)

(1)

3) Solve the problem:

(2)

usolution u0

usolution=0.5
(3)

This is a single Newton-Raphson iteration:

f u0
f ' u0

2
usolution 0
0.5
4
f ui
ui 1 ui
f ' ui

For a linear problem, the starting point does not matter

Solving a FE system matrix is equivalent to taking


a single Newton-Raphson iteration
4u=2
f (u) = 2 - 4 u = 0

k 2 k3
k
3

k3 u2 0

k1 k3 u3 p

0 k k
f u 2 3
p k3

k3 u2 0

k1 k3 u3 0

f (u) = b - Ku,

usolution u0

f u0
f ' u0

2
usolution 0
0.5
4

u solution u 0

u0 = 0

b Ku 0 b
f u 0
0
f' u 0
K
K

u solution K 1b

24/12/2011

The non-linear problem is solved the same way


Algorithm:

f (u) = 2 - exp(u) u

1) Start at a point, e.g. u0 = 0


f (u)

2) Linearization point at u0 = 0
3) Take repeated NewtonRaphson iterations
u

4) Terminate when:

f i 1 / f i & ui 1 / ui tolerance

Similarly, if we have a non-linear system matrix


k1 = 6 + (u3-u1)2

k2 = exp(u2-u1)

u1

u2

f (u) = b(u) - K(u)u


f(u) = S(u)

ui 1 ui

p= 2

k3 = 4
u3

S(u) is known as the JACOBIAN

f ui
1
ui Sui bui K ui ui
f ' ui

Iterate until:

f i 1 / f i & ui 1 / ui tolerance

24/12/2011

The possibility of convergence of a non-linear


problem is dependent upon the starting point, u0
f (u) = 2 - exp(u) u
f (u)
Non-convergent
if starting on this
side of the line

u0= -1

Non-linear problems have a radius of convergence

Finding a good starting point, u0, can


improve convergence
f (u) = 2 - exp(u) u

It is not strictly possible to


define slow or fast
convergence

f (u)

Finding a good starting point is


a matter of experience and luck

slow
convergence
u
fast
convergence

24/12/2011

A damping factor, , is used to improve convergence


f (u) = 2 - exp(u) u

while ( |fi+1| > |fi| )

f (u)

choose ( < 1) & (<previous)

|fi|

f ui

ui 1 ui
f ' ui

final |fi+1|

recompute fi+1(ui+1)

intermediate |fi+1|
end

undamped |fi+1|

A better solution is to ramp up the load


Load

Recall that:
Load

k = exp(u) N/m

f (u) = 2 - exp(u) u

p=2N

f (u)

u
Almost all problems have a
zero solution at zero load
Ramping up the load is a
physically reasonable approach

f (u) = 1 - exp(u) u = 0

24/12/2011

Ramping up the non-linearity can also work


Non-linearity

Identify non-linearity
- kNL = exp(u)

f (u) = 2 - exp(u) u = 2 - ku
f (u)

Linearize around chosen u0


- kLIN = exp(u0=0) = 1
f (u) = 2 - 1u
u

f (u) = 2 - {(1-0.5)+(0.5exp(u)}u

Use an intermediate value


- k = (1-)kLIN+kNL
- starts at 0
Use intermediate solution as new u0
Ramp from 0 to 1

f (u) = 2 - exp(u) u

Example - Heat flow through a square


Build this 2D model in Heat Transfer,
Save this model, we will build upon this
1x1m square
Insulated

q = 100 W/m2
Mesh

T=0K

Tinitial=0K

Insulated
k, Thermal conductivity

Solution

24/12/2011

Study the following cases:


k = 1[W/(m*K)]

k = (1+T/200[K])[W/(m*K)]

k = 0.1+exp(-(T/25[K])^2)[W/(m*K)]

k = (0.1+10*(T>25[K]))[W/(m*K)]

Questions:

How many iterations did each case take? Was damping used?
Tini = 0K, Case 1 = 1, case 2 = 5, case 3 = 7, case 4 = 50 (no convergence)
Tini = 50K, Case 1 = 1, case 2 = 5, case 3 = 13, case 4 = 50 (no convergence)

What does the temperature and thermal conductivity solution look like?

Did they all converge? Why not?

Try solving case #2 with an initial temperature of 50[K], how does this
affect the solution? What about the other cases?
Set back to T=0 afterwards

10

24/12/2011

Ramp up the heat load and monitor peak temperature

k =(1-T/200[K])[W/(m*K)]

Tmax

?
T

Qin

Why does this happen?

Multiphysics Problems

11

24/12/2011

FEA formulation in Multiphysics problems

Interpreting multiphysics FEA

Fully-coupled and Segregated Solvers

Suggestions on convergence of multiphysics problems

Consider two simple physics, on the same geometry


Electric currents

Heat Transfer
All other surfaces
insulated

T=0K

k = 1 W/mK

All other surfaces


insulated

V=0V

= 1S/m

V=1V

q=100 W/m2

kT 0
n kT 100
T 0K
T 0

W
m2

in the domain

V 0

in the domain

right boundary

V 1V

right boundary

left boundary

V 0V

left boundary

other boundaries

V 0

other boundaries

fT = KTuT - bT

fV = KVuV - bV

12

24/12/2011

Now, consider a coupled multiphysics problem


Electric currents

Heat Transfer
All other surfaces
insulated

T=0K

All other surfaces


insulated

k = 1 W/mK

V=1V

V=0V
q=100 W/m2
= (1-0.001T) S/m

The temperature solution now affects the


material properties of the electrical problem

fV = KV(uT)uV - bV

fT = KTuT - bT

Consider more couplings between the physics


Electric currents

Heat Transfer
Volumetric resistive
heating due to current

T=0K

All other surfaces


insulated

Q(V)
k = 1 W/mK

(T)

V=0V

V=1V

q=100 W/m2

fT = KTuT - bT(uv)

fT uT
f u
fV uT

fV = KV(uT)uV - bV

fT uV uT bT uV

K uu bu
fV uV uV bV

u i 1 u i Su i K u i u i bu i
1

Same equation
as before

u i 1 u i f u i u f u i
1

13

24/12/2011

Definitions of various types of couplings

One-way coupled

Two-way coupled

Information passes from one physics to the next, in one direction


Information gets passed back and forth between physics

Load coupled
The results from one physics affect only the loading on the other physics

Material coupled
The results from one physics affect the materials properties of other physics

Non-linear coupled

Fully coupled

Weakly coupled

Strongly coupled

The results of one physics affects both that, and other, physics
All of the above
The physics do not strongly affect the loads/properties in other physics
The opposite of weakly coupled

It is possible to solve multiphysics problems in a


segregated sense, solving each physics separately
f uT
f u T
fV uT

fT uV uT bT uV , uT

fV uV uV bV uV , uT

Assume that these are approximately zero and ignore them

initialize uT,i, uV,i


do {
uT,i+1= uT,i+ST(uT,i, uV,i)-1bT(uT,i, uV,i)
uV,i+1= uV,i+SV(uT,i+1, uV,i)-1bV(uT,i+1, uV,i)
i=i+1
}
while ( not_converged )

is damping

14

24/12/2011

Solving in a segregated sense has some advantages


Less memory to store matrices:

f uT
f u T
fV uT

fT uV uT bT

fV uV uV bV

f uT
f u T
0

0 uT bT

fV uV uV bV

The Jacobian is O(2) times smaller in memory


Less memory to solve:

ui 1 ui Sui Kui ui bui


1

uT,i+1= uT,i+ST(uT,i, uV,i)-1bT(uT,i, uV,i)


uV,i+1= uV,i+SV(uT,i+1, uV,i)-1bV(uT,i+1, uV,i)

Jacobian is exactly 2 times smaller in degrees of freedom


The optimal iterative solver can be used for each physics
If the problem is strongly coupled, then the segregated approach
will not work, and a direct solver is often necessary since the
iterative solvers are not tuned for a general Jacobian matrix.

Achieving convergence for multiphysics problems

Set up the coupled problem and try solving it with a direct solver
If it is not converging:

Check initial conditions


Ramp the loads up
Ramp up the non-linear effects
Make sure that the problem is well posed (this can be very difficult!)

If you are running out of memory, or the solution time is very long:
Use the segregated solver and select the optimal solver (direct or iterative) for
each physics, or group of physics, in the problem. FOR 3D, START HERE!
Upgrade hardware
Try the PARDISO out-of-core solver

Perform a mesh refinement study

15

24/12/2011

Try yourself: heat and current flow through a


unit cube
Electric currents

Heat Transfer

TL=0

k=1 W/mK

=1 S/m

VL=0
q=100 W/m2

J=10 A/m2

All other surfaces insulated

All other surfaces insulated

Identical to previous problem

Set up an Inward Current Flow


on the right side

Set up and solve this uncoupled linear problem

Consider the following multi-physics couplings:


Volumetric
Heat Load

Thermal
Conductivity

Electric
Conductivity

Normal
Current

Iterations

Solution
Times (sec)

Linear

10

3.572

Non-linear
uncoupled

1-(T/10000)

1-(V/1000)

10

9.422

One-way load
coupled

Joule
Heating

10

27.846

Two-way load
coupled

Joule
Heating

10+(T/100)

29.703

Fully coupled

Joule
Heating

1-(V/1000)

1-(T/10000)

10+(T/100)

29.469

Thermal problem

Electric problem

16

24/12/2011

Try yourself: Ramp up the applied current,


and monitor peak temperature
Thermal
Conductivity
Case 1

Case 2

Electric
Conductivity

Tmax

exp(-T/600)

exp(-T/600)

Jin

Use the parametric solver


Ramp up inward current density range(0,2,20)
Plot the temperature distribution.
What happens?
Why?

Hands on exercises: Ramp up the applied


voltage, and monitor peak temperature
Thermal
Conductivity
Case 1

Electric
Conductivity
1

Same as before
Case 2

exp(-T/600)

Tmax

exp(-T/600)

Ramp up applied voltage


How high can it go?
Why?

17

24/12/2011

FEM Background

18

You might also like