Simultaneous Simulation of volume Expansion of particles and Applied Force

Submitted by krobot on Tue, 04/23/2024 - 16:52

Hello everyone,

I'm currently working on a simulation involving a box where the particles inside undergo a volume expansion of 100%. My objective is to calculate the critical stress within the box by applying a compressive force, when the simulation box will alternately expand and contract.

Up to now, I have managed to simulate the expansion and contraction of the box and the application of force on its walls as separate processes. However, I'm facing challenges in combining these two simulations to run concurrently.

Any insights or advice on how to achieve this simultaneous simulation would be greatly appreciated!

Thank you in advance for your help.

Here I attached part of the code:

#import triangular mesh from cad
fix cad1 all mesh/surface/stress/servo file meshes/Part1.stl type 1 scale 0.012 move ${cen_x} ${cen_y} ${z1} com ${cen_x} ${cen_y} ${z1} ctrlPV force axis 0. 0. 1. target_val ${ctrlForce} vel_max ${velMax} kp ${ctrlKp} ki ${ctrlKi} kd ${ctrlKd}

#use the imported mesh as granular wall
fix granWall all wall/gran model hertz tangential history mesh n_meshes 1 meshes cad1

ix pts all particletemplate/sphere ${seed1} atom_type 1 density constant ${dens} radius constant ${rad}
fix pdd all particledistribution/discrete ${seed2} 1 pts 1.0

#particle insertation
fix ins all insert/pack seed ${seed3} distributiontemplate pdd maxattempt 10000 insert_every once overlapcheck yes all_in yes vel constant 0.0 0.0 0.0 region reg particles_in_region 1000 ntry_mc 10000

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

fix_modify cad1 integrate stop
#insert the first particles so that dump is not empty
run 1

########################################################################################
compute radi all property/atom update_on_run_end yes radius

run 1

# Define the growth parameters
variable grow_rate_dia equal 0.3 # size of the diameter grows every growth step
variable grow_every equal 50 # The growth of particles in every step

variable start_dia equal 2*${rad}
variable end_dia equal 2*${rad}*100
variable grow_steps equal (${end_dia}-${start_dia})/${grow_rate_dia}
variable grow_runs equal ${grow_steps}*${grow_every}
variable relax_runs equal ${grow_runs}

variable grow_ratio atom c_radi*2+${grow_rate_dia}

fix grow_particles g_reg adapt ${grow_every} atom diameter v_grow_ratio
#############################################################################################
# Run particle growth and box expansion
run ${grow_runs}

# move
fix_modify cad1 integrate start

#run
run ${nStepsRun}

####################################################
#unfix grow_particles
unfix grow_particles

run ${grow_runs}