  Erupting magnetic flux ropes (MFRs) play a crucial role in producing solar
flares. However, the formation of erupting MFRs in complex coronal magnetic
configurations and their subsequent evolution in the flaring events are not
fully understood. We performed an MHD simulation of active region NOAA 12241 to
understand the formation of a rising MFR during the onset of an M6.9 flare on
2014 December 18, around 21:41 UT. The MHD simulation was initialised with an
extrapolated non-force-free magnetic field generated from the photospheric
vector magnetogram of the active region taken a few minutes before the flare.
The initial magnetic field topology displays a pre-existing sheared arcade
enveloping the polarity inversion line. The simulated dynamics exhibit the
movement of the oppositely directed legs of the sheared arcade field lines
towards each other due to the converging Lorentz force, resulting in the onset
of tether-cutting magnetic reconnection that produces an underlying flare
arcade and flare ribbons. Concurrently, an MFR above the flare arcade develops
inside the sheared arcade and shows a rising motion. The MFR is found to be
formed in a torus-unstable region, thereby explaining its eruptive nature.
Interestingly, the location and rise of the rope are in good agreement with the
corresponding observations seen in EUV channels. Furthermore, the foot points
of the simulation's flare arcade match well with the location of the observed
parallel ribbons of the flare. The presented simulation supports the
development of the MFR by the tether-cutting magnetic reconnection inside the
sheared coronal arcade during flare onset. The MFR is then found to extend
along the polarity inversion line (PIL) through slip-running reconnection. The
MFR's eruptive nature is ascribed both to its formation in the torus-unstable
region and also to the runaway tether-cutting reconnection.
