Skip to content

Learning project: Very simple molecular dynamics simulator written in Rust.

License

Notifications You must be signed in to change notification settings

progDes007/m_sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

m_sim - particle simulator

Introduction

This is a pet project where I'm learning Rust and playing with particle simulation. It supports defining of simple scene through YAML file. This toy simulator doesn't serve any specific goal rather than some learning.

Features

  1. Ellastic collision between particles and wall
  2. Walls have temperature and can be used to heat or cool down particles
  3. Simulation chamber can have arbitrary shape formed by walls.
  4. Gravity
  5. Simulation is generated in background thread.
  6. Basic playback controls.

Usage

Execute m_runner. Specify the path to YAML file as argument. Windows example: m_runner.exe scenes/brownian.yaml

Emergent Phenomena

Some emergent physical phenmomena can be observed using this simulation.

Brownian motion. Macro particles wiggle randomly due to collisions with micro particles. Brownian motion screenshot

Density gradient. Gravity increases density of th gas at the bottom. Density gradient screenshot

Convection and heating. Heating and cooling particles by walls create convection current. Convection screenshot

Diffusion. Two substances/gases diffuse into each other as time progresses. Diffusion screenshot

Future Improvements

Use spatial index to accelerate the collision detection. Currently the O(n^2) nature of algorithm makes large simulation impractical.

About

Learning project: Very simple molecular dynamics simulator written in Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages