Pressure tensor for inhomogeneous fluids.

We develop a simple, efficient, and general statistical mechanical technique for calculating the pressure tensor of an atomic fluid. The method is applied to the case of planar Poiseuille flow through a narrow slit pore, and the results indicate that our technique is accurate and relatively efficient. A second method to calculate shear stress is derived from the momentum continuity equation. This mesoscopic method again is seen to be accurate with low statistical uncertainty. Using both approaches, the viscosity is calculated as a function of position across the pore, and is seen to oscillate because of a wall-induced local structure in the fluid. We discuss these methods in relation to the well-known ambiguity of the pressure tensor.