Numerical Simulation of Confined Flares