The numerical MHD simulation of solar flares