## 3. Monte Carlo proceduresIn this section, the Monte Carlo methods used to obtain the temperature distribution in an extended, spherically symmetric, non-grey stellar atmosphere are described. These methods represent a continuation and extension of previous work on stellar winds (Abbott & Lucy 1985; Lucy & Abbott 1993), supernovae (Lucy 1987; Mazzali & Lucy 1993), and photoionized nebulae (Och et al. 1998). ## 3.1. Energy packets and radiative equilibriumIn Monte Carlo treatments of radiative transfer, we can take the
calculation's "quanta" to be photons, thereby simulating exactly the
physical processes occurring as matter and radiation interact.
However, we also have the freedom to take the quanta to be packets of
photons of the same frequency so that
is the energy content of a packet containing In this investigation, photons are also grouped into packets of constant energy but now with the motivation of rigorously imposing the constraint of zero flux divergence on the Monte Carlo radiation fields derived for an iterative sequence of approximate temperature distributions. Thus, when a packet of radiant energy suffers a pure absorption event, it is re-emitted with frequency in accordance with the emissivity of the medium and with energy This simple but powerful device constrains the radiation field to be divergence-free at each and every iteration, and this has the following consequence: For a not-yet-converged temperature stratification, this Monte Carlo radiation field will in general be a closer approximation to the final radiative equilibrium solution than would be that derived by actually solving the equation of radiative transfer. Accordingly, successively bringing matter into thermal equilibrium with a sequence of such divergence-free radiation fields should result in rapid convergence, with acceptable results if sampling errors are small enough. As the above remarks imply, with the adopted procedure, the derived Monte Carlo radiation fields only represent solutions of the equation of radiative transfer when the temperature distribution has converged to the radiative equilibrium solution, for only then does Eq. (1), which implies a balance between the rates of absorption and emission of energy, correspond to physical reality. Apart from sampling errors, the divergence-free radiation fields at early iterations differ from the final solution only in consequence of the temperature dependence of the absorption and scattering coefficients. Accordingly, for grey atmospheres "convergence" is immediate, since successive temperature iterates then differ only because of different sampling errors. ## 3.2. InitiationIn order to carry out the Monte Carlo calculation, the extended
atmosphere is approximated by At the lower boundary , the outwardly-directed radiation field is taken to be - i.e. isotropic in the outward hemisphere with black body intensity at unknown "boundary" temperature . Using the current estimate of , energy packets are selected according to this boundary condition as follows: (1) The mid-probability points of
with (2) An integer (3) The initial direction cosine is taken to be where here and below In practice, it is beneficial to depart from step (2) by
introducing stratified sampling for the frequency distribution of
packets emitted at the lower boundary. Thus, in fact, we constrain
Poisson noise by selecting equal numbers of packets from each of the
The frequency sampling at the lower boundary can be checked by computing the mean value of . For black body emission, this should = 3.83223. ## 3.3. TrajectoriesHaving thus launched a packet across the lower boundary, we must now compute its trajectory as it scatters off free electrons and undergoes absorptions followed by re-emissions due to bound-free and free-free processes. This trajectory ends when the packet escapes to infinity or re-enters the core by crossing the lower boundary. Notice that because of Eq. (1), packets do not disappear within the atmosphere. Nor, in this scheme, are packets spontaneously created within the atmosphere. Within each uniform shell, the random flight path of a packet between events is which corresponds to the physical displacement given by If this displacement would carry the packet out of its current shell, then the packet is moved along its linear flight path to the boundary with the next shell, at which point a new is selected and its further progress followed in the next shell. On the other hand, if this displacement leaves the packet within the current shell, then at the end-point of the displacement the packet is either scattered or undergoes absorption followed by re-emission. We take this physical event to be a scattering if and to be an absorption otherwise. Note that the selection of a new when a packet crosses a boundary does not result in bias: a photon always has = 1 as the expected path length to its next interaction no matter what distance it has already travelled. After a physical event, the packet's frequency and direction cosine must be re-assigned. If the event was a scattering, the frequency is unchanged - i.e., assumption of coherent electron scattering. If the event was an absorption, the re-emitted packet is assigned frequency given by the equation where is the emissivity. In either case, the new direction cosine is selected according to the rule corresponding to isotropic scattering or emission. As with frequency sampling at the lower boundary, the operation indicated by Eq. (8) is in practice replaced by a pre-iteration calculation of equal probability emissivity bins, and so it is the label of the bin that is randomly selected in assigning a frequency to a re-emitted packet. Note that these bins change from shell to shell and must be recomputed after each temperature-correction step. When these emissivity bins are calculated, the mean frequency of the emissivity function for each shell can also be calculated. These can then be used to check the mean frequencies of the packets re-emitted during the Monte Carlo calculation. ## 3.4. Monte Carlo estimatorsIn order to detect departures from radiative equilibrium, we must first calculate the rate at which matter absorbs energy from the radiation field, and this must be derived from the Monte Carlo model of the radiation field. Now, the exact expression for this quantity is and in radiative equilibrium this balances the rate at which matter emits energy, given by Evidently, to compute , we must first compute the mean intensity . Now, in constructing Monte Carlo estimators for moments of the radiation field, the natural starting point is the basic definition of specific intensity in terms of energy flow in a given direction across a reference surface. This is the approach adopted by Och et al. (1998), leading to an estimator for given in their Eq. (13). However, for problems without symmetries, there will in general be no unique or natural reference surfaces for the volume elements of the adopted discretization. Accordingly, with respect to and weighted integrals thereof, it is preferable to construct Monte Carlo estimators from the basic result that the energy density of the radiation field in () is . At a given instant, a packet contributes energy to the volume element containing it. Accordingly, if denotes the path length between successive events, where "events" includes crossings of boundaries between volume elements, then this segment of a packet's trajectory contributes to the time-averaged energy content of a volume element, where and is the duration of our Monte Carlo experiment. The estimator for the volume element's energy density that follows from this argument gives the following estimator for the monochromatic mean intensity where where the summation is now over all segments in If we now compare Eqs. (6) and (12), we see immediately that a Monte Carlo estimator for the absorption rate is This is the expression used below in an iterative scheme to find the radiative equilibrium () solution. It is worth noting that these estimators are such that all packets
entering the volume element A further point to emphasize is that packets contribute to our estimate of the absorption rate even if they pass through V without being absorbed. Indeed, Eq. (14) returns estimates of the absorption rates throughout a model atmosphere even when that atmosphere is so tenuous that all packets pass through without absorption. This is a point of difference with the investigation of Bjorkman & Wood (1997), where the absorption rate is computed only from the packets that are absorbed in the volume element. If the estimator is thus restricted to absorbed packets, the result is noisier, is indeterminate in the optically thin limit, and we have failed to use our knowledge of the exact formula given in Eq. (10). ## 3.5. Temperature correctionsIf Since the factor has hitherto remained free, we now fix it by setting , the desired luminosity of the model. With thus determined, Eq. (14) now gives the absorption rate throughout the atmosphere in physical units, and in general this rate will not balance the emission rate given by Eq. (11) - i.e. . To obtain a modified temperature distribution that brings the atmosphere closer to radiative equilibrium, we note that can be written as where is the Planck-mean absorption coefficient and is the integral of the Planck function. This then suggests that the temperature distribution for the next iteration should be that given by with quantities on the right-hand side evaluated from the just-completed iteration. This is the adopted temperature-correction procedure, with only the slight modification that an undercorrection factor -0.8 is commonly used. Readers familiar with temperature-correction procedures for non-grey atmospheres will recognize that Eq. (17) can be written as where is the intensity- or
absorption-mean absorption coefficient. Thus, the adopted scheme is
The boundary temperature , which determines the frequency distribution but not the luminosity of the radiation emitted at the lower boundary, must also be iteratively improved. Now, integration of Eq. (2) gives Accordingly, after completion of a Monte Carlo step, is obtained as noted earlier from Eq. (15). Eq. (20) then gives , which on substitution in Eq. (19) yields an improved value for . The implied correction is, however, applied with the same undercorrection factor used above when iteratively correcting . © European Southern Observatory (ESO) 1999 Online publication: March 10, 1999 |