Density Profile in LAMMPS for Argon Droplet

Hello all,
I am trying to simulate stable argon nano droplet on gold surface. I have relaxed the structure. For contact angle calculation I need to output the density profile. I am using the following command but not getting anything near what I want. Would anyone please help me out?

compute densitymap argon chunk/atom bin/cylinder z center 1 30 30 0 40 40 discard yes units
lattice
fix 103 argon ave/chunk 10 10 100 densitymap density/mass norm sample ave running file densitymap.txt overwrite

Nobody here is a mind reader, so please explain:

  • what is it that you get?
  • what is it that you want/expect?
  • how are those different?
  • why did you choose the commands you chose?
  • did you visualize your trajectory and does the system behave as expected?

Please also note that by just quoting the two commands at best people can check the syntax, but that is also built into LAMMPS

My bad, I am describing everything here.
I want to simulate a stable nano droplet of Argon interacting with solid surface of Au substrate. I have to relax the structure first for stable nano droplet (No atoms flying out of the surface). I am running 100000 steps for that using nvt ensemble, and after that I am running another 100000 steps and I want to output density profile (Density vs radial distance) during these steps. From that profile, I want to calculate the contact angle of the liquid and solid surface.

My question is,

  1. How can I output density profile from which I can calculate contact angle?

I am putting up my code below,

stable Ar nanodroplet

units real
atom_style atomic
boundary s s s
processors 2 2 2

generate initial Ar structure by LAMMPS commands

lattice fcc 5.26
region box block -60 60 -60 60 -60 60
create_box 2 box

#################### Create Argon atoms #####################

region particle sphere 0 2 25 25 side out units box
create_atoms 1 box
delete_atoms region particle compress yes
mass 1 39.948

#################### Create Au atoms #####################

lattice fcc 2.95 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
region brocode block -10 10 -10 10 -5.9 0
create_atoms 2 region brocode
#delete_atoms region brocode compress yes
mass 2 196.967

#################### Define groups ####################

group argon type 1
group gold type 2

assign initial velocities

velocity all create 84 1928059 mom yes rot yes sum no dist gaussian

#################### LJ potentials for Argon ###########

pair_style lj/cut 15
pair_coeff 1 1 .24468 3.5 15

pair_style hybrid/overlay lj/cut 10
pair_coeff * * lj/cut .73404 3.5

#air_style lj/cut 10
#air_coeff 2 2 .24468 3.5

timestep 1

thermo 1000
thermo_style custom step temp pe etotal lx ly lz

dump config all custom 600000 Ar.droplet.config.* id type x y z vx vy vz
dump_modify config format line “%8d %5d %25.18g %25.18g %25.18g %20.13g %20.13g %20.13g”

relax nano-droplet

apply thermodynamic conditions / constrains here

fix 1 argon nvt temp 84 84 100.0
fix 3 argon momentum 1 linear 1 1 1

dump myDump all xyz 5000 movie.xyz
#dump_modify myDump element Ar

run 100000

################### Continuie to run to output density profile for contact angle############

unfix 1
unfix 3

fix 1 argon nvt temp 84 84 100.0
fix 3 argon momentum 1 linear 1 1 1

#compute densitymap argon chunk/atom bin/cylinder 0 2 25 2 25 50 discard yes
#compute densitymap argon chunk/atom bin/cylinder z center 1 30 30 0 40 40 discard yes units lattice
#fix 103 argon ave/chunk 10 10 100 densitymap density/mass norm sample ave running file densitymap.txt overwrite
run 100000

No you don’t. You just provided the entire input, but did not really answer any of the questions I posed.

I am answering your questions below,

  1. I got a solid sphere of Argon interacting with the solid surface of Au

  2. I want to calculate the contact angle from density profile.

  3. I need 3 informations, as I need to get the attached picture for contact angle

             * Radial distance from center
             * Coordinate along cylinder axis
             * Density/mass 
    
  4. I chose the ave/chunk to output the density profile. I got coordinate 1 and coordinate 2 and density/mass. I do not know what to do with the output.

  5. I saw the movie in VMD, even if the structure is stable, I am not being able to get a countour or density profile.

I hope I answered your questions. If not, please let me know.

You answered most of them, but it looks like you need help in doing basic scientific research work beyond what we can provide here.

If you don’t know what to do, why did you choose it?
Your figure shows a graph labeled in x- and z- direction (how was this obtained?), but the cylinder binning is in direction of the given axis and radial distance orthogonal to it. The format of the output data is explained in the fix ave/chunk documentation.

If you need to learn how to do post-processing of data and in particular how to process and visualize data created by LAMMPS, you need to build your skills and start with something much simpler (say a 1d binning density profile). Run the computation, figure out how to process the data, compare it to what you should get and then move on to a more complex procedure. For as long as you only move on to the next step when you have mastered the current, you will eventually reach your goal.

But you cannot expect that there is a simple “do this, not that” kind of answer or somebody that will sit down and provide you with the result and work that you should be doing.

Basically, any kind of question of the kind “how do it do this task?” is something that you need to work on with your adviser or colleagues or similar. The forum can help more with the more technical aspects, e.g. when you get errors or when your output has a different format than what is written in the documentation. LAMMPS input is in many ways like a programming language, we can help with the syntax, but the program itself you have to write yourself.

Thank you for your valuable reply. The picture was obtained from the internet.

One final remark, if you do a little research of the literature on how to obtain the contact angle from molecular dynamics, you should quickly find some useful discussions on what are suitable approaches. Your strategy of binning and deriving a geometry from that is not likely going to be very useful or accurate. Transferring macroscopic methods to the atomic scale rarely works.

Thanks. I tried so many combinations of that command but could not succeed. I needed three infos.

  1. Radial distance
  2. height
  3. Density./mass
    Using these 3 I have to draw a contour which I can do in Matlab.

Radius/height are not well defined for atomic systems. Unlike with macroscopic systems, you don’t have a well defined surface since the atoms are represented by point particles. This is a double problem since a) you have a system with mostly vacuum and a few points and b) you would have to consider the size of the atoms but that is also not a well defined property.

Also, you cannot really define a density map on an atomic scale (it would be very noisy and very coarse) so trying the kind of contour mapping and analyzing cannot easily work. To get a representation of the surface you would need to apply some completely different method, i.e. some kind of tessellation, but that is also not so easily usable since you also have fluctuations and thus would have to average over a sufficient period to get converged results.

As I have mentioned before, there are publications discussing how to determine the property you are looking for and even publications comparing the shortcomings and benefits of different methods. You seem to be trying to apply logic and methods that are suitable for macroscopic experiment to atom scale data without taking into account the differences.

Thank you so much for your detailed answer. I have gone through 5/6 publications but none of them mentioned anything about the code in LAMMPS. They just mentioned the result.

Then you should search more specifically for methods to compute the contact angle. I did a quick Google search and found multiple publications easily that are describing or discussing different methods.

1 Like

May be I have gone through them. Is it possible to share the link?

https://bfy.tw/S8fD