above it and includes the top of the convection zone, the photosphere, chromosphere and a part of the corona. The simulation box has $1024 \times 512 \times 1536$ grid points, which correspond to $98.304~\text{Mm} \times 49.152~\text{Mm} \times 49.152~\text{Mm}$ in physical size, with a uniform horizontal grid of 96 km and a uniform vertical grid of 32 km. The simulation setup contains a bipolar active region that was present in the initial state. Near one of the sunspots a strongly twisted small bipolar magnetic structure was emerged by feeding in horizontal flux at the bottom boundary located about 7.5 Mm beneath the photosphere.

The simulation is run with gray LTE radiative transfer in the photosphere and chromosphere, optically thin radiative losses from the transition region and corona and included heat conduction along the magnetic field. The EOS uses a realistic solar composition and assumes local thermodynamic equilibrium.

The primary goal of this numerical experiment was to simulate the evolution of coronal magnetic field self-consistently in 3D in a flare. For this reason, the processes relevant for chromospheric layers were not accounted for in detail. The gray approximation is chosen because it resulted in a chromospheric temperature stratification which agreed with 1D 