G. Meynet1 - A. Maeder1 - N. Mowlavi1,2
1 - Geneva Observatory, 1290 Sauverny, Switzerland
2 -
Integral Science Data Center, Ch. d'Ecogia, 1290 Versoix, Switzerland
Received 5 May 2003 / Accepted 18 November 2003
Abstract
We describe and discuss the properties of three numerical methods for solving the diffusion equation
for the transport of the chemical species and of the angular momentum
in stellar interiors. We study
through numerical experiments both their accuracy and their ability to provide
physical solutions. On the basis of new tests and analyses applied to the stellar
astrophysical context, we show
that the most robust method to follow the secular evolution
is the implicit finite differences method.
The importance of correctly estimating the diffusion coefficient
between mesh points is emphasized and a procedure for estimating
the average diffusion
coefficient between a convective and
a radiative zone is described.
Key words: diffusion - methods: numerical - stars: interiors
For many physical processes in stellar interiors, such as heat transfer, transport of angular momentum, mixing of chemical elements through time dependent convection, semiconvection or turbulence, a diffusion equation needs to be solved. Diffusion is thus involved in numerous interesting astrophysical problems. For instance, Vauclair & Charbonnel (1998) discuss the importance of selective diffusion in low-metallicity stars and the consequences for lithium primordial abundance; Charbonnel (1995) has shown how rotational diffusion in low mass stars may lead to the destruction of 3He and thus to new insights on the evolution of the abundance of this cosmological element; most of the results on the effects of rotation in stellar interiors are based on the resolution of a diffusion equation for both the transport of the chemical species and of the angular momentum (Chaboyer & Zahn 1992; Zahn 1992; Talon & Zahn 1997; Denissenkov et al. 1999; Heger et al. 2000; Maeder & Meynet 2001; Meynet & Maeder 2003). Diffusion plays also a key role in our understanding of the structure and the cooling of white dwarfs (cf. Kawaler 1995).
For solving numerically the diffusion equation, different methods are available. Quite generally, they can be classed into two main categories: the finite differences methods and the finite elements methods. Depending on how the time discretisation is performed, one distinguishes three subclasses in each of these two main categories, namely the subclasses of the explicit, implicit and of the "Crank-Nicholson'' type methods. Thus, at least six different methods are available. Here we are interested in modelling the long-term evolution of stars (secular evolution). This immediately prevents us from using explicit methods which requires the use of much too short time steps (see below). Among the four remaining methods, the "Crank-Nicholson'' finite elements method was not tested in view of the results obtained by the "Crank-Nicholson'' finite differences method (see Sect. 5.4). Thus we shall focus our attention on three of them namely
The interested reader will also find in this paper a detailed description of the discretized equations for resolving the diffusion of chemical elements and of the angular momentum in stars. We also propose a new way to estimate the diffusion coefficient in the interface between a convective and a radiative zone.
In Sect. 2 we briefly recall the physical problem to be resolved. The three numerical methods are described in details in Sect. 3. The estimate of the diffusion coefficient at the interface between a convective and a radiative zone is presented in Sect. 4. Section 5 is devoted to various tests and comparisons. Section 6 summarizes the main results.
Diffusion is a process by which components of a mixture
move from one part of a system to another as a result of
random motion. Let us briefly recall how the diffusion
velocity is defined (see e.g. Battaner 1996).
In a multicomponent fluid, one defines
the mean velocity
of the mixture as
The peculiar velocity of a particle is defined as
There is thus no net mass flux associated with diffusion. In that respect, in a star, the changes of chemical composition due to diffusion can be treated very similarly as those due to the nuclear reactions. Like the nuclear reactions, diffusion modifies the mean molecular weight (and thus the hydrostatic structure of the star), but does not induce any net mass flux.
In the context
of the Boltzmann microscopic theory, it is
possible to deduce from
the equations
of motion for the different components, expressions for the
's (see Battaner 1996). We shall not repeat
these developments here. Instead we consider that diffusion is equivalent to a displacement of particles whose velocities
may be related to the diffusive coefficient, D, by the expression
(see also Sect. 3.2)
We are interested in resolving the diffusion equation in
spherically symmetric systems.
Let us consider a one-dimensional problem, where particles i may diffuse along
the radial direction r. Thus
Sometimes, Eq. (6) is written as below
This can also be seen in a slightly different way.
When, in Eq. (7),
the ci's are identified with
the number fractions, one obtains
Starting
from Eq. (6) and summing
over all the chemical species i, one obtains
The equation expressing the diffusion of the angular momentum is (see e.g.
Endal & Sofia 1978)
where
is the angular velocity and D' the diffusion coefficient for the angular momentum.
In our numerical experiments, the radii do not change with time
.
Equation (12) then becomes
The detailed description of the implicit finite elements method used to resolve
the diffusion equation for the chemical species
is presented in Schatzman et al. (1981) (see the appendix by Glowinsky & Angrand).
We present here the procedure for the case of the
angular momentum diffusion. The basic idea of this method is to decompose the unknown
function, here
,
as a linear combination of well chosen independent functions.
This decomposition can be performed in many different ways. We
adopt here the same decomposition as in Schatzman et al. (1981).
Of course, the conclusions concerning the ability of this method to provide physical solutions
will only refer to this particular choice.
We decompose the star in K shells, with the langrangian mass coordinate
of the ith mesh point being mi (mi is the mass inside the sphere
of radius ri). In the following all the quantities with an indice i are evaluated
at the mesh point i.
The shells are numbered from 1 at the surface to K at
the centre.
Let us introduce K functions bi(mr) defined by
| (16) |
![]() |
(17) |
![]() |
(18) |
Expressing
as indicated in Eq. (20), Eq. (19) becomes
![]() |
(22) |
![]() |
(23) |
![]() |
(24) |
![]() |
(25) |
![]() |
(26) |
![]() |
(27) |
| Ai, i=2(Ai, i-1+Ai+1, i). | (28) |
| AK, K-1=0.5 AK, K, | |||
| A2, 1 =0.5 A1,1, | |||
![]() |
(29) |
![]() |
(30) |
| Bi, i=-Bi, i-1-Bi+1, i. | (31) |
![]() |
(33) |
Let us consider in a first step the case of the diffusion of the chemical elements.
Multiplying Eq. (10) by
and integrating with respect to
the spatial coordinate r from
to
,
one obtains
One can also derive Eq. (35)
from the continuity equation. Indeed
supposing that the bulk gas velocity is zero, that
(stationary situation), and that there is no sink/source terms of matter, the continuity equation becomes
![]() |
Figure 1: Discretized distribution of the abundance of element i in a star model as a function of radius. Only a few mesh points are represented. K is the total number of mesh points. Numbering increases from outside to inside. |
| Open with DEXTER | |
Let us now consider the discretized abundance profile of element i sketched in Fig. 1.
The mass of element i removed from
point k+1 and added to point k per unit time is (see Eq. (34)):
![]() |
(37) |
![]() |
(39) |
![]() |
(41) |
![]() |
(42) |
and let us separate the abundances evaluated at time tn from those estimated at
time tn+1. Equation (40) then becomes
The discretized equations describing the diffusion of the angular momentum
are obtained in a similar way. The final result are
equations similar to Eqs. (43)-(45) with Xi replaced by
,
replaced by
,
replaced
by
and
replaced
by
.
Of course the diffusion coefficient must be
the one describing the diffusion of the angular momentum.
This method is not fully implicit and thus, one can expect that some sort of Courant's condition will limit its domain of validity (see Sect. 5).
In the implicit finite differences method,
the right hand term of Eq. (38) is estimated at time tn+1 (in the explicit method
the right hand term would be estimated at time tn). In this case, one obtains
![]() | |||
| (47) | |||
![]() |
(48) |
![]() |
(49) |
For obtaining the equations for the angular momentum, we apply the same recipe as indicated at the end
of the previous section.
The system of equations describing the transport of the
angular momentum also conserves the total angular momentum.
![]() |
Figure 2:
Schematic representation of the mass shell between the radii rk and rk-1. The
diffusive coefficient Dk operates in the zone between rk and |
| Open with DEXTER | |
Let us consider two mesh points as in Fig. 2. Let us suppose that the diffusion
coefficient Dk-1 is the
coefficient for the whole region between rk-1 and
.
Similarly
the diffusion
coefficient Dk is the
coefficient for the whole region between
and rk.
When both mesh points are in a radiative or convective region,
the radius
is equal to
(rk-1+rk)/2, otherwise
is taken as
the radius of the limit between the radiative and the convective zone.
Over the path
(see Fig. 2), the particles have an average diffusive
velocity Vk(see Eq. (35)) and over the path
they have
a diffusive velocity <Vk-1>. The total time for going from k to k-1is equal to
| (50) |
When the finite elements method is used, we need to evaluate the mean value between
two mass shells of the diffusion coefficient, D, multiplied by a factor
,
which for the transport of the chemical elements is
and for that of the angular
momentum is
(see Sect. 3.1). In that case, one adopts the
following procedure:
![]() |
Figure 3:
Comparison of the abundances obtained with the implicit finite differences method
using two different ways of evaluating the diffusion coefficient Dk-1/2between two
mesh points (see Sect. 4). The dotted line shows the
initial situation ( |
| Open with DEXTER | |
In this section, we study how the different methods described above behave in a very simple
configuration. Let us consider a uniform density sphere of 1
,
with
a radius of 1
,
composed of two chemical
elements X and Y. The initial distribution of these two elements in the sphere is a quasi step function.
The variation as a function of the radius of the abundance of one of these
two elements, let us call it X, at the beginning
of the computation is shown in Fig. 3 by the dotted line
(cf. also the dotted lines in Figs. 5 to 8). At the center, its initial value
is 0.99,
in the outer regions X=0.01.
The abundance Y is simply 1-X.
The diffusion coefficient is set equal to 1014 cm2 s-1in the interior region (i.e. for a radius r inferior to 0.7963
or a mass inferior to 0.5049
)
and to
cm2 s-1in the outer zone. Such values for the diffusion coefficient imply that the interior has a very
small mixing timescale (of the order of
yr) and therefore will be always
homogenized by mixing, while the outer one
will have a much longer mixing timescale (of the order of 4.26 Myr).
Such a situation is quite analog to a convective core
surrounded by a radiative envelope in a star. In the following we
shall define the interior region as "the core'', and the outer one as "the envelope''.
In our numerical experiments we keep the diffusion coefficient
constant as a function of time. The sphere is decomposed in 100 shells of
equal mass.
From these data one expects that the whole star will be completely mixed
in less than about 107 yr and that the final abundance of element Xin the homogeneous star will be 0.5048.
From this initial structure, on can also estimate the "Courant condition''.
Let us recall that the "Courant condition'' imposes a superior limit
to the time step for an explicit method to be stable (see e.g. Press et al. 1992). To estimate this limit,
one has to compute for each element and for each mass shell,
the time required for the element to diffuse through
the width of the shell i.e.
Let us begin by illustrating the importance of correctly estimating the diffusion coefficient at the
interface between a convective and a radiative zone.
In Fig. 3, the resulting distributions of the element X inside the star
after 1000 yr is shown. The time step used is
yr
The continuous line shows the results obtained using Eq. (51) for Dk-1/2. The dashed line represent the solution obtained using
a simple algebraic mean. We see that the results
are significantly different, in particular the algebraic mean tends to slightly increase
the convective core. This may have important consequences when such increases
are repeatedly applied over the whole evolution of a star. The use
of Eq. (51) which results from physical considerations is thus
recommended, and this is the one we used in the numerical experiments we now describe.
We have computed the diffusion of the chemical elements
(and of the angular momentum, see Sect. 5.7) for
different durations
of the period during which the diffusion operates and for different time steps
.
In Fig. 4 the set of values (
,
)
explored are indicated. For each couple of values, we
performed computations with the three methods described above, namely the implicit finite elements method, the Crank-Nicholson finite
differences method and the implicit finite
differences method. Most of the results are displayed in Figs. 5 to 8. On these figures,
the results obtained for increasing durations, using the same time step,
are ordered horizontally (from left to right), while the results obtained for the same duration, with increasing time steps,
are arranged vertically (from top to bottom). Since the Courant time step is equal to one year, the time
step
expressed in years gives directly the time step in units of the Courant time step.
![]() |
Figure 4:
Computations have been performed with the three methods
for each couple of (
|
| Open with DEXTER | |
The solutions obtained with the implicit finite elements method are shown in Figs. 5 and 6
(the dashed-dotted lines).
This method gives reasonable results in all the cases explored in this work except for small values
of
.
We note that for
yr, whatever is the time step, the solution leads to
negative values of X just above the "convective core''.
If the integration is
performed over a sufficiently long time, the system eventually reaches a reasonable solution,
even when instabilities appear at earlier time
(see for instance in Figs. 5 and 6 the evolution when
increases with
yr).
One notes that the star is completely mixed for
,
i.e. for durations
more than twice the mixing timescale of the envelope (about 4.3 Myr, see Sect. 5.1), which
is not very satisfactory. The final abundance
in the homogeneous star is on the other hand equal to that expected (
0.5).
As expected from an implicit scheme, reasonable solutions are obtained even if the time steps
are much greater than
the time step given by the Courant condition.
Inspection of the results for
yr show in general a great stability of the solution with respect to
the choice of the time step.
The solutions obtained with the implicit
finite elements method are in general less mixed that those obtained with the implicit finite differences method
(see Figs. 7 and 8).
This method is a kind of compromise between a fully implicit and an explicit scheme. In order to better understand what happens here, let us briefly recall a few generalities about implicit and explicit schemes (see Press et al. 1992, pp. 838-842).
Explicit finite differences schemes are stable only if the
time steps satisfy the Courant condition. Such methods are not
suited for the computation of the secular evolution of stars. Indeed, we are interested
in modeling the evolution of features with spatial scales of the order of the radius of the
star R, much greater
than the distance between two mesh points
.
If we are limited to time steps satisfying
the Courant condition, we will need of the order of
steps before
anything interesting begins to happen. We would like instead use timesteps of the order
of R2/D or, maybe, for purpose of accuracy, somewhat smaller.
With such great timesteps, it is no longer possible to describe accurately what happens at small spatial scales. However at small scales, the differencing scheme must do "something stable, innocuous, and perhaps not too physically unreasonable'' write Press et al. (1992). One possibility is to use a Crank-Nicholson differencing scheme. One of its main property is to let small-spatial-scale features maintain their initial amplitudes. In that case, according to Press et al. (1992), the evolution of the larger-scale features, in which we are interested in, take place superposed with a kind of "frozen in'' (though fluctuating) background of small-scale features. This is what happens in our numerical experiments. Indeed looking at the continuous lines in Figs. 5 and 6, one sees that the amplitude of the initial step in chemical composition is more or less maintained, although with great fluctuations.
The method gives reasonable solutions for not too big time steps. More precisely,
physical solutions are obtained when
in years is inferior to
,
or
when
in years is inferior to 100 yr
(see Fig. 4). This restriction on the time step is reminiscent of a kind
of Courant's condition. This is not so surprising given that the Crank-Nicholson scheme
is a mixture of both an implicit (not submitted to Courant condition) and
an explicit method (submitted to Courant condition).
Let us finally note that in its domain of validity in the log
versus log
plane
this method gives the same solution as the implicit finite differences method, and
since, it is centered in time,
this scheme is second-order accurate in time.
Another possibility for imposing an "inoccuous'' behaviour to the small-scale features
is to adopt an implicit method. Such schemes drive small-scale features to their equilibrium form,
i.e. imposes that at small scales
The solutions obtained with the implicit finite differences method are shown in Figs. 7 and 8
(continuous lines). The results show in general a great stability of the solution with respect to
the choice of the time step.
Only when the time step is of the same order of magnitude as
can
we notice some differences (compare for instance the continuous line for
yr and
yr with
the case
yr and
yr in Fig. 8).
This method leads to a completely mixed star after a time less than 107 in agreement with the estimate made in Sect. 5.1. The final abundance of the element X in the homogeneous star is also equal to that expected.
Although, in that case, the differencing scheme is only first-order accurate in time, it has the advantage over the Crank-Nicholson finite differences method and the implicit finite elements method to propose a physical solution (i.e. without negative abundance values) for all the cases investigated here (see Fig. 4). Moreover, as seen just above, it predicts a timescale for the star to be completely homogenized in agreement with the usual analytical estimate (see Sect. 5.1). In that respect this method does appear as the best one.
Table 1:
Maximum value over the star of the quantity
and of
for different values of
,
(in years) and for different numerical schemes. X
and Y are the mass fraction of the two elements composing the "star'', B is the
total angular momentum of the star. The labels CN and FI are for
"Crank-Nicholson'' and "Fully Implicit'' respectively (see text).
![]() |
Figure 5:
Abundance of the element X as a function of the distance to the center.
The dotted line show the situation at the beginning of the computation. The continuous line
refers to the solution obtained after a time |
| Open with DEXTER | |
![]() |
Figure 6:
Same as Fig. 5 for other values of |
| Open with DEXTER | |
![]() |
Figure 7:
Same as Fig. 5 except that the continuous line corresponds to the result
obtained after a time |
| Open with DEXTER | |
![]() |
Figure 8:
Same as Fig. 6 except that the continuous line corresponds to the result
obtained after a time |
| Open with DEXTER | |
Let us now have a look on the ability of the different schemes to conserve the sum of the
abundances (in mass fraction). In each shell and at any time step, one should have that X+Y=1.
In Table 1, we indicate for all the cases where the three methods give physical solutions,
the maximum over the star of the quantity
at the end of the computation. As expected
we see that in general
becomes greater when
increases.
The Crank-Nicholson finite differences method appears to give, in most of the
cases, the smallest
values for
(inferior to 10-4 for the cases considered). This is likely related to the fact that this method is
second order accurate in time.
The implicit finite elements method gives in general the highest
values (in the worst case
is of the order of 10-3), while the implicit finite differences method gives in general results inbetween.
Thus
the implicit finite differences method enables to avoid unphysical solutions and keeps reasonably well the sum
of the abundances equal to one.
We have performed similar tests and comparisons for the diffusion of the angular momentum.
We started from an initial configuration where the "convective core'' defined in Sect. 5.1
has an angular velocity equal to
s-1 and the radiative envelope an
angular velocity equal to
s-1. The other variables were taken
as described in Sect. 5.1. In such situation the Courant time step, which writes
We see that the finite differences method appear to better conserve the total angular momentum. The Crank-Nicholson finite differences method gives the best results, followed by the implicit finite differences method which reaches the same level of accuracy in most cases. Thus the implicit finite differences method that we recommended on the base of the results obtained for the diffusion of the chemical species gives also very satisfactory results for the diffusion of the angular momentum.
From the above numerical experiments, it appears that the implicit finite differences method
seems to be the most robust one, giving physical solutions in all the cases studied here spanning more than nine orders
of magnitude in
and
.
It has moreover
the following characteristics: 1) it reduces the problem to a first order
differential equation, 2) it enables an easy and clear interpretation of what happens
physically in the system, 3) it is quite easy to implement in a code, 4) it conserves reasonably well the
sum of the abundances at each mesh point as well as the total angular momentum.
On the basis of the new tests and analysis made here, we can recommend this method to resolve the diffusion equation in stellar interiors. Of course many more tests could be performed by changing the initial conditions. We restrained our discussion here on a case with a very sharp gradient in order to test the different numerical methods in some extreme conditions. Adopting initially shallower gradients would facilitate the finding of a solution for all three methods for all three methods and they would give identical results.
The diffusion coefficient between two mesh points has to be evaluated correctly to obtain reliable results. The mean diffusion coefficient is equal neither to the algebraic nor to the geometric mean. Its expression is given in Eq. (51).