# ========================================================================= # Magnetized beam — Config A # Beam magnetized in +x, uniform field in +y # ========================================================================= variable N equal 258 # Beam geometry variable L equal 25.8 variable W equal 1.21 variable H equal 0.49 variable l0 equal $(v_L/v_N) # Rectangular cross-section variable A equal v_W*v_H variable I equal v_W*v_H^3/12 variable J equal v_W*v_H/12*(v_W^2+v_H^2) # Material properties variable E equal 1.16e3 variable nu equal 0.49 variable G equal "v_E/(2*(1+v_nu))" # Magnetization variable M equal 0.941 variable mu equal v_M*v_l0*v_W*v_H # ========================================================================= # Initialization # ========================================================================= units lj # milli units dimension 2 boundary f f p processors * 1 1 atom_style hybrid bpm/sphere dipole special_bonds lj 0.0 1.0 1.0 coul 1.0 1.0 1.0 newton on off neighbor $(v_l0) bin neigh_modify delay 0 every 10000 atom_modify sort 10000 1 comm_modify mode single cutoff $(2*v_l0) vel yes read_data magnetic-beam-N${N}.lam # Set dipole in +x direction set group all dipole ${mu} 0 0 # ========================================================================= # Groups # ========================================================================= region left block INF $(v_l0/2) INF INF INF INF region right block $(v_L-v_l0/2) INF INF INF INF INF group left region left group right region right group free subtract all left # ========================================================================= # BPM bond style # ========================================================================= variable Kr equal v_E*v_A/v_l0 variable Ks equal 12*v_E*v_I/v_l0^3 variable Kt equal v_G*v_J/v_l0 variable Kb equal v_E*v_I/v_l0 bond_style bpm/rotational smooth no break no bond_coeff 1 ${Kr} ${Ks} ${Kt} ${Kb} & -1 -1 -1 -1 & 0.01 0.01 0.01 0.01 pair_style zero $(2*v_l0) pair_coeff * * $(2*v_l0) # ========================================================================= # Computes and output # ========================================================================= timestep 5e-4 compute delx right reduce ave x compute dely right reduce ave y variable dx equal "c_delx/v_L-1" variable dy equal "c_dely/v_L" variable l equal 0 variable Bone equal v_E*v_I/(v_M*v_A*v_L^2) thermo 10000 thermo_style custom step temp ke pe etotal v_l v_dx v_dy thermo_modify lost ignore flush yes norm no dump 1 all custom 100000 ./config-A.dump id type x y fx fy mux muy fix prnt all print 100000 & "${l} ${dx} ${dy}" & file config-A.txt screen no # ========================================================================= # Loop 1: small field increments (lambda_m^C = 0.5 to 5) # ========================================================================= variable i index 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 label LOOP1 variable By equal "v_Bone*v_i" variable l equal "v_i" bond_coeff 1 ${Kr} ${Ks} ${Kt} ${Kb} & -1 -1 -1 -1 & 0.01 0.01 0.01 0.01 fix 1 free nve/bpm/sphere update dipole fix 2 free langevin 0 0 1000 83715463 zero yes omega yes fix 3 all efield 0 v_By 0 fix 4 all enforce2d fix_modify 3 energy yes run 500000 velocity all zero linear velocity all zero angular bond_coeff 1 ${Kr} ${Ks} ${Kt} ${Kb} & -1 -1 -1 -1 & 0.05 0.05 0.05 0.05 fix 2 free langevin 0 0 100 83715463 zero yes omega yes run 2500000 next i jump SELF LOOP1 # ========================================================================= # Loop 2: large field increments (lambda_m^C = 6 to 45) # ========================================================================= variable i index 6 7 8 9 10 12.5 15 17.5 20 25 30 35 40 45 label LOOP2 variable By equal "v_Bone*v_i" variable l equal "v_i" bond_coeff 1 ${Kr} ${Ks} ${Kt} ${Kb} & -1 -1 -1 -1 & 0.05 0.05 0.05 0.05 fix 1 free nve/bpm/sphere update dipole fix 2 free langevin 0 0 100 83715463 zero yes omega yes fix 3 all efield 0 v_By 0 fix 4 all enforce2d fix_modify 3 energy yes run 500000 next i jump SELF LOOP2