# Local stress tensor with stress/atom and ave/chunk

Hi,
I am trying to model a liquid-vapor interface and interested in finding the local stress tensor Pxx, Pyy, and Pzz.

#### The relevant part of my script reads:

#defines a region of interest
region LV block INF INF INF INF 20 60 units box
#defines 3d chunk
compute chunks3D all chunk/atom bin/3d x lower 10 y lower 10 z lower 2 units box region LV
#computes per atom stress tensor
compute Pressure all stress/atom NULL
#chunk-averaged data
fix all_chunks all ave/chunk 100 2 200 chunks3D c_Pressure[1] c_Pressure[2] c_Pressure[3] file â€śmyoutputâ€ť norm none

I am struggling with the part that the stress/atom compute gives the pressure in (pressure x volume) units. I read that the Voronoi tessellation can be used to divide the c_Pressure[*]. I am wondering if there is any other workaround to this problem without the voronoi ?

Many thanks for your help,
Muhammad

Since you are using 3d binning, the volume of your chunks can be easily determined.

Dear Alex
Many thanks. In my post-processing, Actually I did find the bin volumes and calculated: Pxx_local = np.divide(P_xx, binVolume). The results are in the right ball park.
However I was wondering whether it is technically correct (partly due to my very limited idea on voronoi). Thanks for reassuring. While the binVolumes remain static over the time, my concern was if the voronoi shows any temporal variation ?

Thanks again,
Muhammad

Bests,
Muhammad

Using Voronoi tesselation for your application makes no sense at all. It is a method to divide a total volume into per-atom volumes in a consistent fashion. However, that is irrelevant in your case, since you are summing virial stress contributions into a pre-determined grid of bins, so the volume to use is the volume of those bins. Per-atom volumes do not enter that consideration. Full stop.

Whether this procedure of summing per-bin virial contributions is a valid representation of local stress is a different consideration. This is not my area of research, but I know that there are multiple methods, but they will require more extensive post-processing.

1 Like

Thank you, Alex. Itâ€™s clear to me now. Highly appreciate your help.