The Weak Form of Heat Conduction
This section describes the physics of steady-state heat conduction used in Scikit-Topt. We derive the governing equation, weak formulation, and treatment of Dirichlet, Neumann, and Robin boundary conditions in the finite element method (FEM).
Governing Equation (Strong Form)
Let \(T : \Omega \rightarrow \mathbb{R}\) be the temperature field. The steady-state heat conduction equation without internal heat source is:
where
\(k(\mathbf{x})\) is the thermal conductivity
\(T\) is the unknown temperature
Here, the thermal conductivity \(k(\mathbf{x})\) is treated as a scalar (isotropic conductivity). Anisotropic or tensor-valued conductivity is not considered in the current implementation.
Boundary Conditions
We consider three types of thermal boundary conditions:
Dirichlet (Temperature BC) Prescribed temperature:
\[T = T_0 \quad \text{on } \Gamma_D.\]Neumann (Heat Flux BC) Prescribed heat flux \(q\):
\[-k \nabla T \cdot \mathbf{n} = q \quad \text{on } \Gamma_N.\]Robin (Convective BC) Newton’s cooling law:
\[-k \nabla T \cdot \mathbf{n} = h(T - T_\infty) \quad \text{on } \Gamma_R,\]where
\(h\) : heat transfer coefficient
\(T_\infty\) : ambient temperature
This boundary condition models cooling by air or fluid.
Weak Formulation
Let \(v\) be a test function. Multiply the strong form by \(v\) and integrate over \(\Omega\):
Using the divergence theorem:
We now insert boundary conditions.
Dirichlet BC
For \(\Gamma_D\), the temperature is prescribed. As usual in FEM, this is enforced through modification of the linear system after assembling the matrix (see below).
Neumann BC
On \(\Gamma_N\):
Substituting into the boundary integral:
Robin BC
Robin BC provides an additional contribution:
Plug into the boundary integral:
This term splits into:
As a result:
The first part contributes to the matrix (Robin = “boundary stiffness”)
\[K_{ij}^{(R)} = \int_{\Gamma_R} h \phi_i \phi_j \, d\Gamma.\]The second part contributes to the load vector
\[f_i^{(R)} = \int_{\Gamma_R} h T_\infty \phi_i \, d\Gamma.\]
FEM Discretization
Expand the temperature field as:
The weak form becomes:
where
stiffness matrix
\[K_{ij} = \int_\Omega k \nabla\phi_j \cdot \nabla\phi_i \, d\Omega + \int_{\Gamma_R} h \phi_j \phi_i \, d\Gamma.\]load vector
\[f_i = \int_{\Gamma_N} q \phi_i \, d\Gamma + \int_{\Gamma_R} h T_\infty \phi_i \, d\Gamma.\]
Dirichlet Boundary Enforcement
Dirichlet temperature BCs (prescribed \(T=T_0\)) are applied by modifying the linear system:
Zero out rows of fixed DOFs
Set diag = 1
Set load entry = prescribed value
In Scikit-FEM (as used by Scikit-Topt):
Solving the Linear System
The final assembled system is:
In Scikit-Topt, the solver is typically:
T = scipy.sparse.linalg.spsolve(K_e, f_e)