Skip to content

Molecular diffusion simulation utilizing segment trees for fast queries

Notifications You must be signed in to change notification settings

Theod0reWu/DiffusionSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DiffusionSim

Diffusion Simulation using particle dynamics
Includes discretized simulations following ficks law, brownian motion modeled by random walks (wierner process) and step-based simulations of elastic collisions. The graph below shows the concentrations of a disretized simulation in a 1-D line. The concentrations should become uniform over time. image
The gif below shows the same simulation but with the wierner process: test
The gif below show the simulation done for elastic particle collisions test_particle

Data Generation

Generate data using the datagen.py file:

python datagen.py <wierner/collision> <width> <height> <num particles> <timesteps> <dt> <output path>

- weiner will use the wierner process to generate data (faster), collision will use elastic collusions (slower)
- width and height are the dimensions of the simulation
- num particles will place that many particles uniformly into the simulation space (for the collision simulation the velocity is chosen randomly from [0,1]).
- timesteps is how many timesteps to simulate
- dt is the amount of time that will elapse for each timestep

Simulation Results Query

Running the analysis tool

The analysis tool allows users to query the simulation data within a specified bounding box. Users can specify timestep ranges of interest, including the interpolated position of particles within fractional timesteps.

python query_simulation.py python <input filename> <left> <right> <top> <bottom> <start time> <end time>

Libraries

  • numpy
  • scipy
  • matplotlib

About

Molecular diffusion simulation utilizing segment trees for fast queries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages