You are on page 1of 3

2 VARIATIONAL FORMULATION

LW 5 2015-2016
Master Maths K M University

Lab Work 5 : Heat equation

1 Heat equation
Suppose we have a solid body occupying a region Ω ⊂ R2 . The temperature distribution
in the body can be given by a function u : Ω × [0, T ] → R where [0, T ] is an interval of
time and u(x, t) is the temperature at a point x = (x1 , x2 ) and at time t.
Let us denote the heat entering from external sources by f (x, t) and λ to the conductivity
constant of the material. If the material is homogeneous (the same everywhere) and not
changing with time. The the heat equation reads :
c ∂u f
= ∆u + (1)
λ ∂t λ
where c is positive constant depends on the density of the material. Since c and λ are
constants and the equation simplifies to
∂u
− ∆u = f. (2)
∂t
To determine the steady state temperature distribution in a body we need to know not
only the sources and sinks within the body (given by f ), but also what is happening at
the boundary and at the initial time, say, t0 = 0. For example a common situation is that
the boundary is held at a given temperature u0 , then the boundary value problem takes
the form :
∂u(x, t)

 ∂t − ∆u(x, t) = f (x, t), (x, t) ∈ Ω×]0, T [.


u(x, t) = 0 x ∈ ∂Ω×]0, T [ (3)


u(x, 0) = u0 , x ∈ Ω

2 Variational formulation



 Find u ∈ L2 (0, T, H01 (Ω)) ∩ C 0 (0, T, L2 (Ω)) such that
 Z Z
 d
uvdx + ∇u · ∇vdx = hf, vi , ∀v ∈ Ω. (4)

 dt Ω Ω

u(x, 0) = u0 .

page: 1/ ??
3 SOME SCHEMES

Theorem 2.1 (Raviart-Thomas p. 162) Assume that f ∈ L2 (Ω×]0, T [) and u0 ∈ L2 (Ω).


Then the boundary values problem (??) has a unique solution. Moreover, this solution
satisfies
(
kukC 0 ([0,T ],L2 (Ω)) ≤ C (ku0 kL2 (Ω) + kf kL2 (Ω×]0,T [) )
(5)
kukL2 (]0,T [,H01 (Ω)) ≤ C (ku0 kL2 (Ω) + kf kL2 (Ω×]0,T [) )

3 Some schemes
3.1 Explicite Euler’s scheme

∂u un+1
j − unj
(xj , tn ) ≈ (6)
∂t ∆t

3.2 Implicite Euler’s scheme

∂u unj − ujn−1
(xj , tn ) ≈ (7)
∂t ∆t
So the iteration will be as follows :

ä Give un−1
ä We compute un by the following formula :
Z  n
u − un−1
 Z Z
n
vdx + ∇u · ∇vdx = f vdx (8)
Ω ∆t Ω Ω

which is equivalent to
Z Z Z Z
u vdx + ∆t ∇u · ∇vdx = ∆t f vdx + un−1 vdx
n n
(9)
ω ω Ω Ω

ä We do a loop on time.
mesh Sh ;
f e s p a c e Vh( Sh , P1 ) ;
Vh u , v , f , u0 ;
f u n c s o u r c e =;
f u n c i n i d a t a =;
f= s o u r c e ;
u0=i n i d a t a ;
r e a l dt =;
problem Heat ( u , v ) = i n t 2 d ( Sh ) ( dt ∗mu∗ ( dx ( u ) ∗ dx ( v)+dy ( u ) ∗ dy ( v ) ) + u∗v )
−i n t 2 d ( Sh ) ( dt ∗ f ∗v+u0∗v )
+on ( 1 , u =0);
f o r ( i n t i t e r =1; i t e r < 1 0 ; i t e r ++)
{
Heat ;
u0=u ;
p l o t ( Sh , u , f i l l =1, w a i t =1, v a l u e=t r u e ) ;
}

page: 2/ ??
3.2 Implicite Euler’s scheme 3 SOME SCHEMES

Exercise 1 For the example presented in Figure ??, we suppose that


ä the initial data u0 = 0.
ä The source is set to
(
10 if (x − 2.5)2 + (y − 2.5)2 ≤ 0.25
f (t, x, y) = (10)
0 if not

1. Compute (numerically) the temperature at point (3,1) for all times.


2. At time t = 1s compute the temperature at the points (2,1) (4,1) and (8,1).

x = 10 − 8 sin(t); y = 5 − 2 cos(t); 0 ≤ t ≤ π/2

(x − 2.5)2 + (y − 2.5)2 = 0.25

Figure 1 – The domain Ω

Exercise 2 We want to solve the following heat equation in Ω =]0, 6[×]0, 1[

∂u(x, t)
− div (a(x)∇u(x, t)) = 0, (x, t) ∈ Ω×]0, 5[. (11)
∂t
∂u
a(x) + 0.25(u − 25) = 0, x ∈ ΓN ×]0, 5[ (12)
∂n
u(x, 0) = u0 , x ∈ Ω ∪ ΓD (13)

where, u0 = 10 + 15x1 , ΓD = {x1 = 0 and x1 = 6} and the function a(x) is given by


(
2 if x2 < 0.5
a(x) = (14)
0.2 if x2 ≥ 0.5

1. Compute (numerically) the temperature at point (3,0.5) for all times.


2. Show that this temperature decays when t ∈ [0, 5].

page: 3/ ??

You might also like