|
|
|||
|
|
|||
Mario Alberto Rodríguez-Meza
|
md_lj_tree - Hierarchical (tree force calculation) simulation of Lennard-Jones liquid DOWNLOAD Click the link md_lj_tree to download the code. ANIMATIONS AND TESTS In the right panel we show some tests and animations. SYNOPSIS md_lj_tree [parameter_file_name] [options] DESCRIPTION md_lj_tree - Simulates the evolution of a N-body system interacting with a Lennard-Jones potential. The force is computed by walking a hierarchical tree. Code complexity is O(N Log N). Periodic boundary condition is used and temperature is kept constant. OPTIONS The options have the structure option_name = <option_value> Options and their possible values are:
UNITS Units are such that eps=sigma=m=1, where eps is the potential depth of the Lennard-Jones potential, sigma the cut radius, and m is the mass of each particle. We also have that the Boltzmann constant kB=1 such that eps/kB is the unit of temperature. OUTPUT AND THERMODYNAMICS md_lj_tree code produces several output files by default: md_lj_tree.log, thermo.dat, snap.dat, vel.dat, rdf.dat, and if you instruct other additional files are produced, such as those instructed by snapout options. The file md_lj_tree.log is the log file were some simulation parameters are save such as size of the simulation box, number of particle created if a initial condition file were not used, and so on. The files snap.dat, vel.dat, and rdf.dat are intended to be used in combination with gnuplot. In files vel.dat and rdf.dat are saved the velocity and radial distribution function histograms, they are produced in steps greater than stepEquil, and its frequency is controled by the options stepVel, stepAvgVel, stepRdf, and stepAvgRdf. In snap.dat file a snapshot of the system is saved and this file is produced every dtout/dtime steps. Thermodynamics parameters such as pressure and its fluctuation are saved in file thermo.dat every dtout/dtime steps. SPATIAL DIMENSIONS md_lj_tree code may be run in two or three spatial dimensions. To choose two dimensions edit the file "vectdefs.h" in directory "NagBody_pkg/General_libs" and choose TWODIM. Recompile again the code. STOPPING THE CODE Once md_lj_tree is running you may allways stop it by executing the command echo > stop You must be in the same directory were the process were lunched. A file named 'stop-state' is saved containing the state of the simulation run. This option permits us to stop the simulation and change numerical and/or physical parameters such as temperature or density. EXAMPLES Executing md_lj_tree will run the default simulation which is consistent with the experimental data reported in: J.L. Yarnell, et al, "Structure factor and radial distribution function for liquid Argon at 85 K", Phys. Rev. A7 (1972) 2130. Parameter eps in the Lennard-Jones potential that fit the experimental data is eps/kB = 119 K. With the command md_lj_tree nbody=4096 out=snap%03d dtout=2/256 we run a simulation with 4096 bodies and save a snap data every other time step. With the command md_lj_tree statefile=state we run a simulation were a state file is saved every dtout/dtime steps. If for some reasons the simulation run is interrupted you may always restart the run ejecuting the command md_lj_tree restorefile=state Or if you stop it the run using the command 'echo > stop' you may restart the run with the command md_lj_tree restorefile=stop-state ANIMATIONS You may run gnuplot to see animation plots. Make the following script: a=a+1 plot "rdf.dat" w l pause 1 if(a<50000) reread Save the script in a file named "rdf.gnu". At the same time that the simulation is running start gnuplot and execute the commands: a=0 load "rdf.gnu" Also you may see animation of the particles positions. Make the following script: a=a+1 plot "snap.dat" w p pointtype 6 pause 1 if(a<50000) reread Save the script in a file named "snap.gnu". Again, at the same time that the simulation is running start gnuplot and execute the command: a=0 set xrange [-5:5] set yrange [-5:5] load "snap.gnu" The values of "xrange" and "yrange" options may change according the particle positions ranges. |
||
|
|
||
| Fig. 1 - Radial distribution function. The red line is the result of a simulation using default values of md_lj_tree. Dots are experimental results taken from J.L. Yarnell, et al, "Structure factor and radial distribution function for liquid Argon at 85 K", Phys. Rev. A7 (1972) 2130. | |||