Temperature evolution in a magnetohydrodynamics simulation of a reversed-field pinch