51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
# Point dipoles in a 3d box with an external potential (ignoring dipolar interactions)
|
|
|
|
units lj
|
|
atom_style hybrid sphere dipole
|
|
dimension 3
|
|
boundary s s s
|
|
region box block -2 2 -2 2 -2 2
|
|
|
|
create_box 1 box
|
|
create_atoms 1 random 100 12345 NULL
|
|
|
|
# need both mass settings due to hybrid atom style
|
|
mass 1 1.0
|
|
set group all mass 1.0
|
|
set group all diameter 0.1
|
|
|
|
set group all dipole/random 98934 0.01
|
|
pair_style none
|
|
comm_modify cutoff 3.0
|
|
|
|
velocity all create 0.0 87287 mom yes rot yes
|
|
|
|
fix 1 all nve/sphere update dipole
|
|
|
|
###############################################################################################################
|
|
## Yukawa potential
|
|
#fix 2 all efield/lepton "A*exp(-B*r)/r; r=abs(sqrt(x^2+y^2+z^2)); A = 0.1; B = 5" step 1e-8
|
|
|
|
## Gradually increasing uniform field
|
|
#variable E equal ramp(0,1)
|
|
#fix 2 all efield/lepton "-v_E*(x+y+z)"
|
|
|
|
## Linear gradient field
|
|
fix 2 all efield/lepton "-1/6*x^3" step 1e-6
|
|
|
|
fix_modify 2 energy yes
|
|
|
|
###############################################################################################################
|
|
|
|
timestep 1e-3
|
|
|
|
compute erot all erotate/sphere
|
|
variable etotal equal "ke + c_erot + pe" # thermo etotal doesn't include erot
|
|
thermo_style custom step temp ke c_erot pe v_etotal
|
|
thermo 500
|
|
thermo_modify norm no
|
|
|
|
#dump 1 all custom 500 dump.dipole id x y z diameter mux muy muz fx fy fz tqx tqy tqz
|
|
|
|
run 10000
|