Hi! I’m trying to simulate a indentation process. All the sample codes I have seen (LAMMPS examples & other Github codes) use a constant velocity indenter. Is there any way indentation can be done at a constant load (which better replicates real life hardness tests imo). And if not, then how do I model the indenter to penetrate upto a certain depth, stay there for some time and then be retracted? I can explain the algorithm in my head but do not know how to apply such conditions in the code. The code I currently have just makes the indenter keep penetrating into the material infinitely. Thanks in advance

units metal
echo both
atom_style atomic
dimension 3
boundary p s p
region box block 0 140 0 100 0 140 units box
create_box 1 box
lattice fcc 3.61
region cu block 0 140 0 100 0 140 units box
create_atoms 1 region cu units box
timestep 0.002
pair_style eam/alloy
pair_coeff * * Cu_zhou.eam.alloy Cu

# Energy Minimization

minimize 1.0e-4 1.0e-5 10000 10000

# rigid boundary

region 1 block 0 140 0 25 0 140 units box
group anvil1 region 1
region 2 block 0 25 0 100 0 140 units box
group anvil2 region 2
region 3 block 115 140 0 100 0 140 units box
group anvil3 region 3
group anvil union anvil1 anvil2 anvil3
group mobile subtract all anvil

# initial velocities

compute new mobile temp
velocity mobile create 300 482748 temp new
fix 1 mobile nvt temp 300.0 300.0 0.05
fix 2 anvil setforce 0.0 0.0 0.0

reset_timestep 0
variable y equal “100.1-stepdt0.05”
print “y is \$y”

variable disp equal “stepdt0.05”
variable f1 equal f_4[1]
variable f2 equal f_4[2]
variable f3 equal f_4[3]
variable load equal “((v_f1)^2 + (v_f2)^2 + (v_f3)^2)^(1/2)”
variable force equal fmax
variable stp equal “step”

fix 4 mobile indent 1000 sphere 70 v_y 70 10.0 units box
thermo 100
thermo_style custom step temp v_y f_4[1] f_4[2] f_4[3] fmax
fix 8 all print 100 “{stp} {force} \${disp}” title “step load disp” file output_data3.txt screen no
dump 1 all atom 100 cryst_indent3.lammpstrj

run 10000

Fix indent is not a good choice to replicate the macroscopic hardness test because the time and the length scales are different. In the macroscopic test you deform the system on the timescale of seconds and you would deform not just a tiny bit of the surface but measure the bulk of the material. In a simulation you can only model processes with duration of up to nano or microseconds, so you cannot really study the dynamics if you are looking at high frequency processes.

Thus you can load your system by just deforming the box, either gradually with fix deform or instantly with change_box, but keep in mind that “gradual” is still “instant” by comparison to the macroscopic procedure.

If you need an additional opinion on this, please search for some LAMMPS tutorials on uniaxial tension or search the archives for previous discussions on that subject.

So what I understand is that real life hardness tests are difficult to reproduce in simulation. I want to keep it simple for now and just validate my results with that of a paper. The indenter needs to be penetrated till a certain depth, held fixed & then retracted back at the same velocity. So in the given code, the indenter is at 100.1 in +y direction at step 0. The box dimension is 100.0. If I want the indenter to reach till 99.9, it requires 2000 steps according to the equation variable y equal “100.1-stepdt 0.05”

But then how to keep it there for say, 1000 steps & then retract it? For retraction, if I unfix the fix indent & run, will the gradual removal occur or will the indenter vanish (this seems likelier) ? Any suggestions will be of great help

LAMMPS input scripts are like little programs. You can have multiple “run” commands and thus break down your simulation into multiple parts. In between you run replace the fix command with a one that has different settings like a constant position or change the variable definition.