Simulationg of heat transferring in a solid body

I want to simulate basic thermodynamic.
I already have most functions that work in the same way as in real life.
But I now stuck with creation of ‘proper’ model which should handle whole process of heat transferring in volume of a body.

I already have working model which works using cellular automates model. I.e. I divide whole body on blocks, each block have its own specific heat capacity, if temperature of neighbors blocks are lower than self temperature calculate amount of energy current block should transfer, otherwise do nothing.
But such approach have problems specific to concept of cellular automates. Like discreteness of a process of heat transferring, energy losses on some edge cases, etc
Of course it possible to add safeguard for all such situations. But that wont fix the core of an issue, which is a bad model.

So, maybe someone here tried to simulate same thing and can help me to make it work ‘right’?

I have made a thermodyanmic simulation in UE4, it’s not simple though.

You want to implement the Gauss-Weierstrass transform, as it is a solution of the heat diffusion equation.

It boils down to taking a gaussian kernel, and implementing a separated 3D gaussian blur on your cells. You can actually rely on a property of these transforms: the square root of the sigmas in your kernels are additive. As in, you can repeatedly do a gaussian blur on the heat distribution and the result remains guassian, just as if it was blurred in one go with a bigger sigma.

For the boundaries, I had great results in stretching the borders’s temperature. The border cells sees a virtual neighbor that has the same temperature as itself, so it’s not diffusing any heat to it. It’s the least worse you can do. Boundary conditions are an issue for all simulations.