Box Compression

Submitted by rasoul on Sun, 11/10/2013 - 19:58

Hi,

I'd like to compress a box includes particles in all 6 directions. For doing that I have to build six (6) 2-D plate (stl file) and use "mesh/surface/stress/servo" for every plate. Is it true?
Or, I can build a 3-D box and compress in all 6 directions. If it is possible, would you please inform me how can I do that.

Best Regards,
Rasoul

sirop | Mon, 11/11/2013 - 04:47

I have done similar simulation - tension and compression - maybe it will be useful for you
===============================================================

#Cubic region tensile (compression) without gravity

log post/_INFO
echo both

#processors 2 2 1

atom_style granular
atom_modify map array
boundary m m m
newton off

communicate single vel yes
units si

region reg block -3. 3. -3. 3. -3. 3. units box
create_box 2 reg

variable ave_radius equal 0.024
variable rel_radius equal 1.5
variable min_radius equal ${ave_radius}/${rel_radius}
variable max_radius equal ${ave_radius}

neighbor ${min_radius} bin
neigh_modify delay 0 check yes

variable rest equal 1.0
variable friction equal 0.5
variable density equal 2500
variable pressure equal 1.e+6

#Material properties required for new pair styles
fix m1 all property/global youngsModulus peratomtype 1.e9 1.e9
fix m2 all property/global poissonsRatio peratomtype 0.0 0.0
fix m3 all property/global coefficientRestitution peratomtypepair 2 ${rest} ${rest} ${rest} ${rest}
fix m4 all property/global coefficientFriction peratomtypepair 2 0.0 0.0 0.0 ${friction}
fix m5 all property/global characteristicVelocity scalar 1.

#New pair style
pair_style gran/hooke/history
pair_coeff * *

timestep 1e-5

variable dump_frameps equal 50
variable dump_file equal 1/dt/${dump_frameps}
variable dump_thermo equal ${dump_file}

variable time_grow equal .5
variable time_relax1 equal 1.
variable time_relax2 equal 1.
variable time_pack equal 2.

variable run_grow equal ${time_grow}/dt
variable run_relax1 equal ${time_relax1}/dt
variable run_relax2 equal ${time_relax2}/dt
variable run_pack equal ${time_pack}/dt

variable vel_rel equal 0.0
variable vel_defx equal 0.05
variable vel_defz equal ${vel_defx}*${vel_rel}
variable vel_pack equal 0.25/${time_pack}

variable time_def equal 30.0
variable x_def equal ${vel_defx}*${time_def}
variable z_def equal ${vel_defz}*${time_def}
variable run_def equal ${time_def}/dt

variable servo_vel equal 10.
variable servo_kp equal 10.e-1
variable servo_ki equal 0.e-1
variable servo_kd equal 0.e-1

#inner ant outer walls
fix xwalls1 all wall/gran/hooke/history primitive type 1 xplane -3.
fix xwalls2 all wall/gran/hooke/history primitive type 1 xplane +3.
fix ywalls1 all wall/gran/hooke/history primitive type 1 yplane -3.
fix ywalls2 all wall/gran/hooke/history primitive type 1 yplane +3.
fix zwalls1 all wall/gran/hooke/history primitive type 1 zplane -3.
fix zwalls2 all wall/gran/hooke/history primitive type 1 zplane +3.

#import triangular mesh
fix xplane1 all mesh/surface/stress file stl/plane-x-equal-0.5-yz-equal-3.0-trg4.stl type 1 move -0.25 0. 0.
fix xplane2 all mesh/surface/stress file stl/plane-x-equal+0.5-yz-equal-3.0-trg4.stl type 1 move 0.25 0. 0.
fix yplane1 all mesh/surface/stress file stl/plane-y-equal-0.5-xz-equal-3.0-trg4.stl type 1
fix yplane2 all mesh/surface/stress file stl/plane-y-equal+0.5-xz-equal-3.0-trg4.stl type 1
fix zplane1 all mesh/surface/stress file stl/plane-z-equal-0.5-xy-equal-3.0-trg4.stl type 1 move 0. 0. -0.25
fix zplane2 all mesh/surface/stress file stl/plane-z-equal+0.5-xy-equal-3.0-trg4.stl type 1 move 0. 0. 0.25

#use the imported mesh as granular wall
fix granwallsx all wall/gran/hooke/history mesh n_meshes 2 meshes xplane1 xplane2
fix granwallsy all wall/gran/hooke/history mesh n_meshes 2 meshes yplane1 yplane2
fix granwallsz all wall/gran/hooke/history mesh n_meshes 2 meshes zplane1 zplane2

#distributions for insertion
fix pts1 all particletemplate/sphere 1 atom_type 1 density constant ${density} radius uniform number ${min_radius} ${max_radius}
#fix pts1 all particletemplate/sphere 1 atom_type 1 density constant ${density} radius constant ${ave_radius}
fix pdd1 all particledistribution/discrete 1. 1 pts1 1. #pts2 0.7
variable volfraction equal 0.3

#region and insertion
group nve_group region reg

#region for insertion
region reg_ins block -0.75 0.75 -0.5 0.5 -0.75 0.75 units box
#particle insertion
fix ins nve_group insert/pack seed 5330 distributiontemplate pdd1 &
maxattempt 1000 insert_every once overlapcheck yes all_in yes vel constant 0. 0. 0. &
region reg_ins volumefraction_region ${volfraction} ntry_mc 1000

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

compute as all stress/atom pair #compute stresses
compute ac all coord/gran skin 0.0 #coordination number
compute vo all volume/gran #particles volume

fix ts all check/timestep/gran ${dump_thermo} 0.1 0.1 warn yes

thermo_style custom step atoms ke c_vo f_ts[1] f_ts[2] press f_xplane1[1] f_xplane2[1] f_yplane1[2] f_yplane2[2] f_zplane1[3] f_zplane2[3]
thermo ${dump_thermo}
thermo_modify lost ignore norm no
compute_modify thermo_temp dynamic yes

#insert the first particles
run 1
dump dmp all custom ${dump_file} post/dump*.global id type x y z vx vy vz fx fy fz radius c_ac c_as[1] c_as[2] c_as[3] c_as[4] c_as[5] c_as[6]
dump dmpr all custom ${run_relax1} post/dump*.data id type diameter density x y z
dump_modify dmp first yes pad 8
dump_modify dmpr first yes pad 8
unfix ins

#moving mesh - pack in two directions (y direction is fixed)
fix loadx1p all move/mesh mesh xplane1 linear ${vel_pack} 0. 0.
fix loadx2p all move/mesh mesh xplane2 linear -${vel_pack} 0. 0.
fix loadz1p all move/mesh mesh zplane1 linear 0. 0. ${vel_pack}
fix loadz2p all move/mesh mesh zplane2 linear 0. 0. -${vel_pack}
run ${run_pack}
unfix loadx1p
unfix loadx2p
unfix loadz1p
unfix loadz2p

run ${run_relax1}
set type 1 type 2 #initial friction coefficient for particles is equal zero

fix xplane1_ all mesh/surface/stress/servo file stl/plane-x-equal-0.5-yz-equal-3.0-trg4.stl &
type 1 com -0.5 0. 0. dim x ctrlPV force target_val ${pressure} vel_max ${servo_vel} kp ${servo_kp} ki ${servo_ki} kd ${servo_kd}
fix xplane2_ all mesh/surface/stress/servo file stl/plane-x-equal+0.5-yz-equal-3.0-trg4.stl &
type 1 com +0.5 0. 0. dim x ctrlPV force target_val -${pressure} vel_max ${servo_vel} kp ${servo_kp} ki ${servo_ki} kd ${servo_kd}
#fix yplane1_ all mesh/surface/stress/servo file stl/plane-y-equal-0.5-xz-equal-3.0-trg4.stl &
# type 1 com 0. -0.5 0. dim y ctrlPV force target_val ${pressure} vel_max ${servo_vel} kp ${servo_kp} ki ${servo_ki} kd ${servo_kd}
#fix yplane2_ all mesh/surface/stress/servo file stl/plane-y-equal+0.5-xz-equal-3.0-trg4.stl &
# type 1 com 0. +0.5 0. dim y ctrlPV force target_val -${pressure} vel_max ${servo_vel} kp ${servo_kp} ki ${servo_ki} kd ${servo_kd}
fix zplane1_ all mesh/surface/stress/servo file stl/plane-z-equal-0.5-xy-equal-3.0-trg4.stl &
type 1 com 0. 0. -0.5 dim z ctrlPV force target_val ${pressure} vel_max ${servo_vel} kp ${servo_kp} ki ${servo_ki} kd ${servo_kd}
fix zplane2_ all mesh/surface/stress/servo file stl/plane-z-equal+0.5-xy-equal-3.0-trg4.stl &
type 1 com 0. 0. +0.5 dim z ctrlPV force target_val -${pressure} vel_max ${servo_vel} kp ${servo_kp} ki ${servo_ki} kd ${servo_kd}
fix granwallsx_ all wall/gran/hooke/history mesh n_meshes 2 meshes xplane1_ xplane2_
#fix granwallsy_ all wall/gran/hooke/history mesh n_meshes 2 meshes yplane1_ yplane2_
fix granwallsz_ all wall/gran/hooke/history mesh n_meshes 2 meshes zplane1_ zplane2_

unfix xplane1
unfix xplane2
#unfix yplane1
#unfix yplane2
unfix zplane1
unfix zplane2
unfix granwallsx
#unfix granwallsy
unfix granwallsz

variable fwx1 equal f_xplane1_[1]
variable fwx2 equal f_xplane2_[1]
variable fwy1 equal f_yplane1[2]
variable fwy2 equal f_yplane2[2]
variable fwz1 equal f_zplane1_[3]
variable fwz2 equal f_zplane2_[3]

variable dwx1 equal f_xplane1_[7]
variable dwx2 equal f_xplane2_[7]
variable dwz1 equal f_zplane1_[9]
variable dwz2 equal f_zplane2_[9]

variable t equal step*dt
variable k equal ke
variable p equal press

fix dumpw all print ${dump_file} &
"$t $k $p ${fwx1} ${fwx2} ${fwy1} ${fwy2} ${fwz1} ${fwz2} ${dwx1} ${dwx2} ${dwz1} ${dwz2}" &
file post/_WALL screen no title "time ke press fx1 fx2 fy1 fy2 fz1 fz2 dx1 dx2 dz1 dz2"

thermo_style custom step atoms ke f_ts[1] f_ts[2] press f_xplane1_[1] f_xplane2_[1] f_yplane1[2] f_yplane2[2] f_zplane1_[3] f_zplane2_[3] f_xplane1_[7] f_xplane2_[7] f_zplane1_[9] f_zplane2_[9]

run ${run_relax1}

fix_modify xplane1_ integrate stop
fix_modify xplane2_ integrate stop
#fix_modify yplane1_ integrate stop
#fix_modify yplane2_ integrate stop

thermo_style custom step atoms ke f_ts[1] f_ts[2] press f_xplane1_[1] f_xplane2_[1] f_yplane1[2] f_yplane2[2] f_zplane1_[3] f_zplane2_[3] f_zplane1_[9] f_zplane2_[9]

#moving mesh - tension
fix loadx1 all move/mesh mesh xplane1_ linear -${vel_defx} 0. 0.
fix loadx2 all move/mesh mesh xplane2_ linear +${vel_defx} 0. 0.

run ${run_def}

#unfix loadx1
#unfix loadx2
#run ${run_relax2}

#moving mesh - compression
#fix unloadx1 all move/mesh mesh xplane1 linear -${vel_defx} 0. 0.
#fix unloadx2 all move/mesh mesh xplane2 linear +${vel_defx} 0. 0.
#fix unloadz1 all move/mesh mesh zplane1 linear 0. 0. +${vel_defz}
#fix unloadz2 all move/mesh mesh zplane2 linear 0. 0. -${vel_defz}

#run ${run_def}

#unfix unloadx1
#unfix unloadx2
#unfix unloadz1
#unfix unloadz2
#run ${run_relax2}

Sergei Klishin, Mining Institute

rasoul | Mon, 11/11/2013 - 18:33

Thanks for the helpful response.

PaulWinkler's picture

PaulWinkler | Wed, 11/20/2013 - 12:42

Hi,

you can create and edit ASCII-stl files with any editor. Here an example of a rectangle, described by two facets.

solid Created by PW
facet normal 0 0 1
outer loop
vertex 0.0 0.0 0.1
vertex 0.1 0.1 0.1
vertex 0.1 0.0 0.1
endloop
endfacet
facet normal 0 0 1
outer loop
vertex 0.1 0.1 0.1
vertex 0.0 0.0 0.1
vertex 0.0 0.1 0.1
endloop
endfacet
endsolid Created by PW

Regards,
Paul

deepakpawar.2310 | Thu, 01/10/2019 - 05:31

hi
i am getting following error while runnig thea above acript

compute as all stress/atom pair #compute stresses
compute ac all coord/atom 0.003 mix yes # coordination number
#compute vo all voronoi/atom #particles volume
compute vo solute voronoi/atom only_group
ERROR: Invalid compute style (/home/pawar/LIGGGHTS-PUBLIC-master/src/modify.cpp:1024)

Any comment on that. however, I tried the following command as well
compute 1 all voronoi/atom