Nonlinear finite elements/Solution of heat equation

From testwiki
Jump to navigation Jump to search

Finite element solution for the Heat equation

Let us now try to create a finite element approximation for the variational initial boundary value problem for the heat equation . This problem can be stated as

๐–ต๐–บ๐—‹๐—‚๐–บ๐—๐—‚๐—ˆ๐—‡๐–บ๐—…๐–จ๐–ก๐–ต๐–ฏ๐–ฟ๐—ˆ๐—‹๐—๐—๐–พ๐–ง๐–พ๐–บ๐—๐–ค๐—Š๐—Ž๐–บ๐—๐—‚๐—ˆ๐—‡Find a functionT(t)๐’ฎt,t[0,τ]such that for allw๐’ฑΩ(ρCvTt)wdV+Ω(w)(κT)dV=ΩswdVΓqwqdAΩwρCvT(0)dV=ΩwρCvT0dV.

Let ๐’ฑh be a finite dimensional approximation to ๐’ฑ and let ๐’ฎh be a finite dimensional approximation to ๐’ฎ. Let the weighting functions wh๐’ฑh be such that wh=0 on ΓT. Similarly, any other function vh๐’ฑh also goes to zero on the boundary ΓT.

Assume that the trial solutions Th๐’ฎh can be represented as

Th=vh+Thwherevh๐’ฑh.

The additional quantity Th results in the satisfaction of the boundary condition T=T on ΓT.

If we substitute these quantities into the variational initial boundary value problem, we get the Galerkin formulation. The steps in this process are shown below.

Approximate IBVP

The approximate form of the variational IBVP is

Ω(ρCvTht)whdV+Ω(wh)(κTh)dV=ΩswhdVΓqwhqdA.

Replacing Th with (vh+Th) we get

Ω(ρCv(vh+Th)t)whdV+Ω(wh)(κ(vh+Th))dV=ΩswhdVΓqwhqdA.

After expanding and rearranging terms, we get

ΩwhρCvvhtdV+Ω(wh)(κvh)dV=ΩwhsdVΓqwhqdAΩwhρCvThtdVΩ(wh)(κTh)dV.

In compact notation

wh,ρCvvห™h+a(wh,vh)=wh,swh,qΓwh,ρCvTห™ha(wh,Th).

Similarly, the initial condition can be written as

ΩwhρCvTh(0)dV=ΩwhρCvT0dV.

Substituting for Th and expanding out terms, we have

ΩwhρCvvh(0)dV=ΩwhρCvT0dVΩwhρCvTh(0)dV.

In compact form,

wh,ρCvvh(0)=wh,ρCvT0wh,ρCvTh(0).

Therefore the approximate form of the variational BVP can be written as

(40)๐– ๐—‰๐—‰๐—‹๐—ˆ๐—‘๐—‚๐—†๐–บ๐—๐–พ๐–ต๐–บ๐—‹๐—‚๐–บ๐—๐—‚๐—ˆ๐—‡๐–บ๐—…๐–จ๐–ก๐–ต๐–ฏ๐–ฟ๐—ˆ๐—‹๐—๐—๐–พ๐–ง๐–พ๐–บ๐—๐–ค๐—Š๐—Ž๐–บ๐—๐—‚๐—ˆ๐—‡Find a functionTh(t)=vh+Th๐’ฎh,t[0,τ]such that for allwh๐’ฑhΩwhρCvvhtdV+Ω(wh)(κvh)dV=ΩwhsdVΓqwhqdAΩwhρCvThtdVΩ(wh)(κTh)dV.ΩwhρCvvh(0)dV=ΩwhρCvT0dVΩwhρCvTh(0)dV.

Note that the derivatives with respect to time are still continuous in this approximate variational BVP.

Finite element approximation

We now discretize our domain into elements Ωe where 1<e<E and E is the total number of elements. Nodes may exist anywhere within the element domains. But the most common locations are at the element vertices and along the interelement boundaries.

Let the set of global node numbers be

η={1,2,,N}.

Let the set nodes at which a temperature (essential BC) is prescribed be

ηTη.

Then the set of nodes at which a temperature is to be determined is the complement

ηηT.

Let n be the number of nodes in ηηT. Then the number of equations to be solved is also n. See Figure 1 to get an idea about what these sets of nodes refer to.

File:HeatCondProbFEM.png
Figure 1. FEM discretization for the heat conduction problem.

As we have seen before, a typical weighting function wh๐’ฑh is assumed to have the form

(42)wh(๐ฑ)=i=1nbiNi(๐ฑ)iηηTbiNi(๐ฑ).

Note that wh=0 only if bi=0 for every iηηT. On the other hand wh=0 for every node in ηT.

Similarly, a typical trial solution vh๐’ฑh can be written as

(43)vh(๐ฑ,t)=iηηTTi(t)Ni(๐ฑ)

where Ti(t) is the unknown temperature at node i at time t.

We also often represent the approximate form of the essential BCs in a similar way, i.e.,

(44)Th(๐ฑ,t)=iηTTi(t)Ni(๐ฑ),Ti(t)=T(๐ฑi,t).

Substitute equations (42), (43), and (44) into the first of equations (40). You will get

Ω(jbjNj)ρCv(iTitNi)dV+Ω(jbjNj)[iTi(κNi)]dV=Ω(jbjNj)sdVΓq(jbjNj)qdAΩ(jbjNj)ρCv(kTktNk)dVΩ(jbjNj)[kTk(κNk)]dV,i,jηηT,kηT.

Assuming that Ω does not change with time, we can take the constants and time-dependent parameters outside the integrals to get

jbj[iTit(ΩρCvNiNjdV)+iTi(ΩNj(κNi)dV)]=jbj[ΩNjsdVΓqNjqdAkTkt(ΩρCvNjNkdV)kTk(ΩNj(κNk)dV)],i,jηηT,kηT.

Using the usual argument about the arbitrary nature of bj, we get

iTit(ΩρCvNiNjdV)+iTi(ΩNj(κNi)dV)=ΩNjsdVΓqNjqdAkTkt(ΩρCvNjNkdV)kTk(ΩNj(κNk)dV),i,jηηT,kηT.

In compact notation,

iNj,ρCvNiTiห™+ia(Nj,Ni)Ti=Nj,sNj,qΓkNj,ρCvNkTห™kka(Nj,Nk)Tk

where i,jηηT, and kηT.

Let us rename parts of the above equation as follows:

Mij:=Ni,ρCvNjKij:=a(Ni,Nj)fj:=Nj,sNj,qΓkNj,ρCvNkTห™kka(Nj,Nk)Tk.

Then we get

iMjiTiห™+iKjiTi=fj.

In matrix form,

(45)๐Œ๐“ห™+๐Š๐“=๐Ÿ.

As before, we can break up the global matrices into sums over elements. Thus,

๐Œ=e=1E๐Œe๐Š=e=1E๐Še๐Ÿ=e=1E๐Ÿe

where

Mije=ΩeρCvNiNjdV,Kije=ΩeNi(κNj)dVΩe๐iT๐ƒ๐jdV,fje=ΩeNjsdVΓqeNjqdAk=1ne[MjkeTห™kKjkeTk]

and ne is the number of nodes in an element.

We can do the same for the initial conditions. However, a more common approach is to specify the values of ๐“0 directly at the nodes instead of going through an assembly process.

Computing M, K, f

The finite element system of equations at time t:

Mije=ΩeρCvNiNjdV,Kije=ΩeNi(κNj)dVΩe๐iT๐ƒ๐jdV,fje=ΩeNjsdVΓqeNjqdAk=1ne[MjkeTห™kKjkeTk]

Isoparametric Map

File:Isoparametric.png
Isoparametric map.

Coordinate Transformation

x=x1eN1e(ξ,η)+x2eN2e(ξ,η)+x3eN3e(ξ,η)+x4eN4e(ξ,η)y=y1eN1e(ξ,η)+y2eN2e(ξ,η)+y3eN3e(ξ,η)+y4eN4e(ξ,η)

Integrating Stiffness Matrix

Stiffness matrix terms:

Kije=ΩeNi(κNj)dV

Index notation:

Kije=ΩeNi,mκmnNj,ndV

Expanded out (in 2D) (assume κ12=0):

Kije=Ωe(Nixκ11Njy+Nixκ22Njy)dxdy

Transformation

Chain Rule:

Niξ=Nixxξ+NiyyξNiη=Nixxη+Niyyη

Matrix notation:

[NiξNiη]=[xξyξxηyη][NixNiy]=๐‰e[NixNiy]

Inverse Transformation

[NixNiy]=(๐‰e)1[NiξNiη];๐‰*=(๐‰e)1exists ifdet(๐‰e)0.

with

xξ=x1eN1eξ+x2eN2eξ+x3eN3eξ+x4eN4eξyξ=y1eN1eξ+y2eN2eξ+y3eN3eξ+y4eN4eξxη=x1eN1eη+x2eN2eη+x3eN3eη+x4eN4eηyη=y1eN1eη+y2eN2eη+y3eN3eη+y4eN4eη

Returning to the integration of the stiffness matrix terms:

Kije=Ωe(Nixκ11Njy+Nixκ22Njy)dxdy

In parent element coordinates:

Kije=11(κ11(J11*Niξ+J12*Niη)+(J11*Njξ+J12*Njη)+κ22(J21*Niξ+J22*Niη)+(J21*Njξ+J22*Njη))dξdη

Gaussian Quadrature

11Fij(ξ,η)dξdη=I=1MJ=1NFIJ(ξI,ηJ)WIWJ

Gaussian Quadrature Example

Find the constants Co, C1, and X so that the quadrature formula

01f(x)dx=Cof(0)+C1f(x1).

This has the highest possible degree of precision.

Solution.

Since there are three unknowns, Co, C1 and X1, we will expect the formula to be exact for

f(x)=1,x,and x2

Thus

f(x)=1, 01f(x)dx=1=C0+C1  Equation1,f(x)=x, 01f(x)dx=12=C1x1  Equation2.f(x)=x2, 01f(x)dx=13=C1x12.

Equation 2 and 3 will yield.

c1x1c1x12=x1=23.c1=34.c0=14.

Hence

01f(x)dx=14f(0)+34f(23)

Now,

f(x)=x3.01x3dx=14

And

14(0)3+34(23)3=29.

Thus the degree of the precision is 2

Robin boundary conditions

A similar approach can be used when w:Robin boundary conditions are needed to be applied. Let us assume that the Robin boundary conditions take the form

αT+β(T๐ง)=honΓ.

Recall from the previous section that the boundary term in the weak form of the heat equation is

ΓwqdA

where

q=(κT)๐ง..

Let us assume, for simplicity, that the material is isotropic. In that case κ becomes a scalar quantity κ and we can write

q=κ(T๐ง).

Now, we can write the Robin boundary condition as

T๐ง=hβαβTh^α^TonΓ.

Using this expression we can get of the flux term in q to get

q=κ(h^α^T).

Then the boundary term takes the form

ΓwqdA=Γwκ(h^α^T)dA.

If we ignore the contributions to the trial function from the Dirichlet boundary conditions we can write

wh(๐ฑ)=j=1nbjNj(๐ฑ);Th=vh(๐ฑ,t)=i=1nTi(t)Ni(๐ฑ)

Plugging these expressions into the boundary term leads to

jbjΓNjqdA=jbjΓNjκ(h^α^iTiNi)dA=jbj(Γκh^NjdAiTiΓκα^NiNjdA)

Now recall that spatially discretized equation for transient heat conduction can be expressed as (in simplified form; after getting rid of contributions due to Dirichlet boundary conditions and with a scalar κ)

jbj[iTit(ΩρCvNiNjdV)+iκTi(ΩNjNidV)]=jbj[ΩNjsdVΓNjqdA]

Substituting the last term on the right hand side with the new expression for the boundary term, we have

jbj[iTit(ΩρCvNiNjdV)+iκTi(ΩNjNidV)]=jbj[ΩNjsdVκΓh^NjdA+iκTiΓα^NiNjdA]

Invoking the arbitrariness of bj and rearranging, we get

iTit(ΩρCvNiNjdV)+iκTi(ΩNjNidVΓα^NiNjdA)=ΩsNjdVΓκh^NjdA.

Define

Mji:=ΩρCvNjNidVKji:=ΩNjNidVΓα^NjNidAfj:=ΩsNjdVΓκh^NjdA.

Then the finite element system of equations is

iMjiTห™i+iKjiTi=fj.

or, in matrix form

๐Œ๐“ห™+๐Š๐“=๐Ÿ.

Note that the ๐Š matrix and the ๐Ÿ vector are different from the case where there are no Robin boundary conditions. The boundary terms in the discretized system of equations can be computed in the usual manner and will add terms to the diagonal of the ๐Š matrix.

Template:Subpage navbar