Description

KineticGas is a simulation of the kinetic model of a gas in a constant gravity field. The particles are modeled spherical and can collide with the walls as well as with each other in 3D space. The simulation results in the Maxwell-Boltzmann distribution. Also mixtures of several gases with different properties or temperature gradients can be simulated.
KineticGas has been developed on the base of PhysX3D, so only the physics part had to be rewritten. This demonstrates the capability of PhysX3D and the GraphicsEngine as one framework for physical simulations.

Collision Detection Algorithm

The collisions in this simulation are calculated continuous, meaning if a collision is detected as two spherical particles overlapping in a discrete time step, the exact time of collision is being calculated, so the elastic collision is performed with no error (except for round-off error). Also the loss of kinetic energy per collision can be adjusted.
The same algorithm is being used for detecting collisions between particles and the walls of the cube.

Performance

Currently KineticGas can simuate 15k particles in real time on a common notebook GPU (Nvidia GeForce GTX 960M (1.54Tflops, 640 shader units @1.201GHz)). There is still plenty of space for further optimisation.

Demo