Numerical simulation of Reversed-Field Pinch dynamics