Edge localized modes (ELMs) are qualitatively and quantitatively modeled in tokamaks using current bursts which have been observed in the scrape-off-layer (SOL) during an ELM crash. During the initial phase of an ELM, a heat pulse causes thermoelectric currents. They first flow in short connection length flux tubes which are initially established by error fields or other nonaxisymmetric magnetic perturbations. The currents change the magnetic field topology in such a way that larger areas of short connection length flux tubes emerge. Then currents predominantly flow in short SOL-like flux tubes and scale with the area of the flux tube assuming a constant current density. Quantitative predictions of flux tube patterns for a given current are in excellent agreement with measurements of the heat load and current flow at the DIII-D target plates during an ELM cycle.