This is extremely cool! Amazing work @flockaroo
The implementation very different from other fluid simulations I've seen, copying the comments from the source:
// single pass CFD - with some self consistency fixes
// ...the actual fluid simulation
// this is some "computational flockarooid dynamics" ;)
// the self-advection is done purely rotational on all scales.
// therefore i dont need any divergence-free velocity field.
// with stochastic sampling i get the proper "mean values" of rotations
// over time for higher order scales.
//
// try changing "RotNum" for different accuracies of rotation calculation
// for even RotNum uncomment the line #define SUPPORT_EVEN_ROTNUM