Skip to content

A simple implementation of advection (without a diffusion term) in a randomly generated 2-dimensional carrier field.

Notifications You must be signed in to change notification settings

Michal-Szczygiel/fluid_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About the project:

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.

Jump start:

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):

'config.json'

{
    "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

Simulation result:

Simulation progress bar:

A movie composed from successive frames generated by the program:

fluid_simulation.mp4

About

A simple implementation of advection (without a diffusion term) in a randomly generated 2-dimensional carrier field.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages