How to calculate pressure

Dear users,
I’m trying to calculate the pressure on the solid surface when the droplet hits the solid surface (from the vertical direction of the impact), the droplet is a simple spherical water droplet, the pt atoms arranged in seven layers are the solid base, part of the code is below, what is wrong in my setup?

Modeling…(ppf)
Relaxation…(NVT)
unfix nvt
fix 1 all nve

compute subTemp pt temp
compute 2 pt stress/atom subTemp
compute v pt Voronoi/atom
variable stressz atom c_2[3]/c_v[1]*100000 ##units Pa

dump pressure pt custom 40 pt.xyz id type x y z v_stressz

Then I put the file into OVITO and the visual pressure chart didn’t meet my expectations, and I wondered if there was something wrong with my code? At the same time, what do I need to set up to eliminate the pressure of the lower solid atoms on the surface atoms?

Hi @HJ.Ran,

Computing local pressure at the atomic scale is a tricky business.

But apart from that when you say:

What were your expectations? How did they differ from the results?

What does that mean? Would it have a physical meaning to have the underlying atoms not included in the calculation?