############################# INITIALIZATION ############################### units metal dimension 3 boundary p p p atom_style atomic atom_modify map array sort 0 0.0 neighbor 0.3 bin neigh_modify every 1 delay 0 check yes #================================================================ #----------------Potential & Structure--------------------------- #================================================================ lattice fcc 3.604 origin 0.25 0.25 0.25 #region box block 0 80 0 40 0 40 #bigger block contains Ni #region Inconel block 0 40 0 40 0 40 #block of inconel half along X, OTHERS SAME region box block 0 20 0 10 0 10 #bigger block contain Ni region Inconel block 0 10 0 10 0 10 #block of inconel half along X, OTHERS SAME create_box 3 box create_atoms 1 box #region pore sphere 40 20 20 5.5 side in #delete_atoms region pore group inconel region Inconel set group inconel type/fraction 3 0.47 1234 #Fe set group inconel type/fraction 2 0.21 12345 #Cr mass 1 58.6934 # Ni mass 2 51.9961 # Cr mass 3 55.8450 # Fe pair_style hybrid/overlay eam/alloy zbl 0.90 1.250 pair_coeff * * eam/alloy FeNiCr.eam.alloy Ni Cr Fe pair_coeff 1 1 zbl 28.0 28.0 pair_coeff 2 2 zbl 24.0 24.0 pair_coeff 3 3 zbl 26.0 26.0 pair_coeff 1 2 zbl 28.0 24.0 pair_coeff 1 3 zbl 28.0 26.0 pair_coeff 2 3 zbl 24.0 26.0 variable natoms equal "count(all)" # Total number of atoms print "Number of atoms = ${natoms}" variable T equal ${natoms} variable t equal 1 variable randnum equal random(0,1,${seed1}) # Choosing a random number variable rand equal ${randnum} variable denom equal $t/$T print "Denominator = ${denom}" variable calc equal ${rand}/${denom} print "Calc = ${calc}" variable i equal ${calc}+1 # Choosing the random atom based on the random number # --------------------------------------------- # ASSIGNING THE ID, TYPE AND X,Y,Z COORDINATES OF THE CHOSEN ATOM TO VARIABLES # --------------------------------------------- variable xi equal x[v_i] # Extracting the x-coordinate of the atom variable yi equal y[v_i] # Extracting the y-coordinate of the atom variable zi equal z[v_i] # Extracting the z-coordinate of the atom variable idi equal id[v_i] # Extracting the ID of the atom variable typei equal type[v_i] # Extracting the type of the atom variable atom1 equal ${typei} # Assigning the atom type to the variable 'atom1' variable ID1 equal ${idi} # Assigning the atom ID to the variable 'ID_1' variable x0 equal ${xi} # Assigning the x-coordinate of the atom to the variable 'x0' variable y0 equal ${yi} # Assigning the y-coordinate of the atom to the variable 'y0' variable z0 equal ${zi} # Assigning the z-coordinate of the atom to the variable 'z0' region 1 sphere ${x0} ${y0} ${z0} $l side in group nnatoms region 1 # Grouping the nearest-neighbour atoms of the randomly-chosen first atom # --------------------------------------------------------------------- # COUNTING THE NUMBER OF ATOMS WITHIN THE NEAREST-NEIGHBOUR RADIUS # --------------------------------------------------------------------- variable num_nnatoms equal "count(nnatoms)" variable nn equal ${num_nnatoms}