electrostatics

Submitted by pain08 on Mon, 06/01/2020 - 17:35

hello everyone i hope ur all doing well i am a new ligggths user i need help i want to add an electrostatic field to attract granuls or push them if possible with positive and negative voltage to make a granular separation i am trying to modify the chute wear scrit by adding efield command but it's not working getting the following error thank you all

atom_style hybrid charge granular
atom_modify map array
boundary f f f
newton off

communicate single vel yes

units si

region domain block -0.5 0.1 -0.2 0.2 -0.4 0.15 units box
create_box 1 domain

neighbor 0.002 bin
neigh_modify delay 0

#Material properties required for new pair styles

fix m1 all property/global youngsModulus peratomtype 5.e6
fix m2 all property/global poissonsRatio peratomtype 0.45
fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
fix m5 all property/global k_finnie peratomtypepair 1 1.0

#New pair style
pair_style gran model hertz tangential history #Hertzian without cohesion
pair_coeff * *

timestep 0.00001

fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
fix kick external-field efield 1.0 1.0 1.0

#the chute
fix cad all mesh/surface/stress file meshes/simple_chute.stl type 1 wear finnie
fix inface all mesh/surface file meshes/insertion_face.stl type 1
fix granwalls all wall/gran model hertz tangential history mesh n_meshes 1 meshes cad

#distributions for insertion
fix pts1 all particletemplate/sphere 15485863 atom_type 1 density constant 2500 radius constant 0.0015
fix pts2 all particletemplate/sphere 15485867 atom_type 1 density constant 2500 radius constant 0.0025
fix pdd1 all particledistribution/discrete 32452843 2 pts1 0.3 pts2 0.7

#region and insertion
group nve_group region domain
region bc cylinder z 0.0 0.0 0.015 0.05 0.12 units box

#particle insertion
fix ins nve_group insert/stream seed 32452867 distributiontemplate pdd1 &
nparticles 6000 massrate 0.1 insert_every 1000 overlapcheck yes all_in no vel constant 0.0 0.0 -1.0 &
insertion_face inface

#apply nve integration to all particles that are inserted as single particles
fix integr nve_group nve/sphere

#output settings, include total thermal energy
compute 1 all erotate/sphere
thermo_style custom step atoms ke c_1 vol
thermo 1000
thermo_modify lost ignore norm no

#insert the first particles so that dump is not empty
run 1
dump dmp all custom/vtk 200 post/chute_*.vtk id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
dump dumpstress all mesh/gran/VTK 200 post/mesh_*.vtk stress wear cad

#insert particles
run 100000 upto
unfix ins

ERROR: Could not find fix group ID (../modify.cpp:782)

pain08 | Tue, 06/02/2020 - 17:10

thank you that solved my problm unfortunatly i have another error
ERROR: Fix efield requires atom attribute q (../fix_efield.cpp:134)
if u could help me with that i'd appriciatee it thank you again for ur help

tjleps | Wed, 06/03/2020 - 23:46

You need to use "atom_style hybrid" charge granular with "fix_efield"

pain08 | Thu, 06/04/2020 - 21:02

thank you so much i made a mistake by using hybride sphere granular and by changing it to charge granular it worked great i just hav a little question the program is working fine but i don't see the granuls changing direction because of the electric field that's why i hav some doubts i modifyied many variables to make some particles go right and others go left like for the electrostatic separation by appliying like 20 kv on a side and -20 kv the other side for example if u have and idea on what i should modify in the script it would mean the world to me and thanks for ur help :

#Simple chute wear test

atom_style hybrid charge granular
atom_modify map array
boundary f f f
newton off

communicate single vel yes

units si

region domain block -0.5 0.1 -0.2 0.2 -0.4 0.15 units box
create_box 1 domain

neighbor 0.002 bin
neigh_modify delay 0

#Material properties required for new pair styles

fix m1 all property/global youngsModulus peratomtype 5.e6
fix m2 all property/global poissonsRatio peratomtype 0.45
fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
fix m5 all property/global k_finnie peratomtypepair 1 1.0

#New pair style
pair_style gran model hertz tangential history #Hertzian without cohesion
pair_coeff * *

timestep 0.00001

fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
fix efield all efield 0 200000 0
fix efield all efield 0 -20000 0

#the chute
fix cad all mesh/surface/stress file meshes/simple_chute.stl type 1 wear finnie
fix inface all mesh/surface file meshes/insertion_face.stl type 1
fix granwalls all wall/gran model hertz tangential history mesh n_meshes 1 meshes cad

#distributions for insertion
fix pts1 all particletemplate/sphere 15485863 atom_type 1 density constant 2500 radius constant 0.0015
fix pts2 all particletemplate/sphere 15485867 atom_type 1 density constant 2500 radius constant 0.0025
fix pdd1 all particledistribution/discrete 32452843 2 pts1 0.3 pts2 0.7

#region and insertion
group nve_group region domain
region bc cylinder z 0.0 0.0 0.015 0.05 0.12 units box

#particle insertion
fix ins nve_group insert/stream seed 32452867 distributiontemplate pdd1 &
nparticles 1000 massrate 0.1 insert_every 1000 overlapcheck yes all_in no vel constant 0.0 0.0 -1.0 &
insertion_face inface

#apply nve integration to all particles that are inserted as single particles
fix integr nve_group nve/sphere

#output settings, include total thermal energy
compute 1 all erotate/sphere
thermo_style custom step atoms ke c_1 vol
thermo 1000
thermo_modify lost ignore norm no

#insert the first particles so that dump is not empty
run 1
dump dmp all custom/vtk 200 post/chute_*.vtk id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
dump dumpstress all mesh/gran/VTK 200 post/mesh_*.vtk stress wear cad

#insert particles
run 100000 upto
unfix ins

tjleps | Thu, 06/04/2020 - 21:44

You need to set the charge for the atoms, right now they're all uncharged so they won't be affected by the efield. Also fix_efield sets an electric field, not a potential, you're just overriding one field with the other.

pain08 | Thu, 06/04/2020 - 22:07

wish commands and lines should i change sir can u help me correct it by charging particles and create a potential please thank you for ur precious help

tjleps | Thu, 06/04/2020 - 23:12

I recommend you go through a couple unedited tutorial scripts, looking up each command in the documentation, until you fully grasp what the structure of a LIGGGHTS script is, it will help a lot when you start making your own scripts. In the meantime, use the set command:

set atom all charge 0.000001
will put one microcoulomb on every atom in your system.

fix_efield 0 50000 0
will create the equivalent of a 20kv potential across your simulation box since V=E*d for a constant electric field.

pain08 | Fri, 06/05/2020 - 01:33

thank you verry much for ur help sir i hope u could guide me with ligggths and if u have publications that i can site email them to me i hope we can work on a project someday meanwhile here my email painrikosu8@gmail.com and thanks again for sharing ur knowledge

tjleps | Wed, 06/10/2020 - 02:01

No problem, it can be a little bit of a steep learning curve. I don't have any publications that would make sense to cite I don't think, but I'm glad I could help.

pain08 | Sun, 07/05/2020 - 16:46

hello tjleps i hope ur doing great i have a little problm i hope u can help me with i have trouble charging particles the set command u told me about only charges atom or molecules i need it to charge particles like granuls the adapt command is not working properly either can you please help me i am kinda stuck on it thank you

tjleps | Sun, 07/05/2020 - 19:44

If you could attach some code and specify more precisely, exactly what you're trying to have happen, it would help with trying to figure out a solution.

pain08 | Mon, 07/06/2020 - 20:03

i am trying to do something like this example https://www.cfdem.com/electrostatics with two different granular particles types that are mixed and two electric fields so that type one goes left and type two go right if u could help me it would be great and thank you so much ur help is priceless my friend

#falling particles and way flow coupling

atom_style granular
atom_modify map array
boundary f f f
newton off

communicate single vel yes

units si

region domain block -0.155 0.155 -0.015 0.015 -0.005 0.235 units box
create_box 1 domain

neighbor 0.002 bin
neigh_modify delay 0

#Material properties required for new pair styles

fix m1 all property/global youngsModulus peratomtype 5.e6
fix m2 all property/global poissonsRatio peratomtype 0.45
fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
fix m4 all property/global coefficientFriction peratomtypepair 1 0.5

#New pair style
pair_style gran model hertz tangential history #Hertzian without cohesion
pair_coeff * *

timestep 0.00001

fix gravi all gravity 9.81 vector 0.0 0.0 -1.0

#distributions for insertion
fix pts all particletemplate/sphere 15485863 atom_type 1 density constant 1000 radius constant 0.004

fix pdd all particledistribution/discrete 15485867 1 pts 1.0

region factory block -0.14 -0.10 -0.006 0.006 0.215 0.225 units box
lattice sc 0.0001
create_atoms 1 region factory

fix ins all insert/rate/region seed 32452843 distributiontemplate pdd &
nparticles 1000 massrate 1.66666667 insert_every 1000 &
overlapcheck yes vel constant 0. 0. -1. region factory ntry_mc 10000

# Geometry
fix wal11 all wall/gran model hertz tangential history primitive type 1 zplane 0.0
fix wall2 all wall/gran model hertz tangential history primitive type 1 xplane -0.15
fix wall3 all wall/gran model hertz tangential history primitive type 1 xplane 0.15
fix wall4 all wall/gran model hertz tangential history primitive type 1 yplane -0.01
fix wall5 all wall/gran model hertz tangential history primitive type 1 yplane 0.01

#apply efield and atom charges

set atom all charge 0.000001
fix efield all efield 0 50000 0

#apply nve integration to all particles that are inserted as single particles
fix integr all nve/sphere

# Thermo settings
thermo_style custom step atoms ke cpu
thermo 10000
thermo_modify lost ignore norm no
compute_modify thermo_temp dynamic yes

# Run 1 step to check timestep and initialize
fix ctg all check/timestep/gran 1 0.01 0.01
run 1
unfix ctg
# Dump particle positions
dump dmp all custom/vtk 100 post/fall*.vtk id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
### Execution and further settings
# Run remainder
run 200000 upto

tjleps | Mon, 07/06/2020 - 21:47

I'm not sure what you mean by "charges atom or molecules i need it to charge particles like granuls" Atoms in LIGGGHTS are generic to all particles including grains, owing to it's molecular dynamics roots. The set command as you have it should work to give your grains a charge.

I can try to run your code to see if I can figure out what's going on, but it could be a few days.

pain08 | Mon, 07/20/2020 - 17:41

hi tjleps hope ur doing great i wanted to ask you about the dump files i cannot get atom charge or electric charge after adding q to dump i get zeros hope u can help thanks
dump dmp all custom/vtk 100 post/fall*.vtk id type type x y z ix iy iz vx vy vz fx fy fz q omegax omegay omegaz radius

tjleps | Mon, 07/20/2020 - 22:10

The reason is that the set command only applies to atoms after they are inserted, so you need to set the charge after you've done your insertion commands. I'm not sure how, or if it's possible, to set the charge before an insertion. If you move your set command to after the insertion step it should work fine.

Also your lattice is extremely small (2.5% of your radius) in your example code, resulting in millions of overlapping particles.

pain08 | Thu, 07/23/2020 - 18:39

hi tjleps hope ur doing great i also wanted to ask you about the dump files i cannot get atom charge or electric charge after adding q to dump i get zeros hope u can help thanks