## 2 Equations

To simulate magneto-convection, the conservation equations for mass, momentum, energy and the induction equation for the magnetic field must be solved, together with Ohm’s law for the electric field and an equation of state relating pressure to the density and energy. For a detailed discussion of the equations governing convection see Nordlund et al. (2009).

Mass conservation controls the topology of stratified convection,

where is the density and the velocity.

Momentum conservation controls the plasma motions. In the presence of magnetic fields, convection is altered by the Lorentz force in the momentum equation, which becomes:

Here is the pressure, is the gravitational acceleration, is the magnetic field, is the current, is the permeability (magnetic constant), and is the viscous stress tensor,
The Lorentz force inhibits motion perpendicular to the field. As a result, the overturning motions that are essential for convection are suppressed and convective energy transport from the interior to the surface is reduced. When large depths are included where the fluid motions become slow, the coriolis force, , needs to be included. Angular momentum conservation then produces a surface shear layer with the surface rotating slower than the bottom of the domain.

Kinetic energy is changed by energy transport and work against the forces acting on the plasma. The equation for kinetic energy is

Note that if there is no net mass flux, , then there is no net buoyancy work by gravity. The vertical convective velocity and density are correlated. Upflows have lower density and cover a larger area while downflows have higher density and cover a smaller area. Downflows are pulled down by gravity and upflows are buoyant. Gravity drives the convection, doing positive work on both the upflows and downflows. But the total work by gravity vanishes. Hence, the positive work on the convective motions is balanced by an equal but negative work on the mean flow. There is necessarily a horizontally averaged mean flow in the opposite direction to gravity. Such mean flows do exist in the simulations.

Internal energy is changed by transport, by work, by Joule heating, by viscous dissipation, and by radiative heating and cooling. It is the fluid version of the 2nd law of thermodynamics and (together with the density) determines the plasma temperature, pressure, and entropy.

where is the internal energy per unit volume. The radiative heating/cooling is:
Here is the opacity ( is the mean free path of photons of frequency ), is the radiation intensity (energy at frequency , at location , travelling in direction , at time , per unit area, per unit solid angle, per unit frequency, per unit time), and is the source function ( is the rate of energy emission at frequency per unit frequency, per unit mass, per unit time, per unit solid angle). The viscous dissipation is:
Magnetic energy changes due to transport by the Poynting flux, , work by the Lorentz force, and joule dissipation, ,
Adding kinetic, internal and magnetic energy equations gives the equation for the total energy, ,

Convection influences the magnetic field via the term in the induction equation,

where the electric field is given by Ohm’s Law. In a one-fluid MHD system, it is
where is the resistivity, is the electron number density, is the electron pressure, and e is the electron charge. The last two (Hall and pressure) terms are usually neglected, but the Hall term may be important in the weakly ionized photosphere. Where the magnetic field is weak and the resistivity low, the field is frozen into the ionized plasma. Convective motions drag the field around, stretching and twisting it.

To make “realistic” models of solar surface magneto-convection it is necessary to include all the significant physical processes occurring near the solar surface. In the photosphere and upper convection zone Local Thermodynamic Equilibrium (LTE) is a good approximation. For models that extend into the chromosphere non-local thermodynamic equilibrium (NLTE) effects must also be included, as is being done in the bifrost code (Gudiksen et al., 2011).

Ionization energy accounts for 2/3 of the energy transported near the solar surface and must be included to obtain the observed solar velocities and temperature fluctuations (Stein and Nordlund, 1998). An equation of state (EOS) is used to determine the pressure and temperature for the partially ionized plasma. Typically this is in tabular form and includes LTE ionization of the abundant elements as well as hydrogen molecule formation as a function of log(density) and internal energy per unit mass.

Radiation from the solar surface cools (and heats) the plasma and produces the low entropy, high density fluid whose buoyancy work drives the convective motions. Since the optical depth is of order unity in these regions, neither the diffusion approximation (Ustyugov, 2010) nor the escape probability approach (Abbett and Fisher, 2010) are sufficiently accurate. Radiative heat/cooling is calculated by explicitly solving the radiation transfer equation in both continua and lines,

where is the intensity at frequency , position , time t, in direction , is the radiation emission at that frequency, location, time, and in that direction, and is the absorption probability of radiation at that frequency, location, time, and direction. Since time steps in the solar case are short, the plasma state is known from the previous time step, so the emission and absorption can be calculated and the radiation transfer can be solved explicitly. The main problem is the large number of frequencies necessary to accurately represent the radiation. A multi-group approximation is used to drastically reduce the number of frequencies for which the transfer equation is solved. The opacity and emissivity are grouped into a few bins (typically 4 – 12) according the magnitude of the opacity and its frequency (Nordlund, 1982; Skartlien, 2000; Stein and Nordlund, 2003; Vögler et al., 2004; Vögler, 2004). The number of directions is also limited.