# ========================================================================= # Magnetized beam — Config B2 # Beam magnetized in +x, constant-gradient field with a small +y perturbation # ========================================================================= 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 dB equal 0 variable dBone equal v_E*v_I/(v_M*v_A*v_L^3)*0.36 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-B2.dump id type x y fx fy mux muy fix prnt all print 100000 & "${l} ${dx} ${dy}" & file config-B2.txt screen no # ========================================================================= # Loop 1: small field increments (lambda_m^C = 1 to 4) # ========================================================================= variable i loop 4 label LOOP1 variable dB equal "v_dBone*v_i" variable l equal "v_i" fix 1 free nve/bpm/sphere update dipole fix 2 free langevin 0 0 1000 83715463 zero yes omega yes fix 3 all efield/lepton "-v_dB*(-x^2+2*y^2)/4 -0.001*y" step 1 fix 4 all enforce2d fix_modify 3 energy yes run 1000000 next i jump SELF LOOP1 # ========================================================================= # Loop 2: transition increments (lambda_m^C = 5.0 to 5.5) # ========================================================================= variable i index 5.0 5.1 5.2 5.3 5.4 5.5 label LOOP2 variable dB equal "v_dBone*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 10000 83715463 zero yes omega yes fix 3 all efield/lepton "-v_dB*(-x^2+2*y^2)/4 -0.001*y" step 1 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 1000 83715463 zero yes omega yes run 1500000 next i jump SELF LOOP2 # ========================================================================= # Loop 3: large field increments (lambda_m^C = 6 to 45) # ========================================================================= variable i index 6 6.5 7 7.5 8 8.5 9 9.5 10 12.5 15 20 25 30 35 40 45 label LOOP3 variable dB equal "v_dBone*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/lepton "-v_dB*(-x^2+2*y^2)/4 -0.001*y" step 1 fix 4 all enforce2d fix_modify 3 energy yes run 1000000 next i jump SELF LOOP3