implementing unique forces on individual atoms at each time step in a CFDEM simulation

Submitted by dbcmih001 on Tue, 03/20/2012 - 10:29

Hi

I am trying to apply forces on atoms based on one of their coordinate positions. I have implemented this type of force successfully on a single atom using

run 50000 every 10 "fix acforce all addforce ${Force} NULL NULL region ac"

where

variable Force equal (variable function(v_xposition))

I have introduced additional atoms into the system using

read_data grann

in which I specify their positions, initial velocities, etc

To my understanding I require

variable Force atom (variable function(v_xposition)) where v_xposition is an atom type also or a vector type compute

which generates a corresponding force vector array for each atom position

I try to insert this into repeating fix

run 50000 every 10 "fix acforce all addforce Force NULL NULL region ac"

but it does not work. Can you assist me in this regard. I would like to stay away from coding at this point.

I have also investigated the possibility of doing this in a loop using equal type variables and grouping a single atom, applying the force then unfixing and ungrouping and repeating for all the atoms. I get the following output

old group != new group

Is there a way to assign new names based on the loop number or any other alternative or solution to this?

my code segment

label loop
variable i loop 7
variable xatompos equal x[$i]
variable A equal (v_function(v_xatompos[v_xatompos]))
print "Force = $A"
group atomgroup id $i
fix fixname atomgroup addforce ${A} NULL NULL region ac
unfix fixname
group atomgroup delete
next i
jump in.script loop
variable i delete

In addition when I run a coupled simulation with a single atom system the repeating fixes as previously mentioned are not accounted for. Where to account for these; In the liggghtsCommands script? And how to implement this?

Thank You

ckloss's picture

ckloss | Thu, 03/22/2012 - 18:59

Hi dbcmih001,

the command

run 50000 every 10 "fix acforce all addforce ${Force} NULL NULL region ac"

does not make sense. Fix addforce adds a force to the particles each time-step, so you need this fix only once. Allowing to use a variable with "v_" will be part of the next major LIGGGHTS release

what you could do, as a workaround would be to unfix acforce first and define it again every few steps, but I am not sure how well this will work.

Cheers, Christoph

dbcmih001 | Sat, 03/24/2012 - 12:49

Thanks

1.I will see what I can do. How can I respecify a fix every few timesteps? The thing is that I need a force which varies with particle position and requires regular update. I am simulating an acoustic force which has a sinusoidal form.

2. Is it possible to add an acoustic force to each atom every x timesteps via a loop in the run command i.e.
run 50000 every 50 " variable i loop natoms" etc

3.If I have to code would fix_viscous.cpp be the way to go? Because that has a different force for each particle and updates every timestep?

4.Also How can I make the mpi coupling run see the run 50000 every 50 "...." command?