In this paper a complete set of MHDequations was used to study the energy storage in the solar atmosphere by twisting the tube of magnetic lines of force at the base.By means of numerical method, dynamic evolution of nonlinear, force-free magnetic fields of the solar surface, including the transition region, was investigated.It was assumed that the initial magnetic fields configuration is a potential field;the plasma motions at the feet of lines make magnetic fields in the active regions twisting.Magnetic energy is rearranged in this way much of magnetic energy can be stored in the local regions.Computed results give a quantitative expression for nonlinear force-free fields..These results could explain the energy-storing process of solar flares.