On my site, I host data on particle motion, including the motion of molecules in gases and liquids, as well as the motion of Lagrangian particles in turbulence. Most of these systems, like turbulence, exhibit intrinsically smooth time dynamics and can be simulated using conventional time-stepping algorithms such as direct numerical simulation (DNS). However, I also host data on the dynamics of hard-sphere fluids — statistical systems with intrinsically discrete, collision-based dynamics modeled using event-driven algorithms.
The data for hard-sphere systems is obtained using the DynamO particle simulator. DynamO outputs data in XML format and is designed to provide processed data. I, on the other hand, offer raw trajectory data for users to process themselves. I consider HDF5 to be a more convenient format for this purpose. Below, I describe how I store DynamO output in HDF5, along with the parameters used to run the simulations.
At equilibrium, the monodisperse hard-sphere fluid is described by only two dimensionless parameters: the number of particles and the reduced number density , where is the diameter of a hard sphere and is the system volume. We are interested in the thermodynamic limit and run simulations with periodic boundary conditions for a relatively large number of particles , so that becomes the only relevant thermodynamic parameter.
However, to actually run the simulation, in addition to , we need to specify time and length scales: the simulation duration and the size of the domain (which corresponds to ). Both need to be large enough to capture temporal and spatial decorrelation of particle velocities. Because I am primarily interested in the gas-like rather than the liquid-like state of the hard-sphere fluid, all computations below apply to a sufficiently dilute gas.
First, we estimate the simulation duration sufficient to capture decorrelation of the particle velocity . We run each simulation for , where is the velocity autocorrelation time:
Via a Green–Kubo relation, is directly related to the self-diffusion coefficient ; in reduced units, :
For a dilute hard-sphere gas:
Hence, we choose the simulation time in reduced units to be
To determine the system size, we set half the length of the simulation box, , equal to , where is the speed of sound:
With this, we can estimate the number of particles required:
The goal is to be able to accurately simulate systems with as low as . This corresponds to . We use a fixed value of
for all systems with . This value is close to our estimate and is consistent with how DynamO assigns in simulations.
The DynamO simulation proceeds in three main steps:
Create an initial configuration file.
Equilibrate the system by running it for , to obtain an equilibrated state.
Simulate the system from the equilibrated state for another . During this step DynamO also computes various statistical quantities.
I describe the three steps using a system at .
First, I create an initial configuration file named 0.1_173_config.start.xml
, where 0.1
reflects the reduced density value, and 173
corresponds to the way DynamO specifies the number of particles.
Initially, the particles are packed into a grid of face-centered cubic (FCC) unit cells (4 particles per cell), with the unit cells arranged in a cubic grid of side length 173
. This results in a total of particles.
The initial configuration file is created with the command:
dynamod --pack-mode 0 \
--NCells 173 \
--density 0.1 \
--i1 0 \
--out-config-file 0.1_173_config.start.xml
Once the initial configuration file was created, we equilibrated the system. For the chosen density, , we have . Thus, the DynamO command used for equilibration is:
dynarun --config-file 0.1_173_config.start.xml \
--sim-end-time 10.6 \
--out-data-file 0.1_173_output.xml.bz2 \
--out-config-file 0.1_173_config.equilibrated.xml
Now we use the equilibrated state to launch the main simulation, still for . We also want to collect all kinds of data
dynarun --config-file 0.1_173_config.equilibrated.xml \
--sim-end-time 10.6 \
--load-plugin Trajectory \
--unwrapped \
--out-data-file 0.1_173_output.xml.bz2 \
--out-config-file 0.1_173_config.end.xml
dynarun --config-file 0.1_32_config.equilibrated.xml \
--sim-end-time 10.6 \
--load-plugin Trajectory \
--unwrapped \
--out-data-file 0.1_32_output.xml.bz2 \
--out-config-file 0.1_32_config.end.xml