## 3. Numerical methodIn this section we describe the complete numerical method. It is
more stable and more accurate than the one used in Paper I and
allows to take into account H, He, C, N and O simultaneously in all
calculations. The stability of the methods used requires that the
Courant condition is fulfilled. If
is the geometrical distance between two grid points, At each point of the fixed gas pressure scale we would like to
calculate the time-derivative of the mass fraction of an element
is the atomic weight, the proton mass and the density. The mass fraction may change because of the effects of diffusion and wind. The corresponding variation of the particle density will be denoted as . Mass loss and diffusion do not change , because the wind velocity is derived from the equation of continuity (see Sect. 2) and diffusion does not lead to a net mass flow. However, the stellar structure changes with time. For example, if the gravity increases the mass-depth at a given gas pressure decreases. So mass elements move to larger values on the scale. In the presence of concentration gradients, this leads to variations of the composition at the various points on the scale. We denote the corresponding time-variation of the mass-fraction with . Alltogether we then have For the particle density and the total velocity is obtained from the equation of continuity for radial symmetry: This equation has to be evaluated numerically for each element. Under certain conditions, which are fulfilled preferably in the outer regions, we use a modified upwind scheme described in Sect. 3.3. Otherwise the monotonic transport scheme described in Sect. 3.4 is used. The variation of the mass fraction due to the stellar evolution is written as
In the following subsections some conventions are used. The indices
## 3.1. The primary gridFor the calculation of the stratification a grid is constructed as described in Unglaub & Bues (1997). For the gas pressure at the outer and inner boundaries we chose and , respectively. The grid spacing is The points denoted as in Unglaub & Bues (1997) define the primary grid of the present calculations. At each grid point the diffusion and wind velocities are calculated. ## 3.2. The secondary gridLet and
be the diffusion and wind velocities
for a given element at the points of the primary grid and
the distance of point The expression represents the
relation between the indices The points If is an integer, then the
quantities at this point of the primary grid are taken. Let, however,
be
, where ## 3.3. The modified upwind schemeAt a grid point The first condition means, that the flows at point Now we denote with the number of
particles per unit time which cross a surface
. Then
is the number of particles per unit
time, which enter the zone The obvious method would be to evaluate the values The expression in the denominator on the right would be the volume
of the zone This is more consistent with our upwind evaluation of ## 3.4. The monotonic transport schemeThe monotonic tranport scheme (abbreviated mono scheme) is used, if the conditions (13) and (14) are not fulfilled. This is the case especially in the inner regions, where the primary and the secondary grid tend to be identical. The basic ideas from which the mono scheme is derived are described in Hawley et al. (1984). It is an improved upwind scheme, which combines stability with accuracy. In deep regions, during one time step the flow covers a distance which is small in comparison to the distance between two points of the primary grid, so that . Especially in such cases the mono scheme is more accurate than the upwind scheme. According to the mono scheme the flow at the zone boundary , for example, is evaluated as follows: is the geometrical distance
between the points For the mono scheme is identical with the upwind scheme. With the flows and at the inner and outer zone boundaries, respectively, the number of particles crossing the boundaries per unit time are obtained according to: Then the time derivative of the particle density of an element at
point ## 3.5. The evaluation ofTo evaluate the variation of the mass fraction of an element
An exception is the point which represents the inner boundary. Here is used: The variation of the mass depth during the considered time step is obtained by linear extrapolation from the preceding time step with is the width of the preceding
time step. The nominator on the right represents the difference
between the actual mass depth at point ## 3.6. Boundary conditionsThe outermost points of the primary and secondary grid are identical. The point represents the center of the outermost zone. The outer boundary of this zone is beyond of our computation domain. The gas pressure at is for all our computations. Therefore the density will be low enough, so that for the considered mass loss rates the wind velocity is usually large in comparison to the diffusion velocities. As shown in Paper I this tends to smooth out concentration gradients. This justifies the assumption of homogeneous composition in the region between the two outermost grid points: This choice avoids numerical problems at the outermost point. At the lower boundary () at , we assume that diffusion and mass loss do not change the mass fractions. Only if the mass depth at decreases, the composition is allowed to vary. In this case mass elements located within our computation domain at move to the lower boundary. So we obtain the inner boundary condition: ## 3.7. The time stepIn Sect. 3.2 we have introduced the chosen time step width
. This value is used to define the
secondary grids for the various elements and to obtain the time
derivatives of the particle densities according to the monotonic
transport scheme. For all calculations presented in this paper
is used. The drawback of the
numerical method is, that during many time steps the composition
fluctuates around some slowly changing mean value. To restrict these
fluctuations, during one time step we do not allow the mass fractions
to vary by more than . For each
element is the time, for which the mass fraction would change by . The actual time step width used in the computations is the minimum value of and all : In most cases and
are identical. Exceptions may occur,
if one of the elements has an extremely low abundance or during the
calculations for helium-rich white dwarfs with traces of hydrogen.
Then may be smaller than
. The new mass fractions of the
element The new mass fractions of these points ## 3.8. The stability of the methodThe method is by far more stable than the one used in Paper I. There the stable upwind scheme has been used only for the part of the flow which is due to the wind, whereas the diffusion flows have been evaluated at the zone boundaries. Then unstabilities occurred in cases of very large diffusion velocities. This may happen for extremely low abundances, where the radiative acceleration may be much larger than the gravitational one. Therefore in the present method stable schemes are used for the total flow. If the velocities increase the grid is adapted by increasing the distances between the points. We use a separate grid for each element. So if one element requires a coarse grid (because of large velocities), the grids for the other elements can be kept more refined, which means a better accuracy. However, numerical instabilities may still occur under certain circumstances. This is for the case of helium-rich white dwarfs with small admixtures of hydrogen ( by number). © European Southern Observatory (ESO) 2000 Online publication: July 13, 2000 |