Is it possible to add random height while inserting particles?

Submitted by laudari on Sat, 07/17/2021 - 08:45

Hello everyone, I need some help.

Currently, I am doing simulation in LIGGGHTS. My particles insertion area and surface have height approximately 0.02 in si units.

I would like to add some random height so that my particles drop from different height in the same simulations. Purpose of this is to bring noise on heights.

So I want to drop particles randomly at the height of 0.02 +- 10 % or 0.02 +- 20 %while running simulation.

Is it possible to add this idea in liggghts script?

What will be the command?

Thank you.

mschramm | Sat, 07/17/2021 - 15:56

Hello,
Currently, how are you doing your insertion? What type of randomness are you looking for?

I mostly use insert/pack to insert my fibers. This insert takes a region argument for where the particles should be inserted and are inserted uniformly inside this region.

laudari | Sat, 07/17/2021 - 16:45

Thank you for your reply @ mschramm
Currently I am inserting particles in a region like :
```
group nve_group region domain
region bc cylinder z 0.0 0.0 0.015 0.05 0.12 units box

#particle insertion
fix ins nve_group insert/pack seed 32452867 distributiontemplate pdd1 insert_every 1 overlapcheck yes all_in yes particles_in_region 1 region bc

```

Actually I also used 'insert/pack ' to drop particles like you mentioned. I found that particles are dropping from different heights. So I want to know the highest and lowest distance from surface to particles insertion area. So that I can figured out how much noise is there in heights from my actual height.

for eg: if my average height between surface to particles dropping region is 0.2m. Then how much percent is added from 0.2m to get highest point and how much percent from 0.2 is decreased to get lowest point.
Main purpose of this is that I am trying to define a simulation including an information like` we dropped particles from the height of 0.2+- a% m.`

So is it possible to record such distance/height ?

I hope I made clear in my explanation.

Thank you.

mschramm | Mon, 07/19/2021 - 16:29

Hello,
As you are trying to inserting a single atom every time step, there really is no elegant solution without writing a custom fix.
IF you were inserting all of your particles in a single go, you could use the "fix store/state" command to get all of your atoms initial positions.

4 see three ways you can accomplish what you want (ranked in increasing difficulty).
1) Only use your region information and not the actual particle positions.
2) Output a dump file each step so you can extract your information.
3) Create a loop in your script that calculates the mean insertion location and the variance of your insertion position using "online" algorithms to calculate the mean and variance. Use these values to create your confidence band of particle insertion (https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance).
4) Write a custom fix based off of the "fix strore/state" command that will only ever grab the initial properties of your atoms.