9. Appendix: the ATON 2.0 code
In this appendix, we provide a synthetic but exhaustive description of the numerical inputs of the code ATON 2.0, to complement the elucidation in Sects. 2 and 3 of the main macro/micro-physical inputs. The choice of fully document the code will also help us, in the future, to avoid useless debates about results obtained from codes having different and/or not fully documented inputs.
ATON 2.0 describes spherically symmetric structures in hydrostatic equilibrium. It has been conceived to follow the evolution of stellar objects from early pre-main sequence phases prior to D-ignition, down to final brown or white dwarf cooling (apart from dynamical phases like full degenerate He-ignition) or to the onset and early developement of reactions. The ignition of and the following (pre-supernova) phases are not accounted for. In future papers, we will always refer to an ATON N.M version of the code, where N will keep track of the major macro-physical updates (e.g. rotation, non grey atmospheres etc), and M of the micro-physical ones (thermodynamics, opacities etc). In the same spirit above discussed, any change of release will be fully documented.
9.2. The numerical structure
The internal structure is integrated via the usual Newton-Raphson relaxation (Henyey) method, from the center to the base of the optical atmosphere (). The independent variable is the mass; the dependent ones are: 1) radius, 2) total luminosity, 3) total pressure and 4) temperature. To avoid numerical precision problems close to the surface, where can be , the code rezones and performs numerical derivatives directly on the vector, and the local value of mass at each grid point is obtained as a summation of from the center. This procedure, as opposed to the traditional one of computing grids of subatmospheres - with pressure as independent variable - down to a given fraction of , allows straightforward evaluation of the gravothermal energy generation rate up to the stellar surface, especially when mass loss (e.g. in contact binaries) plays a dominant role on the structure.
Given the grid point, and the dependent variable , the corrections can be found from the solution of the system (in Einstein notation):
where are the four canonical differential equations, and are the residuals. Since only two boundary conditions are known at the center, the values of cannot be found until the surface is reached. We then compute at each grid point the matrix elements µ and , and the vector elements such that
The only non-vanishing coefficients are:
; ; ; ; ; ; ; ;
Once reached the surface (base of the optical atmosphere) the system is closed by the integration of three optical atmospheres, with (L,R), (L+ L,R), (L,R+ R). Backward application of Eq. (A2) allows the evaluation of all the 's. Note that, with the above choice, and , and also all the other coefficients do not depart from unity for too many orders of magnitude, avoiding round-off and truncation errors. Also, during the iterations to convergency, the values are updated as
and new values of are differentially computed only after convergency.
9.3. Internal zoning, time steps and nuclear evolution
Internal zoning of the structure is reassessed at each physical timestep, with particular care in the central and surface regions, in the vicinities of convective boundaries and H or He-burning shells, and close to the superadiabaticity peak. Tipically, pre-main sequence and main sequence structures are resolved in grid points; red giants in grid points, of which in the thin H-burning shell; horizontal branch structures contain grid points and, during thermal pulses, up to grid points are often reached.
The physical time step is evaluated according to experience, allowing maximum variations, both integral and local along the structure, of several physical and chemical quantities. Among the integral quantities, total, CNO, and luminosities are considered; among the local ones, the four structural quantities and the central chemical compositions. The final time step chosen is obviously the shortest one out of the fifteen evaluated. For a solar-like star, evolution from pre-main sequence to turn-off takes physical time steps; He-flash is reached after time steps (no shell projection), in horizontal branch central He-exhaustion is reached in time steps, and one fully developed thermal pulse cycle, from peak to peak takes time steps.
So far we spoke of "physical" time steps. For the purposes of chemical evolution only, each physical time step is further divided into at least 10 "chemical" time steps. Any mechanism leading to a variation of chemical composition, such as nuclear evolution, gravitational settling and convective mixing, is repeatedly applied for the number of chemical time steps up to the reaching of the physical time step, projecting pressure and temperature to get also projected nuclear reaction rates. In this way, the evolution up to the He-flash can require up to chemical time steps, and the advancement of an H-burning shell from step to step is only a tiny fraction of its thickness.
As for the chemical evolution, we adopt the implicit scheme by Arnett & Truran (1969). It can be assumed equivalent to a first order Runge-Kutta, since it accounts for both the initial and the final chemical composition in the evaluation of the reaction rates. The integration error is then proportional to . The alternative approach to compute the rates for the initial abundances only can be instead assimilated to a zero order Runge-Kutta, and the integration error would be proportional to , being then much larger. To restore better integration precision in this latter case, it is customary to divide each physical timestep in a large number of chemical timesteps, decreasing in this way for each step. Also in code ATON 2.0, however, the physical timestep is divided in several chemical ones, as above mentioned, leading to almost vanishing numerical errors in the nuclear evolution integration.
If instantaneous mixing of convective regions is adopted (not recommended, since diffusive mixing is more physically sound), the average chemistry and reaction rates over all the region are evaluated, and the linearization procedure applied to the whole region as a single grid point. The very small variations of chemistry with time obtained in this way ensure enormously better numerical precision of integration than the alternative procedure of locally evaluating the new chemistries and then mixing.
9.4. Diffusive mixing
In the case of diffusive mixing, we must solve Eq. (1) to get the new chemical abundances at time for each element a at each mesh point i. Nuclear evolution and mixing are strictly interwined, so that their simultaneous resolution is invoked. We adopted a network of 22 nuclear reactions for 14 elements (Sect. 3.3).
The equation describing the rate of change of abundance for the nucleus a, having number density , is:
where ( = Avogadro's number).
Using a finite difference method based on a two-time level and three-point scheme, Eq. (A1) can be approximated by
where is computed at half-integer grid points. The boundary conditions have the meaning of no convective flux at the boundaries of convective (plus overshooting - if any) region, since no mass exchange with the non turbulent regions of the star is allowed.
Equation (A2.a) can be rewritten as
where ; ; where A(a,k) stands for the coefficients of the terms and B(a) stands for terms relative to time step . Note that the abundance of each element at a given grid point is coupled to the abundances of all the other elements at the same grid point, and to its own abundance at adjacent grid points. Since the two boundary conditions are met at the base and at the top of convection, the problem can not be explicitly solved until the whole convective region is addressed.
We now provide a description of the numerical method adopted to solve the system (A3, A2.a, A2.b).
For each convective region of Tot grid points, we should in principle compute, store and invert a matrix. A careful analysis of Eq. (A3) shows however that the storage of a matrix is sufficient, since only the matrix elements close to the diagonal are nonzero. Our problem has been reduced to solve a system , where , while .
Were A a square matrix, it would be possible to save computer time by applying the usual L-U (lower-upper) triangular decomposition (Crout's algorithm) such that . Iteratively evaluating L and U, and recalling that
one would get the vector x such that , and finally the vector y so that .
We adapted Crout's algorithm to our matrix. Being a and j two generic chemical elements and i the spatial grid point (from the base of the convective region , to the top ) the algorithms used to determine L and U are as follows:
Since the terms of the L and U matrices do not occupy the same location, and since each element of matrix A is used just once to evaluate the corrisponding ones of matrices L and U, these new elements can be stored in matrice A.
The iterative procedure to evaluate the vector x is:
Finally the new abundances for each element can be obtained from the following:
To further reduce storage allocation, it is again possible to store each new element Y(a,i) in the corrisponding location of X(a,i).
© European Southern Observatory (ESO) 1998
Online publication: June 2, 1998