We present a series of numerical studies (MHD and kinetic) that may lead to further understanding of particle energization and emissions in solar flares. In the reconnection region, magnetic energy is rapidly converted into plasma kinetic energy, which leads to acceleration of particles in the large-scale current sheet and development of turbulence. Global MHD simulation for solar flares shows that flare termination shock forms when the high-speed outflow jet collides the magnetic loop. Because of the upstream turbulence from the reconnection region, the shock front is likely to be turbulent and rippled at a range of spatial scales, which has a strong implication for electron acceleration. We find that the accelerated electrons are concentrated in the looptop region due to the acceleration at the termination shock and confinement by the magnetic bottle structure, in agreement with HXR and microwave observations. Numerous plasmoids can be produced in the reconnection current sheet and interact dynamically with the TS. We find that the energetic electron population varies rapidly in both time and space due to plasmoid-shock interactions. Our simulations have strong implications to the interpretation of nonthermal looptop sources, as well as the commonly observed fast temporal variations in flare emissions.