Skip to content

Simulation of interacting driven Brownian particles

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE-EN.txt
Unknown
LICENSE-FR.txt
Notifications You must be signed in to change notification settings

stykoo/BrownianTracers

Repository files navigation

BrownianTracers

The purpose of this program is to simulate the motion of Brownian particles (in arbitrary dimension) interacting via a soft-sphere potential, some of the particles being driven by an external force.

The stochastic differential equation that is simulated is
txi(t) = I(i is tracer)f - ∑ j≠ixi V(xi(t) - xj(t)) + ξi(t)
where xi is the position of particle i, f is the external force, V is a soft-sphere potential and ξi is a Gaussian white noise with correlation proportional to the temperature T.
V(r) = ½ θ(1 - r) (1 - r)2 [θ is the Heaviside function]
⟨ ξia(t) ξjb(t') ⟩ = 2T δij δab δ(t - t')

See [Poncet and al., 2016] for an example of application of this program.

Dependancies

  • Boost for program options and gzip compression
  • SFML for on-the-fly visualization of particles in 2d (can be disabled)

Compilation

For compiling the source code, your compiler should support C++11 (both g++ and clang++ do).

The compilation was only tested on Linux. It should in theory also work on Windows and MacOS.

Executable files and compilation flags

If the source code is compiled with the Makefile provided (and all the dependancies are met), three executable files are created:

  • brownianTracers-2d for simulations in dimension 2
  • brownianTracers-2d-visu same as the previous one with on-the-fly visualization of the system
  • brownianTracers-3d for simulations in dimension 3

At the Makefile level, this behavior is enabled by compilation flags:

  • -DDIM=d (with d any striclty positive integer) is a mandatory flag to indicate the dimension of the system
  • -DVISU2D is an optional flag that enables visualization in dimension 2.

Use of the program

Arguments to the program can be defined either via the command-line or via a configuration file.
The configuration file is defined via --config and should be made of lines of the type arg=value (e.g. particles=40000 or gzip=).

Mandatory arguments

  • --particles Number of particles of the system
  • --tracers Number of tracers (i.e. particles driven by the external force)
  • --density Density of the system (1 means on average 1 particle per cube of unit size)
  • --temperature Temperature (the mobility being set to 1)
  • --force External force (the mobility being set to 1)
  • --timestep Time step of the simulation
  • --iters Number of iterations of the simulation

Export

If the visualization is disabled, it is mandatory to provide at least one of the following arguments:

  • --mobility Export data for mobility
  • --correl Export data for correlations
  • --livepos Export positions every given number of iterations

Optional arguments

  • --thermalization Number of iterations of thermalization (i.e. without recording any observable) (default=0)
  • --resolution Resolution for the correlations (default=0.25)
  • --path Directory in which the files are saved (default=Results/)
  • --fileMobility (resp. --fileCorrel) File name (without directory) for data for mobility (resp. correlations). If undefined the file name will be BT<dimension>d-<day>-<time>-<6randomCharacters>-<mobility|correl>.dat (e.g. BT2d-20150320-102714-sUfrH-mobility.dat)
  • --filePos File name (without directory and extension) for positions (default format if not defined)
  • --gzip Compress output with gzip format (useful for the correlation file if the resolution is small)

Command-line only arguments

  • --config Configuration file in which the previous arguments can be read (if an argument is both in the command-line and in the file, the priority goes to the command-line)
  • --verbose Verbose mode
  • --help Display help message and exit

License

The code belongs to ESPCI Paris and is released under CeCILL 2.1 license, a French license similar to and compatible with GNU GPL. Feel free to modify the code and redistribute it under either CeCILL or GPL.

About

Simulation of interacting driven Brownian particles

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE-EN.txt
Unknown
LICENSE-FR.txt

Stars

Watchers

Forks

Packages

No packages published