This project is a simple implementation of the advection model (without a diffusion term) in a randomly generated 2-dimensional carrier vector field. A simple but quite stable Upwind scheme was used to integrate the equation. The carrier vector field was generated by determining the rotation from a 2-dimensional scalar field which was an image of Super Simplex noise. Details of the method can be found in this publication.
The 'bin' directory contains precompiled programs (for Windows x86-64 and Linux x86-64 architectures). The program uses .json configuration files, to perform a complete invocation of the sample simulation use: './fluid_simulation config.json'. The included 'config.json' configuration file contains the following keys (all keys are required):
{
"mass_distr_file_path": "mass_distr/mass.bmp",
"output_directory_path": "frames",
"frames_number": 1000,
"simulation_factor": 8,
"target_resolution": 1080,
"flow_field_scale": 300.0,
"dynamize_flow_field": true,
"randomize_flow_field": true
}
- mass_distr_file_path - path to the graphic file with the initial mass distribution (popular graphic formats such as .bmp, .png, .jpeg ... are supported),
- output_directory_path - path to the folder for the result files (simulation frames will be saved in .png format),
- frames_number - number of frames generated,
- simulation_factor - simulation speed multiplier,
- target_resolution - target resolution of generated frames (supported resolutions: 480, 720, 1080, 1440, 2160),
- flow_field_scale - scaling of the vector field (to obtain a "dense" vector field (with a large number of small vortices), reduce this parameter),
- dynamize_flow_field - randomization of the vector field during simulation (simulation might be quite slow in this mode),
- randomize_flow_field - randomization of the initial state of the vector field