I am trying to understand the calculation of viscosity using combinations of different ensembles and different methods.

For non equilibrium MD calculation using periodic perturbation of external shear, which is the best ensemble that can be used? My values appear similar for NVT and NPT but vary significantly with NVE ensemble. I am assuming that NVE gives the best results because of no influence of thermostat and barostat and all of the change in energy due to the applied shear is captured in calculation of viscosity. Is my reasoning appropriate? Can someone direct me to a research paper with the right way of calculating viscosity using Non equilibrium MD?

Finally, which is the best way to calculate viscosity optimising computational time and accuracy of results?

the thermostat influence in the non-equilibrium cosine perturbation approach is automatically taken care by GROMACS, which biases termperature rescaling based on the velocity profile of fluid particles.

However, some thermostats will introduce additional ‘artificial’ viscosity, so your reasoning is correct, I believe. However, from a practical standpoint I don’t see the reason why one would want to compute a nominal value of viscosity from a NVE simulation, mainly because of two reasons:

production runs are rarely NVE, so you would want to use a consistent value for viscosity (and the one from NVE would be incorrect).

viscosity itself is a function of temperature, so I’m not sure if it makes sense from a purely physical standpoint to estimate if by fixing the total energy, rather than temperature.

When it comes to pressure, as far as I know it may be problematic to estimate viscosity from equilibrium NPT simulations (you want the cell volume not to fluctuate in order for the Green-Kubo formula to converge). I am not sure about non-equilibrium though; probably volume fluctuations are not a problem in NE.