ps: here is the description in pseudo code (4 lines near bottom) http://pascal.sources.ru/demo/otfire.htm
tl;dr: it's a very approximative diffusion process.