Implement a particle generator with which we can initialize the simulation.
The generator should create a cuboid, where the molecules are arranged in a
3d rectangular grid.
The cuboid is being described by the following parameters:
– The coordinate of the lower left front-side corner.
– Number of particles per dimension: N1 × N2 × N3.
– Distance h of the particles (mesh width of the grid).
– Mass m of one particle.
– Initial velocity v of the particles (3 Components).
– The mean-value of the velocity of the Brownian Motion. For now it is
sufficient if you hard-code it in the code.
The movement of the molecules should be initialized by Brownian Motion. Use
the code from MaxwellBoltzmannDistribution.h to add the thermal friction!
The Brownian motion is only applied once at the beginning of the simulation,
not at every time step.
Specify the parameters via the command line, or read them from a file. It has
to be possible to add several cuboids! Moreover, it should be still possible to
use a file for input.
The interaction between two molecules i and j can be described with the help
of the Lennard-Jones potential.
-Implement a new method for force calculation, which computes the Lennard-
Jones force between two molecules! For the moment it’s ok if you hard-code
the Lennard-Jones parameters ϵ and σ.
• If not already done, change the traversal of the particle pairs in such a way
that the method for calculating the force is only called once for every pair and
that the force for each pair is not evaluated twice, making use of Newton’s
third law. Does this speed-up your simulation?
• Now perform the 2D simulation of the collision of two bodies with the param-
eters listed below.
• If not stated otherwise, this and all following simulations use only the Lennard-
Jones potential!
• How long did it take to run your simulation and what was the hardware you
used?
Note: For run time measurements disable all IO within the measured part of
the code!
⇒ No log messages.
⇒ No vtk files.
Implement a particle generator with which we can initialize the simulation. The generator should create a cuboid, where the molecules are arranged in a 3d rectangular grid.
The cuboid is being described by the following parameters: – The coordinate of the lower left front-side corner. – Number of particles per dimension: N1 × N2 × N3. – Distance h of the particles (mesh width of the grid). – Mass m of one particle. – Initial velocity v of the particles (3 Components). – The mean-value of the velocity of the Brownian Motion. For now it is sufficient if you hard-code it in the code.
The movement of the molecules should be initialized by Brownian Motion. Use the code from MaxwellBoltzmannDistribution.h to add the thermal friction!
The Brownian motion is only applied once at the beginning of the simulation, not at every time step.
Specify the parameters via the command line, or read them from a file. It has to be possible to add several cuboids! Moreover, it should be still possible to use a file for input.
-Implement a new method for force calculation, which computes the Lennard- Jones force between two molecules! For the moment it’s ok if you hard-code the Lennard-Jones parameters ϵ and σ.
• If not already done, change the traversal of the particle pairs in such a way that the method for calculating the force is only called once for every pair and that the force for each pair is not evaluated twice, making use of Newton’s third law. Does this speed-up your simulation?
• Now perform the 2D simulation of the collision of two bodies with the param- eters listed below.
x1 = {0, 0, 0} x2 = {15, 15, 0} v1 = {0, 0, 0} v2 = {0, −10, 0} N1 = {40, 8, 1} N2 = {8, 8, 1} h = 21/6 · σ ≈ 1.1225 ϵ = 5 σ = 1 m = 1 ∆t = 0.0002 tend = 5 Brownian Motion average velocity: 0.1
• If not stated otherwise, this and all following simulations use only the Lennard- Jones potential! • How long did it take to run your simulation and what was the hardware you used?
Note: For run time measurements disable all IO within the measured part of the code! ⇒ No log messages. ⇒ No vtk files.