Finite Element Method
1 Weak Form of the Heat Equation
Strong form:
[ c_p = (kT) ]
Multiply by a test function (v), integrate over (), and integrate by parts:
[ c_p v,d + kTv,d = _{q}q’’v,d - {h}h(T-T)v,d ]
For a Robin boundary:
[ -kTn=h(T-T_) ]
the weak contribution is:
[ _{h}hTv,d = {h}hTv,d ]
2 Backward Euler Time Discretization
[ c_p v,d + kT^{n+1}v,d + _{_h} hT^{n+1}v,d = ]
[ c_p v,d + {h} hTv,d + _{_q} q’’v,d ]
3 Gridap.jl Skeleton
using Gridap
domain = (0.0, 1.0, 0.0, 1.0)
partition = (40, 40)
model = CartesianDiscreteModel(domain, partition)
order = 1
reffe = ReferenceFE(lagrangian, Float64, order)
V = TestFESpace(model, reffe; conformity=:H1)
U = TrialFESpace(V)
Ω = Triangulation(model)
dΩ = Measure(Ω, 2)
k = 1.0
a(T,v) = ∫(k*∇(T)⋅∇(v))dΩ
l(v) = 0
op = AffineFEOperator(a, l, U, V)
T = solve(op)4 When to Use FEM
FEM is especially useful for:
- complex geometries,
- multi-material heat conduction,
- weak-form boundary conditions,
- structural thermal analysis,
- coupled thermomechanical problems.