A brief history

The first mission was to create a tool which helps us to check adequacy of a fluid simulation using set of well-known problems. Then, the idea to publish the tool came to the mind.

For educational purposes, the application allows you to change the fluid viscosity and draw tracers (line which follows fluid velocity). The viscosity influences appearing of vortexes, which give interesting picture of experiment.

Today tablets and smartphones have multi-core processors and enough power for mathematical simulation. Multi-threading (Kotlin coroutines) helps me to run multiple experiments at the same time. While you see visualization of one experiment, the others continue to run in the background. The challenge was to independently run calculation and visualization, so user can, for example, change point of view without waiting for computation results. Finally, there are 3 threads at least in program: the main is for user interface, the second is for OpenGL rendering and the third is for a calculation (new threads are added as user starts experiments).

Getting color for each pixel 60 frames per second is processor-consuming task. That`s why the colorization of calculated fluid properties (velocity, pressure and others) has been moved from CPU rendering thread to GPU shader. Even 5-year old devices have a good GPUs, which complete that task much faster than CPU. Eventually, the frame rate on my old API 19 device (Android 4.4) has been increased from 5-13 fps to 60-200 fps ("Vortex street" experiment). Firstly, the program copies a whole array of calculated numbers to the GPU using FloatBuffer.put(array). Then the GPU uses that array to colorize vertexes converting from HSV to RGB color space.

Taken screenshots

Where we are today

What has your team accomplished? What are you most proud of? Tell site viewers some of your project's latest accomplishments.

Recording GIF animation
Full-screen mode
Streamlines