A Fast and Accurate Method of Radiation Hydrodynamics Calculation in Spherical Symmetry

and

Published 2018 May 25 © 2018. The American Astronomical Society. All rights reserved.
, , Citation Torsten Stamer and Shu-ichiro Inutsuka 2018 AJ 155 253 DOI 10.3847/1538-3881/aac023

Download Article PDF
DownloadArticle ePub

You need an eReader or compatible software to experience the benefits of the ePub3 file format.

1538-3881/155/6/253

Abstract

We develop a new numerical scheme for solving the radiative transfer equation in a spherically symmetric system. This scheme does not rely on any kind of diffusion approximation, and it is accurate for optically thin, thick, and intermediate systems. In the limit of a homogeneously distributed extinction coefficient, our method is very accurate and exceptionally fast. We combine this fast method with a slower but more generally applicable method to describe realistic problems. We perform various test calculations, including a simplified protostellar collapse simulation. We also discuss possible future improvements.

Export citation and abstract BibTeX RIS

1. Introduction

Theoretical investigations of many astrophysical problems require an accurate treatment of radiative transfer. Since analytic solutions of the transfer equation are generally unavailable except in trivial systems, numerical methods are employed. However, the complexity of the problem typically means that a realistic treatment is computationally expensive. One example of such an expensive problem is the simulation of protostellar collapse. The term refers to the process by which a molecular cloud core contracts under its own gravity to form a star, investigated in a seminal paper by Larson (1969) and by others such as Winkler & Newman (1980), Masunaga et al. (1998), and Vaytet & Haugbølle (2017). This process is initially isothermal; the cloud is optically thin, so any heat gained through the compression of the gas is efficiently radiated away. As the collapse proceeds, the compressional heating increases and eventually catches up with the radiative cooling, so the temperature begins to rise. Depending on the initial conditions and opacity, this may happen before or after the system has become optically thick. The later evolution in the high-density region is essentially adiabatic. When the thermal pressure becomes large enough to stop the gravitational collapse, a hydrostatic object with a typical radius of a few au forms. This is called the first hydrostatic core or the first Larson core. The first core continues to accrete material from the surrounding envelope, and temperature continues to increase until, at about 2000 K, molecular hydrogen starts to dissociate. This is a strong cooling effect that reduces the pressure and triggers a second collapse, which only ends when all the hydrogen molecules have dissociated and a second hydrostatic core, much smaller and hotter than the first, has formed. This second core is also called a protostar; it continues to accrete matter and heat up until nuclear fusion is ignited in its core.

Numerical simulations of protostellar collapse are challenging, which is in part due to the extremely wide range of size and density. When forming a solar-type star, typical values for the initial cloud core are 104 au and 10−19 g cm−3, while the protostar is 10−3 au and 10−1 g cm−3. Radiative transfer presents another difficulty. While the early, isothermal phase can be approximated by simple optically thin cooling and the optically thick regions in the later stage by radiative diffusion, neither of these approximations is valid in the optically intermediate region near the photosphere. However, this is the most important region for the exchange with the outer medium, which determines the temperature structure and ultimately the entropy of the protostar. The latter determines the initial location in the Hertzsprung–Russell diagram and the subsequent evolution.

In recent years, numerical simulations have become more and more sophisticated. The number of physical processes included keeps increasing, among them magnetic field effects (Tomisaka 2002; Machida et al. 2006; Commerçon et al. 2010; Federrath 2015), protoplanetary disk formation (Stamatellos & Whitworth 2008; Inutsuka et al. 2010; Machida et al. 2011; Nordlund et al. 2014; González et al. 2015; Tomida et al. 2015; Seifried et al. 2016), chemical evolution (Visser et al. 2015; Dzyurkevich et al. 2016; Hincelin et al. 2016), and nonideal MHD (Tsukamoto et al. 2015a, 2015b; Masson et al. 2016; Wurster et al. 2016). There are now also synthetic observations comparable with actual data (Commerçon et al. 2012; Frimann et al. 2016; Seifried et al. 2016).

At the same time, much more simplified, spherically symmetric radiation hydrodynamics (RHD) simulations such as those by Masunaga et al. (1998), Masunaga & Inutsuka (2000), and, more recently, Vaytet et al. (2011, 2012, 2013) and Vaytet & Haugbølle (2017), are still valuable. This one-dimensional modeling is still the only method to describe the evolution of the entire process of protostellar collapse, since multidimensional modeling has to mask the central region that requires extremely short timesteps. In this context, we aim to develop a radiative hydrodynamics scheme for spherical systems that is both fast and accurate, so that it can be used for a detailed exploration of the parameter space to investigate the effects of the initial conditions on properties such as protostellar mass, radius, and entropy. Note also that the present method can be combined with multidimensional modeling. In addition, even though collapse simulations are the primary motivation for this work, the method is not limited to this and may well be used in other systems that can be approximated as spherical.

Radiative transfer is often treated using either the flux-limited diffusion approximation—for example, in works such as Bodenheimer et al. (1990) and Yorke et al. (1993)—or a method based on solving the moment equations of radiation (Castor 1972; Buchler 1979). The latter requires a closure relation, which commonly appears in the form of the Eddington approximation, which assumes that the Eddington factor f, the ratio between the second and the zeroth moment of radiation, is equal to 1/3. This is exactly correct only in the case of isotropic radiation. An improvement upon this is the variable Eddington factor method (Tscharnuter & Winkler 1979), in which the Eddington factor is no longer constant but instead is calculated depending on the degree of anisotropy of the radiation field. Details of the numerical implementation can be found, for instance, in Mihalas & Mihalas (1984) and Stone et al. (1992), the basis for the "ZEUS" RHD code.

Both the diffusion and Eddington approximation are very fast but also somewhat crude, since they are only exact in optically thin/isotropic regions. On the other hand, the variable Eddington factor method is very accurate but requires considerable computational effort. In this work, we develop a method that aims to combine the advantages of both. Our approach is different in the sense that it uses neither the diffusion approximation nor the moment equations. Instead, it is based on the radiative exchange between pairs of spherically symmetric shells. It does have some resemblance to ray-tracing schemes, especially in the case of the numerical angle integration discussed in Section 2.3.3.

This paper is structured in the following way. In Section 2, we derive the basic equations on which our method is based, followed by a description of the numerical implementation. Section 3 presents the results of various test calculations, both for the case of a homogeneous extinction coefficient and for the more realistic, inhomogeneous case. Section 4 summarizes our work and presents ideas for possible future improvements.

2. Method

2.1. Aims

We develop a method to solve the radiation transport in a spherically symmetric fluid system. The aim is to calculate the rate of energy gain or loss due to radiation at any radius, i.e., ${dU}/{dt}(r)$, where U is the specific internal energy of the fluid. Therefore, the unit of this "radiation term," as we shall call it from now on, is power per mass.

Ultimately, our method is intended to couple to a hydrodynamic simulation by including the radiation term in the hydrodynamic energy equation. To first order, this can be done by subdividing the system into a finite number of shells, calculating the radiation term at some radius representative of each shell (such as the shell center), and assuming that it does not vary over the shell. For higher-order calculations, one may interpolate the value of the radiation term between neighboring shells.

The radiation term is the sum of radiative heating and cooling. The latter is trivial even in a 3D system, since it depends only on the local values of density, opacity, and temperature at position r. But heating is far more complicated, as it depends on the local radiation field, which in turn is determined by the distribution of these variables across the entire system.

2.2. Derivation of the Basic Equations

2.2.1. General Derivation

The monochromatic radiation transfer equation in three dimensions is

Equation (1)

where Iν, κν, and Sν are the intensity, opacity, and source function at frequency ν. In the following, we will leave out the index ν for convenience.

Equation (1) combines the effects of emission and absorption of radiation by the material. We shall neglect the explicitly time-dependent term dIν/dt throughout this paper. This is equivalent to assuming that the radiation field instantaneously adjusts to any changes in the hydrodynamic variables. This assumption is valid as long as the time for light to cross the system is much shorter than the time for the hydrodynamic variables to change significantly, which is the case in most astrophysical systems.

With the above assumption, the solution is

Equation (2)

where $\tau ({\boldsymbol{r}},{\boldsymbol{r}}+{\boldsymbol{n}}D)$ is the optical depth between positions ${\boldsymbol{r}}$ and ${\boldsymbol{r}}+{\boldsymbol{n}}D$, while DB and τB refer to the distance and optical depth between ${\boldsymbol{r}}$ and the outer boundary of the system in the direction ${\boldsymbol{n}}$. The first term represents radiation emitted by other points within the system, while the second term represents radiation coming from outside. The latter's intensity is determined by SO, the source function of the external radiation, which must be supplied as a boundary condition.

Equation (2) determines the direction-dependent intensity. The integral over all directions gives us the radiation energy density:

Equation (3)

A prime on a position-dependent quantity indicates that it is to be evaluated at ${\boldsymbol{r}}+{\boldsymbol{n}}D$ rather than ${\boldsymbol{r}}$.

Let us now consider the total radiation term (heating plus cooling). Assuming that each fluid element emits isotropically,

Equation (4)

and inserting the previously derived expression for epsilon, we obtain

Equation (5)

Assume a case where the temperature, and therefore the source function, is constant everywhere, $(S=S^{\prime} ={S}_{{\rm{O}}})$. In this case, $\tfrac{{dU}}{{dt}}$ must be zero, and it follows that

Equation (6)

We can now replace the 4π in Equation (4) with this expression:

Equation (7)

Consider the physical meaning of the integration in the first term. For all directions, we integrate outward from a point ${\boldsymbol{r}}$ to the system's boundary. In other words, we are integrating over the volume of the physical system but using a coordinate system whose origin lies at ${\boldsymbol{r}}$, so the volume element is $d{\boldsymbol{r}}^{\prime} ={D}^{2}d{\rm{\Omega }}{dD}$, and we may write

Equation (8)

As long as the integral is over the whole volume, we may use the usual coordinate system and volume element. From this point onward, we shall abbreviate the product κρ as χ (the extinction/emission coefficient). The physical interpretation of this equation is as follows.

The volume integral represents the exchange of radiative energy between different positions within the system. Thus, the term with S (cooling term) is the radiation emitted at ${\boldsymbol{r}}$ and absorbed at some other point ${\boldsymbol{r}}^{\prime} $, while the term with S' (heating term) is radiation emitted at ${\boldsymbol{r}}^{\prime} $ and absorbed at ${\boldsymbol{r}}$.

Likewise, the SO term in the solid angle integral represents radiation coming from outside the system that is absorbed at ${\boldsymbol{r}}$, while the S term represents radiation emitted at ${\boldsymbol{r}}$ that reaches the boundary and escapes from the system.

The factors $\kappa \chi ^{\prime} {e}^{-\tau }/{D}^{2}$ and $\kappa {\int }_{{\rm{\Omega }}}{e}^{-{\tau }_{{\rm{B}}}}d{\rm{\Omega }}$ can be regarded as exchange coefficients, quantifying the efficiency of the radiative exchange between ${\boldsymbol{r}}$ and ${\boldsymbol{r}}^{\prime} $ and ${\boldsymbol{r}}$ and the outside radiation field, respectively. Furthermore, Equation (6) tells us that the volume integral over all of these exchange coefficients, plus the exchange coefficient for the boundary, must be equal to 4πκ. This is simply another way of saying that the radiative cooling is equal to −4πκ S.

2.2.2. Spherical Symmetry

In principle, Equation (8) can be integrated numerically to obtain the radiation term, but in realistic problems, the computational cost is prohibitively high.

Many hydrodynamical problems in astrophysics can be reasonably well approximated as spherically symmetric, so that all variables depend only on radius. While this reduces the computational cost, it is still quite slow because the equations include the distance and optical depth between different points. Even in spherical symmetry, these depend on all three coordinates. In this section, we shall manipulate the equation in such a way as to reduce this computational load for the case of a spherically symmetric system.

Consider the radiative exchange between a point ${\boldsymbol{r}}$ and an infinitesimally thin, spherical shell at radius r' (Figure 1). Calculating the radiation term at point ${\boldsymbol{r}}$ is sufficient, because spherical symmetry implies that it is the same for every point with radius r.

Figure 1.

Figure 1. Schematic illustration of the situation in spherical symmetry for the case r' > r. The idea is to calculate the radiative exchange between the point ${\boldsymbol{r}}$ and the infinitesimal shell r'. The red line represents a single ray between ${\boldsymbol{r}}$ and a point on r'. The full calculation requires an integration over all such rays. The picture shows the meaning of a number of important variables: the distance between the points D, the polar angle θ', the direction angle $\tilde{\theta }$, and the minimum and maximum distances between shells r and r', which occur at $\tilde{\theta }=\theta ^{\prime} =0$ and $\tilde{\theta }=\theta ^{\prime} =\pi $, respectively. The optical depth τ is proportional to the distance, but unless χ is constant throughout the system, the proportionality constant depends on the direction of the ray.

Standard image High-resolution image

If we choose the coordinate system such that ${\boldsymbol{r}}$ lies on the Cartesian y axis, there is no longer any dependency on the azimuthal angle, essentially reducing the system to 2D. Equation (8) tells us that the contribution of the (infinitesimal) shell r' to the radiation term at ${\boldsymbol{r}}$ is

Equation (9)

Numerical integration over r' is, of course, unavoidable. The main challenge is the calculation of the angle integral:

Equation (10)

Figure 1 illustrates the physical meaning of the variables in this equation. The next section deals with methods of calculating ${A}_{r\leftarrow r^{\prime} }$.

2.3. Numerical Implementation

2.3.1. General Considerations

In order to perform numerical simulations, we subdivide our system into a finite number of spherically symmetric shells. Within each shell, density, opacity, and temperature are assumed to be constant. The contribution of shell j to the radiation term at radius r is determined by

Equation (11)

Here rjL and rjR are the inner and outer boundaries of shell j, respectively. In order to obtain the exchange coefficient between shells i and j, the above expression would have to be integrated over shell i, i.e.,

Equation (12)

Here m is the mass coordinate, and Mi is the mass contained within shell i.

Unfortunately, the integration over shell i can only be done numerically, so this method is slow. In addition, if we numerically integrate over j as well (as in Section 2.3.3), there are large inaccuracies for neighboring shells near the singularity that occurs at r = r' for θ' = 0. For these reasons, we do not integrate over shell i, but instead we set ${A}_{i\leftarrow j}={A}_{{r}_{i}\leftarrow j}$, where ri is the radius of shell i's center. This definition allows us to accurately calculate the radiation term at radius ri, but note that energy conservation between shells requires that ${R}_{i\leftarrow j}=-{R}_{j\leftarrow i}$. Since the radiation term is power per mass, this implies that ${A}_{i\leftarrow j}\ {M}_{i}={A}_{j\leftarrow i}\ {M}_{j}$. With this definition, this is generally not fulfilled, since the radiation term at the shell center is not equal to the shell average. In other words, when updating shell i, we calculate the effect of shell j on radius ri, but when updating shell j, we calculate the effect of shell i on radius rj. This is not symmetric between i and j, which ultimately causes a violation of energy conservation.

Alternatively, it is possible to use the following definition:

Equation (13)

The radiation term is now defined as an average between the two directions of transfer. This means the radiation term at ri is no longer calculated as accurately, but this expression is symmetric to exchanging i and j and therefore conserves energy.

The method we develop in the following sections is able to calculate the radiation term at a specific radius exactly in the limit of infinite resolution. Therefore, for the test calculations in this paper and to investigate the effect of different resolutions, we use the nonsymmetrized definition, and from now on, we will refer to ${A}_{{r}_{i}\leftarrow j}$ simply as ${A}_{i\leftarrow j}$. In a real application, the symmetrized definition may be preferred, since it guarantees energy conservation.

2.3.2. Constant-χ Method

The fastest way of calculating ${A}_{i\leftarrow j}$ is to substitute $\tau ={\overline{\chi }}_{{ij}}D$. This is an approximation: it assumes that ${\overline{\chi }}_{{ij}}$, the proportionality constant between distance and optical depth, is a constant independent of θ'. But unless χ is actually constant throughout the whole system, this is clearly not true. Consider again Figure 1. If χ increases toward the center, as is usually the case, then rays going through the inner region will have larger values of χij than those that move only outward.

It is ultimately up to the user which value to choose for ${\overline{\chi }}_{{ij}};$ the simplest method, which we adopt here, is to take the value for θ' = 0. If χ increases toward the center, we expect this to cause an overestimation of ${A}_{i\leftarrow j}$, especially for the case i < j, and a somewhat smaller overestimation for i > j. Despite this inaccuracy, this method can be useful, because it allows us to solve the angle integral analytically and is therefore very fast. We start by expressing the distance D as a function of ri, rj, and θ':

Equation (14)

We insert this into the definition of ${A}_{i\leftarrow j}$ (Equation (11)) but ignore the integration over shell j for the moment and set r' = rj. Using $\tau ={\overline{\chi }}_{{ij}}D$, we obtain

Equation (15)

The indices min and max refer to the minimum and maximum distances/optical depths between the radii ri and rj (see Figure 1). The integral over τ can be reformulated using exponential integrals. The exponential integral of order n is defined as

Equation (16)

Using this, Equation (15) becomes

Equation (17)

We have avoided the numerical integration over θ' and instead have to solve two exponential integrals. This is much faster, since analytic formulae are available for the latter. The τmax term is negligible in optically thick systems, since in that case ${E}_{1}({\tau }_{\max })\ll {E}_{1}({\tau }_{\min })$.

We now consider the integration over shell j, so we replace the constant rj with the variable r'. Based on Equation (17), the dependency on r' is of the form $r^{\prime} {E}_{1}(\tau (r^{\prime} ))$. This can be integrated analytically using the relation between an exponential integral and its derivative, $\int {E}_{{\rm{n}}}(x){dx}=-{E}_{{\rm{n}}+1}(x)+C$.

We express r' as a function of τ, assume $\tfrac{{dr}^{\prime} }{d\tau }=$ const., and perform integration by parts:

Equation (18)

The function $r^{\prime} (\tau )$ differs depending on whether we are looking at τmin or τmax and whether shell i is inside or outside of shell j:

Equation (19)

Here ± means + in the case of ri < r' and – in the case of ri > r'. In every case, $\tfrac{{dr}^{\prime} }{d\tau }$ is either ${\overline{\chi }}_{{ij}}^{-1}$ or $-{\overline{\chi }}_{{ij}}^{-1}$, validating the above assumption $\tfrac{{dr}^{\prime} }{d\tau }\,=$ const.

To summarize, we have three different relations between r' and τ: ${r}_{-}^{{\prime} }({\tau }_{\min })$, ${r}_{+}^{{\prime} }({\tau }_{\min })$, and $r^{\prime} ({\tau }_{\max })$.

This situation arises because the minimum optical depth (case θ' = 0) either increases or decreases with r' depending on whether r' > ri or r' < ri, but the maximum optical depth (case θ' = π) always increases with r'.

2.3.3. Numerical Angle Integration

We now abandon the assumption of a constant ${\overline{\chi }}_{{ij}}$, which makes it impossible to solve the angle integral analytically. For numerical integration, one may use either variant (7) or (8) of the basic equation. We choose the latter for consistency with the previous section, but the method discussed here is essentially independent of the formulation used.

Recall that our definition of ${A}_{i\leftarrow j}$ is

Equation (20)

We consider rays emitted from point ${\boldsymbol{r}}$ in directions between $\tilde{\theta }=0$ and π (see again Figure 1 for a visualization of the situation). It is important to note that, unless r = 0, the direction angle $\tilde{\theta }$ is different from the polar angle θ'. Here τ depends on D and $\tilde{\theta }$, so if we have a total of n shells and the number of direction angles considered is a, for each individual frequency, we create 2D arrays of size n ∗ a in which to store the values of τ, D, and θ' for each combination of j and $\tilde{\theta }$. Once that is done, the integral can be calculated numerically. In addition, implementing the numerical integration over the radius of shell j is straightforward: instead of stopping only at each shell center and writing τ, D, and θ' there, we do so multiple times within each shell.

The rest of this section describes how to obtain these arrays. For each direction angle $\tilde{\theta }$, we start from position ${\boldsymbol{r}}$ and then move along the ray from shell to shell until we reach the outer boundary. We will now summarize the algorithm for an individual direction.

First, we define variables representing the current position (initially ${\boldsymbol{r}}$), distance, and optical depth (both initially zero). Then, we move along the ray from one shell to the next, all the while updating distance and optical depth and writing the results in our arrays. We can easily calculate θ' from the position. This continues until reaching the outer boundary. This scheme is similar to the "impact parameter" method introduced by Hummer & Rybicki (1971), in the sense that we move from shell to shell along a ray. In that method, parallel rays at different distances (impact parameters) from the center are considered. The calculation then jumps from one intersection of such a ray with a discrete spherical shell to the next in order to track the changing intensity. This can then be used to calculate the moments of radiation and the Eddington factor. The main difference in our method is the fact that we do not follow the intensity but instead calculate the distance and optical depth between any two shells in a certain direction, in order to obtain our coefficients for the radiative exchange between those two.

To move along the ray, at every step we must define a "target radius" to reach with the next step. For outward-moving rays ($\tilde{\theta }\lt \tfrac{\pi }{2}$), the radial coordinate is always increasing, so the target radius is always larger than the current radius. For inward-moving rays, such as the one depicted in Figure 2, the situation is more complicated, since the radius decreases down to a minimum before increasing again. In addition, the ray crosses smaller shells not once, but either twice or never (the blue and magenta shells in Figure 2).

Figure 2.

Figure 2. We see here a ray moving inward from position ${\boldsymbol{r}}$. The four different cases in Section 2.3.3 are illustrated, with the colored shells representing different target radii. Case 1 (red): two solutions. The ray crosses the shell once in the positive x direction and once more in the negative direction, which we ignore. Case 2 (blue): two positive solutions. The ray crosses the shell once moving inward and once again coming out, both in the positive x direction. Case 3 (magenta): no solution. The shell is too small for this ray to hit it at all. Case 4 (black): current and target radius are equal, so we have a trivial solution (dx = 0) and a second solution by moving through the inner region.

Standard image High-resolution image

If our current position is $({x}_{c},{y}_{c})$ at radius rc, we wish to move along the direction of the ray by a distance ΔD until we reach the target radius rt:

Equation (21)

Defining $g=1/\tan (\tilde{\theta })$, after some manipulation, we obtain the following quadratic equation for Δx:

Equation (22)

Equation (23)

This equation tells us how far in the x direction we need to move along the ray to reach the target radius. There are four possible cases, whose geometric meaning is depicted in Figure 2.

  • 1.  
    rt > rc: There are two solutions, one positive and one negative. Since $0\leqslant \tilde{\theta }\leqslant \pi $, all the rays we consider move in the positive x direction, so we choose the positive solution.
  • 2.  
    rt < rc, and the value under the root is positive: There are two positive solutions. We choose the smaller of the two, since otherwise we would go through the whole inner region in a single step.
  • 3.  
    rt < rc, and the value under the root is negative: There is no real solution. This means that the target radius is not reached by this ray. We set rt = rc and recalculate.
  • 4.  
    rt = rc: One solution is zero, and the other one is $-(2{x}_{c}+2{y}_{c}g)/(1+{g}^{2})$. We choose the latter.

Note that for outward-moving rays ($\tilde{\theta }\lt \pi /2$), only case 1 occurs, since the radius is always increasing.

2.3.4. The Boundary Term

We have not yet considered the second term in the basic Equation (8). This "boundary term" is given by

Equation (24)

The index O here means the value at the outer boundary, while the index B means "from radius r to the outer boundary." We shall not consider the possibility of a ϕ-dependent SO here, so that we can eliminate the azimuthal angle and treat the system as 2D. Including the boundary term in the numerical angle integration (Section 2.3.3) is straightforward: we simply add an additional element to our array for τ at the radius of the outer boundary and integrate numerically.

For the constant-χ method, we must numerically integrate as well, since, even if SO is isotropic, there is no analytic solution. Here τB can be expressed as ${\overline{\chi }}_{{\rm{B}}}{D}_{{\rm{B}}}$, and

Equation (25)

Here the polar angle θ' appears again, so we require a relation between θ' and $\tilde{\theta }$.

Here $\tilde{\theta }$ is simply the polar angle of a coordinate system centered at ${\boldsymbol{r}}$, and D is equivalent to the radial coordinate in that system. Since ${\boldsymbol{r}}$ lies on the y axis, for any point (x', y'),

Equation (26)

Equation (27)

Equation (28)

Numerical integration is performed over θ'. For each θ', calculate DB, x', and y', which leads to $\tilde{\theta }$ and, ultimately, ${\rm{\Delta }}\tilde{\theta }(\theta ^{\prime} )$, allowing numerical integration.

While the lack of an analytic solution makes this comparatively slow, it hardly affects the total calculation time because the boundary term only needs to be calculated once per shell, not n times per shell.

Nevertheless, it is possible to find an analytic solution by approximating $\tilde{\theta }=\theta ^{\prime} $. This approximation only holds if r ≪ rO, but this can be reasonable if, for instance, one is interested in the behavior of a small object inside a large, optically thin envelope.

If SO does not depend on $\tilde{\theta }$, we can use Equation (14) and $\tau ={\overline{\chi }}_{{\rm{B}}}{D}_{{\rm{B}}}$ to write

Equation (29)

2.4. Optically Thick Shells

So far, we have implicitly assumed that the individual shells in our system are sufficiently optically thin that the radiative exchange between different points of the same shell is negligible. The method outlined in the previous sections no longer works if that assumption does not hold. Most of the radiative exchange then should happen within a shell, but in our method, the temperature within each shell is constant, so this internal exchange is by definition zero. This section explains how to expand the method to overcome this problem.

We make use of the constant-χ approximation and use the expression from Equation (17) for ${A}_{i\leftarrow j}$. We modify the definition to include $(S^{\prime} \,\mbox{--}\,S)$, which is no longer zero throughout the shell:

Equation (30)

Concerning the applicability of the constant-χ approximation, if a single shell is optically intermediate or thick already, then the effect of rays that have to move through the interior region will generally be negligible. Because of this, assuming that the direction-independent ${\overline{\chi }}_{{ii}}$ is equal to χi is generally a good approximation. However, we recognize that this can introduce some inaccuracy in certain atypical scenarios, such as an optically intermediate shell surrounding an optically thin interior region.

We abbreviate $(S^{\prime} \,\mbox{--}\,S)$ as a function $f(r^{\prime} )$ and interpolate it within shell i. We consider here a second-order polynomial of the form

Equation (31)

Since $f({r}_{i})=0$, it follows that c = 0, and the other two coefficients can be calculated from the known values $f({r}_{i+1})$ and $f({r}_{i-1})$.

To integrate, r' and f must be expressed as functions of τmin/τmax. We have already done this for r' in Equation (19). Similarly, for f, we obtain

Equation (32)

Equation (33)

Again, ± means + for r' > ri and – for r' < ri, and τC = χi ri is the optical depth from the center of shell i to the center of the system if χ were constant.

We split the integral into parts:

Equation (34)

The leading factors are χi−1 or $-{\chi }_{i}^{-1}$. Since the shell-internal exchange only matters for optically thick systems, the third term is usually negligible unless the shell is optically intermediate, and we are so close to the center that ${E}_{1}({\tau }_{\max })$ is comparable to ${E}_{1}({\tau }_{\min })$.

After inserting the expressions for the various functions r' and f', we see that these integrals all have the following form:

Equation (35)

The coefficients $\overline{a}$ through $\overline{e}$ depend on the integral in question and

Equation (36)

This allows us to solve all of these integrals recursively, with $\int {I}_{0,{\rm{m}}}(\tau )=-{E}_{m+1}(\tau )+C$.

2.5. Method Summary

In our method, there are three terms contributing to the total radiation term:

  • 1.  
    the radiative exchange between different shells ("external term"),
  • 2.  
    the radiative exchange within the same shell ("internal term"), and
  • 3.  
    the radiative exchange with the background radiation field ("boundary term").

The optical depth structure and the resolution determine which of these terms dominate and which are negligible. In a completely optically thin system, the boundary term dominates everywhere. When the system becomes optically thick but individual shells are still optically thin, the external term dominates the optically thick region, while the boundary term is still important in the outer regions. Finally, if the optical depth becomes so large that individual shells become optically thick, the internal term dominates in that region.

In terms of computational effort, the external term is by far the slowest, since even with the fast method (constant-χ approximation; Section 2.3.2), it is $O({n}^{2})$ for each frequency, while the other two are $O(n)$. With numerical integration over a angles as in Section 2.3.3, it becomes $O({{an}}^{2})$, and if splitting shell j into x subshells for numerical integration, it increases to $O({{axn}}^{2})$.

The internal term could, in theory, be made obsolete by choosing a sufficiently high resolution that all shells remain optically thin. But in realistic simulations of astrophysical objects such as stars, the opacity and density in the inner region are so high that this is impossible in practice. In addition, it is not desirable, since the internal term is much faster than the external term.

We summarize the main advantages of our method as follows.

  • 1.  
    It is accurate for both optically thin and thick systems and smoothly transitions between the two.
  • 2.  
    It is fast, especially when using the constant-χ approximation. Significant increases in speed can be achieved by neglecting terms (especially the external term) in regions where they are not relevant.
  • 3.  
    The constant-χ method can be combined with numerical angle integration to achieve the best compromise between speed and accuracy (see Section 3.2.4 for details on this).
  • 4.  
    If we ignore the weak temperature dependency of κν, then the ${A}_{i\leftarrow j}$ for the external and boundary term depend only on the density profile but not on the temperature. In systems where $\rho (r)$ changes much more slowly than $T(r)$, these ${A}_{i\leftarrow j}$ only need to be recalculated very rarely, making the method extremely fast.

3. Test Calculations

3.1. Homogeneous Extinction Coefficient

3.1.1. Constant Temperature

We begin with the simplest possible case: a static, fully homogeneous medium with constant temperature. Of course, the radiation term is zero everywhere in this case, but nevertheless, we can assess the accuracy of our method by looking at the radiative cooling only. Even in more complicated cases, the radiative cooling is known to be 4πκ S, giving us an analytic result to compare our method to. Unfortunately, an analytic solution for the heating and therefore the total radiation term is generally not available, except in this trivial case and the thermal relaxation test (Section 3.1.2).

The accuracy of our method depends on the optical depth structure of the system. In practice, this is different for every frequency, but for our test calculations, it is sufficient to look at a single optical depth array. We therefore employ the gray approximation, using the Planck opacity and expressing S as σ T4/π.

Instead of the radiation term, we calculate the total radiative cooling by simply setting S' and SO to zero in all the equations. The optical depth per shell and the number of shells determine which of the three terms in our method dominate. We consider optically thick systems with three different values of τS (the optical depth per shell in the radial direction).

  • 1.  
    τS = 0.1. The external term dominates most of the system, but the boundary term is important in the outer region.
  • 2.  
    τS = 1. The internal and external terms are comparable. The boundary term is negligible except in the outermost shell.
  • 3.  
    τS = 10. The internal term dominates everywhere.

We discuss the relative error in the cooling rates (Figure 3). As expected, the constant-χ method is nearly exact in this case, since the system's density and opacity are homogeneous. The only inaccuracy comes from the limited angular resolution of the boundary term (recall from Section 2.3.4 that the boundary term is integrated numerically over all angles θ', even for the fast method). This resolution should be chosen for each shell individually, since for shells very close to the outer boundary, the dependency of distance and optical depth on θ' is much stronger than for shells further inside. We do not investigate the effect of this resolution in detail, since its impact on the overall calculation time is very small.

Figure 3.

Figure 3. Homogeneous system: relative error in the cooling rate for different optical depths per shell and various angular and subshell resolutions. The black line shows the result for the fast (constant-χ) method. For the numerical integration cases, a is the number of angles, and x is the number of points per shell.

Standard image High-resolution image

Let us now turn to the numerical integration. We investigate the dependency of the error on two resolutions, namely, the angular resolution (number of angles: a) and the radial resolution in shell j (number of points considered in shell j: x).

Consider first the upper two plots. Both have a total optical depth of 20 and a radial size of 1 per shell, but the optical depth per shell and the number of shells differ.

For τS = 1, in the lowest-resolution case (a = 20, x = 2), the numerical integration overestimates the result by about 6%. Increasing both a and x helps to reduce this error. In contrast, for τS = 0.1, the angular resolution alone determines the accuracy. This is expected, since for optically thin shells, the exponential term eτ hardly changes between the inner and outer boundary of the shell, so once individual (sub)shells are optically thin, a further increase of x has no effect.

We further notice that in the case of optically thin shells, the error is not constant but increases toward the system center up to a maximum and then decreases again. In addition, higher angular resolution is required to achieve a similar accuracy as the τS = 1 case. To understand this behavior, refer to case 3 in Figure 2. When calculating the exchange between shell i and a smaller shell j, only a subset of all direction angles $\tilde{\theta }$ actually interacts with shell j. This subset becomes smaller as the ratio of rj to ri becomes smaller, effectively decreasing the angular resolution, until it eventually becomes zero. In other words, the exchange with shells smaller than i becomes first inaccurate and then neglected, causing an underestimation of ${A}_{i\leftarrow j}$. This also explains why the error decreases again near the center, since shells there mainly interact with shells larger than themselves. In the case of τS = 1, this error does not appear, since only the first few neighboring shells contribute, and their radius is very similar to ri.

The magnitude of this error is limited by the fact that smaller shells also have a smaller surface area, decreasing their overall contribution, but care must be taken: just because some shell j is negligible for the cooling (i.e., it only absorbs a very small amount of the radiation emitted by shell i) does not necessarily mean that it is negligible for the heating as well, since the shell may be very hot. In such a case, it must be ensured that the angular resolution is high enough to capture all shells that are relevant for the heating.

Finally, the case of τS = 10 shows only a tiny error, even with very low angular and radial resolution. This is understandable, since the internal term, which is the only term that matters in this case, depends on neither of these. It does not matter how accurately the external and boundary terms are calculated because they are negligible anyway.

3.1.2. Thermal Relaxation Test

A small temperature perturbation in an otherwise homogeneous system will be smoothed out over time by radiation ("thermal relaxation"), and in this special case, an analytic solution can be found. This was first done by Spiegel (1957) for a plane wave, and Masunaga et al. (1998) showed that the thermal relaxation rate for a spherical wave is exactly the same, provided that the initial perturbation has the form of the zeroth-order spherical Bessel function ${j}_{0}(r)=\sin ({kr})/({kr})$ (see Figure 4 for the concept). This was also confirmed by Stamatellos et al. (2007), in which they applied their radiative transfer scheme for SPH simulations to a spherical thermal relaxation test.

Figure 4.

Figure 4. Concept of the thermal relaxation mode in spherical symmetry. An initial temperature perturbation with the shape of the zeroth-order spherical Bessel function decays over time (various timesteps shown in different colors). The decay rate n(k) can be calculated analytically. For a detailed derivation, see Masunaga et al. (1998).

Standard image High-resolution image

Similarly, we test our method by superimposing small perturbations on a base temperature of 10 K. We then measure the decay rate for various values of k/χ. Figure 5 shows very good agreement with the analytic result, confirming that our method works in the case of a homogeneous system.

Figure 5.

Figure 5. Result of the thermal relaxation test. This plot was obtained with the constant-χ method, but results for the numerical angle integration are indistinguishable even at low resolutions. These results include both calculations with optically thin and optically thick shells. For very large values of k/χ, the result converges toward simple optically thin cooling.

Standard image High-resolution image

3.2. Variable Extinction Coefficient: Protostellar Collapse Calculations

As an example for a system where χ is not constant, we consider the gravitational collapse of a molecular cloud core. This is the mechanism by which high-density cores within molecular clouds form into stars. In a future paper, we will apply our method to detailed simulations of this process, but for now, we simply use it as a test for the method. The system transitions from an initially optically thin, constant-temperature, constant-χ state into a system with a small, hot, optically thick core surrounded by a cold and thin envelope. Therefore, at different stages and different radii over the course of the collapse, all three of the terms in our method become important. For the hydrodynamics part of the simulation, we use an ideal gas equation of state with γ = 5/3 and a second-order Godunov scheme based on Colella & Woodward (1984). We start from the following initial conditions:

  • 1.  
    core mass 1 M*,
  • 2.  
    initial radius 104 au,
  • 3.  
    initial and background temperature 10 K, and
  • 4.  
    initial (constant) number density 104 cm−3.

Figure 6 shows the profiles of density and temperature in the late stage of the collapse when the total (Planck) optical depth τ from the core to the outside has reached 2500.

Figure 6.

Figure 6. Density and temperature plotted against Planck optical depth in the late stage of a simplified protostellar collapse simulation. A hot and dense interior region (the first hydrostatic core or Larson core) has formed, surrounded by a cold and thin envelope.

Standard image High-resolution image

At this point, we are not looking to provide a realistic simulation of protostellar collapse. We use optically thin cooling until the total optical depth reaches 0.1 and the constant-χ method with the gray approximation after that. Whenever the system's total (Planck) optical depth crosses certain thresholds (τ = 1, 5, 1000, and 2500), we perform multiple calculations in a single timestep (constant-χ method, as well as numerical angle integration with various resolutions). This provides snapshots of the difference in the results at these timesteps.

Since no analytic solution for the heating is available, we have to evaluate the accuracy by considering the total radiative cooling (same as in Section 3.1.1). It must be mentioned that this is not unproblematic, because the error in the total cooling is not necessarily representative of the error in the heating and, therefore, in the total radiation term. This is because the radiative exchange between shells i and j is proportional to ${A}_{i\leftarrow j}({S}_{j}-{S}_{i})$, so the total cooling is proportional to ${S}_{i}{\sum }_{j}{A}_{i\leftarrow j}$, but the total heating is proportional to ${\sum }_{j}{A}_{i\leftarrow j}{S}_{j}$. This means that, depending on the temperature of shell j, a given error in the calculation of ${A}_{i\leftarrow j}$ may have a much larger or much smaller effect on the heating than on the cooling. In consequence, the error in the total radiation term may be quite different from the error in the cooling alone. We will consider the total radiation term in Section 3.2.3, but in this section, we will only evaluate the relative error in the cooling.

3.2.1. Constant-χ Method

Consider first the results for the constant-χ method (Figure 7). Recall that for this method, we took the average value of χ between i and j in the radial direction and assumed that this same value could be used for every direction. Since in reality, χ near the center is now much larger than that further outside, we expect this method to significantly overestimate the radiative exchange in the region where the external exchange is important. The plot confirms this; while the result is nearly exact close to the outer boundary, the overestimation increases toward the inside and reaches a maximum near the photosphere. After that, the error decreases again for several reasons. In the optically thick region, directions that are much different from the radial direction play a small role; near the center, χ does actually approach direction independency due to symmetry; and, for the very optically thick cases, the external term becomes negligible compared to the internal term.

Figure 7.

Figure 7. Relative error in the cooling rate for the constant-χ method at different stages in the collapse.

Standard image High-resolution image

The maximum error is about 20% in the optically intermediate (τ = 1) case but increases to 35% when the core is fully optically thick. At this point, the core's optical thickness is essentially infinite, so further increases have no more effect.

3.2.2. Numerical Angle Integration

The error in the cooling rate at the same timesteps as in Section 3.2.1 is shown in Figure 8.

Figure 8.

Figure 8. Relative error in the cooling rate for numerical angle integration at different stages in the collapse. Subshell resolutions x = 4 and 10 and angular resolutions a = 100 and 500 are shown.

Standard image High-resolution image

As expected, there is no error in the far outer and deep inner regions. Near the photosphere, we see two different kinds of erroneous behavior. For all optical depths, there is an underestimation of the result reminiscent of Figure 3's τS = 0.1 case. The magnitude of this error depends on the angular resolution. In addition, for the very optically thick cases, there is also an overestimation behind the photosphere. The magnitude of this error depends on the subshell resolution.

The latter error naturally increases with the optical depth per shell but reaches a maximum at τS ≈ 3. At even larger values, the internal term starts to dominate the external term, so the error in the latter becomes irrelevant. The internal term does not suffer from this error, since it integrates over the radius analytically.

3.2.3. Total Radiation Term

Except for the thermal relaxation test (Section 3.1.2), up to this point, we have tried to evaluate our method by comparing the total radiative cooling to the analytic value. As was mentioned in Section 3.2, unlike the radiative cooling, the error in the heating depends not only on the optical depth but also on the temperature profile. This makes it difficult to predict how a given error in the cooling will translate to an error in the total.

Figure 9 compares the total radiation terms for different resolutions and the constant-χ method at various stages in the collapse. We also include a high-resolution calculation for the symmetric version of the method discussed in Section 2.3.

Figure 9.

Figure 9. Total radiation terms for different resolutions at various stages during the collapse. Note that in the upper panel only, the x axis is linear instead of logarithmic. The resolution for the symmetric version is a = 500, x = 10. The results for a flux-limited diffusion (FLD) calculation are also included for comparison.

Standard image High-resolution image

We concentrate on the photospheric region, since the differences are due to the external term, which is negligible in the deep interior and far outside. We notice several tendencies.

  • 1.  
    The net effect of radiation is a radially outward transfer of energy, as would be expected (net cooling inside, net heating outside).
  • 2.  
    The constant-χ method consistently shows a smaller value than the numerical integration. This is understandable, since, as was mentioned briefly in Section 2.3.2, the overestimation of ${A}_{i\leftarrow j}$ is smaller for i > j than for i < j. This leads to the relative overestimation in the heating being smaller than in the cooling, since the former comes mostly from the inside.
  • 3.  
    As the total optical depth increases, so does the jump in χ at the boundary of the first core, which becomes more and more sharply defined. Because of this, the number of shells where the external term is relevant continues to decrease. This is advantageous for the computational speed; however, if a higher resolution of the (post-)photospheric region is desired, some kind of mesh refinement method is needed.
  • 4.  
    The differences are most noticeable in the τ ≈ 100 case, when there is an optically thick region where individual shells are still optically thin. The error in the fast method is more significant here. Because of this, the pure constant-χ method may not be a good choice for a realistic calculation.
  • 5.  
    Concerning the resolution of the numerical integration: Similar to the results in Figure 8, we see that low angular resolution leads to an overall underestimation, while low subshell resolution leads to an overestimation in the optically thick region but has almost no effect further outside. The behavior of the fast method essentially corresponds to a calculation with minimal angular and infinite subshell resolution. The differences between a = 100, x = 4 and a = 500, x = 10 are small, showing that the method has converged.
  • 6.  
    The use of the symmetric definition of Aij has only a small effect for optically thin shells, since there is little difference then between fixing the position in shell i and integrating over shell j or doing it the other way around. It also does not matter for very optically thick shells, where the internal term dominates. However, for the intermediate case (interior region of the middle panel in Figure 9), the result is significantly different from the nonsymmetric case, despite using the same angular and subshell resolutions. Note that the differences here do not necessarily mean that the symmetric version is less accurate; it is rather that the two versions attempt to do different things. The nonsymmetric version is designed to calculate the radiation term at the shell center as accurately as possible, while the symmetric version is intended to calculate a shell average that guarantees energy conservation.
  • 7.  
    As would be expected, the flux-limited diffusion approximation causes significant errors in the photospheric region where individual shells are not yet optically thick.

These results are specific for this particular optical depth and temperature profile, so when applying the method to a different system, the results may differ as well. However, the general situation of a hot, optically thick interior surrounded by a cold, thin envelope is a rather common state in astrophysics.

The differences between the symmetric and nonsymmetric versions of the method are expected to disappear in the limit of optically thin shells, since in that case, the variation of the radiation term within a shell should vanish. In principle, we could confirm this by performing a protostellar collapse calculation with sufficiently high resolution to keep all shells optically thin throughout the simulation. In practice, the computational cost makes this impossible: the system optical depth after first core formation is already larger than 103, so the required number of shells would be 104 at the very least and 105 for truly optically thin shells. The presence of optically thick shells is not an issue, since they are dominated by the internal term, which is the same for both variants of the methods. However, there will always be a region in which shells are neither fully thin nor fully thick. This is the problematic region in which the external term is important. Increasing the resolution will not make this region disappear but only move it closer to the system center.

Therefore, we test the convergence of the two variants by using a simplified system in which the density is constant, the velocity is zero, and all hydrodynamic calculations are switched off. We introduce a temperature gradient (temperature decreasing outward from the center) to create a situation similar to the realistic simulation, and the (gray) opacity increases quadratically with temperature. The latter is important to introduce some asymmetry between the different shells. If the density, opacity, and radial size of all shells are the same, then the asymmetry that causes the differences between the two variants of the method (Section 2.3.1) disappears, and both variants give identical results irrespective of the temperature profile.

Figure 10 clearly shows that the two variants, whose results differ substantially in the low-resolution case (optically intermediate shells), are converged for sufficiently high resolution (optically thin shells). Interestingly, the high-resolution results are closer to the low-resolution results of the symmetric than the nonsymmetric method, which indicates that, at least for this setup, the former may be preferable. The flux-limited diffusion results are also included, but as would be expected in this region of optically thin/intermediate shells, they are quite different from the results of our method.

Figure 10.

Figure 10. Convergence test for the symmetric and nonsymmetric versions of the method. The upper panel shows the temperature profile used for this test. The number of shells in the middle panel is 250, and the optical depth per shell is close to 1 near τ = 101 and decreases further outward. In the lower panel, the number of shells is 1000, and the optical depth per shell at 101 is around 0.2; i.e., the shells are optically thin throughout the relevant region.

Standard image High-resolution image

3.2.4. Combined Method

In Section 3.2.3, we found that the constant-χ method is too inaccurate to be used for the whole calculation, at least during the time when there is an optically thick region with optically thin shells. The numerical angle integration is much more accurate but also much slower. In this section, we will attempt to combine the two in order to arrive at a compromise between speed and accuracy.

This can be done in the following way. At timestep t, both the slow and fast methods are used to calculate the ${A}_{i\leftarrow j}$. Then, the ratio of the two is written into an array of correction factors ${C}_{i\leftarrow j}={A}_{i\leftarrow j}(\mathrm{fast})/{A}_{i\leftarrow j}(\mathrm{slow})$. For the following timesteps, only the fast method is used, and the resulting ${A}_{i\leftarrow j}$ are divided by ${C}_{i\leftarrow j}$. After n timesteps, both methods are used and the correction factors recalibrated. From Figure 11, we can see that after five steps, the results have already become quite inaccurate, so this combined method could only reduce the computational cost by a factor of a few at most. However, this is not true over the whole calculation. Figure 11 represents the worst case, as it is during the transition phase when the optical depth structure is changing quickly. In earlier and later stages, acceptable values of n can be much larger. Therefore, instead of being constant, n should be changed dynamically during runtime. We suggest the following method.

Figure 11.

Figure 11. Combined method: Snapshots of the photospheric region at a timestep when τP ≈ 100, equivalent to the middle panel of Figure 9. Here n indicates the number of timesteps since the correction factors ${C}_{i\leftarrow j}$ were last calibrated.

Standard image High-resolution image

First, we choose a number m (for example, m = 0 initially) and set n = 2m. Every n timestep, we perform both slow and fast calculations as described above to obtain the radiation terms dU/dtfast and dU/dtslow. We then calculate the relative error in the internal energy that would result after n timesteps:

Equation (37)

We evaluate this for every shell, and if it is larger than some critical value in any shell, we reduce m by 1. If it is smaller than some other critical value in every shell, we increase m by 1. In this way, the frequency of slow and accurate radiative calculations changes dynamically during the calculation. This method still risks having large errors in some timesteps when m is too large before it can adapt. We can avoid this by including a rollback function as a safety. Every time we perform a slow calculation, we also store all the basic variable arrays, such as density, temperature, etc. If the error in the next slow timestep (n timesteps later) is too large, in addition to reducing m, we also jump back to the stored values. This guarantees that the maximum error is always smaller than some critical value defined by the user. In practice, this method succeeds in significantly increasing the computational speed compared to the pure slow method, since numerical calculations are only very rarely needed after the first core has established itself and the optical depth structure no longer changes quickly.

3.2.5. Computational Speed and Optimization

Table 1 shows the wall-clock time for calculations using the pure fast or pure slow methods. In our calculation, there are three different constraints on the timestep.

  • 1.  
    The basic hydrodynamical timestep, determined by the condition that neighboring shells must not overtake each other, i.e., Δt = xΔr/(Δv+cs), where Δr and Δv are the differences in radius and velocity of two neighboring shells, and x is a number between 0 and 1. Here we choose x = 0.1.
  • 2.  
    The radiation timestep. Since the radiation term is very sensitive to temperature, it must be recalculated after the temperature in any shell has changed by more than a certain percentage. Here we choose 1%. Note that the exchange coefficients Aij are not updated at this point.
  • 3.  
    The opacity timestep. The Aij depend on the optical depth structure of the system, which in turn is determined mostly by the density structure. We update these coefficients whenever the density in any shell has changed by more than 1% since the last update. Whenever this is done, the radiation term is also recalculated.

Table 1.  Simplified Gray Collapse Calculations for Various Shell, Angle, and Subshell Resolutions

Method Type Shells Angles Subshells Wall-clock time (minutes)
No rad. transfer 200 <0.5
Fast 200 6
Fast 400 21
Slow 200 20 2 17
Slow 200 100 2 61
Slow 200 20 4 27
Slow 400 20 2 71
FLD 200 9
FLD 400 17

Note. The tests were run on a single 3.4 GHz processor and stopped once the total optical depth reached 1500.

Download table as:  ASCIITypeset image

The purely hydrodynamical timestep requires much less computational effort than the ones related to the radiative transfer, as evidenced by the fact that the calculation without radiative transfer (RT) takes less than a minute. The radiation timestep and especially the opacity timestep are far more time-consuming, the latter even more so if numerical angle integration is used. The calculations shown in Table 1 required roughly 7500–10,000 hydrodynamical timesteps (depending on the number of shells), 3000 radiation timesteps without Aij updates, and 1500–2000 opacity timesteps. Note that the ratios of these numbers may be vastly different in other systems, depending on the timescales at play. The flux-limited diffusion method is comparable in speed to the fast method at 200 shells but scales better with higher resolutions, since it is $O({fn})$. Its speed depends on how many steps are allowed for the radiation field to converge, however.

As mentioned before, the external term is by far the slowest of the three terms in the radiative calculation. If the number of shells is n and the number of frequencies considered is f, the fast method's external term scales as $O({{fn}}^{2})$, while the numerical integration over a angles and with x subshells scales as $O({{axfn}}^{2})$, which for reasonable resolutions is two to three orders of magnitude slower. This is why optimization requires minimizing the number of numerical integrations, as we did in the previous section.

The separation of the computationally expensive external term from the other two, and the fact that it can be ignored in many regions, is of primary importance. In order to optimize speed, it is imperative to neglect the external term wherever possible, especially in the slow method. In our collapse simulations, we may ignore the external term in the far outer regions and, after first core formation, also in the interior, because individual shells there are optically thick. In addition, there may be regions where the external term is not negligible but high accuracy is not required. In this case, instead of completely neglecting it, one may calculate it using only the fast method. These optimizations can reduce the actual time required by an order of magnitude or more compared to the values seen in Table 1. In any case, the optimization strategy must be adapted according to the problem.

4. Conclusion and Future Development

In this paper, we have developed a new method of treating the radiative transfer in a spherically symmetric fluid system. Based on the transfer equation, we derived a scheme that is reduced to the calculation of exchange coefficients ${A}_{i\leftarrow j}$ between pairs of shells ("external term"), between a shell and the radiation coming from outside the computational domain ("boundary term"), and between the shell center and other points within the same shell ("internal term"). The external term is by far the most problematic of these, since the calculations of the other two are both much faster and produce (nearly) exact results.

Numerical integration over all angles can solve the external term to a high degree of accuracy if a sufficiently large number of angles is used; however, it is quite slow. By assuming a direction-independent absorption coefficient, the speed can be increased by two to three orders of magnitude, but at the cost of reduced accuracy. The resulting error is most evident in regions that are optically thick while individual shells are still optically thin. A combined method of numerical angle integration and constant-χ approximation can be used as a compromise between speed and accuracy.

Future improvements of the method will likely focus on speed optimization, either directly by increasing the speed of the numerical angle integration or indirectly by increasing the accuracy of the fast method to make it more usable. Several approaches are possible.

  • 1.  
    In this paper, we have taken the angular and subshell resolutions to be constant throughout a given test run. It may be far more effective to change them during runtime. For example, x only needs to be larger than 1 for shells in a certain optical depth range between about 0.1 and a few, and a can be smaller near the center, where there is little exchange with shells smaller than i.
  • 2.  
    For the constant-χ method, we use the average χ between shells i and j in the direction $\tilde{\theta }=0$. There may be better options, such as a weighted average between the $\tilde{\theta }=0$ and $\tilde{\theta }=\pi $ directions. In addition, the effect of the optically thick core could be approximated by defining a "shadow region" in the interior and reducing ${A}_{i\leftarrow j}$ accordingly.
  • 3.  
    The main reason that the numerical integration is so slow is because of the high angular resolution required, which is a consequence of the fact that many rays emanating from a given shell i fail to interact with shell j if the latter is much smaller than i (case 3 in Figure 2). However, instead of calculating ${A}_{i\leftarrow j}$ and ${A}_{j\leftarrow i}$ separately, one may calculate ${A}_{i\leftarrow j}$ only for the case of i < j and reuse this value when updating shell j. Aside from the obvious decrease by a factor of 2 in the computation time, this also reduces the angular resolution required and has the additional advantage of guaranteeing energy conservation. But this method is problematic: ${A}_{i\leftarrow j}$ is the exchange coefficient between ri and the whole of shell j. As we discussed in Section 2.3, this is conceptually different from ${A}_{j\leftarrow i}$, the exchange coefficient between rj and the whole of shell i. If one is willing to accept this inconsistency, a significant performance increase may be possible.

In conclusion, the performance of the method will depend strongly on steps taken for optimization, and which methods of optimization are effective will depend on the optical depth and temperature structure of the system in question.

Please wait… references are loading.
10.3847/1538-3881/aac023