Skip to content

jsreyl/Thesis

Repository files navigation

Thesis

Statistical Mechanics for monodisperse granular materials. These codes use the LIGGGHTS software to generate a granular material distribution and realize experiments on it. Additionally the voro++ library is used to calculate Voronoi cells of the distribution. Thanks to professor William Oquendo for his support on post processing LIGGGHTS files. The order in which codes should be run to recreate the local folder is as follows:

1. Run the LIGGGHTS simulation

   mpirun -np 4 '/path_to_liggghts/LIGGGHTS-PUBLIC/src/lmp_auto' -i in.packing_rescaled
   
   For a simulation using wall compression; this uses mpi to run on 4 cores and requires the .stl files located on the /meshes/ folder.
   This will output dump files on /out, containing info regarding particles and contacts. If you need visualization edit the LIGGGHTS code uncommenting the dump on /out_vtk and use pareview to import the .vtk files. (WARNING: .vtk files may be large depending on the number of particles)
   
   dump files are fomatted as follows:
   - dump_{timestep}.gz
   particleID particleType x y z vx vy vz fx fy fz radius omegax omegay omegaz tqx tqy tqz
   - dump-contacts_{timestep}.gz
   x1 y1 z1 x2 y2 z2 particleID1 particleID2 IDperiodic fcx fcy fcz fnx fny fnz ftx fty ftz tqx tqy tqz contactArea interpenetrationDistance cx cy cz
   <REQUIREMENTS>: An installation of LIGGGHTS that can dump .gz files and use mpi.
   
2. Run the postprocessing for dump files (based on Wiliam Oquendos postprocessing code)

   python3 postproc.py 2>&1 | tee log.postproc
    
   This will output a bunch of files on the /post folder.
   The code reads the dump files and calculates certain parameters.
   Specifically:
    - cundall.txt: Cundall parameter vs time (keeps track of force equilibrium)
    - packing_fraction.txt: Packing fraction vs time (keeps track of volume equilibrium)
    - z.txt: Mean coordination number vs time (keeps track of system statistics)
    - qp.txt: q/p vs time (keeps track of the isotropic compression)
    - *_distance.txt: All the above parameters vs filtering distance
    - pressure_per_particle_*.txt: Pressure and number of contacts for a given particle, organized by ID.
    - voro_ixyz_*.txt: ID, and center coordinates for all particles (this is an input file for voro++)
    - voro_ixyz_*.txt.vol: id, vertices, edges, faces, area, volume of the voronoi cell which corresponds with a given particle
    - .pov files of particles and voronoi cells for visualization using povray may be generated if needed. Notice these files are specially large, so manage your space accordingly. (That is, don't post process an enormous amount of files)

    Histogram files may be generated by uncommenting lines on the script (functions to generate them are already implemented) but they're not necessary since all the information is already on the other files.
    
    <REQUIREMENTS>: python3 and the libraries os, sys, numpy, glob, colorama. An installation of voro++ to calculate voronoi cells of the distribution.
    
3. Run the plot generator for the postprocessed files
   
   python3 postHisto.py 2>&1 | tee log.postHisto
   
   This will generate plots in the /plots folder for:
   - equilibrium_parameters.png: Equilibrium parameters for force and volume equilibrium.
   - histogram_*.png: Histograms for Voronoi cell volume and Pressure at various filtering distances
   - PDF_*.png: Probability Distribution Function for Voronoi cell volume and Pressure classified by number of faces and number of contants respectively (you need to choose an equilibrium time manually)
   - ../post/V_k*.txt and ../post/P_k*.txt: files containing filtering distance and theoretical k and theta (shape and scale parameters) for the PDFs (these are stored in /post)
   - Param_*_distance*.png: Different parameters varying with filtering distance
   - particle_number_distance.png: Particle number vs filtering distance
   - k_s.png and k_z.png: shape parameter vs number of faces (for Volumes) and vs contact number (for Pressures)
   - Pavg_z.png and V-Vminavg_s.png: Averages of pressure and volume divided by their conjugate variables (angoricity and compactivity) vs number of contacts and faces (the slope should indicate the number of degrees of freedom)
   
   <REQUIREMENTs>: python3's matplot and scipy libraries
   
4. Run the bash jobs to generate images of the packing

    ./voro_img.job
    
    This will generate images for the packing in each timestep using the povray script import.pov.
    
    <REQUIREMENTS>: povray version 3.6 or higher
    
5. Run the /anim bash jobs

    ./sorf_files.job
    
    to generate a "images.txt" file containing the order in which images should be rendered to create a video
    
    ./images_to_video_ffmpeg.job <filename>.mp4
    
    to generate a video using the images.
    
    <REQUIREMENTS>: ffmpeg

About

Statistical Mechanics for monodisperse granular materials

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages