Hi everyone.
I have a system which contains both vapor and liquid of a substance. Because it is not a monatomic substance, I used fix rigid/nve. I want to calculate pressure of vapor. The liquid film is not stationary in the z direction. So first I defined a region that its volume is 0.1 of the whole simulation box and I’m sure there won’t be any liquid in it during the run time. Then I used compute stress/atom command according to the instructions of manual, to calculate pressure of vapor.
Here is my code:
region temp_calc block EDGE EDGE EDGE EDGE -120 -20
group press_calc region temp_calc
compute Temp_Region press_calc temp
compute press press_calc stress/atom Temp_Region
compute p molecule reduce sum c_press[1] c_press[2] c_press[3]
variable pressure equal -(c_p[1]+c_p[2]+c_p[3])/(3*100*40*40)
In which the volume of the region is (40 * 40 * 100) and my system is three-dimensional. I also computed the temperature of this region. Then I output the variable using fix ave/time.
I know that my system has reached the equilibrium at the final timesteps. I have the vapor pressure of that specific temperatures and the problem is, the pressure values that LAMMPS gives do not agree with the pressure values that I have.
Is my system valid? Does calculating pressure in this way give the correct value?
I would be grateful if anyone can help me.