Let's start with the basic. Particle Acc produce a beam of charged particles that can be used for variety of research purposes. A beam of particles meaning protons or electrons. If you see the gold foil experiment done which was the basis of telling there is an atom in the center that deflects alpha particles in an obtuse angle. So usually gold or radioactive elements that keep emitting alpha particles is used for accelerating the particle. Now an atom consists of Proton, Neutron and Electron which you can for the sake of simplicity remember them as +1,0,-1 just to signify the type of particle we are dealing with here. Let's see how we can achieve the most basic setup, that is to make a particle go in a straight line. 

The basic linear accelerator setup (source: https://en.wikipedia.org/wiki/Linear_particle_accelerator#/media/File:Wideroe_linac_en.svg)

The particle source let's take a thermionic electron gun. Thermionic electron gun is a device that generates and accelerates a focused beam of electrons by heating a cathode material until electrons boil off its surface. The speed of the electron fired depends on the voltage applied between the cathode and anode. 1000V can make the electrons fired go up to 18,000 km/s. There are drift tubes installed where all tubes are connected in parallel to a oscillating voltage source.

Lorentz described the force that a charged particle experiences when placed in an electromagnetic field. the magnets are installed on all 4 sides in alternating polarity, forming a quadrupole. 
quadrupole magnet arrangement (source:  https://thumb.wikimedia.org/wikipedia/commons/thumb/9/93/Magnetic_quadrupole_moment.svg/500px-Magnetic_quadrupole_moment.svg.png?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail)

This makes sure the particles are in a straight line and do not collide with the walls or escape through gaps. The Lorentz equation is this:

F = -e(E+v*B) 
where e is 1.6 x (10**-19) and is negative because we are shooting an electron.
E is the electric field
v is the velocity which we know is 18000 km/s
B is the magnetic field

to calculate E, we need to step back and calculate how much is the energy of the source. when a particle is fired form a gun that has an applied voltage of 1000V between the cathode and anode, it gains kinetic energy equal to e x V. So, each electron leaves with 1000 electron-Volts of kinetic energy. The drift tubes here are hallow metallic chambers in series which in setup are called Radiofrequency cavities. Now since for the accelerator we are using an oscillating voltage in each chamber, each chamber gives a forward push due to the massive electric field applied on the electron passing through. So, a stronger electric field results in higher acceleration. E = F/q and Eq/m = a. So, if I want to find the gap length which let's say is the length of 1 drift tube in meters for example in this case is 0.5m and voltage or energy gain per gap is lets take 200KeV then the voltage becomes 200kV. So now the E or electric field becomes V/g which is 200kV / 0.5m = 400kV/m

So now we have E = 400,000 V/m
v = 18000 km/s OR 18000000 m/s
(v is the initial velocity)
Now let's compute B which is E/v = 400,000/1.8x(10**7) = 0.022 Tesla

So, the F in the first tube would be -e (4x10**(5) + 18x10**6 times 0.022)
F = 796000 * -e = 1.2736 x (10**-13) N

This force increases by number of tubes. So, if I have a 500m long setup then I need 1000 tubes so i multiply this force with that number to get the final force applied on the election which is 1.2736 x (10**-10) N

Now if I want to find 2 things: the final velocity from at the end of 500m and the energy of the electron at the end.
E = V/ng = 200kN / 1000*0.5 = 400 V/m
The final velocity is basically (F/qn - E)/B = ([1.2736 x (10**-10) / 1.6 x (10**-16)] - 400)/(2.22 x (10**-5))
v` = 3.584 x (10**10) m/s

That is ~119 times faster than speed of light!
WOW we reached from 18000km/sec to this speed.

The kinetic Energy gained by the end is Delta K = qEd = 1.6 x (10**-19) *400*500 = 3.2 x (10**-14) J per electron
and the thermionic electron gun shoots 6.24 x (10**14) electrons per second.

So, in a second, the energy E at the end cross section of the 500m long tube is 3.2*6.24 = 19.968 J/s or 19.968 Wh
The energy generated for 1 hour = P x t = 19.968 * 3600 = 71884.8 J, which is enough to charge my phone theoretically ~90% in an hour.

So yes, in the most ideal conditions we have proved that a linear accelerator can produce an Energy equivalent to charging your phone if left for one hour keeping the thermionic power source on for an hour and the enter tube runs 500m long (ignoring the gaps between)

But is E(out) > E(in)??
E(out) in an hour is 71885 J
E(in) in an hour is 252000 J

So clearly my E(out) must less than E(in). For increasing the Kinetic energy, I can increase the alternating voltage applied across the gaps or increase the length although increasing more than 100m itself get costlier or get a powerful source that gives the initial velocity much higher than the one we used for our case.

You got money? If yes, then definitely try building one...