Solar flares play a key role in the dynamics of the solar atmosphere. They occur with a wide range of energies, from the largest X-class flares representing some of the most violent releases of energy in the solar system, to the tiny nanoflares whose faintness imposes a considerable observational challenge for current telescopes. While unimpressive in isolation, nanoflares are believed to occur in great numbers, and their collective heating has been proposed as a possible explanation for the high temperature of the corona. Detailed 1D numerical models have provided great insight into the behaviour of individual flares, but they are unsuited for examining how flares collectively influence the atmosphere. We develop a numerical model for the generation and evolution of accelerated electron beams associated with small flares in the solar atmosphere. This is integrated into the 3D radiative magnetohydrodynamics code Bifrost. The model tackles four primary tasks: detecting electron acceleration sites, determining the resulting electron energies, tracing the trajectories of the accelerated electron beams and computing the amount of heat they deposit. The latter two tasks are the focus of this thesis. A realistic simulation of the solar atmosphere is run with the electron beam physics included. Regions of strong beam heating are produced in the lower transition region, at locations where magnetic coronal loops are anchored in the lower atmosphere. The heat input shifts the transition region downwards locally by approximately 10 km, which is expected to lead to a slightly enhanced emission in transition region spectral lines. A modest increase in pressure accelerates the plasma at the heating sites upwards by a few kilometres per second. The relatively small response of the plasma to the presence of electron beams is a consequence of the abnormally cool and dense corona of the initial atmosphere. This leads to fewer high-energy electrons being generated and more of the beam energy being deposited in the corona. A larger simulation box is likely required for obtaining an atmosphere capable of producing stronger flare events.