Compute Stress/Atom with nanoparticle(rigid)

Hi Dear Lammps users,

I try to simulate a oil–water–nanoparticle system, but the interfacial tension seems wrong.
I used commands like that:
compute peratom all stress/atom NULL
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
variable ten equal 0.5*((c_p[1]+c_p[2])/2-c_p[3])/vol*40
fix s1 all ave/time 1 200000 400000 v_ten file tension.txt

But it seems that when the system includes nanoparticles (rigid wtih command-
fix 1 nano rigid/nve molecule
neigh_modify exclude molecule/intra nano)
The compute commands or other commands needs other set?

Any help is appreciated very much.

I cannot capture your exact system from your posted information, but when a simulated system has an interface parallel to the xy-plane and is conducted with proper ensemble and …, the interfacial (or surface) tension can be calculated from the pressure tensor of the system (please read some textbooks or publications). The command to calculate the interfacial tension will look like:
variable pl equal 0.5*(pxx+pyy)
variable st equal 0.5*lz*(pzz-v_pl)*conv
where conv is a variable for unit conversion and st is a variable storing a value of the interfacial tension. st can be outputted with the ave/time command as you have already done.