Entries for December 7, 2017
-
Time-Dependent Finite Elements
Time dependent problems are commonplace in physics, chemistry and many other disciplines. In this post, I’ll introduce the FE formulation of linear time-dependent problems and derive formulas for explicit and implicit Euler integration.
The weak formulation of a first order time-dependent problem reads:
Find u∈V such that
m(u˙,v;t)+a(u,v;t)=b(v;t)(1)for all v∈V and t∈[0,∞).
We can convert (1) into a system of equations
M(t)u˙+A(t)u=b(t)(2)where the components of the matrices and vectors involved are calculated as
MIJ(t)AIJ(t)bI(t)=m(NJ,NI;t)=a(NJ,NI;t)=b(NI;t).(3)If we further discretize in time with the finite difference u˙≈[un+1−un]/Δt, linearity allows us to write
m(u˙,v;t)≈Δt1[m(un+1,v;tn+1)−m(un,v;tn)](4)This reflects on the system as
M(t)u˙≈Δt1[Mn+1un+1−Mnun](5)Here, un+1:=u(x,tn+1), Mn+1=M(tn+1) and vice versa for un and Mn.
Explicit Euler Scheme
For the explicit Euler scheme, we substitute evaluate the remaining terms at tn
Δt1[m(un+1,v;tn+1)−m(un,v;tn)]+a(un,v;tn)=b(v;tn)∀v∈V.(6)The corresponding system is
Δt1[Mn+1un+1−Mnun]+Anun=bn(7)The update equation becomes
un+1=Mn+1−1[Mnun+Δt(bn−Anun)](8)If m is time-independent, that is m(u˙,v;t)=m(u˙,v), we have
un+1=un+ΔtM−1(bn−Anun)(9)Implicit Euler Scheme
For the implicit Euler scheme, we substitute evaluate the remaining terms at tn+1
Δt1[m(un+1,v;tn+1)−m(un,v;tn)]+a(un,v;tn+1)=b(v;tn+1)∀v∈V.(10)The corresponding system is
Δt1[Mn+1un+1−Mnun]+An+1un+1=bn+1(11)The update equation becomes
un+1=[Mn+1+ΔtAn+1]−1[Mnun+Δtbn+1](12)If m is time-independent, one can just substitute M=Mn+1=Mn.
Example: Reaction-Advection-Diffusion Equation
The IBVP of a linear reaction-advection-diffusion problem reads
∂t∂uuu=∇⋅(D∇u)−∇⋅(cu)+ru+f=uˉ=u0inoninΩ×I∂Ω×IΩ,t=0(13)where t∈I=[0,∞),
- D is a second-order tensor describing the diffusivity of u,
- c is a vector describing the velocity of advection,
- r is a scalar describing the rate of reaction,
- and f is a source term for u.
The weak formulation is then
Find u∈V such that
∫Ωu˙vdv=∫Ω[∇⋅(D∇u)−∇⋅(cu)+ru+f]vdv(14)for all v∈V and t∈I.
We have the following integration by parts relationships:
∫Ω∇⋅(D∇u)vdv=∫Ω∇⋅(vD∇u)dv−∫Ω(D∇u)⋅∇vdvfor the diffusive part and
∫Ω∇⋅(cu)vdv=∫Ω∇⋅(cuv)dv−∫Ωuc⋅∇vdv(15)for the advective part. The canceled terms are due to divergence theorem and the fact that v=0 on the boundary. Then our variational formulation is of the form (1) where
m(u˙,v)a(u,v)b(v)=∫Ωu˙vdv=∫Ω(D∇u)⋅∇vdv−∫Ωuc⋅∇vdv−∫Ωruvdv=∫ΩfvdvFrom these forms, we obtain the following system matrices and vector
MIJAIJbI=∫ΩNJNIdv=∫Ω(DBJ)⋅BIdv−∫ΩNJc⋅BIdv−∫ΩrNJNIdv=∫ΩfNIdvwhere M is constant through time.