Coupling the photosphere and corona requires bridging with a large separation of length- and time-scales. While typical photospheric time-scales of interest range from minutes (granulation) to days (active region flux emergence), numerical time-step constraints in the corona can be very severe due to Alfven velocities exceeding 100,000 km/s and very efficient heat conduction. I present a recently developed version of the MURaM (Max Planck University of Chicago Radiative MHD) code that includes coronal physics in terms of optically thin radiative losses and field aligned heat conduction. The code employs the "Boris correction" (semi-relativistic MHD with a reduced speed of light) and a hyperbolic treatment of heat conduction, which allow for efficient simulations of the photosphere/corona system by avoiding the severe time-step constraints arising from Alfven wave propagation and heat conduction.
I will discuss applications of the code that include studies of quiet sun magnetism, flux emergence and active region formation, and a simulation of a solar flare in response to active region scale flux emergence. In the quiet sun a small-scale mixed polarity magnetic field is maintained through a small-scale dynamo that is distributed through the solar convection zone. Accounting for the resulting deep recirculation of magnetic flux leads to a saturation field strength in agreement with observational constraints. In addition, deep recirculation leads to an organization of magnetic flux on scales larger than the scale of photospheric granulation, which turns out to be crucial for maintaining a quiet sun corona. I present a coupled simulation of flux emergence that demonstrates that flux concentrations found in global dynamo simulations do lead to the formation of solar active regions when the flux evolution is followed through the solar photosphere. Extending such setups into the solar corona allows us to study a flare that is triggered by flux emergence into a pre-existing bipolar active region. Synthetic observables of EUV, soft and hard X-ray emission reproduce several well-known features of solar flares, such as the fast rise and slow decay of GOES soft X-ray flux, hard X-ray emission from the corona with extended powerlaws and temperature dependent Doppler shifts in the flare ribbons. I conclude the talk with a brief discussion of ongoing code developments that include refactoring for GPU use with OpenACC and a more accurate treatment of the solar chromosphere.