4. The Monte Carlo code
4.2. Numerical technique
4.2.4. Radiative transfer
After all the input data are gathered, the appropriate line list has been built, and the temperature structure has been determined, the real MC calculation can begin. The event histories of a number of energy packets are followed adopting
the Sobolev approximation. The photospheric luminosityLphis divided evenly
amongNpackets, so that each packet has the same initial energy0 =Lph/Nin
the rest frame of the WD. Each packet contains a number of photonsnν, where
nνhν=. Using energy packets rather than photons leads to a more accurate
sampling of the radiation field at the wavelengths where the bulk of the energy emerges and avoids following an unnecessarily large number of IR photons. All
4.2 Numerical technique 43
Figure 4.1.: Random walk of a photon through the SN ejecta (Abbott & Lucy 1985). Filled circles indicate interactions with lines, while open circles indicate electron scattering.
processes involved in the computation preserve the energyin the co-moving
frame of the packets. Even in the case of branching after a line absorption the energy is conserved, only the number of photons in the packet changes. The distribution of the packets with frequency is determined by sampling the Planck functionBν(Teff) each bin containing an integer number of packets.
Monte Carlo experiments
A randomly chosen frequency in the specific bin and a random direction cosine are assigned to each packet. Then the event history of each packet is followed as it travels through the envelope. A schematic diagram of such a random walk is shown in Fig. 4.1. There are two possibilities for the fate of a packet. Either it is scattered back into the photosphere, or it escapes the envelope possibly after undergoing line interaction or electron scattering.
The main task of the MC calculation is to determine whether a packet encoun- ters a line or scattering event before it can cross the border to the next shell where the physical conditions change. First, a random “event” optical depth is selected
asτR = −ln (1−z), wherezis a random number 0 ≤z <1. Electron scattering
is a linear function of distance, whereas line interactions are restricted to certain points in the ejecta where the co-moving frequency is in resonance with a spec- tral line. The photon (or energy packet) encounters an electron scattering optical depthτeduring its flight and the length of the pathsehas to be calculated before
τebecomes equal toτR. Here,τR=σTne(i)se, whereσTis the Thomson electron
cross section andne(i) denotes the electron density in theith shell. If se is less
than the distance for the photon to leave the shell, the packet may suffer electron
scattering. In the next step the distance to the next line encounters`is compared
toseby simply calculating the photon’s co-moving frequencyν0 =ν[1−µ(v/c)].
Finally, bothseands` have to be compared to the distance to the edge of the
shellssh. The smallest of these three values decides what happens next to the
photon.
1. If the photon is closest to the shell’s edge, it enters the next shell with new physical conditions and a new optical depth calculation must begin. 2. If electron scattering occurs next, a new random direction is assigned to
the packet and the MC experiment starts again.
3. Finally, if the photon encounters a line event, the actual downward transi- tion has to be chosen. In this case the probability of each transition from
level u is computed through the effective downward rate Au`βu`, where
Au` is the Einstein coefficient for spontaneous emission, and
βu` = τ1 u`
(1−e−τu`) (4.18)
is the escape probability (Lucy 1999b). Finally, τu` denotes the Sobolev
optical depth:
τu` =hνu`(B`un`−Bu`nu)λu` t
4π (4.19)
The probability of spontaneous decay from leveluto level`after absorp-
tion is given by:
pu` = PAu`βu`hνu`
`Au`βu`hνu`
(4.20)
The factor hνu` has to be introduced, since we consider energy packets
4.2 Numerical technique 45
Figure 4.2.: Photon encounters line and scattering events during its flight through a model shell (Mazzali & Lucy 1993).
Figure 4.2 sketches the MC procedure showing the sum of allτias the packet
travels through a shell, encounters a sample line event, and is scattered by an electron before it escapes the shell.
If the number of packets used is sufficiently large, the distribution of the re- emitted packets in the various lines becomes rather accurate. Again, since the packet’s energy in the co-moving frame is conserved so is the total luminosity during the modelling procedure.
Following the event history of about 10,000 packets is usually sufficient to
avoid random noise and to converge the radiation field iteration.
Line absorption rate
In order to calculate the emergent spectrum via the formal integral solution we need to know the line absorption rate from the radiation field.
After a line has absorbed an energy packet and the ion is in an excited stateu,
u → i. Then the fraction of energy emitted by levelu that escapes via thekth branch is qk = jk/ X m jm (4.21)
Since the entire energy in the co-moving frame of a packet is absorbed by
a line, we can give an estimate for the rate per unit volume at which energy is
removed from the radiation field by excitations`→u:
˙ E`u= ∆0 t 1 V X 0