Solar flares are the most energetic phenomenon in the solar system, and have been recognized as a prototype of cosmic flares and explosions. The central engine is now believed to be magnetic reconnection. Because magnetic reconnection is a highly dynamical process, it is expected that many magnetohydrodynamic (MHD) waves and shock waves will be generated during flares in some way. MHD waves can tell us the quantitative information of the plasma conditions, and shocks could be important for generating high-energy particles. For these reasons, it has been extensively studied their origin. Recent observations discovered MHD waves emitted from flaring regions. Furthermore, observations pointed out that emission of MHD waves from the flaring sites and non-thermal emissions from high-energy particles looks correlated. However, because of the complexity of the flaring regions, the generation mechanism of MHD waves and causal relation to the non-thermal emissions have not been understood yet. To reveal the dynamical processes related to the wave/shock generation, we performed 2D MHD simulations of a solar flare. As a result, we discovered the local oscillation of the flare loop-top and the generation of quasi-periodic MHD waves from such oscillating flare loop-top. The new model unveiled that the loop-top is full of shocks and waves. If the particle acceleration is actually related to the shocks, for the first time we revealed the origin of MHD waves and causal relation between MHD waves and particle acceleration. Furthermore, we point out that this study may help us to derive physical quantities of flares from the oscillation seen in flare light curves. This will be important for estimating physical quantities of stellar flares whose structure cannot be resolved. In this talk, I will show our recent results, and discuss the application of this study.