I thought up of a nice way to simulate heat conductivity in parallel with other drag/heating physics calculations (and in parallel with X-Plane). So I went and did it. It sped up execution quite a lot!
The primary idea: heat flux is computed in the main thread. It is asynchronously read by the heat conduction thread, and the heat flux is accounted for when calculating the equations of heat conduction.
It’s a slightly complex piece of software, but while main thread runs at simulator FPS the heating thread will run at constant 30 FPS (or less, but not less than 10 FPS) in parallel, doing all the calculations. Each heating simulation frame the thread copies temperature data back to main thread (asynchronously).

The conduction is done between two faces, and two layers in each face. These layers and their temperature data correspond to the model shown on the picture.
There are two subroutines:
- Conduction calculation once for every pair of two triangles which are connected by heat conduction (right now that only includes triangles which share vertices)
- Conduction calculation between layers on every triangle
There are two big ideas here. First of all, the common 1D fourier law (heat conduction equation) is used to compute heat flow between layers and between triangles:

In the later equations
is the way to refer to triangle
, layer
.
Flow between two layers of two triangles (between hull of triangle 1 and 2, between TPS of triangle 1 and 2) is computed:
(distance between two triangles)
(estimated triangle edge length)
(distance across first triangle)
(distance across second triangle)
(effective heat conductivity coefficient)
(heat conducted via hull)
The hull is assumed to be 1 meter thick, and conduction is done over the triangle edge. The edge is approximated by taking triangle as an equilateral triangle – this works well for “good” heating mesh.
For flow between thermal protection system layer (all variables not mentioned are same as for the hull layer):
(effective heat conductivity coefficient)
(heat conducted via TPS)
These two heat changes are used to compute total change of heat in two layers due to conduction between two triangles:




But this will probably explode/cause unstable simulations at high deltatime! There is one more step here, which makes sure it will not explode under any conditions.
The idea is very very simple. I’m sure it’s been discussed before elsewhere, but it goes like this: the maximum change of heat is limited by difference in temperatures – it is not possible to transfer heat from colder to hotter object. This seems obvious, but here’s the maximum delta heat computed from this rule:




The 0.5 factor means that the most heat that can be transferred between two triangles is only enough to put them in thermal equality. Also the smallest limit out of all these four is found, and is used to clamp all values of heat. It is important that in all conductive transfer at this step there will be no more heat transferred than the smallest of these variables!
Change in temperature is computed at this step as:

The second idea: compute heat conduction between layers of a single face. It’s important to do this independently of heat conduction between triangles – this makes simulation much more stable as amount of heat that conducts between layers is usually much different from amount conducted between triangles.
Due to where temperature variables are measured, the equations here are very simple (this is for a single triangle):



This might look a bit confusing – if someone wishes to implement a similar simulation, here’s the (latest as of writing this post) source code:
http://dev.wireos.com/hg/x-space/file/source/dragheat.c (line 762)
Free free to contact me and I’ll try to help you.
Recent comments