The servo-wall requires a contact model. Therefore, it has to be used for a fix wall/gran too

Submitted by masoodvalavi on Thu, 02/09/2023 - 10:03

Hello everyone,

i am trying to make a unixal compression stress test using ligggths and i get below error when i am running my script.Does anyone has any idea to how to fix below error:
The servo-wall requires a contact model. Therefore, it has to be used for a fix wall/gran too

my code is as below:

#### Writen for LIGGGHTS ritchi with bond ##########################################################

### Build Simulation
# Specify what we are simulating
atom_style hybrid granular #bond/gran n_bondtypes 1 bonds_per_atom 6
atom_modify map array

## newton off is needed due to the tangential history contact model
atom_modify map array
boundary p p p
newton off

communicate single vel yes

units si
hard_particles yes
region reg block -11.81102471215828 11.81102471215828 -11.81124 11.81102471215828 -12 12 units box
create_box 4 reg
#mass 1 100.0
neighbor 0.002 bin
neigh_modify delay 0

#Material properties required for new pair styles

fix m1 all property/global youngsModulus peratomtype 10e9 10e6 11e9 11e9
fix m2 all property/global poissonsRatio peratomtype 0.2 0.4 0.5 0.5
fix m3 all property/global coefficientRestitution peratomtypepair 4 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5
fix m4 all property/global coefficientFriction peratomtypepair 4 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5

#New pair style
pair_style gran model hertz tangential history
pair_coeff * *
# Use the stiff granular bond model

#bond_style gran

#bond_coeff 1 1 2.8e-3 1 1 1 1
timestep 0.0001
## Set coefficients for contact and bond model
# For the contact model, we do not need to set anything
pair_coeff * *

#

communicate single vel yes
fix zwalls1 all wall/gran model hertz tangential history primitive type 3 zplane 6
fix zwalls2 all wall/gran model hertz tangential history primitive type 3 zplane 8

fix zwalls3 all wall/gran model hertz tangential history primitive type 4 zplane 10
fix zwalls4 all wall/gran model hertz tangential history primitive type 4 zplane 11

#run
#run 200
# Import mesh from cad
#fix cad1 all mesh/surface file new2.stl type 3 scale 0.5 move 0 0 1
fix cad1 all mesh/surface/stress file new2.stl type 3 stress on
fix cad2 all mesh/surface/stress file new4.stl type 4 stress on
# Use the imported mesh as granular wall

# Move wall
#fix move all move/mesh mesh cad1 linear 0 0 1
fix zplane1 all mesh/surface/stress/servo file new2.stl type 3 com 0. 0. 0. ctrlPV force axis 0. 0. 1. target_val 10 vel_max 1. kp 5.
fix meshwalls all wall/gran model hertz tangential history mesh n_meshes 2 meshes cad1 cad2
# Creating imaging information
dump dumpstl all stl 1000 post2/dump*.stl
group pave type 1
group grain type 2
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0
#distributions for insertion
fix pts1 pave particletemplate/sphere 15485863 atom_type 1 density constant 4000 radius constant 0.3
fix pdd1 pave particledistribution/discrete 15485867 1 pts1 1.0

#region for insertion
region bc block -12 12 -12 12 4 6 units box
group bcg region bc
region de block -12 12 -12 12 4 6 units box
group deg region de

#particle insertion
fix ins1 pave insert/pack seed 32452867 distributiontemplate pdd1 &
maxattempt 10000 insert_every once overlapcheck yes all_in no vel constant 0.0 0.0 0 &
region bc particles_in_region 1000
run 1000
unfix ins1

fix gravi all gravity 9.81 vector 0.0 0.0 -1.0

#apply nve integration to all particles
#fix integr all nve/sphere

#output settings, include total thermal energy
compute rke all erotate/sphere
compute peratom all pe/atom
compute pperatom all stress/atom
compute myTemp all temp
compute myPress all pressure myTemp
compute propat all property/atom xs ys zs vx vy vz vx fx fy fz
compute p all reduce sum c_pperatom[1] c_pperatom[2] c_pperatom[3] c_pperatom[4] c_pperatom[5] c_pperatom[6]
variable p1 equal c_p[1]
variable p2 equal c_p[2]
variable p3 equal c_p[3]
variable p4 equal c_p[4]
variable p5 equal c_p[5]
variable p6 equal c_p[6]
variable press equal (c_p[1]+c_p[2]+c_p[3])/(3*vol)

thermo 100
thermo_style custom step lx ly lz c_myPress c_myTemp
thermo_modify lost ignore norm no

#insert particles

#run
#run 2500 upto

communicate single vel yes

# Store final cell length for strain calculations
variable tmp equal "lz"
variable L0 equal ${tmp}
print "Initial Length, L0: ${L0}"

variable strain equal "(lz - v_L0)/v_L0"
variable p0 equal "v_strain"
#variable p7 equal "v_press"
variable p7 equal c_myPress

#fix def1 all print 1000 "${p0} ${p1} ${p2} ${p3} ${p4} ${p5} ${p6} ${p7}" file STRESS-STRAIN.txt screen no

#fix 2 all deform 1 z erate -1 y volume x volume
#fix 2 all deform 1000 z erate -0.2 remap x units box
run 1000

#distributions for insertion
fix pts3 pave particletemplate/sphere 15485863 atom_type 1 density constant 4000 radius constant 0.3
fix pdd3 pave particledistribution/discrete 15485867 1 pts3 1.0
fix ins3 pave insert/pack seed 32452867 distributiontemplate pdd3 &
maxattempt 10000 insert_every once overlapcheck yes all_in no vel constant 0.0 0.0 0 &
region bc particles_in_region 1000
run 1000
unfix ins3
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0

#apply nve integration to all particles
#fix integr all nve/sphere

#fix 2 all deform 1 z erate -1 y volume x volume
#fix 2 all deform 1000 z erate -0.2 remap x units box
run 1000

#distributions for insertion
fix pts4 pave particletemplate/sphere 15485863 atom_type 1 density constant 4000 radius constant 0.3
fix pdd4 pave particledistribution/discrete 15485867 1 pts4 1.0
fix ins4 pave insert/pack seed 32452867 distributiontemplate pdd4 &
maxattempt 10000 insert_every once overlapcheck yes all_in no vel constant 0.0 0.0 0 &
region bc particles_in_region 1000
run 1000
unfix ins4
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0

#apply nve integration to all particles
#fix integr all nve/sphere

#insert particles

#run
#run 2500 upto

communicate single vel yes

#fix 2 all deform 1 z erate -1 y volume x volume
#fix 2 all deform 1000 z erate -0.2 remap x units box
run 1000

fix pts2 grain particletemplate/sphere 15485863 atom_type 2 density constant 1000 radius constant 0.03
fix pdd2 grain particledistribution/discrete 15485867 1 pts2 1.0

fix ins5 grain insert/pack seed 32452843 distributiontemplate pdd2 &
maxattempt 10000 insert_every once overlapcheck yes all_in no vel constant 0.0 0.0 0 &
region de particles_in_region 1000
#dump 21 all custom 10 dump.lammpstrj id type x y z radius
#dump dmpvtk all custom/vtk 100 dump.myforce.vtu id type x y z radius
run 1000
unfix ins5

fix gravi all gravity 9.81 vector 0.0 0.0 -1.0

#apply nve integration to all particles
fix integr all nve/sphere

#insert particles

#run
#run 2500 upto

dump I_stl all mesh/gran/VTK 1000 post3/Stress_file-*.vtk stress
dump dmp all custom 1000 post4/dump.compression id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius

#dump 13 all custom 10 dump.vtk id type x y z radius

#fix 2 all deform 1 z erate -1 y volume x volume
#fix 2 all deform 1000 z erate -0.2 remap x units box
run 4000000