Add functions to calculate Cv for NVT simulation.