In the previous chapter, the basic equations that govern the evolution of a self-gravitating gas were presented. This chapter is concerned with the additional methods that are required, in order that the Capture Theory may be modelled with as high a spatial resolution and physical accuracy as possible. The addition of radiative energy transfer, Section 3.2, is developed in order to improve physical accuracy, whilst a spatial tessellation tree, Section 3.1, is included to reduce the computational run-time.
![]() |
An alternative method to that given in the previous chapter for calculating the
gravitational force between particles, is clearly necessary in order that the
computational run-time may be reduced. This is because the long-range nature of the
gravitational force, requires that every particle in the system interacts with every
other particle. This leads to the computational run-time scaling as
, where
the
corresponds to an approximately constant computational overhead. The best any
scheme can hope for is a computational run-time that scales as
. Even if this
could be exceeded, not much would be gained, as the hydrodynamical component of
the force calculation scales as
, which reduces to
.
The choice of alternative method is restrained by certain factors. The main factor is that the benefits associated with using the SPH method should not be undermined. Specifically, the system should still be Lagrangian, and the spatial resolution not compromised. One method could be to extrapolate the mass onto a uniform grid, and solve for the potential using a Fast Fourier Transform algorithm. The computational run-time could then easily be controlled by the number of cells in the grid. Unfortunately this method as given, could severely compromise the resolution in a highly clustered simulation. A way of avoiding this could be to recognise where the resolution is compromised, and subdivide the offending cells into a similar grid structure, but on a smaller scale. One such method that uses this approach with SPH is being developed by Couchman et al. (1995) . Applying this approach to the example of Section 2.1, results in Figure 3.2.
Here the centres of both spheres have been re-sampled with a finer grid, resulting in an increased resolution in those regions. In general, the depth of subdivision and the number of regions subdivided is greater than shown here.The method of dividing space according to resolution requirements is central to most efficient gravitational potential solvers. Usually when such an approach is adopted, the computational run-time is reduced at the expense of the accuracy in the computed force. In general, particles still incur a direct summation with their closest neighbours, but particles far away are grouped together, and an averaged force applied. The motivation behind this can be understood by the following example:
Consider the forces between a distant galaxy and our own. In theory the gravitational force between every single subatomic particle in both galaxies should be computed. Obviously this is an overwhelming task in practice, and in general, when the galaxies are well separated, it is sufficient enough to calculate just the force between the centre of masses. Again, an overwhelming task is confronted when calculating the relative motion of the stars within the galaxies, even if the stars are considered to be single bodies. In this case, grouping the stars into clusters, and calculating the force between the centre of mass of those, greatly reduces the computational load. Further grouping of the stars into subclusters, and similar subcluster-subcluster force calculations within a cluster, can be performed if necessary. Finally, the force between stars in the same (sub)cluster can be calculated directly. A simplified schematic overview of this method is shown in Figure 3.3.
The diagram shows the force evaluations required to follow the motion of the two particles on the bottom left of the diagram. The double arrowed lines represent centre of mass force calculations between clusters at the same level in the tree hierarchy.The method outlined above belongs to the cluster-cluster family of tree-codes. An overview of the procedures used in most implementations of this type of tree-code is now given. It may be useful to refer to Figure 3.3.
Cluster-cluster interactions are computed prior to calculating the force on the particles. This involves interacting every cluster with every other cluster at the same level in the hierarchy, and belonging to the same region of space, i.e. clusters with the same `parent' cluster. When calculating these interactions, extra accuracy is obtained by considering higher moments of the mass distribution than just the total enclosed mass and centre of mass. This is normally necessary in a cluster-cluster tree-code, and although not necessary, it is common practice in a particle-cluster tree-code, explained later. The potential field in a cluster, calculated from all other clusters, can then be determined; the higher the moments used, the more accurate the field. Once the cluster-cluster interactions have been performed, the force on a single particle can be calculated: First a direct force calculation with all particles belonging to the same cluster is carried out. From the previous cluster-cluster interactions a potential field gradient at the position of the particle is then estimated and used to approximate the force from the remaining particles.
An alternative approach to a cluster-cluster tree-code is a particle-cluster tree-code. The difference in approach between the cluster-cluster tree-code, and the particle-cluster tree-code is demonstrated in Figure 3.4.
The diagram shows the force evaluations required to follow the motion of the same two sample particles as examined previously. The details of the actual particle-cluster tree-code used in this thesis, are presented in Section 3.1.2. An overview of the method is given now:As the name implies, particles not only interact directly with neighbouring particles in the same cluster, but also directly with other clusters of particles. The centre of mass in every cluster is computed prior to calculating the force on the particles. As before, higher multipole moments describe the mass distribution more accurately. Once the mass distribution of every cluster in the tree hierarchy has been computed, the force on a single particle can be calculated: As before, a direct force calculation with all particles belonging to the same cluster is performed. The particle then interacts with the clusters. As seen in Figure 3.4, the further away a particle is from a collection of clusters, the higher up in the cluster hierarchy the particle interacts with.
In the past, cluster-cluster type tree-codes have been claimed to scale as
.
Recently this claim has been disputed, and a more conservative
log
estimation
has been demonstrated in practice (Capuzzo-Dolcetta and Miocchi, 1998). Figure 3.3 is a
very simple example of a cluster-cluster simulation, containing just two layers of
clusters, not counting the particle layer. In general, many layers of clusters are
present, so that the computational overhead hidden in the
can be very large.
Cluster-cluster tree-codes are generally more accurate than particle-cluster codes.
Normally this is a good reason for using them, however in astrophysical simulations
using SPH, the additional accuracy is often not required, due to reasons discussed in
Section 2.11.
Particle-cluster tree-codes also scale as
log
, where the
is usually
smaller than in cluster-cluster tree-codes. Capuzzo-Dolcetta and Miocchi concluded that their
optimised implementation of the Barnes-Hut tree-code (a particle-cluster tree-code,
see Section 3.1.2.) became more efficient than direct summing, for
, and was approximately
times faster than their optimised version of the
Fast Multipole Method (a cluster-cluster tree-code) in the simulation domain
. It was not until the number of particles exceeded
, that the FMM outperformed direct summing. Both tree-codes were constrained to
produce an error of no greater than
in the force on a particle.
The method used in this thesis is a particle-cluster tree-code. This was chosen because of the reasons above, but also because this type of tree-code is simpler to understand and program. Having implemented the tree-code, it was realised that the same principles of space division and data storage, could be used for a new radiative energy transfer technique, see Section 3.2. Since other methods can be more spatially abstract in nature, it is uncertain whether it would be possible to implement the new radiation transport scheme, without explicitly introducing a Barnes-Hut type tree structure.
Figure 3.5 shows an example quad-tree after construction. Figure 3.5(b) is the tree representation of the spatial distribution, and was formed by starting at the top-left square in Figure 3.5(a), and rotating clockwise through the hierarchy. The dotted lines in Figure 3.5(b) correspond to empty squares, and are subsequently removed to reduce storage space and improve tree-traversal efficiency.
Applying this procedure to the example of Section 2.1, results in Figure 3.6.
In this implementation of the tree-code, the squares of the tree are arranged in memory in the same order in which they were created. When a square is subdivided, the created sub-squares are positioned at the end of the tree-list, one after another. The square that was subdivided contains a link forward to its first sub-square, and all sub-squares contain a link back to their `parent' square. The empty squares are removed by deleting their entry in the tree list, and shuffling every subsequent entry up a place, making sure that all links are updated.
The resultant data structure is arranged almost completely randomly in memory, due to the effectively random location of the particles in space. A more logical approach could greatly improve tree access efficiency. Salmon et al. (1994) have progressed some way to developing such a structure. In their implementation of the Barnes-Hut tree, the distribution of the tree in memory is closely related to the spatial distribution of the particles. This has advantages in parallel processor implementations, as a portion of space, along with the corresponding tree fragment, can be allocated to an individual processor. Using the data structure implemented here, the complete tree structure would have to be available to each processor. Their method has advantages in single processor machines also, as the tree data structure results in mostly linear memory access during tree traversals (the most heavily used tree function, see later.)
In the radiative transfer of energy, Section 3.2, the tree is most heavily used during the random walks of power packets (explained in that section) through the tree, resulting in the data structure of Salmon et al. being less attractive. However, that is not to say that a more logical memory arrangement is not possible. In hindsight, since the tree construction routine takes practically zero computational run-time, almost any additional routine to arrange the tree in memory more logically would be beneficial. In fact, the more logical approach of Section 3.2.6 for removing unnecessary squares, results in almost linear memory access for tree traversals.
The MAC used in this work is the original one proposed by Barnes and Hut (referred to
as the BH-MAC hereafter). It asserts that the current square can only be used, if the
ratio of the size of the square to the distance between the particle and the centre of
mass in the square, is less than a tunable parameter,
, called the opening
angle. This leads to approximately the same percentage error in the force acting on a
particle, regardless of the distance to the region it is interacting with. In the
example of Figure 3.8 this criteria corresponds to
.
![]() |
The approach of collecting the neighbours of a particle, results in an array of size
by
integers. Since
can potentially be rather large3.1, most
memory conservative codes prefer to re-find the neighbours of a particle for
subsequent use, rather than store them. This is the method used here, but in
hindsight, storage may have been possible, since an array of integers approximately
that size is used during the transfer of radiative energy, see Section
3.2.
The complete tree-code algorithm for calculating the force is now given:
A few points need to be made concerning Stage 3 and Stage
4. Whilst traversing the tree to collect the required particles, the
normal MAC is unnecessary. Instead, the current particle is enclosed in a box of sides
, and squares in the tree are only opened if this box overlaps into them. This
additional SPH-MAC is combined with the usual BH-MAC in Stage 5, where
both the gravitational force and hydrodynamical force are calculated via one tree
traversal per particle. When both MACs are used, the SPH-MAC takes precedence, i.e. a
square must be opened if the
box surrounding the particle overlaps into it.
When using a tree-code for calculating particle interactions, symmetry in the particle
quantities must be considered more carefully. In Stage 4 and Stage
5, whilst traversing the tree, quantities are calculated only at the
position of the current particle. This is unlike an
code, where quantities at
both particles are incremented via a single interaction. The consequence of this is
that ensuring symmetrisation in the density and force calculation is not so
straightforward. Essentially the problem arises from the spread nature of the
particles. In an
code, a particle interacts with another particle if
. In a tree-code, particle
may not interact with particle
, even
though
. This would happen when
is sufficiently smaller than
, and is unavoidable given the current MACs.
Symmetry is ensured by keeping track of particle interactions. Given the above
hydrodynamic case of
interacting with
, but not vice versa, symmetry is ensured
by also incrementing the quantity at
due to
, even though it is particle
that is currently under consideration. This is fairly straightforward to implement for
the hydrodynamic quantities of density, pressure force, and internal energy. The
gravitational interaction is slightly more complicated, as the point-point force that
will be calculated on
due to
, when
is under consideration, must be
counteracted whilst particle
is still under consideration.
The pseudo-code for Stage 5 is given in Appendix
A.5, where the above methods concerning symmetrisation are
presented more completely. The pseudo-code is for the general case of differing
gravitational (
) and hydrodynamical (
) smoothing lengths.
Although this classification is fairly straightforward at the end of a simulation, it is difficult in this model to classify each stage a priori to simulation. This is because different simulation parameters produce differently classed stages, i.e. by varying the initial conditions, a stage determined to be opaque and controlled by radiative processes, could subsequently be determined to be opaque, but evolving on a dynamical timescale. As a relevant example of this, consider the planetary contraction stage. In this stage, the timescale for collapse is usually governed by how effectively the planet can radiate energy, the radiative timescale. However, given conditions which produce a sufficiently cool protoplanet such that the thermal energy is much less than the gravitational potential energy, the timescale for contraction will be of the order of the free-fall time.
This lack of a priori knowledge is one reason which prevents simplified radiative schemes from being applied. One such scheme which relies on the above classification was outlined in Section 2.9. In that scheme, the knowledge of the optical depth as a function of density is required. In implementations of SPH which use schemes similar to this, the gas is assumed to reside in either completely transparent or completely opaque regimes. It is also assumed that the dynamical timescale is much shorter than the radiative timescale in the opaque regime, and that the radiative timescale is much shorter than the dynamical timescale in the transparent regime. The latter assumptions are required in order that an explicit radiative energy transfer mechanism not be necessary, i.e. in the transparent regime, a compressed gas has sufficient time to cool to the same temperature as surrounding gas, and in the opaque regime, the change in energy due to radiative processes is much less than that due to dynamical ones, and thus can be ignored. In these methods, only the consequent behaviour of the gas due to it residing in a particular regime is important, the actual transfer of energy being unimportant. As outlined in Section 2.9, this behaviour is controlled via the effective ratio of specific heats in the equation of state.
As demonstrated above, the simulation domain in this model does not afford simplifications to the radiative energy transfer problem, firstly due to a lack of a priori knowledge of the conditions present, and secondly due to no desirable coupling between optical depth and timescale regimes. Other methods that deal explicitly with radiative energy transfer exist, but these cannot be satisfactorily applied here, as they usually cover only one optical regime, and normally require boundary conditions in order that energy can be lost at surfaces.
The new radiative energy transfer method presented in this section, was developed in order that the conditions present in the Capture Theory could be modelled as accurately as possible. Since all optical depth and timescale regimes are present in almost any combination, this led to a general SPH radiative energy transfer scheme being developed. Before the scheme is presented, radiative principles are discussed, and a first attempt at a general radiative scheme, including reasons for failure and what was learned from this attempt, is examined.
Both of the methods considered in this work essentially split the radiative transfer
mechanism into two components: radiating and receiving. The simulated region is
considered in terms of sub-regions of order of size
. To simplify the calculation,
the gas is assumed to be in local thermal equilibrium (LTE). This implies that the
temperatures of the components that constitute the gas are coupled together, i.e.
hydrogen, helium, the metals, the ices, and the dust grains are all at the same local
temperature. Certainly in the simulation domain under consideration here, the dust and
gas temperatures are strongly coupled together, see Whitworth et al. (1998) for a fairly
complete analysis of this coupling for a wide range of simulation domains. Given this
assumption, it is possible to estimate the local Rosseland mean opacity,
,
from the temperature and density of the gas, as demonstrated later in Section
3.2.3. With the LTE approximation, the amount of energy emitted, and the
amount of energy received, can both be related to the optical depth in the region
under consideration:
A completely opaque region radiates energy at a rate according to a black body law:
| (3.1) |
The optical depth of a region is defined as:
The opacity of an astrophysical gas depends on the state and concentration of the individual components which compose the gas. Since some astrophysical applications are particularly sensitive to opacity3.2, a great deal of effort has been spent in recent years in investigating this dependence. This has led to accurate results, covering the whole of the Capture Theory's simulation domain, becoming available. Therefore in theory, every plausible combination of gas components and conditions can be accounted for. In practice, this is an impossible task, given the myriad of combinations that are possible. Thus some assumptions concerning the state and composition of the material throughout the simulation domain must be made.
A practical method is to use a set of opacities for one particular mix of materials, and apply a multiplication parameter to these opacities to simulate varying the composition. Incorporating a multiplication parameter is also useful for investigating how sensitive the simulation is to opacity, and consequently to radiative energy transfer in general. The mix used here is closest to what the solar-nebula theorists believe would have been present at various stages in their model. This is estimated from what is observed in star forming regions, the planets, and the surface of the Sun today. An in-depth description of the radiative processes present in this mix, which subsequently lead to an effective opacity, is not relevant here, instead see Alexander and Ferguson (1994); Gaustad (1963); Henning and Stognienko (1996); Alexander et al. (1983) for detailed discussions of the physics involved. However a brief qualitative description is in order:
At low temperatures the opacity is dominated by solid grains. Above
the
volatile ices evaporate, but the residual refractory compounds in the grains still
provide the major absorption. When the grains have completely evaporated,
, hydrogen molecules and
are the major contributors to the opacity.
Two sources of opacity data are used in this thesis. The first is for temperatures up
to
, where only temperature dependence is necessary (Henning and Stognienko, 1996). The
results from this paper were conveniently provided in a parameterised form:
| (3.4) |
|
![]() |
The second source covers
to
(Alexander and Ferguson, 1994). Since the gas
component of the medium is the major contribution to opacity at these temperatures,
the opacity depends on density as well as temperature. It is usually the convention
with temperature-density dependent opacities, to introduce a new variable,
, in order
to facilitate rectangular tabulation of results:
| (3.5) |
These values of opacity (log
), expressed as a function of log
and log
, are given in Table 3.2. The opacities covered by this table range
from log
to log
. These values of
cover the density range
to
x
at
, and the density range
to
x
at
. The last three columns and the bottom row are
extensions to the data of Alexander and Ferguson:
The bottom row, log
, was added so as to ensure a smooth transition between the
two opacity data sets, all values being the same as the low temperature opacity data
set at that temperature. The last three columns on the right (log
to log
), were added so as to allow the results to be applicable at higher densities.
For low temperatures in this region (below log
), the values are all equal to
the values at log
in the same row. Analysis of this table and other sources,
show that this is a reasonably valid assumption. The values of the opacity above log
(and log
) are estimated from other sources of opacity data available
for mixes similar to this, and are seen to be consistent with the pattern of increase
demonstrated by preceding opacities in the same row.
Simple linear interpolation is applied for intermediate values. If the material has properties which result in opacities outside of the table being required, the boundary values are used, and a warning flag set. This set of opacities, along with the first set, are plotted in Figure 3.12 for four sample densities.
![]() |
(3.6) |
The corresponding receiving element associated with each particle is taken as a uniform density truncated segment of a sphere centred on the radiating particle.
Figure 3.13 shows this arrangement for two dimensions. In three dimensions, the choice of using a square or circular cross section is available. The exact definition of the segment used in practice is unimportant here, suffice to say many geometrical relationships are available.
Given the arrangement of Figure 3.13, the proportion of radiation
absorbed from particle
, incident on the front face of the receiving element, is
given by
. This rather simple result is the reason for
representing the mass and energy of a particle as a truncated segment whilst it is
receiving radiation, rather than as a cube or sphere, where calculating the amount
absorbed from a point source is rather involved.
A grid is required in order that absorption between particles can be accounted for,
i.e. placing a particle between
and
in Figure 3.13, reduces the
amount of radiative energy incident on
due to
. A simple regular grid was
employed for this purpose. In order that the absorption properties of a grid cell can
be estimated, a temperature and density sampled from surrounding particles is
calculated at the centre of the cell, and taken to apply throughout the cell. This can
be achieved in various ways, but the modified SPH interpolation procedure given later
in Section 3.2.7 was used.
When considering the radiative energy absorbed in
due to
, several
interparticle points are considered along the line joining the particles, between the
surfaces of the radiating and receiving elements, the absorbing properties of which
are estimated from the grid3.3. The amount of
energy falling on the front face of the receiving element, from the radiating element,
is attenuated by a factor determined using these points. The energy lost due to the
interparticle absorption is not stored, as it is assumed that when the particles that
contributed to the grid properties interact with
, this energy will be absorbed by
them then.
The merits of the method can be discussed in terms of physical accuracy and computational expense.
On the computational side, the method is essentially an
code, as every
particle interacts with every other, and is thus relatively easy to implement compared
to tree based methods. However, this leads to large computational run-times when large
numbers of particles are employed, and would not be computationally viable for tree
based implementations of the force calculation. Moreover, a large computational
overhead is present in the
proportionality constant, due to the interparticle
absorption calculation. Thus even an
based force calculation routine would
suffer considerably longer computational run-times, with the inclusion of this
radiative energy transfer scheme. One way of circumventing these concerns is to apply
the radiative energy transfer routine intermittently, e.g. every
time-steps for
an
force calculation routine, and every
time-steps say, for a tree based
force calculation routine. Obviously this is not the most desirable of solutions.
Continuing with the computational side of the discussion, the use of a regular grid introduces resolution considerations. Specifically the number of cells in the grid must be such that the smallest detail in the simulation be resolved. In three dimensional clustered simulations, this can be an unachievable task, requiring many billions of grid cells, most of which will resolve space to an unnecessarily high degree of accuracy. Obviously the solution to this problem is to use a tree type grid structure, as demonstrated in earlier sections, and applied later in Section 3.2.5.
Physically the method performs well in the almost transparent and semi-opaque opacity
regimes, producing errors at the
level per time-step in test scenarios. However
the method is beset with problems in the opaque regime. The major symptom is that
during radiation tests, the amount radiated by the particles can be severely less than
expected. Likewise, during absorption tests, the amount absorbed by the particles is
less than expected. The reason for these problems stems from the relationship between
the radiating, receiving, and grid geometries:
A simple demonstration of this can be given by considering the example scenario in
Figure 3.14. Here the group of small circles on the right represents
the radiating elements of the particles in a sphere of uniform density, represented
approximately by the inner large circle. The outer large circle is the approximate
extent to which the particles contribute to the grid properties, i.e.
from the
edge particles. Beyond this, grid cells have zero density and temperature, and thus
are completely transparent. The cross on the left of the diagram is a point source
radiator, used to test the absorption properties of the particles.
Assuming that the particles are all at the same temperature initially, a theoretical rate of absorption in the sphere of particles from the point source can be determined. The rate of energy lost by the particles can also be found analytically. These details are not important here, but can be found in Section 4.3, where this scenario is used to test the tree radiation transport code. Only an instant in time is being considered in these tests, so force and velocity calculations are unnecessary. As already mentioned, the radiative energy transfer algorithm under investigation, performs well in the low opacity regime, where optical depths of the order of the size of the modelled region or greater are present. However, as the optical depth across the spheres increases significantly beyond unity, the simulation diverges severely from the analytical solution.
Considering the absorption test first: The reason for very little absorption in the sphere from the point source radiator, is due to the grid absorbing most of the radiation erroneously, as demonstrated in Figure 3.15(a), i.e. it is falsely assumed that the energy absorbed by the shaded region of the grid, will be absorbed by particles at a later stage.
![]() |
A possible way of alleviating these effects, could be to estimate the grid properties from the particles using the same uniform density spheres as determined for the radiating elements. However, even with this approach the erroneous absorption can still occur. This happens markedly when a particle's radiation sphere just overlaps onto the centre of a grid cell. This is because the properties at the centre of the cell are taken to apply throughout the whole cell, and thus a part of the cell could be beyond the desired radiation surface. A similar argument is applicable for the absorption elements.
For this effect to be completely suppressed, the geometry of the radiating and receiving elements must be the same as the grid geometry, i.e. square. It is also necessary to coincide the centre and size of the emitting and receiving elements, with the centre and size of the grid cells, or some multiple of them.
The tree is essentially a Barnes-Hut tree, but with a few modifications. Firstly,
since the properties of the particles will be spread onto the tree at a later stage,
the definition of the tree should be such that space is sufficiently resolved in all
directions within
of a particle. The usual procedure for tree construction, see
Section 3.1.3, can result in situations as shown in Figure
3.16(a), especially at surfaces.
![]() |
The Barnes-Hut tree construction algorithm can result in an unnecessarily high
resolution around some particles. This occurs when particles are very close to each
other, and is amplified by using
particles in the construction process. Clearly
the resolution around particles should be of the order of a smoothing length, much
higher resolution being an unnecessary waste. This is accomplished by a process coined
``tree pruning''. A square is pruned, meaning that all of its sub-squares are deleted,
if all of its sub-squares are deemed to resolve space too finely. This condition is
necessary in order that the leaf level of the tree covers space completely. A square
is defined as resolving space too finely, if the average smoothing length of the
particles contained within it, is greater than some factor of the size of the square:
The tree pruning procedure is implemented in the opposite sense to what has been explained above, i.e. all squares are marked as `prunable', and a tree traversal determines which ones should not be pruned:
![]() |
Essentially the same tree procedure as given in Section 3.1.7 for
calculating the density, is used to estimate the properties of the leafs from
surrounding particles. The major difference being that the density at the centre of a
leaf is calculated using:
By assuming that the properties calculated at the centre of the leaf, apply
throughout the whole leaf, a mass and consequently an internal energy can be derived:
When adopting this procedure for calculating the properties on the grid, the total
mass and internal energy is typically conserved to within
or so, depending on
the pruning factor. If the change in internal energy were to be returned to the
particles in an absolute manner, this discrepancy may cause problems related to energy
conservation, however the change is returned in such a way that these problems are
avoided. See Section 3.2.13 for the details of this procedure.
Given the average density and temperature of a leaf, the opacity can be calculated as
demonstrated earlier in Section 3.2.3, and consequently the optical
depth, as given by Equation 3.2. The optical depth is used to calculate
the proportion of radiative energy incident on a region that is absorbed. Since the
radiative energy transfer process is discretised, as described in 3.2.9,
the proportion of energy absorbed is more appropriately referred to as the probability
of absorption of a region. Furthermore, in practice it is more convenient to calculate
the transmission probability, denoted by
, rather than the absorption probability
of the leafs in the tree. Obviously the absorption probability is simply
.
As will be seen later in Section 3.2.9, radiative energy only travels
along the Cartesian axes in this method. This means that radiative energy is always
incident perpendicular to a face of a square. Thus for the leafs, the transmission
probability of radiative energy incident on a face is given by:
| (3.13) |
![]() |
(3.14) |
The purpose of this and the following three sections is to estimate the change in energy at the leaf level of the tree, due to radiative processes during the dynamical time-step. Instead of attempting to consider every leaf with every other leaf, or perhaps considering a leaf with a group of leafs sufficiently far away (as in the gravitational tree force calculation), the radiative energy emanating from a leaf is absorbed in a sample distribution of surrounding leafs.
The first stage in the method involves calculating a rate of radiative energy loss
from the surface of the leafs:
When a power packet passes through a leaf, it is either absorbed in the leaf, or `scattered' from it. In a true tree random walk process, the scattering could be in any of the six axial directions, however, here the power packet cannot be scattered in the direction it came from, or back along the axis it was originally transmitted. For a uniform grid, i.e. all leafs at the same depth in the tree (and hence the same size), this results in power packet walks similar to those demonstrated in Figure 3.19.
![]() |
This uniform example is simple to implement: When a power packet moves into a leaf, a
random number between
and
is generated. If the random number is less than
for that leaf, the power packet is scattered from the leaf, otherwise it is
absorbed in it. However, the non-uniform general tree structure is more complicated,
requiring additional considerations.
Figure 3.20 shows four scenarios which can occur when different levels of leafs are present. The scenarios are ordered in increasing complexity.
![]() |
In this scenario, a power packet is simply absorbed or scattered from a neighbouring leaf, in the manner just explained.
This scenario is similar to the previous one, the only difference being that a tree boundary is crossed. In order to find the appropriate leaf, a tree neighbour search is performed, see Section 3.2.10 for the details. This procedure involves specifying a leaf, and a direction of travel. The tree is searched upwards until it is possible to move in the specified direction to an adjacent square of the same size, without crossing a tree boundary (the found squares will share the same parent square). The tree is then searched downwards, descending to squares which are adjacent to the original leaf, until the required leaf on the other side of the boundary is found. The power packet is then either absorbed or scattered in the usual manner. If the neighbouring leaf is of a different size to the current leaf, then the following two scenarios are appropriate.
This scenario is exactly the same as the previous one, except that whilst descending the tree, if the leaf level is encountered prematurely, the power packet is either scattered or absorbed from the leaf currently being examined in the descent.
If necessary, the same neighbour searching procedure as used previously is performed. So as not to introduce additional complexity, or reduce the resolution unduly in the tree walking procedure, and hence the simulation in general, an additional criteria is introduced: A power packet can only be absorbed or scattered at the leaf level of the tree. This has already been implied to some extent in the previous scenarios, but here the definition is required explicitly, as the choice of using a subdivided square for these purposes is clearly possible.
The approach adopted to ensure that this criteria is met in a computational efficient
and physically realistic manner, involves generating a random number between
and
as
before, and comparing it against the
of the subdivided square, for the current
axis the power packet is travelling along. If the random number is less than this
transmission probability, the power packet is descended down the tree to completely
random sub-squares, until a leaf is reached, at which point the power packet is
scattered in the usual constrained manner from it.
If the random number is greater than the transmission probability of the square in
question, the power packet is absorbed in one of the leafs contained in it. The leaf
it is absorbed in is determined by consideration of the transmission probabilities of
the square and leafs it contains. Again, trivial probability analysis is
appropriate, but this time the direction along an axis is important. Consider the
example of Figure 3.18 again, where it is assumed that a power packet
from leaf
has just been absorbed somewhere in square
, Figure
3.21.
In practice, all of the above scenarios are combined together in the same routine, as it is not known a priori which of the above scenarios will be encountered during the random walk. Figure 3.22 shows some example constrained random walks for the multiple leaf depth example of Section 2.1. See Appendix A.8 for the pseudo-code of a tree walk for one power packet.
This procedure is required when a power packet crosses a boundary, i.e. it moves to a square which does not share the same parent as it. The square is found by searching upwards in the tree, until it is possible to move in the required direction without crossing a tree boundary. Whilst ascending the tree, a list containing the relative positions of the ascended squares with respect to other squares that share the same parent is constructed. The list is read in reverse order during the descent, i.e. it is a stack. To determine which squares should be descended into, the current list value is compared with the direction of travel.
As an example of this, consider Figure 3.23.
Figure 3.23(a) shows the labelling notation used in this example. The stack generated for the power packet example of Figure 3.23(b) is `This procedure results in a full tree climb when a power packet crosses the central axes of the largest square in the tree.
In using random walks to sample the radiative energy emanating from a leaf, the probability of absorption of surrounding leafs is artificially enhanced. This can be demonstrated by considering Figure 3.24.
Here two sample random walks are shown. The long arrowed lines indicate the depth of material the radiative energy would have travelled through for a more physically realistic direct interaction between the leafs. As can be seen, the sampling process has artificially increased the absorption depth by just over a factor of two in these examples.The theoretical basis of the procedure used here for softening this effect, involves keeping track of the total depth of material which has already been considered for absorption during the random walk of the power packet. The absorption depth of the current square is reduced to the difference in distance between the total absorption depth already considered, and the distance between the centre of the current square and the centre of the radiating leaf. The total absorption depth is then incremented by this amount.
The above procedure works well for uniform grids, almost completely counteracting the surplus absorption, however it cannot be applied directly to a tree structure. Instead an approximation to this method, which uses the distance from the radiating leaf to both the previous leaf and the current square, is used to reduce the absorption depth.
Figure 3.25 shows the distances required for a typical multi-depth random walk. The transmission probabilities at each stage in the walk are reduced as follows:| (3.17) |
![]() |
(3.18) |
During the random walk radiative energy transfer routine, a list summarising each power packet transfer is compiled. The list is referred to as the power packet transfer list. Each value in the list corresponds to a power packet, and contains a link to the radiating leaf and a link to the absorbing leaf, or zero if the power packet left the system. The list is used to calculate the change in energy of the leafs during the time-step.
Due to the strong dependence on temperature, the radiative energy transfer equations could potentially require a much shorter time-step for explicit integration than the dynamical time-step. Usually in simulations where some part of the physics requires a much shorter time-step than the rest of the system, an implicit time integration scheme is applied. One such scheme commonly used in radiation hydrodynamics is the semi-implicit Crank-Nicholson integration scheme, for example see Stone et al. (1992). In that work, Newton-Raphson iteration is used to solve both the hydrodynamical equations of motion, and the radiation transport equations simultaneously over a dynamical time-step.
A simple, but effective method which requires neither implicit integration or iteration is implemented here. More complicated methods were investigated, but all proved to have apparently intractable problems associated with them. For example, whilst incorporating an implicit iterative integration scheme, problems related to the rapid transfer of energy through the system were encountered, the source of which appeared to be inherent to iterative schemes in general.
In this simple method, the particle properties excluding radiative energy transfer, are
integrated over the dynamical time-step as described in Section 2.11. The
average of the particle properties at the beginning of the dynamical time-step and at
the end of the time-step, are used to construct the radiation tree and calculate the
properties on it. The dynamical time-step is divided into approximately
smaller
radiation time-steps, and a forward Euler integration scheme is used to calculate the
change in energy of the leafs over these smaller time-steps. The change in energy is
returned relatively to the particles from the leafs. The difference in energies at
the average particle positions, before and after radiative energy transfer, is then
applied absolutely to the particle energies at the end of the time-step.
When an approach like this is adopted, i.e. additional physical processes are solved outside of the dynamical equations, FSAL, see Section 2.11, cannot be implemented. This is because the extra change in particle properties at the end of the time-step, now means that the most recent derivative calculation of the dynamical properties at the end of the time-step, cannot be approximated to correspond to the first derivative calculation at the beginning of the next time-step. The main reason for not solving the radiative energy transfer equations simultaneous to the dynamical ones, stems from the random nature of the radiative energy transfer process, and the corruption in time-step prediction it would cause: The time-step prediction algorithm relies on the difference in particle properties calculated between the forward Euler stage and the improved Euler stage. If this difference is swamped with a random component from the radiative energy transfer equations, the algorithm will cease to perform efficiently, or even not at all, i.e. every time-step being failed, due to the tolerance criteria never being met.
The procedure for calculating the change in energy of a leaf over a radiation
time-step, using the power packet transfer list, is now given. At the beginning of the
first radiation time-step, the rate of heating in each leaf is calculated by summing
together the rate of heating associated with each power packet absorbed in the leaf,
via one loop over the power packet transfer list. This is combined with the rate of
energy radiated from the leafs given in Equation 3.15, to form the total rate
of change in energy of the leafs at the beginning of the current time-step:
| (3.19) |
In theory after this first time-step, new tree absorption properties should be calculated, and the power packet transfer routine performed again. However, although calculating the tree absorption properties takes inconsequential computational run-time, the power packet transfer routine is very computationally demanding. Instead, the approximation that the opacities are constant over the dynamical time-step is applied. With this approximation, both the recalculation of the tree absorption properties, and the power packet transfer routine can be avoided.
The modified rate of energy radiated by a leaf at the beginning of radiation time-step
is given by:
![]() |
(3.21) |
In the semi-opaque and almost transparent regime, the speed of light is the limiting
factor for the rate at which energy can travel through the system during a time-step.
When the simulations in this work are in this regime, large time-steps of the order of
years are present. In one year, light travels
, which is around 3 orders of
magnitude greater than the dimensions of the largest simulation. Even if the dynamical
time-step is divided into hundreds of radiation time-steps, this factor is of no
concern here, however the rate of transfer in opaque regimes does require
consideration.
It is apparent that in completely opaque regimes, the rate of energy flow through the system, using the methods presented in earlier sections, is governed by the size of the leafs and the number of radiation time-steps. This is because the energy absorbed by one face of a leaf during a radiation time-step, is assumed to have been absorbed uniformly within it, i.e. all faces of a leaf have the same effective surface temperature at all times. Thus radiation incident on one face of a leaf, effectively travels to the opposite face at a rate proportional to the size of the leaf. The following analysis was used to derive a term which could be used to reduce the flow of energy to a more realistic rate in opaque regimes.
In Figure 3.26,
radiation denoted by arrowed lines is incident perpendicular to a face of a leaf of size![]() |
(3.24) |
It is not until after the power packet transfer list is compiled, that the penetration
depth calculation of Equation 3.25 is exploited: Whilst looping over the power
packet transfer list, collecting the rate of change of energy in a leaf due to other
leafs, the total power absorbed in the leaf is reduced by an amount that depends on
that leaf's average penetration depth,
. In order to conserve energy,
the fraction of power that is not absorbed by the leaf is returned to the leafs where
the power packets responsible for the heating originated.
In opaque regimes, the rate of energy flow between two adjacent leafs (denoted by
and
) of equal size, is thus approximately given by:
| (3.27) |
| (3.28) |
| (3.29) |
| (3.30) |
In practice, when calculating the rate of energy transfer between leafs, the average
of the attenuation factors derived from Equation 3.25 is used. This is
necessary to prevent super-heating occurring around
, where the opacity drops
several orders of magnitude, Figure 3.12. Super-heating occurs because of
the severe imbalance of the radiation flow. For example, if the centre of an opaque
body were to reach a sufficiently hot temperature, such that the optical depth across
the centre fell by several orders of magnitude, then the material present would be
subject to extreme heating from the surrounding opaque regions. This is because the
surrounding opaque regions are able to transfer energy to the central region, but the
central region is unable to transfer energy back effectively to the opaque regions,
due to the large difference in the attenuation factors.
This section is concerned with returning the change in energy at the leafs, as the result of the transfer of radiative energy during a dynamical time-step, back to the SPH particles. There are several possible methods which could be used for achieving this. For example, one method could be to perform the inverse of the procedure set out in Section 3.2.7 for calculating the leaf properties, i.e. the smoothing length of a particle could be used to collect energy from the leafs. This method, although relatively straightforward, has several problems associated with it. One problem is related to the conservation of energy. In general, the total energy of all the leafs is not equal to the total energy of all the particles, due to the finite resolution of the tree. This implies that although the energy of the leafs may remain constant during a time-step, the energy determined at the particles may not be so.
In order to relieve these energy conservation concerns, the change in energies
of the leafs are collected by the particles. The proportion of the change in energy of
leaf
, which is collected by particle
, depends on how much of leaf
's
original energy was contributed to by that particle:
![]() |
(3.32) |
| (3.33) |
| (3.34) |
![]() |
(3.36) |
![]() |
(3.37) |