../images/grain_growth.02.png ../images/grain_growth.32.png ../images/grain_growth.282.png

Commands & Concepts

  • Create lattice [1]
  • Initialize spin values
    • set (random or simple conditionals)
    • read sites (read file, e.g. DREAM3D)
    • pin (set fraction of sites as pinned/fixed)
  • Select app style: potts/pin (grain growth with single precipitate)
  • Select solve style: tree (stores event probabilities in binary tree)
  • Set kT: temperature/energy relevant to potts model
  • Request output text/images for analysis
  • Choose diag style
    • energy (running energy tally for entire lattice)
    • cluster (very useful: compute cluster volumes, centroids)

spparks input file

  • Run spparks:

    # SPPARKS 'potts' model for modeling 'grain' growth
    let N=128
    let Q=2048
    let P=$Q+1
    kT="0.85"
    spk_flame.gnu -var kT $kT -var N $N  -var Q $Q -var P $P < grain_growth.in
    
  • Download 'grain_growth.in'

    # SPPARKS 'potts' model for modeling 'grain' growth
    # let N=128
    # let Q=2048
    # let P=$Q+1
    # kT="0.25"
    # spk_flame.gnu -var kT $kT -var N $N  -var Q $Q -var P $P < grain_growth.in
    
    seed		 56689
    
    # Use 'Potts' app to simulate grain growth;
    # Site 'spins' can assume values of its nearest neighbors.
    app_style	 potts/pin ${Q}
    
    # 2d lattice; Each site has 8 neighbors
    dimension	 2
    lattice		 sq/8n 1.0
    
    # Define lattice extent called 'square'; 
    region		 square block 0 ${N} 0 ${N} -1.0 1.0
    
    # Define 'axis' aligned simulation domain on 'square'
    create_box	 square
    
    # Creates sites on lattice defined above; also creates neighborhood list for each site
    create_sites     box
    
    # Initializes sites randomly with values between 1 and 2048
    set site range 1 ${Q}
    
    # Now pin 1% of sites (including their neighbors (multiflag=1))
    # Pin value = Q+1
    pin .01 1 0
    
    # Simulation temperature; Units of energy
    temperature	 ${kT}
    
    # KMC solver
    solve_style      tree
    # sectors are required to run 'tree' kmc in parallel
    sector yes
    
    # Diagnostic style energy computes the total energy for all sites
    diag_style       energy
    
    # Print diagnostic information to screen and log file every 50.0 seconds
    stats            50.0
    
    # Write snapshot of site values to 'grain_growth.dump' every 25.0 seconds 
    dump  1 text  25.0 grain_growth.dump
    
    # Write 'image'; boundary between grains drawn with color = 0 0 0 aka 'black'
    dump grain_growth_image image 50 grain_growth.*.jpg site site crange 1 ${Q} drange 1 1 view 0.0 0.0 boundary site 1 shape cube box no 1 zoom 1.95
    dump_modify grain_growth_image boundcolor black backcolor white scolor ${P} black pad 4
    
    # Write 'cluster/grain' diagnostics
    diag_style       cluster stats no delt 25.0 filename grain_growth.cluster
    
    # Run for 1400 *spparks* steps
    run              1400.0
    

[1]../images/cubic_lattice_bcc2.gif

https://www.uwgb.edu/dutchs/symmetry/bravais.htm