Skip to content
The Falling Particles Simulator (FPS) is a program to visualize the evolution in time of the rigid spherical particles fall.
C C++ Makefile
Branch: master
Clone or download

README.md

Falling Particle Simulator (FPS)

Description

The Falling Particles Simulator (FPS) is a program to visualize the evolution in time of the rigid spherical particles fall. We suppose that these particles are subject to gravity and other forces which we will detail in the file Particles.md.

The falling particles simulator considers as many particles as the user has decided to. If the user enters a large number of particles, the more he will enter data. Therefore, I suggest beginning with two particles.

Supported platforms

  • Linux

How to use

The FPS runs on Linux. Before using the FPS, make sure you have Gnuplot on your Linux distribution.

Makefile

Open the terminal and type the command lines:
make particles_simulator
./particles_simulator

To plot the evolution in time of the falling rigid spherical particles, you need to run gnuplot and load the particles positions.

Command lines for gnuplot:
gnuplot
load 'positions.plt'

Overview

In the FPS, we distinguish two properties:

  • The simulation properties
  • The particle properties

The simulation properties are:

  • The number of particles
  • The total simulation time
  • The time step of the simulation

The particle properties are:

  • The radius of the particle
  • The mass of the particle
  • The coefficient of restitution to the impact
  • The friction coefficient
  • Its initial position
  • Its initial speed

Once the PFS has all the data, it will calculate all positions in the x, y and z axes of the particles over time. All the x, y and z positions of each particle are stored in the .data files and some commands for gnuplot are generated in the file 'positions.plt' that will be created automatically.

Then the user type in the terminal, the command "gnuplot" to call gnuplot, then load the file positions.plt by typing: load 'positions.plt'

The user can see the trajectory of each particle in space (see below).

Particles

Example

We set the following parameters for two particles, see the tables below:

Parameter name Data
Number of particles 2
Total simulation 50
Time step 0.01
Parameter name Particle 1 Particle 2
Radius 0.05 0.08
Mass 1 0.5
Coefficient of restitution 0.4 0.2
Friction coefficient 0.4 0.8
Initial position x 4 5
Initial position y 4 5
Initial position z 4 5
Initial velocity Vx 1 2
Initial velocity Vy 1 2
Initial velocity Vz 1 2

See FPS Equations

In the terminal:

************ Welcome to the Falling Particle Simulator *************

Enter the number of particles: 2
Enter the total simulation time: 50
Enter the time step of the simulation: 0.01

Enter the radius of the particle 1: 0.05
Enter the mass of the particle 1: 1
Enter the coefficient of restitution of the impact of the particle 1: 0.4
Enter the friction coefficient of the particle 1: 0.4

Enter the radius of the particle 2: 0.08
Enter the mass of the particle 2: 0.5
Enter the coefficient of restitution of the impact of the particle 2: 0.2
Enter the friction coefficient of the particle 2: 0.8

Enter the initial position x of the particle 1: 4
Enter the initial position y of the particle 1: 4
Enter the initial position z of the particle 1: 4

Enter the initial velocity Vx of the particle 1: 1
Enter the initial velocity Vy of the particle is 1: 1
Enter the initial velocity Vz of the particle 1: 1

Enter the initial position x of the particle 2: 5
Enter the initial position y of the particle 2: 5
Enter the initial position z of the particle 2: 5

Enter the initial velocity Vx of the particle 2: 2
Enter the initial velocity Vy of the particle 2: 2
Enter the initial velocity Vz of the particle 2: 2

End of calculating positions, please call gnuplot and typing load 'positions.plt' to display the trajectory of each particle

And we get the plot of the particles falls as shown below:

FallParticles

Author

Nicolas Chen

License

MIT License

Copyright (c) 2018 Nicolas Chen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You can’t perform that action at this time.