In the manual (http://lammps.sandia.gov/doc/fix_deform.html), it says (about fix deform xy erate)

The tilt factor T as a function of time will change as

T(t) = T0 + L0eratedt

where T0 is the initial tilt factor, L0 is the original length of the box perpendicular to the shear direction (e.g. y box length for xy deformation).

So the “erate” should be the shear stain rate, I think.

But in “in.nemd.2d”, which is in the directory of [LAMMPS]/examples/VISCOSITY, it uses

variable xyrate equal {srate}/lx fix 2 all deform 1 xy erate {xyrate} remap v

variable visc equal -pxy/(v_srate/ly).

I think the viscosity should be calculated as “variable visc equal -pxy/${xyrate}” . Otherwise, when lx is not equal ly, the result would be right. Actually, I think it would be appropriate to write as

variable xyrate equal {srate}/ly
fix 2 all deform 1 xy erate {xyrate} remap v

variable visc equal -pxy/${xyrate}.

Maybe I’m wrong. I sincerely appreciate your attention.