Radiation hydrodynamics in simulations of the solar atmosphere

Nearly all energy generated by fusion in the solar core is ultimately radiated away into space in the solar atmosphere, while the remaining energy is carried away in the form of neutrinos. The exchange of energy between the solar gas and the radiation field is thus an essential ingredient of atmospheric modeling. The equations describing these interactions are known, but their solution is so computationally expensive that they can only be solved in approximate form in multi-dimensional radiation-MHD modeling. In this review, I discuss the most commonly used approximations for energy exchange between gas and radiation in the photosphere, chromosphere, and corona.


Introduction
The interaction of matter and radiation is an indispensable ingredient of solar and stellar atmospheric modeling. Around 98% of the energy generated in the solar core is transported outwards first by radiative diffusion, then convection, and ultimately escapes into space in the photosphere of the Sun where the overlying solar material becomes transparent. The remainder of the energy escapes the Sun in the form of neutrinos (Turck-Chièze and Couvidat 2011). The layers above the photosphere (chromosphere and corona) are hotter than radiative equilibrium models predict. Therefore deposition of non-thermal energy and conversion into heat must occur in these layers. The radiative energy losses (ignoring the $ 10 À6 fraction of energy carried away by the solar wind, Le Chat et al. 2012) from the chromosphere and corona must balance this energy deposition in a time and space-averaged sense. Radiation is thus an essential ingredient in setting the structure of the outer solar atmosphere and the response of the atmosphere to non-thermal energy deposition.
Modeling the interaction of radiation and matter in the solar atmosphere is in general a difficult problem. The specific intensity, the fundamental quantity used to characterise the radiation field, depends on seven parameters: three space dimensions, two angles describing direction, frequency, and time. In addition, the radiative transfer problem is non-linear and non-local: local changes to the intensity through absorption and emission depend on the intensity itself, and radiation emitted at one place in the atmosphere can influence other locations.
Writing general equations that describe the interaction of radiation and matter is not so difficult. Because of limitations in computing time these equations have so far been solved rather completely in one-dimensional geometry only. The RADYN code Stein 1992, 2002), is perhaps the most well-known example, but other codes are used too (e.g., FLARIX, see Kašparová et al. 2009).
However, solving these general equations in 2D and 3D is still beyond current computational capabilities. This is problematic because modeling convection requires at least 2D geometry, and fully modeling the rich physics caused by the interaction of the magnetic field with matter requires 3D geometry.
Radiation-hydrodynamics in the solar atmosphere is a vast topic. In this review, I limit myself to describing only the most commonly used approximations for radiative transfer in the photosphere, chromosphere, and corona in these multidimensional radiation-MHD codes. I do not discuss results obtained with any of these codes. An excellent review of solar magnetoconvection as studied using radiation-MHD simulations is given in Stein (2012). The field of radiation-MHD modeling of the combined photosphere, chromosphere, transition region, and/or corona has developed tremendously during the last 15 years. To my knowledge no recent review covering this development exists. Example starting points for studying applications are Carlsson et al. (2016), Martínez-Sykora et al. (2017), Khomenko et al. (2018), and Cheung et al. (2019).
In the convection zone the radiation diffusion approximation holds to a high degree of precision and the energy exchange between radiation and the solar gas is close to zero. In the photosphere the gas loses large amounts of energy in the form of radiation which then largely escapes into space. The LTE assumption for the source function and opacity is still not too bad and even the grey approximation is still reasonably accurate. I devote a large fraction of this review discussing approximations for the photosphere and low chromosphere in Sect. 3.
The situation in the chromosphere and transition region is more complex. The chromosphere is optically thin for optical continuum radiation and most radiative energy exchange takes place in a few strong spectral lines. Radiation scattering is important so that non-LTE effects must be taken into account, the ionisation balance of hydrogen and helium is out of equilibrium so that assuming LTE or statistical equilibrium to compute opacities or source functions is in general no longer accurate. Modeling energy exchange taking into account these complexities is discussed in Sects. 5 and 6.
In the corona the physics of radiative energy losses and gains becomes again somewhat less complex. Most coronal structures are optically thin for all frequencies except in the radio regime. The radio regime lies in the far tail of the Planck function and does not contribute significantly to the radiative losses. For all other frequencies it can be assumed that photon absorption does not take place and that all photons emitted by the gas escape from the corona. It is discussed in Sect. 4.

Fundamentals
Excellent books that review the fundamentals of radiation hydrodynamics and modeling of stellar atmospheres are Mihalas and Mihalas (1984) and Hubeny and Mihalas (2014). The first book focusses on fundamental theory, while the second one discusses modeling of 1D static and moving atmospheres. Below, I briefly touch upon some general aspects that are relevant for the methods discussed in Sect. 3-7.

The MHD equations including radiation
The dominant paradigm for multidimensional modeling of the solar atmosphere has been the magnetohydrodynamics (MHD) approximation. The MHD equations for the density, momentum and internal energy including radiation terms can be written as with q the mass density, v the velocity vector, p the momentum density, s the stress tensor, P the gas pressure, J the current density, B the magnetic field vector, g the acceleration due to gravity, P rad the radiation pressure tensor, e the internal energy, Q rad the heating or cooling owing to radiation, while Q expresses energy exchange by any other processes such as dissipation of currents, heat conduction, and viscosity.
The assumptions under which MHD is valid tend to be fulfilled in the photosphere and convection zone as well as the corona, but break down in the chromosphere and transition region where the frequencies of collisions between particles become smaller than the cyclotron frequencies of ions and electrons (e.g., Khomenko et al. 2014).
Several radiation-MHD codes have been extended to include some effects beyond MHD, through including the ambipolar diffusion term, the Hall term, and/or Biermann's battery term, to the induction equation (Martínez-Sykora et al. 2012;Cheung and Cameron 2012;Khomenko et al. 2017Khomenko et al. , 2018. These inclusions retain the single fluid description. This greatly simplifies the treatment of the radiative term Q rad , because energy lost or gained by the gas modifies the internal energy of the gas as a single entity, instead of modifying the energy of the electrons and different species of atoms, ions, and molecules separately. Efforts are underway to move beyond single-fluid radiation-MHD to a multi-fluid description, treating neutrals, ions, and/or electrons as separate fluids each with their own temperatures and velocities. Radiative transitions can modify the internal energy and change the ionisation state of atoms, and in a multi-fluid description these must be computed in detail (e.g., Khomenko et al. 2014). This review does not discuss radiation-hydrodynamics in multi-fluid models.

Energy density of radiation and matter
It is useful to compare the energy density and flux of the radiation field to the energy density of the gas in the solar atmosphere. To get an estimate we assume that the radiation field is isotropic and given by the Planck function at T rad ¼ 5777 K. Then the energy density is with r the Stefan-Boltzmann constant. Assuming that the solar surface is a radiating blackbody at the same temperature gives the radiative flux at the surface as Table 1 compares the radiative energy density to the internal energy density e of the solar gas for typical photospheric, chromospheric and coronal values assuming the solar gas has an ideal gas equation of state (e ¼ nk B T). The radiative energy density in the chromosphere and corona is corrected for the non-isotropy of the radiation above the photosphere. The energy density of the radiation is much lower than the energy density of the gas in the photosphere and chromosphere, but in the corona they are about equal. The corona is however optically thin for most photospheric radiation and only little absorption or scattering of radiative energy by the gas occurs.

Radiation pressure and force
The force exerted by the radiation pressure tensor is typically ignored under normal solar conditions because it is small compared to other forces. To illustrate this one can compare the radiation pressure of isotropic black body radiation to the gas pressure in the photosphere. This pressure is 4r 3c at a photospheric temperature of T ¼ 5700 K, while the gas pressure in the photosphere is roughly 10 4 Pa. Similarly, one can compute a rough estimate of the upward acceleration of photospheric material by radiation: with j the Rosseland opacity per mass unit and F the frequency-integrated radiative flux, both taken in the photosphere. The radiative acceleration is much smaller than the downward-directed solar surface gravity acceleration g ¼ 274 m s À2 .

Energy exchange between radiation and matter
In absence of an absorbing medium, the monochromatic radiative flux divergence r Á F m is zero. If a medium (in the solar case a gas or plasma) is present, then the rate per volume with which the material gains energy from the radiation field is given by with F the total radiative flux. The total radiative flux is an integral over frequency, and as far as the internal energy of the gas is concerned, the exact distribution of the flux over frequency is not important. Typically, radiation-MHD simulations of the solar atmosphere aim to reproduce the correct detailed behaviour of the gas only. The computation of the radiation field only has to reproduce the correct heating and cooling, but does not need to reproduce the correct spectral energy distribution. This allows for large simplifications in treating the radiation without sacrificing too much accuracy in the value of the total flux divergence.

Explicit expression of the radiative flux divergence
The monochromatic flux is defined in terms of the intensity I m as with n the unit vector pointing in the direction of X. Substitution of this equation into the integral over all directions of Eq. (14) yields an expression of the total radiative flux divergence in terms of emissivity or source function S m ¼ j m =ðj m qÞ, intensity and opacity: with j m the extinction coefficient per unit mass. If one assumes that both the emissivity and extinction coefficient do not depend on direction then Eq. (10) reduces to where is the angle-averaged intensity. This assumption is reasonable for bound-free transitions and other continuous processes. For bound-bound transitions it is not valid when flow velocities are of the same order or larger than the thermal speed ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 2kT=m þ v 2 turb p , with m the mass of the atom or ion that is involved, and v turb the microturbulent velocity. Nevertheless, the assumption is almost always taken to be valid because it allows large simplifications.

Light travel time and hydrodynamical timescales
Typical bulk flow velocities in the solar atmosphere range from 1 km s À1 in convective upflows to [ 300 km s À1 in chromospheric evaporation following solar flares (Graham and Cauzzi 2015). Alfvén velocities up to 2:2 Â 10 3 km s À1 have been measured in the solar corona by studying properties of coronal loop oscillations (e.g., Aschwanden et al. 1999;Pascoe et al. 2018). These values are much lower than the speed of light.
The typical hydrodynamic timescale in the photosphere is $ 5 min, it is $ 1 min in the chromosphere and a few minutes in the corona. The light crossing time is of the order of a second even for the largest coronal structures.
Because of the low flow speeds and long hydrodynamic timescales compared to light crossing times, it is typically assumed that light travel times can be ignored in solar radiation hydrodynamics. That means that the computation of the radiative flux divergence at a given time t only depends on the state of the atmosphere at time t. The time-dependent transfer equation for the intensity in direction n then simplifies from 1 c to with j m the emissivity and a m ¼ j m q the extinction coefficient per volume. In other words, it is assumed that the radiation field adapts instantaneously to changes in the state of the solar gas.

Diffusion approximation
At very large optical depth the following approximation holds for J m : where the second derivative should be taken along the direction of the gradient of S m . 1 For the flux the following approximation holds: At depths where the optical depth at all frequencies is much larger than unity, one can derive the diffusion approximation for the total radiative flux from Eq. (16) if one also assumes that the source function is equal to the Planck function B m : with the Rosseland opacity defined as Methods to compute the total flux divergence that rely on the solution of the radiative transfer equation must converge to the diffusion approximation at large depth. Methods that require a numerical approximation of the source function must use one of at least second order in order to recover Eq. (15).
3 Radiative transfer in the photosphere: multi-group radiative transfer Multi-group radiative transfer was first introduced in Nordlund (1982). It is a method that approximates the frequency integral in Eq. (11) by a sum over a limited number N so called radiation groups (or radiation bins): with j i , S i , and J i the opacity, source function and radiation field in each group, as defined below. The rationale of the method is the realisation that the K-operator that produces the angle-averaged radiation field from the source function depends on the opacity only, and is a linear operator. While it is customary to write K m ½. . . because the opacity changes with frequency, a better notation would be K j ½. . .. For two frequencies m 1 and m 2 with identical opacities everywhere in the atmosphere j 1 ¼ j 2 ¼ j one can thus write In order to derive the approximation in Eq. (19) one first approximates the frequency integral with a sum over discrete frequencies m j with summation weights w j . These frequencies are then grouped into N bins, each labeled i, that have similar opacities. Finally, Eq. (20) is used to define a bin-integrated source function: Here j(i) is the set of all frequencies with similar opacities that are placed in bin i. The bin-integrated source function is constructed from the frequency-dependent source function using What is left is now is to define how to group frequency points in the various bins, how to define the representative opacity for each bin j i , and how to define the frequency-dependent source function S j . The opacity and source function are in general functions of at least frequency, temperature and density. Additional dependencies are on the velocity field in the atmosphere, the ray direction, possible location-dependent abundances, and in the case of non-LTE radiative transfer, on the radiation field. Section 3.1 discusses how to sort frequencies into opacity groups. In Sect. 3.2 it is assumed that the source function is given by the Planck function. This assumption is relaxed to allow for coherent scattering in Sect. 3.3.

Sorting frequencies into groups
Grouping frequencies and defining a bin opacity are necessarily somewhat crude. The density and thus opacities drop roughly exponentially with height, and opacities at a given point in the atmosphere vary over many orders of magnitude with frequency. The aim of the multi-group opacities is to approximate the full radiative transfer with sensitivity spanning from the low-opacity continua that form in the photosphere to strong lines that form in the mid and ideally even the upper chromosphere.
The de-facto standard method for grouping opacities is called s-sorting: first a 1D reference atmosphere is chosen, for which the opacities and vertical optical depth scales at all frequency points j are computed. The atmosphere is then divided into various height bins. Frequencies at which optical depth unity is reached in height bin i are assigned to radiation bin i. This height sorting can in principle be done directly on a geometrical height scale, but most radiation-MHD codes follow Nordlund (1982). They set the borders between the height bins in terms of the Rosseland optical depth scale s R : let the borders be defined at a number of Rosseland optical depths s k R . A frequency m j then belongs to bin i if A common choice is to put the border values s k R equidistantly spaced in log s R . The method is illustrated in Fig. 1.
Opacities are generally well-approximated by their LTE values in the photosphere. LTE opacities in a static atmosphere are functions of temperature, density and elemental composition only, but even then it requires a large effort to accurately compute them. For historical reasons this is commonly done using an intermediate step called opacity distribution functions (ODFs). ODFs were developed originally to speed up computations used in modeling of 1D LTE radiative equilibrium stellar atmospheres (e.g., Gustafsson et al. 1975;Kurucz 1979).
The method used to compute an appropriate mean opacity in a bin i from the opacities j j depend on whether one assumes an LTE or non-LTE source function and are described in Sects. 3.2 and 3.3. An illustrative solution assuming an LTE source function is given in Fig. 2.

Multi group radiative transfer with LTE source function
The source function in the solar atmosphere is in general not equal to the Planck function because at some height in the atmosphere densities become too low to set up Saha-Boltzmann populations through collisions. However, detailed non-LTE computations in 1D models show that in the deep photosphere (roughly defined here as À100 km\z\200 km, with the z ¼ 0 defined as the location where s 500 nm ¼ 1), the source function is almost exactly equal to the Planck function (see Fig. 36 of Vernazza et al. 1981), and the opacities are close to their LTE values. At larger heights this is no longer the case for lines and continua of neutral atoms with a low ionisation potential because they tend to be over-ionized by the radiation from below. Nevertheless, one can expect that assuming LTE for both the source function and the opacity is a good approximation for computing the flux divergence in the photosphere. The source function in group i is then given by The opacity that is ''assigned'' to each wavelength using a 5-group scheme. The large continuous variation in the left-hand panel is replaced by only five discrete opacities. Note that the high monochromatic opacities in the UV are replaced by a much lower group opacity. Image reproduced with permission from Vögler et al. (2004), copyright by ESO This expression only depends on temperature and can thus easily be precomputed and stored in a 1D lookup table.
Once the opacities j j are grouped into the N bins, one still needs to compute an appropriate bin opacity j i . Choosing the numerical equivalent of the Rosseland opacity in each bin ensures that the diffusion approximation is recovered deep in the atmosphere: This choice of bin opacity is however not appropriate at low optical depths, where photons are mainly in the free streaming regime. Following approximations valid at small optical depth put forward in Mihalas (1970), and further developed in Ludwig (1992), it turns out that the Planck-mean opacity j B is a good choice for the outermost layers of the atmosphere: Somewhere in the atmosphere one should make a transition from one opacity definition to the other. This can be achieved through defining the group opacity as where s 0 is an adjustable parameter of order unity and s i the vertical optical depth. Computing s i in the MHD simulation is somewhat computationally expensive and instead it is estimated, for example through using the relation between mass density and optical depth in the 1D reference atmosphere used for the sorting of frequencies into bins (Ludwig 1992;Vögler et al. 2004).
Another option is to base the transition on the local mean free path: where l i is a typical length scale over which the bin-integrated source function changes (Skartlien 2000). The advantage of this method is that it does not depend on the properties of a 1D reference model. For a fixed elemental composition, j i depends only on a combination of any two thermodynamic parameters (for example, e and q). Like the group-integrated source function, they are commonly precomputed and put in a 2D lookup table.
Extensive discussions of multi-group radiative transfer assuming an LTE source function can be found in the PhD-thesis of Ludwig (1992, in German) and in Vögler et al. (2004).

Multi group radiative transfer with non-LTE source function
The assumption of LTE for the source function is accurate in the photosphere, but breaks down in the chromosphere and transition region. Here the energy exchange is dominated by the resonance lines of H I, Ca II, Mg II, and He II (see, e.g., Fig. 49 of Vernazza et al. 1981). These lines can have photon destruction probabilities with C ul the downward collisional rate coefficient and A ul and B ul Einstein coefficients for spontaneous and induced deexcitation. Scattering should therefore be taken into account. Scattering has a strong damping effect on the amplitude of r Á F m =q. In LTE it is given by If one assumes the presence of a coherently scattering line in a two-level atom at frequency m, then the source function becomes In that case the flux divergence per mass unit is so that for a given difference between B m and J m , the amplitude of the radiative energy exchange in non-LTE can be orders of magnitude smaller than in LTE. Skartlien (2000) extended the method presented in Sect. 3.2 to include coherent two-level scattering, as an approximation to the much more complicated full non-LTE radiative transfer problem. He assumed that the monochromatic extinction coefficient can still be computed in LTE. This assumption is rather accurate for the resonance lines of H I, Ca II, Mg II, whose lower levels are the ground state of a dominant ionisation state. In addition he assumed that the scattering coefficient in a spectral line is given using the approximation by van Regemorter (1962), so that it is independent of the actual line, and only depends on frequency, temperature and electron density. Starting from the monochromatic two level source function S m ¼ ð1 À m ÞJ m þ m B m and following a reasoning similar to the one given in Sect. 3.2, he arrives at an expression for the group source function: Here i represents a group-averaged scattering probability, and t i the group-integrated thermal production of photons. He also derives an expression for the group extinction coefficient j i . Similar to the LTE case, i , t i , and j i have different expressions for the diffusion regime and in the free streaming regime in the outer atmosphere. An important difference is that the streaming quantities now depend on the monochromatic mean intensity J m in a 1D reference atmosphere. This means that the quantities must be recalculated for each different target of simulations (e.g., sunspots or quiet Sun). Simulations containing a variety of structures might suffer from inaccuracies because a 1D atmosphere cannot be representative of all atmospheric structures.
Another difference compared to the method employing an LTE source function is that the computation of Q rad now requires solution of Eq. (37) together with the transfer equation because J i ¼ K½S i . This is typically done through accelerated Kiteration. Because of the multidimensional geometry, a local approximate Koperator (which is equivalent to Jacobi-iteration, see Olson et al. 1986) is efficient and easily coded, such as in the Oslo STAGGER Code (Skartlien 2000). Gauss-Seidel iteration (Trujillo Bueno and Fabiani Bendicho 1995) offers superior convergence speed and has been implemented in the BIFROST code (Hayek et al. 2010;Gudiksen et al. 2011).

Solving the transfer equation
Most modern radiation-MHD codes are parallelized to make use of large supercomputers with distributed memory. Typically, the simulated domain is represented on a 3D Cartesian grid. The domain is split into smaller subdomains and each CPU handles the required computations on its own subdomain, communicating information to other subdomains as needed. This architecture scales well for the MHD equations: they are local and require communication with neighbouring subdomains only.
Radiation is however intrinsically non-local. An emitted photon can traverse many subdomains before undergoing another interaction with the solar gas, so communication between subdomains is not necessarily local. This problem is shared between radiation-MHD codes that aim to compute a reasonable approximation of the flux divergence, and non-LTE radiative transfer codes such as MULTI3D (Leenaarts and Carlsson 2009) and PORTA (Š těpán and Trujillo Bueno 2013), which aim to accurately compute the emergent spectrum from a given model atmosphere. Consequently, there is a large amount of literature addressing efficient solutions of the transfer equation in multidimensional geometries and/or decomposed domains (e.g., Kunasz and Auer 1988;Auer 2003;Vögler et al. 2005;Heinemann et al. 2006;Hayek et al. 2010;Ibgui et al. 2013;Š těpán and Trujillo Bueno 2013). I will only briefly touch upon some aspects.
Solving for the flux F or for the angle-averaged radiation field J requires computation of the intensity for a number of different directions at all points on the numerical grid. In practice there are two methods that are used in radiation-MHD codes: short characteristics (SCs) and long characteristics (LCs). Both are illustrated in Fig. 3.
Short characteristics solve the transfer equation along short line segments (orange in Fig. 3), starting at a grid cell boundary and ending at a grid point where the intensity is desired. Along the line one typically computes a numerical approximation of the formal solution: where the optical thickness scale has its zero point at the start of the SC and s is the optical thickness along the entire SC. Intensities IðsÞ are computed at the grid points (grey circles in Fig. 3). Computation of Iðs ¼ 0Þ, which is needed at the start of the orange arrow, thus requires interpolation from the grid points. SC methods are therefore somewhat diffusive and coherent beams of photons disperse. High-order interpolation schemes can alleviate, but not eliminate, this diffusion. In practice this diffusion is typically not a problem, given that the photosphere is emitting photons everywhere and both the source function and the resulting radiation field are rather smooth.
The transfer equation is solved along all SCs in a sequential order, starting from a known boundary condition (the diffusion approximation at the bottom of the atmosphere for rays going up, and typically zero for SCs going down from the top of the atmosphere). The method was introduced for 2D cartesian geometry by Kunasz and Auer (1988). An in-depth description of the method in 3D Cartesian geometry is given in Ibgui et al. (2013). The ordered fashion in which SCs must be computed leads to complications with spatial domain decomposition. An example method of how to achieve reasonable parallelism despite this ordering can be found in Š těpán and Trujillo Bueno (2013). Short characteristics can be easily computed along any angle. Typical ray quadratures [i.e., the set of angles chosen to numerically compute Eq. (9) or (12)] that are in use are the angle sets from Carlson (1963), or equidistant in azimuth and using a Gaussian quadrature in inclination. Bruls et al. (1999) present a method to compute SCs on unstructured grids. It is not currently in use in the common radiation-MHD codes that use fixed Cartesian grids, but might be of great use for codes that use unstructured or adaptive grids.
The long characteristic method traces rays from the lower boundary of the domain to the upper boundary (red line segments in Fig. 3). An LC does generally intersect only a few grid points. Interpolation of the source function and the opacity from the grid points to the LC and interpolation of the intensity along the LC back to the grid points is thus necessary. The transfer equation along an LC can be solved using the formal solution [Eq. (38)], or by solving the second-order form of the transfer equation (Feautrier 1964).
Long characteristics allow photons to travel in a straight line and are thus not diffusive. Efficient parallel algorithms exist for solving along LCs in decomposed domains (Heinemann et al. 2006). However, this parallel algorithm is only easily implemented when LCs cross cell boundaries exactly through grid points, which limits the application to grids with fixed spacing and a maximum of 26 directions: both directions along three axes, six face diagonals, and 4 space diagonals in a cubic grid (e.g., Popovas et al. 2019). Arbitrary ray quadratures can be implemented at the expense of code simplicity.
Both the SC and LC method can handle exactly horizontal rays, but such rays require implicit solution methods in case of periodic boundary conditions in the horizontal direction, which is the default for solar atmosphere radiation-MHD simulations. This adds additional coding complications in the usual case that parallelism is implemented through spatial domain composition. Horizonal ray directions are therefore usually avoided.

Computation of the heating rate from the intensity and source function
Analytically, the two expressions for the heating rate in a bin Q i ¼ Àr Á F i ¼ 4pj i q i ðJ i À S i Þ are equivalent. In case of actual numerical computation this is no longer the case.
In the deep atmosphere the diffusion approximation holds. Equation (15) shows that while S i and J i increase with depth because of the increase in temperature, their difference becomes smaller, and at some point roundoff errors become noticeable. These errors are then amplified by the exponential increase of the density with depth. Using the source function and radiation field to compute Q i is thus unstable in the deep layers. Instead, computing the flux from the intensity using the numerical equivalent of Eq. (9) and then taking the divergence is stable in the deep layers. Because the radiative flux is small compared to the energy density of the gas, an error in computation of its divergence will not lead to large errors in the internal energy.
In the upper layers the situation is reversed: the radiative flux is large compared to the energy density of the gas [see Table 1 and Eq. (4)], and a small error in computation of the flux divergence from the intensity will lead to a large error in Q i and e. Using 4pj i q i ðJ i À S i Þ is stable however, because of the generally large split between S i and J i .
Following the suggestion by Bruls et al. (1999), most 3D codes that use short characteristics compute Q i using the flux divergence at large optical depth, and switch to using the source function and radiation field around an optical depth of 0.1.
An alternative to the above switching scheme is to rewrite the transfer equation in terms of the quantity K I ¼ S À I (dropping bin indices i here for brevity). The quantity K I is proportional to the cooling rate in a specific ray direction. The transfer equation then transforms into which in its integral form is given by The total heating rate is then computed from This equation does not suffer from the numerical precision problems caused by the cancellation of the subtraction S and I. Equation (40) has the same form as the formal solution of the normal transfer equation and can be solved efficiently using a variety of methods. If the source function is known (such as when assuming LTE) then solving straight for K is possible without having to solve for I first. Heinemann et al. (2006) describe an elegant method for solving for K in decomposed domains using long characteristics and a direct solution of the transfer equation. In case of a non-LTE source function, such as in Sect. 3.3, then computing S requires solving the transfer equation to obtain I and J. Computing Q from K I afterwards then offers little benefit over computing Q straight from r Á F or S À J.
Nordlund (1982) implemented a similar method as Heinemann et al. (2006), but based on the second-order form of the transfer equation: where the average of an ingoing and an outgoing ray (e.g., Hubeny and Mihalas 2014, p. 387). Defining K P ¼ P À S one arrives at This equation has the same form as the second order transfer equation and can be solved efficiently along a long characteristic using the method of Feautrier (1964). Figure 4 shows a summary table of the three major binary choices in multi-group radiative transfer from computing radiative losses and gains in the photosphere: LTE or non-LTE source function, short characteristics or long characteristics, and solving for K or solving for I in order to compute the flux divergence. Each of the resulting 8 options is numbered. The simulation by Nordlund (1982) is of Type 5. MURAM (Vögler 2004;Rempel 2017), RAMENS (Iijima and Yokoyama 2015;Iijima 2016), and MANCHA3D (Khomenko et al. 2017(Khomenko et al. , 2018 are Type 2 codes. STELLARBOX (Wray et al. 2015) is Type 6. CO5BOLD (Freytag et al. 2012) has both Type 2 and Type 6 options, but for stellar atmosphere simulations only Type 2 is supported.

Summary and examples of photospheric radiative transfer
The Oslo version of the STAGGER code (Type 8) and the BIFROST code (Gudiksen et al. 2011) (Type 4) are as of October 2019 the only codes using a non-LTE source function. Figures 5 and 6 demonstrate the result of a 4-group computation in a radiation-MHD simulation. The details of this particular simulation can be found in Carlsson et al. (2016). Figure 5 shows the vertically emergent intensity in each radiation group. Bins 1 and 2 grouped areas of the spectrum with generally low opacities. The corresponding images are indeed reminiscent of observed optical continuum images of the photosphere. Bins 3 and 4 contain opacities of stronger lines, and resemble images taken in the wings of the Ca II H&K lines (e.g., Rutten et al. 2004 Figure 6 shows the heating rate per mass in each radiation bin. The prominent funnel shape in the mass density panel is caused by the presence of a strong magnetic field concentration that fans out with height. All bins show strong cooling at the top of the granules (Red color just below z ¼ 0:0 Mm), and bins 2-4 show heating just above the granules. There is strong cooling per mass unit in the chromosphere above z ¼ 1 Mm. While the optical thickness of the chromosphere above this height is small because of the low density, the heating rate per mass is independent of the mass density, and depends on the value of j i and the size of ðS i À J i Þ only. Figure 7 demonstrates the accuracy of approximating the spectrum by only a few frequency groups in the non-LTE scheme of Skartlien (2000) on the horizontally  Fig. 6. The model was computed with the BIFROST code (Gudiksen et al. 2011) averaged values of Q i . It does however not test the assumptions of coherent scattering, LTE equation of state and LTE opacity. The absolute error in Q ¼ RQ i is of the order of a few percent, while the error in individual groups i can be as large as 50% (group 3 at z ¼ 0:3 Mm). Note that Q is dominated by group 1. The absolute value of Q is decreasing with height because of its dependence on the mass density.
In Fig. 8 the difference between assuming an LTE or non-LTE source function is demonstrated. The expression for the flux divergence in the multigroup scheme is the same as for the monochromatic case: where i ¼ 1 in LTE, and i 1 in non-LTE. In the latter case i can be as low as 10 À4 . A strict comparison between the scattering and non-scattering cases is not possible, because of the different definition of the group-mean opacities, source functions and thermal emission terms. Nevertheless, the main result from this vertical slice along the white line in Fig. 5. The top row shows the temperature and density, the two bottom rows show the flux divergence per mass unit in the four opacity groups. Brown is cooling, blue is heating, and the brightness scale for the flux divergence panels is clipped at 20% of the maximum of the absolute value to enhance contrast. The maximum and minimum values are indicated in each panel. The black curves indicate the s i ¼ 1 height in each bin. Note that the maxima of the heating and cooling per unit mass do not coincide with the s ¼ 1 height. The flux divergence in this simulation is artificially set to zero at the height where the entire atmosphere above has a maximum optical thickness of 10 À5 . The total radiative losses above this height are negligible, but the local losses and gains per unit mass are not figure is that the LTE scheme vastly overestimates the radiative cooling in the chromosphere, because i ¼ 1 in LTE. The amplitude of the cooling and heating in groups 2-4 between z ¼ 0 Mm and z ¼ 0:3 Mm is however much larger in non-LTE than in LTE. Skartlien (2000) speculates that this is caused by the smoothing effect that scattering has on J i , but a thorough investigation of this effect has never been done.

Radiative losses in the transition region and corona
The corona is optically thin at all wavelengths except for the radio regime. Its radiative losses are dominated by a myriad of EUV lines from highly ionised stages of many different elements (e.g., Curdt et al. 2004;Woods et al. 2012).
In the transition region, which I loosely define here as that part of the atmosphere where hydrogen is ionised but the temperature is below 100 kK, the emission is dominated by lines of lower ionisation stages (typically twice to four times ionised). For most lines, and for most regions on the sun, the TR is optically thin. In solar flares this is not necessarily the case: Kerr et al. (2019) showed that the TR can have appreciable optical thickness in the Si IV 140 nm lines. Fig. 7 Average radiation heating and cooling per volume (Q) as a function of height in a 3D radiation-hydrodynamics simulations using a 4-group non-LTE radiative transfer scheme. Upper panels: Horizontally averaged radiative heating per volume unit shown in a bilogarithmic plot. The units are arbitrary. Thick lines are the exact group solutions, while the thin lines are the approximate group solutions. The vertical line segments in the uppermost panel show the heights where the average optical depth per group is unity, as measured along the vertical line. Lower panel: Horizontally averaged amplitudes of radiative heating (average absolute value) relative to the amplitude of the exact total heating. Thick curves are the exact amplitude ratios, while the thin curves are ratios from the approximate group solutions. Image reproduced with permission from Skartlien (2000), copyright by AAS Non-equilibrium ionisation effects play a role in the transition region (Olluri et al. 2013;Golding et al. 2017) and corona (Hansteen 1993;Bradshaw et al. 2004;Dzifčáková et al. 2016). Figure 1 of Hansteen (1993) shows an increase in radiative losses at a given density and temperature in the transition region by a factor two in a 1D hydrodynamic situation when non-equilibrium ionisation is used instead of instantaneous ionisation equilibrium.
A fully general treatment of TR and coronal radiative losses in a radiation-MHD simulation would thus involve solution of the full 3D non-equilibrium-non-LTE radiative transfer problem for most ionisation stages for a wide range of elements. This is currently impossible for 3D simulations because of limits on computation speed.
Neglecting radiative non-local transfer effects through assuming optically thin radiative transfer (i.e., assuming J m ¼ 0 in the rate equations) alleviates already much of the problems without sacrificing much accuracy in most circumstances. If one furthermore excludes hydrogen and helium, the justification being that these elements are fully ionised at high temperatures and do not contribute to line cooling, then changes in ionisation of the elements do not influence the pressure and temperature.
The problem reduces then to solving the rate equations on i ot þ r Á ðn i vÞ ¼ X n l j;j6 ¼i n j P ji À n i X n l j;j6 ¼i where i sums over all energy levels and ionisation stages of each element under consideration. The rate coefficients P ij contain collisional (de-)excitation and collisional ionisation recombination terms and spontaneous radiative deexcitation and recombination terms, but no radiative terms that involve absorption of an existing photon. Ignoring absorption therefore only allows for cooling. The radiative loss rate per volume in a bound-bound transition between a lower level i and upper level j is then given by and a similar expression can be written for bound-free transitions. The total cooling rate per volume can then be computed by summing the contributions of all transitions of all elements and including electron-ion free-free radiation. A more detailed description of this method in a 1D radiation-hydrodynamics code is given Fig. 8 Horizontal averages of radiative heating per mass unit (Q=q for a 4-group scheme assuming LTE and non-LTE. The units are arbitrary, and the scaling is the same for all figures. The amplitude of the flux divergence for the LTE method (labeled old) is much larger above 0.3 Mm than for the non-LTE method (labeleld new). This effect is caused mainly by the larger differences between the source function and the mean intensity. Around 0.0 Mm, the new method produces larger amplitudes in the sense that hot regions are cooled more and cooler regions are heated more. Lower panel: Sum of all groups. The main difference above 1.0 Mm comes from the contribution in group 4. Image reproduced with permission from Skartlien (2000), copyright by AAS b in Hansteen (1993). To my knowledge this method has not been implemented in 3D codes. The option of computing non-equilibrium ionisation was added to the BIFROST code by Olluri et al. (2013), but they did not implement the resulting radiative cooling.
Instead, the default method to compute radiative losses in the corona is to assume statistical equilibrium [i.e., the left-hand-side of Eq. (54)] is assumed to be zero. Together with the assumption of no photon absorption these two assumptions together are often called the ''coronal approximation''. The cooling a spectral line of element X in ionisation stage m with upper level j and lower level i can then be written as: GðT; n e Þ n e n H : Here n j;m =n m is the fraction of all ions in ionisation stage m in level j, n m =n X is the fraction of all atoms of species X in ionisation stage m, and n X =n H is the abundance of element X relative to hydrogen. The function GðT; n e Þ is only weakly dependent on the electron density: the upper level population is dominated by collisional excitation from the ground state, so that n e n m $ A ji n j;m , and the rate coefficients setting up the ionisation balance are almost linear in the electron density. A residual electron density dependence remains in GðT; n e Þ through collisional deexcitation and density-dependent dielectronic recombination (Summers 1972(Summers , 1974. A total coronal radiative loss function KðT; n e Þ can thus be constructed through summing up Q ij for all levels and ionisation stages of all relevant elements and adding the contribution from continuum processes. The electron density dependence of KðT; n e Þ is weak: Landi and Landini (1999) performed a sensitivity study for electron densities in the range 10 14 -10 20 m À3 , and found a difference in the value of K of at most 20% (see Fig 9). It is therefore reasonably accurate to pre-compute K at a fixed typical coronal electron density (say n e ¼ 10 16 m À3 ).  Landi and Landini (1999), copyright by ESO A larger uncertainty can be introduced by inaccuracies of the elemental abundances. The coronal loss function is dominated by losses from C, Si, O, and Fe, and the abundances of these elements have a large influence. The abundance of C and O is debated after 3D non-LTE computations (Asplund et al. 2004(Asplund et al. , 2005 gave a different result than calculations using 1D models (Grevesse and Sauval 1998).
Another complication is that the most accurate abundances are derived from photospheric lines, but coronal abundances are generally different from abundances in the photosphere. Feldman et al. (1992) compared coronal abundances for 15 elements to photospheric abundances, and Fig. 10 show the difference in the loss function when using photospheric or coronal abundances. Unfortunately it appears that no systematic re-investigation of coronal abundances have been made since 1992. Furthermore, the coronal abundances are not constant, but depend on the coronal structure (see, e.g., Sect. 2.1 of Cranmer and Winebarger 2019, and references therein). Abundances might thus well be the dominant source of uncertainty in the coronal loss function.
The CHIANTI atomic database 2 (Dere et al. 1997(Dere et al. , 2019 provides an extensive compilation of critically assessed atomic data. In addition to the data it delivers software packages in both the IDL and Python languages for using this data and easy generation of loss functions using a variety of abundances and other input options. Computation of Q in the corona is then straightforward: 3 1 Fig. 10 Radiative loss functions K computed assuming n e ¼ 10 15 m À3 as function of temperature. Upper curve: coronal abundances from Feldman et al. (1992). Lower curve: photospheric abundances from Grevesse and Sauval (1998). Image reproduced with permission from Dere et al. (2009), copyright by ESO where KðTÞ is computed using a 1D lookup table. The hydrogen density is easily computed from the mass density, and the electron density can be approximated accurately assuming full ionisation of both H and He at high temperatures. In the low temperature regime, where H I, He I, and He II exist in significant amounts, one can employ precomputed tables of the electron density assuming LTE or coronal equilibrium.
In order to avoid contribution from the convection zone, photosphere, and chromosphere, one needs to multiply Q with a cutoff function that drives Q to zero in the lower atmosphere. BIFROST employs a soft cutoff function: expðÀP=P 0 Þ, with P the gas pressure and P 0 a typical pressure at the top of the chromosphere (Gudiksen et al. 2011). MURAM uses a hard cutoff at T ¼ 20,000 K (Rempel 2017).
The radiative losses in the TR and corona tend to have sharp peak in the transition region owing to the quadratic density-dependence. Rempel (2017) noticed that the relatively large grid spacing of the simulations compared to the thickness of the TR can lead to inaccuracies in the computation of Q. He proposed a scheme using subgrid interpolation to improve the accuracy.
A demonstration of Q and its relation to temperature and density is shown in Fig. 11 for a simulation carried out with the MURAM code. The cooling is largest (note the logarithmic scale) in the transition region, just at the border between the TR and the chromosphere, where it typically is in the range of 0.1-1:0 W m À3 , and it quickly drops down to coronal values around 10 À4 -10 À5 W m À3 . Zooming in reveals that the strongly-emitting layer is often only a few pixels wide.

Radiative transfer in the chromosphere
The assumptions underpinning the methods for photospheric radiative transfer as presented in Sect. 3 are no longer valid in the chromosphere: the chromosphere has a low opacity except in a few strong spectral lines, in ultraviolet continua below 160 nm, and in (sub-)mm continua above 160 lm. The lines that dominate the radiative energy exchange are the H&K and infrared triplet of Ca II, the h&k lines of Mg II, and H I Lya (see Fig. 12). The opacity in these lines is severely underestimated in the construction of a bin-averaged opacity. The source function is no longer described by the Planck function, and the assumptions of coherent scattering or complete redistribution are very inaccurate for these strong lines, which should instead be modelled using partially coherent scattering (PRD). The ionisation balance of hydrogen and helium is out of equilibrium.
Proper inclusion of the radiative cooling in the chromosphere (even when ignoring non-equilibrium effects) thus involves solving the 3D non-LTE radiative statistical-equilibrium transfer problem including PRD. This is in principle possible using dedicated radiative transfer codes, but it is computationally expensive. A single solution to the problem for a single atom costs a CPU time of $ 10 s per grid cell (Sukhorukov and Leenaarts 2017), which is very large compared to the $ 5 ls CPU time per grid cell per timestep for radiation-MHD simulations (e.g., Gudiksen et al. 2011). Simplifications that speed up the computation are thus required. Carlsson and Leenaarts (2012) developed techniques to do so by describing the net effect of all the radiative transfer as a combination of (1) an optically thin radiative loss function which represents the local energy loss through radiation per atom in the right ionisation stage per electron, (2) the probability that this energy escapes the atmosphere, and (3) the fraction of atoms in the ionisation stage under consideration. These three factors must all be determined empirically because there are no obvious general physics-based approximations.
The method approximates the radiative loss per volume owing to species X in ionisation state m as Here, L X m is the optically thin radiative loss function per electron and per particle of element X in ionisation stage m, E X m ðsÞ is the photon escape probability as function of some depth parameter s, n Xm n X is the fraction of element X in ionisation stage m, and A X the abundance.
The quantities L X m , E X m , and n X m =n X are determined from a 1D radiationhydrodynamic simulation including non-equilibrium ionisation computed with the RADYN code Stein 1992, 2002) for H I. For Ca II and Mg II they were determined from a 2D radiation-MHD simulation with BIFROST that provided the atmospheric structure and subsequent statistical equilibrium radiative transfer calculations including PRD using MULTI3D (Leenaarts and Carlsson 2009).
The loss function L X m can be computed for each grid cell in the simulation by summing the net downward radiative rates multiplied with the energy difference of the transition, summed over all relevant transitions. The joint probability density Fig. 12 Net radiative cooling in the 1D semi-empirical VAL3C model atmosphere. The cooling between z ¼ 700 km and z ¼ 2120 km in this model is dominated by five lines from Ca II and two lines from Mg II. At larger heights H I Lya alone is the dominant radiative cooling agent. Image reproduced with permission from Vernazza et al. (1981), copyright by AAS function (JPDF) of L X m and gas temperature for Ca II is shown in the top panel of Fig. 13. Radiative transfer effects make that L X m is no longer a unique function of T, but the red curve indicates an approximate fit. The ionisation degree can be computed from the atomic level populations in the calibrating simulations (see the bottom panel of Fig. 13). Again they are no longer clean functions of temperature, but the spread is minor and a sensible fit as function of temperature can be made. Finally, the empirical escape probability E X m is computed from the total radiative losses in the simulation, the radiative loss function and the ionisation degree. The middle panel of Fig. 13 shows E Ca ii with the vertical column mass as depth parameter. Again there is considerable spread in the JPDF. Figure 14 displays a comparison of this simple recipe with a detailed calculation. The recipe does a surprisingly good job in reproducing the average cooling given the simplicity of the method. However, in individual grid cells large errors in Q might occur, caused by the spread of values around the red curves in Fig. 13.
Computing this chromospheric radiative loss function in a radiation-MHD simulation is fast and simple; it only involves computing the values of the fitted quantities from 1D lookup tables. The electron density can for example be determined from a 2D lookup table computed assuming LTE. This is not particularly accurate but simple. A more realistic electron density can be obtained by computing the non-equilibrium ionisation balance of hydrogen and/or helium (see Sect. 6). Carlsson and Leenaarts (2012) also describe techniques to model the absorption by the chromosphere of radiation emitted in the corona. Half of this radiation is emitted downwards and the majority will be absorbed in the chromosphere. The corona emits mainly in the far UV regime, and the dominant source of extinction at these wavelengths are the H I, He I, and He II continua. The coronal loss function is a frequency-integrated quantity (see Sect. 4), so in order to model the extinction one has to estimate a representative opacity. Carlsson and Leenaarts (2012) propose to use the opacity at the edge of the He I continuum at 50 nm. The contribution to the flux divergence is then given by with j He I the representative opacity. The angle-averaged radiation field J cor is computed from the transfer equation: with the emissivity given by g ¼ ÀQ cor =4p. The quantity Q cor is the coronal loss function as defined in Eq. (50). In other words: it is assumed that only the corona contributes to the production of photons, the chromosphere can only absorb these photons, and scattering is ignored. Because most radiation-MHD codes already include a 3D radiative transfer module used for the photospheric radiation, one can relatively easily implement the absorption of coronal radiation at a very modest increase in computation time. Simpler 1D recipes that ignore the spreading of radiation in the horizontal directions are also possible. They offer little else besides a marginal increase in computation speed, and can lead to spuriously large heating when coronal radiation emitted by a small localized source is forced to be absorbed in a single vertical column.
The population of neutral helium in the ground state needed to compute j He I can be computed assuming LTE populations without a too large error. Computing it taking into account non-equilibrium ionisation is more accurate but much slower (see Sect. 6). Figure 15 gives an example of how the various approximations for radiative cooling act in different atmospheric regimes. The photospheric cooling rate per mass is largest in the photosphere, but has a small contribution up into the chromosphere. Coronal losses are relevant throughout the entire corona, but are largest in the transition region. The chromospheric losses are largest just below the transition region owing to Lya cooling (see also Fig. 12). Modest cooling owing to Ca II and Mg II lines and heating from the absorption of coronal radiation happens somewhat deeper in the chromosphere. The lower-right panel, which combines photospheric, chromospheric, and coronal losses, clearly shows that the largest radiative losses per mass unit occur in the transition region. Fig. 13 Chromospheric radiative losses in Ca II using empirically calibrated recipes. Top: JPDF of radiative loss function and temperature in the chromosphere of a radiation-MHD model. The blue curve is the coronal approximation, the red curve the adopted fit. Ca II actually heats (meaning a negative loss function, not shown here because of the logarithmic axis) at low temperatures, and that is why the red curve appears a bad fit. Middle: escape probability, with the adopted fit in red. Bottom: fraction of all Ca as Ca II. Red is the adopted fit, blue the ionisation balance under coronal equilibrium conditions and green the balance assuming LTE. Image reprinted with permission from Carlsson and Leenaarts (2012), copyright by ESO Fig. 14 Test of the validity of tabulated chromospheric radiative losses. The curves show the horizontally averaged radiative cooling (i.e., ÀQ=q as a function of height in a 2D BIFROST radiation-MHD simulation. The colored lines show the results computed from a 2D non-LTE radiative transfer computation (solid) and the approximate recipe (dashed) are shown. For hydrogen there is no detailed radiative transfer computation because the recipe was computed from a 1D simulation with the RADYN code. The black solid land dashed lines show the total cooling from all three elements combined. Image reprinted with permission from Carlsson and Leenaarts (2012), copyright by ESO b Non-equilibrium radiative transfer and non-equilibrium ionisation play a role in the solar atmosphere wherever magneto-hydrodynamic timescales are short compared to timescales on which an atomic system reacts to changes. The combined continuity and rate equation for the level population n i in level i of an atomic species with N energy levels is given by: where P ij is the rate coefficient for transitions from level i to level j. If one ignores the advection term and assumes that all the P ij are constant in time then the equations for all levels together form a set of coupled first-order differential equations Fig. 15 Example of chromospheric radiative losses and gains in comparison to the photospheric and coronal losses and gains in a 3D simulation computed with the BIFROST code. Top row: temperature and density in a vertical slice through the simulation. The panel labeled Q photo shows the radiative losses per mass unit computed with the method described in Sect. 3; Q chromo displays the chromospheric losses and absorption of coronal radiation per mass unit using the methods from Carlsson and Leenaarts (2012); Q corona shows the losses per mass unit computed as described in Sect. 4. The panel labeled Q total shows the sum of the previous three panels, i.e., all radiative losses and gains in the simulation. Brown color indicates cooling, blue color represents heating with n the vector of level populations and P the rate coefficient matrix. This system has the solution: where a i are the eigenvectors of the rate matrix with corresponding eigenvalues k i , and c i are constants that depend on the initial condition. One of the eigenvalues is zero, and the corresponding eigenvector represents the equilibrium solution. All other eigenvalues are negative and have an absolute value smaller than one. If the system starts away from the equilibrium solution, then it will evolve towards equilibrium on a characteristic timescale given by A detailed discussion of the time dependence of atomic level populations is given in Judge (2005). One of the results from that paper is that the slowest time scale tend to be associated with processes that have small net rate coefficients. The smallest rate coefficients are often associated with ionisation and recombination processes (as well as transitions involving metastable levels). An illustrative solution for a two-level atom was derived in Carlsson and Stein (2002). The equilibration timescale is given by with C 12 and C 21 the upward and downward collisional rate coefficient, R 12 and R 21 the radiative rate coefficients and the term between square brackets the net radiative bracket. The collisional coefficients depend linearly (or quadratically in case of collisional recombination) on the electron density and exponentially on temperature. For hydrogen one thus expects a maximum in the chromosphere where the temperature and density are relatively low and strong lines are close to detailed balance so that the net radiative bracket is small. Carlsson and Stein (2002) did a detailed calculation of this timescale for hydrogen and found that the timescale can be as long as 10 5 s in the chromosphere (see Fig. 16), and that this is the timescale on which ionisation equilibrium is established.
A similar calculation for helium was done for helium by Golding et al. (2014), finding timescales of the order 10 2 -10 3 s in the chromosphere and transition region, again associated with the ionisation equilibrium.
These timescale are larger than the hydrodynamical timescales in the chromosphere and transition region. This has severe consequences for the treatment of radiation hydrodynamics. Because hydrogen and helium are majority species they do not only contribute to the radiative flux divergence, but their ionisation state also influences the temperature, pressure and electron density. The assumption that the equation of state (EOS) can be computed assuming LTE is no longer accurate.
The relaxation timescale itself depends on the radiation field, so that a proper treatment of the EOS now requires solution of Eq. (54) together with an equation for charge conservation and energy conservation Here n ijk are the atomic level populations of species i in ionisation state j and excitation state k and E ijk is the sum of the dissociation, ionization and excitation energy of a particle in state ijk. The rate coefficients P ij contain the radiation field so The electron density is given as the thick dashed curve. Image reproduced with permission from Carlsson and Stein (2002), copyright by AAS that the transport equation [Eq. (14)] must be solved too. As stated before, this is too computationally expensive to be of use in 3D simulations. Sollum (1999) developed approximations to the chromospheric radiation field in hydrogen transitions based on detailed 1D calculations with the RADYN code. He found that the angle-averaged and profile-function-averaged radiation field in a given transition can be approximated by a constant above a certain height in the chromosphere, and by the local Planck function at larger depth. In between these two limits he specifies a smooth transition. His recipes allow for an extreme simplification because the solution of the coupled set of Eqs. (54), (59), and (60) can then be computed without having to solve the transfer equation. A limitation of his method is that the Lyman-a line was set in detailed radiative balance. This limitation makes the solution less accurate in the very upper chromosphere and transition region.
His method was implemented in the Oslo STAGGER Code by Leenaarts et al. (2007), and used to perform a 2D radiation-MHD simulation of the solar atmosphere with a non-equilibrium EOS. Helium was still treated assuming LTE populations. The temperature and hydrogen ionisation degree in this simulation is demonstrated in Fig. 17. As a consequence of the long equilibration timescale, the ionisation degree in the chromosphere does not follow the temperature. The ionisation degree is instead rather constant in time for a given Lagrangian fluid element. Golding et al. (2016) developed approximations for the radiation field in helium transitions. The physics of helium ionisation is somewhat more complicated than for hydrogen because ionisation in the chromosphere is mainly driven by UV radiation produced in the corona. The resulting recipes take this into account, but require the Fig. 17 Temperature and hydrogen ionisation degree n H i =ðn H i þ n H ii Þ as function of time in two columns of a 2D radiation-MHD simulation that includes non-equilibrium ionisation of hydrogen. Left-hand panel: a column in a magnetic element. Right-hand panel: a column with weak magnetic field. The left-hand panel shows regular shock waves with 3-min period, while the right-hand panel shows a more irregular temperature structure. In both cases the ionisation degree does not follow the temperature structure. Instead it is rather constant. Image reproduced with permission from Leenaarts et al. (2007), copyright by ESO solution of the transfer equation in seven radiation bins in order to approximate the radiation field in the continua of helium as well as the He II 30.4 nm line.
These authors also implemented a semblance of radiative transfer in the Ly a line. They assigned a single-bin source function based on the net radiative rate and representative opacity to the line, and used those to solve the transfer equation ignoring scattering. The resulting radiation field is then used to add an upward radiative rate coefficient in Eq. (54). In this way, the recipes by Sollum (1999) were extended to the very upper chromosphere, but in a rather crude fashion.
The increased realism of an EOS that includes non-equilibrium ionisation comes at a rather steep price in computational efficiency: a simulation with a nonequilibrium EOS is around three (hydrogen only) to five times (hydrogen and helium) slower than a similar simulation with an LTE EOS.
Non-equilibrium ionisation has strong consequences on the structure of the chromosphere and transition region. Most importantly, ionisation can no longer function as efficiently as an energy buffer when the internal energy density of a gas parcel changes.
In LTE energy must be expended to ionise hydrogen and helium if the internal energy density is increased before the temperature can rise. Likewise, a decrease in internal energy leads to an instantaneous transfer of ionisation energy to thermal energy, slowing down the temperature decrease. This leads to characteristic bands of ''preferred temperatures'' in joint probability density functions of radiation-MHD simulations assuming LTE (see Fig. 18). The temperature of these bands are associated with the temperatures where H I, He I, and He II ionise according to the Saha-Boltzmann equations.
If the ionisation balance is computed in non-equilibrium, and the ionisation/ recombination timescale is long, then an increase in internal energy leads directly to a temperature increase. Temperature decreases are also stronger than in LTE because ionisation energy cannot be released quickly enough to counteract cooling. The bands of preferred temperature disappear, and the gas in the chromosphere behaves somewhat like and ideal gas. A clear example of this effect is the increased the amplitude of the temperature jump in acoustic shocks (see Carlsson and Stein 2002;Leenaarts et al. 2007).
Low-temperature areas in the chromosphere have a higher electron density than predicted by the Saha-Boltzmann equations, and the reverse is true for hightemperature areas. This has an effect on the formation of chromospheric lines because the source function couples to the local temperature mainly through collisions with electrons. Non-equilibrium ionisation is also expected to have an effect on the efficiency of heating through ambipolar diffusion (e.g., Martínez-Sykora et al. 2017;Khomenko et al. 2018). 7 Other developments 7.1 Fast approximate radiative transfer in the photosphere Abbett and Fisher (2012) propose a method for quick evaluation of the radiative losses in the photosphere as an alternative to the methods described in Sect. 3. They assume that each column in a simulation can be treated as an independent planeparallel atmosphere. The angle-averaged radiation field at vertical optical depth s m in a column is then given by: The first exponential integral E 1 ðxÞ peaks sharply at x ¼ 0, so that this expression can be approximated as This result is inserted into the equation for the radiative cooling [Eq. (11)] to yield Q % À2pq If one assumes an LTE source function, then the frequency integral can be approximated using a reasoning similar to the one given in Sect. 3.2, and together with some additional assumptions one arrives at the final result: where j B is the Planck-averaged opacity (see Sect. 3.2), s B the optical depth computed from this opacity, and r is the Stefan-Boltzmann constant. With this scheme, computation of the radiative heating only requires a simple 2D table lookup to get j B , and a column-by-column integration over depth to compute s B . Figure 19 shows the resulting temperature structure in the photosphere in a simulation where the radiative losses are computed in this simplified fashion. The method is simple and extremely fast and is well suited for problems that do not require very accurate radiative losses, but nevertheless want the radiative losses to drive reasonably realistic-looking convection.

Escape probability method
An interesting new method that speeds up non-equilibrium radiative transfer was proposed by Judge (2017). The major time consuming task in radiative transfer is Fig. 19 Temperature at a constant height in the photosphere of a 3D simulation computed with the RADMHD code. The panel spans a size of 24 Â 24 Mm 2 and has a grid spacing of 21.3 km. The convection pattern strongly resembles the result of simulations that model radiation with higher fidelity, despite the strong simplifications in the computation of the radiative losses. Image reproduced with permission from Abbett and Fisher (2012), copyright by Springer to be largest in the transition region and during solar flares, and might well lead to a factor two error in the value of the loss function KðTÞ. The choice of abundance has a smaller effect in the transition region, but can lead to differences up to a factor three at higher temperatures in the corona. A systematic test of these effects in 3D radiation-MHD simulations has so far not been done.
Radiative transfer and non-equilibrium ionisation in the chromosphere is probably the least studied and the methods described in Sects. 5 and 6 are likely the most inaccurate of all method used in the photosphere-chromosphere-corona system. A long sequence of approximations is needed to order to make the problem computationally feasible. Testing the accuracy of all approximations combined can only be done in 1D geometry (using RADYN or similar codes), and has so far not been done. A particular worry is the crude way in which the radiative transfer in the Ly-a line is implemented in the non-equilibrium ionisation method, Interestingly, the way how chromospheric radiative transfer is implemented, and the accuracy of the method used seems however to have only a minor effect on the overall structure of the simulated chromospheres. A MURAM simulation of active regions that only contains single-bin (gray) LTE radiative transfer and a coronal loss function produce chromospheres whose structure resembles the real chromosphere (see, e.g., Bjørgen et al. 2019 and Fig. 20).
I argue that this is a consequence of the physics of the chromosphere in the MHD approximation. Thermal conduction in the chromosphere is not efficient, and the only way a Lagrangian fluid element can lose energy is through radiation. In a chromosphere that is in a statistically stable state, the dissipation of non-thermal energy into heating and the radiative cooling must be in balance in a volume and time-integrated sense. An increase in non-thermal energy deposition must be accompanied by an increase in radiative losses. In other words: radiative losses are a reaction to heating, and the chromosphere will adapt its thermodynamic state until heating and cooling are in balance again.
Here is the catch: the radiative losses are very sensitive to temperature, but the mechanisms that dissipate non-thermal energy are not. The radiative losses assuming LTE scale as T 4 , while the radiative losses in the coronal equilibrium approximation scale exponentially with temperature under chromospheric conditions (see Fig. 10). The non-LTE chromospheric loss function will lie between these two extremes most of the time.
In the MHD approximation there are only two mechanisms that irreversibly convert non-thermal energy into heat: viscosity and electrical resistance. The first one scales as T 1=2 (assuming a dilute gas of rigid elastic spheres), while the second scales as ln T=T À3=2 (assuming Spitzer resistivity). In practice the viscosity and resistance are replaced by numerical terms that are independent of temperature in almost all numerical simulations.
When the description of the chromospheric radiative losses or the equation of state is not correct, then the simulation will change the temperature compared to the correct solution until balance between energy gains and losses is achieved again. The steep temperature dependence of the radiative losses makes the temperature change modest (say 1000-2000 K, if our methods are not too bad), but the effect on the non-thermal energy dissipation rate is small. The result is a chromosphere with the wrong temperature, but almost correct dissipation, density and velocity structure.
It thus seems that one can study certain aspects of chromospheric physics without a too complicated treatment of the radiative losses and equation of state. 3 This does, however, not mean that the work described in Sects. 5 and 6 can be ignored. The only proper way to validate models is to compute the various diagnostics (line profiles and continua) and compare to observations. The emergent intensities in the diagnostics sensitively depend on the temperature and electron density. Comparison of models with observations (such as in Leenaarts et al. 2013;Bjørgen et al. 2018) show that current models are not getting the intensities right, and that they need to be refined. The treatment of chromospheric radiative energy exchange is very likely one of the aspects in need of further improvement.