Dashing through the snowflake simulation

We coded a dazzling C++ simulation for snowflakes growth. Seriously, look at our figures. Isn't it amazing ???!?

How to grow a crystal in 5 easy steps

The grid is divided in a hexagonal lattice, and in each cell we track the mass of water in solid, liquid and vapour form. The evolution process is composed of five steps:

  1. Diffusion: the vapour diffuses all across the domain;
  2. Freezing: part of the vapour and water at the boundary of the snowflake turns into ice;
  3. Attach: neighbouring microcrystals can either join the snowflake or stay alone (</3) depending on its neighbourhood;
  4. Melt: Part of the ice on the boundary of the snowflake melts into liquid and sublimates into vapour;
  5. Noise: a random component can be added to the model to simulate conditions like wind in clouds (when snowflakes form in clouds).

What it does

We followed the algorithm presented in this article that simulates the growth of snowflakes based on 8 physical parameters. The results can be visualized on a hexagonal lattice and the fractal dimension of the snowflake's boundary can be computed.

How we built it

We used C++ and an object-oriented approach to make a matrix update itself. The data is exported into binary files. We then make figures and animated gifs using Python scripts.

Challenges we ran into

Working with a hexagonal lattice was challenging and it was difficult to make a lot of simulations because it required a lot of computation.

Accomplishments that we're proud of

Finishing the simulation algorithm in only 9 hours. We managed to compute the fractal dimension of the different snowflakes using a box-counting algorithm.

What we learned

We learned mostly about the physics of the snowflakes and we perfected our knowledge in C++.

What's next for Snowflake growth simulation

We could explore more thoroughly the parameters influence on the final product. We couldn't do so because of the lengthy simulations.

Built With

+ 3 more
Share this project:

Updates