  Understanding turbulent transport physics in the tokamak edge and scrape-off
layer (SOL) is critical to developing a successful fusion reactor. The dynamics
in these regions plays a key role in achieving high fusion performance by
determining the edge pedestal that suppresses turbulence in H-mode.
Additionally, the survivability of a reactor is set by the heat load to the
vessel walls, making it important to understand turbulent spreading of heat as
it flows along open magnetic field lines in the SOL. Large-amplitude
fluctuations, magnetic X-point geometry, and plasma interactions with material
walls make simulating turbulence in the edge/SOL more challenging than in the
core region, necessitating specialized gyrokinetic codes. Further, the
inclusion of electromagnetic effects in gyrokinetic simulations that can handle
the unique challenges of the boundary plasma is critical to the understanding
of phenomena such as the pedestal and ELMs, for which electromagnetic dynamics
are expected to be important.
  In this thesis, we develop the first capability to simulate electromagnetic
gyrokinetic turbulence on open magnetic field lines. This is an important step
towards comprehensive electromagnetic gyrokinetic simulations of the coupled
edge/SOL system. By using a continuum full-f approach via an energy-conserving
discontinuous Galerkin (DG) discretization scheme that avoids the Ampere
cancellation problem, we show that electromagnetic fluctuations can be handled
in a robust, stable, and efficient manner in the gyrokinetic module of the
Gkeyll code. We then present results which roughly model the scrape-off layer
of the National Spherical Torus Experiment (NSTX), and show that
electromagnetic effects can affect blob dynamics and transport. We also
formulate the gyrokinetic system in field-aligned coordinates for modeling
realistic edge and scrape-off layer geometries in experiments.
