Lammps Tutorial Oct06

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

LAMMPS 2-1

LAMMPS Tutorial CNF Fall Workshop, Oct 2006 Steve Plimpton, Sandia National Labs [email protected], lammps.sandia.gov 1. 2. 3. 4. Input and Output 11 example problems Parameters to change Adding a "feature" to LAMMPS

LAMMPS 2-2

LAMMPS Philosophy

LAMMPS is a parallel MD kernel keep the kernel simple and fast avoid non-parallel operations

LAMMPS doesn't do many pre- and post-processing tasks: other codes already do it limited development resources aren't parallel operations

LAMMPS 2-3

LAMMPS doesn't ...


Build molecular systems use a builder code or write out your own cong le can build lattices, grain boundaries, etc Assign force-eld coefcients auto-magically only hard for molecules, use another MD code Compute lots of diagnostics on-the-y often better left to post-processing you can add it if you want it Visualize your output many packages do this VMD, Rasmol, Raster3d, AtomEye, Ensight, ... LAMMPS package includes auxiliary tools for some of these tasks Python-based Pizza.py package distributed separately: www.cs.sandia.gov/~sjplimp/pizza.html

LAMMPS 2-4

LAMMPS has no GUI

LAMMPS 2-5

LAMMPS Input

Reads an input script (ASCII text) One command per line Command name + arguments atom_style molecular read_data water.data x 1 all nve run 10000 lammps.sandia.gov has link to command doc pages examples sub-dir has many sample input scripts

LAMMPS 2-6

LAMMPS Output

log.lammps contains what is printed to screen thermodynamic info "dump" command outputs snapshots of atom properties default format is simple: id, type, x, y, z other supported formats: XYZ, DCD, XTC conversion tools: PDB, Ensight, XYZ, VTK Rasmol, Raster3d, SVG, etc

LAMMPS 2-7

Viz of LAMMPS Snapshots xmovie auxiliary tool distributed with LAMMPS very fast, simple viz 2d projection of 3d systems reads default dump format % /usr/local/bin/xmovie -scale dump.melt VMD learning about this afternoon 3d hi-quality viz dump 1 all xyz 100 dump.melt % vmd (load xyz le thru GUI)

LAMMPS 2-8

Running an Example Problem


All problems in examples sub-directory Copy entire dir to your space to run & modify cp -r /usr/local/bin/lammps/examples/indent . cd indent; cp /usr/local/bin/lmp_linux . Each example problem reads: in.* input script data.* input data le (optional) % lmp_linux -echo screen < in.indent (serial) % mpirun -np 2 lmp_linux -in in.indent (parallel) Each example problem produces: log.lammps logle output (see examples) dump.* series of snapshots LAMMPS doc pages at /usr/local/bin/lammps/doc/Manual.html see Section_commands.html % /usr/local/bin/xmovie -scale dump.indent

LAMMPS 2-9

11 Example Problems

crack: ow: friction: indent: melt: micelle: min: obstacle: peptide: pour: shear:

crack growth in a LJ crystal (2d) Couette/Poisseuille ow between walls (2d) rubbing of 2 irregular surfaces (2d) crystal response to spherical indenter (2d) LJ lattice (3d) self-assembly of tiny lipid molecules (2d) energy minimization of LJ melt (2d) ow around obstacles (2d) small peptide chain in water (3d) granular particle pour and ow (2d/3d) shear of a metal slab with void (quasi-3d)

LAMMPS 2-10

Crack Problem
Tensile pull on 2d LJ solid Initial slit crack between red/green neigh_modify exclude 2 3 Uniform gradient pull velocity ramp command else shock waves or worse Need large system & slow pull else defects other than crack Biggest computational test problem run in parallel Options to play with: pull rate pair-wise cutoff turn off velocity ramp change NULL 0.0 in x 2

LAMMPS 2-11

Flow Problems Couette ow Poisseuille ow

Options to play with: wall velocity, force kick, temperature

LAMMPS 2-12

Friction Problem 2 non-uniform surfaces 2d LJ hex lattice Region commands to build geometry Options to play with: add/change asperities size separation shape x-velocity multiple passes

LAMMPS 2-13

Indent Problem 2d LJ solid periodic in x free upper y surface Spherical indenter downward push, remove Defect creation and healing Options to play with: speed & depth of indent size of indenter size of system

LAMMPS 2-14

Melt Problem 3d LJ solid periodic in x,y,z Melt an fcc lattice Options to play with: temperature x nvt or npt

LAMMPS 2-15

Micelle Problem
Simple lipid model 2d self-assembly vesicles bilayers Hydrophilic head Hydrophobic tail Monomer solvent Options to play with: timestep size # of timesteps pair-wise coeffs turn off special bonds system size: micelle2d.f

LAMMPS 2-16

Minimization Problem Melt of 2d LJ solid Followed by energy minimization Returns to hex lattice but with defects Options to play with: size of system melt temperature minimize tolerance

LAMMPS 2-17

Obstacle Problem 2d LJ ow around obstacle(s) Poisseuille kick added to atoms pressure-gradient ow Top surface applies pressure Obstacle creation delete_atoms command x indent command Options to play with: size of force kick size of system size & position of obstacles add a new obstacle

LAMMPS 2-18

Peptide Problem
Full-atom model of 5-mer Met-enkaphalin CHARMM force-eld, PPPM Coulombics SHAKE bond/angle constraints 2 fmsec timestep so cant simulate for long! To see bonds: xmovie scale dump.bonds dump.peptide Options to play with: timestep size, turn off SHAKE, add x drag command

LAMMPS 2-19

Pour Problem 3d (or 2d) pour of granular particles into empty box under gravity Change gravity direction to induce chute ow Options to play with: vol fraction for pour # of particles to pour spring constant for atoms direction of gravity

LAMMPS 2-20

Shear Problems
Fixed-end shear in fcc Ni EAM potential quasi-3d non-periodic XY slab thin in Z, periodic Defect formation with and without void Options to play with: size of system shear rate turn off velocity ramp comment in/out void add another void

LAMMPS 2-21

Extra Credit: Add new Feature to LAMMPS


Grab your own copy of LAMMPS source les cp -r /usr/local/bin/lammps/src . Add 2 new les with your feature (from lammps/examples/triangle) region_triangle.cpp & region_triangle.h also region.cpp (one extra line needed, my mistake) Edit style_user.h include "region_triangle.h" #ifdef RegionInclude RegionStyle(triangle,RegTriangle) #ifdef RegionClass Re-build LAMMPS make linux Try it out edit examples/obstacle/in.obstacle to use triangular obstacles edit examples/friction/in.friction to use triangular asperities region 1 triangle x1 y1 x2 y2 x3 y3 run and visualize

LAMMPS 2-22

region_triangle.cpp

35 lines of code constructor(int narg, char **arg) reads arguments: x1 y1 x2 y2 x3 y3 determines extent = bounding box match(double x, double y, double z): determine if (x,y) is inside triangle (2d only) 3 positive cross products inside

LAMMPS 2-23

Region triangle for Friction Problem


examples/friction/in.friction Replace: region lo-asperity sphere 32 7 0 8 region hi-asperity sphere 18 15 0 8 With: region lo-asperity triangle 26 7 32 14 38 7 region hi-asperity triangle 12 15 24 15 18 8

You might also like