Hi,
I want to insert cylinderical particles in my system and I've read all the discussions in the forum about multispheres. unfortunately they didn'e help me.
I'm not familiar about making molecules clumps and using fix rigid. can anyone help me about generating and inserting non-sphere particles step by step?
an example script could be very helpful.
BTW I have STL of my particle, but I'm not sure if it could be helpful!
Thanks,
SHG
ckloss | Tue, 03/10/2015 - 09:51
Hi SHG,
Hi SHG,
what you typically do when using fix rigid is to set up the single particles in the simulation that should lateron be part of the non-spherical ones, attach different molecule IDs to it and then use the fix riid command to "glue" the different particles together
Best wishes
Christoph
shahabgol | Sat, 03/14/2015 - 12:16
Hi Cristoph,
Hi Cristoph,
Thank you for your kind answer.
Could you please type me a sample for using fix rigid command? I need the correct command format. How should I enter particle IDs in fix rigid?
Best Regards,
SHG
richti83 | Sat, 03/14/2015 - 15:10
Example
Hi SHG,
this is the code I used to model this system (each beer bottle is a single rigid body):
https://www.youtube.com/watch?v=W_bRl4wmkY8
###############################################################################################################
#Idea: read same coordinates from file and than move initial position to start position
#needs 3*i files with IDs consecutive from 0..maxID*i*3
#
variable i loop 1 10 #loop counter (max 10, bc only 31 groups are allowed and every loop inserts 3 bottles)
variable p equal 1 #counter for prototype-file
region bottle_in cylinder z 0 0 0.0146 -0.001 0.15 #catch all atoms in insert region
#
label loop
variable xnew atom x+$L*$i
read_data bottle$p.prototype add #bottle in 0/0/0
group bottle$p region bottle_in #assign group1
variable ynew atom y+$L #new y-position
set group bottle$p x v_xnew y v_ynew #shift right
variable p equal $p+1 #next prototype
#
read_data bottle$p.prototype add #bottle in 0/0/0
group bottle$p region bottle_in #assign group2
variable ynew atom y-$L #new y-position
set group bottle$p x v_xnew y v_ynew #shift left
variable p equal $p+1 #next prototype
#
read_data bottle$p.prototype add #bottle in 0/0/0
group bottle$p region bottle_in #assign group3
set group bottle$p x v_xnew #do not shift in y direction
variable p equal $p+1 #next prototype
#
next i
jump SELF loop
#
################################################################################################################
#gravity and integreator for rigid body
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
fix integr all rigid group 30 bottle1 bottle2 bottle3 bottle4 bottle5 bottle6 bottle7 bottle8 bottle9 bottle10 &
bottle11 bottle12 bottle13 bottle14 bottle15 bottle16 bottle17 bottle18 bottle19 bottle20 &
bottle21 bottle22 bottle23 bottle24 bottle25 bottle26 bottle27 bottle28 bottle29 bottle30
This approach is limited to 31 rigid bodies, because you can not make more than 32 groups.
With a little hack in atom_vec_sphere (where the atom style gran is defined) to store & communicate the molecule id too you can assign a molecule ID to every particle and than use fix rigid based on mol-id's instead of groups. (I think this would be possible with a hybrid granular molecure style, but than the read_data files needs to have the mol id included, I did not test this)
variable i loop 1 16 #loop counter (every loop inserts 3 bottles)
variable p equal 1 #counter for prototype-file
region bottle_in cylinder z 0 0 0.0146 -0.001 0.15 #catch all atoms in insert region
#
label loop
variable xnew atom x+$L*$i
read_data bottle$p.prototype add #bottle in 0/0/0
#group bottle$p region bottle_in #assign group1
variable ynew atom y+$L #new y-position
set region bottle_in mol $p
set region bottle_in x v_xnew y v_ynew #shift right
variable p equal $p+1 #next prototype
#
read_data bottle$p.prototype add #bottle in 0/0/0
#group bottle$p region bottle_in #assign group2
variable ynew atom y-$L #new y-position
set region bottle_in mol $p
set region bottle_in x v_xnew y v_ynew #shift left
variable p equal $p+1 #next prototype
#
read_data bottle$p.prototype add #bottle in 0/0/0
#group bottle$p region bottle_in #assign group3
set region bottle_in mol $p
set region bottle_in x v_xnew #do not shift in y direction
variable p equal $p+1 #next prototype
next i
jump SELF loop
#
################################################################################################################
#gravity and integreator for rigid body
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
neigh_modify exclude molecule all #exclude if both atoms are in the same molecule and in the same group (speeds up simulation by factor 4!)
fix integr all rigid molecule #needs hacked atom_vec_sphere.cpp
Cheers,
Christian.
shahabgol | Sat, 03/14/2015 - 15:56
Appreciation
Dear Christian,
Thank you so much for your complete and accurate answer. It is very helpful.
Cheers,
SHG
shahabgol | Sat, 03/14/2015 - 17:59
Christian.
Christian,
Can I have your e-mail?
richti83 | Sat, 03/14/2015 - 19:27
see
http://www.richtisoft.de/impress.php