next previous
Up: CESAM: A code

3. Solving the two-point boundary initial value problem

  The equations of stellar structure, Eq. (1 (click here)), and their numerical counterpart, Eq. (21 (click here)), are non-linear; in CESAM they are solved using the so-called damped Newton-Raphson method, which differs from the standard relaxation method (Clayton 1968, Sect. 6.4) by the fact that the change in the unknowns are reduced; that allows to follow the "good descent direction" given by the jacobian of the linearized equations (Conte & deBoor 1987, Sect. 5.2) of the non-linear problem solved as an optimization problem; doing that the time step remains of reasonable size, even with shell sources.

3.1. Overview on numerical integration

  With instantaneous mixing, the set of partial differential equation Eq. (1 (click here)) is an initial boundary value, integro-differential problemgif; for the numerical solution, following Henyey et al. (1959), it is split into two differential problems:

  1. The "evolution of chemicals" in this first step, the chemical composition is updated for the time step tex2html_wrap_inline4790, taking into account the mixing in MZ; in this first step, only tex2html_wrap_inline4760 changes, the other variables, i.e., P,T,R,L, remain fixed.
  2. The "quasi-static equilibrium", in this second step, the dependent variables, i.e., pressure, temperature, radius and luminosity, are adjusted to fulfill the quasi-static equilibrium with the value of the chemical composition, tex2html_wrap_inline4760, previously updated.
For each time step tex2html_wrap_inline4790, starting from an approximate solution, the two problems are solved sequentially until global convergence; the whole process is fully implicit; all the variables P, T, R, L, tex2html_wrap_inline4760 are centered at time t (Bressan et al. 1993 center the chemical composition at half time step, that save computing effort but can generate instabilities in case of stiffness).

3.2. Numerical solution of the "quasi-static equilibrium"

  The numerical solution of the quasi-static equilibrium is made using the B-spline collocation method described in Appendix C5; the basic idea is to seek the unknown functions as piecewise polynomials which are, by turn, projected on their B-spline basis of order tex2html_wrap_inline5013 (i.e., of degree tex2html_wrap_inline5015), therefore the (non-linear) discretized differential equations only involve the projections and are solved for them; finally, their knowledge allows to rebuilt the solution, i.e., the piecewise polynomials, for any location.

3.2.1. The lagrangian variables employed

  With the mass as the independent variable, the three first equations of the differential system Eq. (1 (click here)) have a singularity at center, tex2html_wrap_inline4826; to overcome the difficulty, Taylor series have been employed (Kippenhahn et al. 1968; Paczynski 1969). Here an alternate approach is applied: first, variables which avoid the central singularities are employed and, second, the equations are not written right at center, as quoted Appendix C5; therefore, for the first shell, there is no need of a peculiar algorithm. Owing to the exponents 2/3 and 2 which are optimal (see Appendix C1), among all sets of variables which avoid the central singularities, the Eggleton (1971) variablesgif:
 equation682
tex2html_wrap_inline5019, lead to the most precise numerical solution. From the surface to the center, the pressure and the temperature typically change, respectively, by eighteen and five orders of magnitude, therefore logarithms are used for those variables. In fine, the following set of lagrangian variables, free from central singularities, is employed:


 equation691

3.2.2. Automatic location of grid points

    Due to large gradients the density of mesh points cannot be kept constant along the model; moreover, in the course of an evolution, the areas affected by large gradients change, therefore the grid cannot kept fixed. The most usual method for grid refinement consists by adding or subtracting points according to criterions (see, for example, Henyey et al. 1959; Kippenhahn et al. 1968). Though this method is very simple in its principle, in practice, it is difficult to be properly implemented; an automatic mesh refinement is more convenient. Here, at a given time t, the number n(t) of mesh points is given and their locations are fixed by fulfilling the condition that, from one grid point to the next, the jump of a strictly monotonous "distribution function", tex2html_wrap_inline5025, is equal to a "distribution constant" C(t) (Eggleton 1971; Press et al. 1986, Sect. 16.5); at each time t the distribution of the grid points, tex2html_wrap_inline5031, therefore satisfies:


 equation709
The choice of tex2html_wrap_inline5025 is based on an a priori knowledge of the behavior of the solution. For each value t of the time, one defines an "index" function tex2html_wrap_inline5037 mapping tex2html_wrap_inline5039 on [1,n]; the shell with the index 1 (respt. n) corresponds to the center (respt. to the top of the envelope). Therefore the integration is made on an equidistant grid. In terms of the derivative of Q with respect to q:


 equation718
Eq. (16 (click here)) becomes:


 equation722
Note that Q is a linear function of q as soon as the Eqs. (17 (click here)) and (18 (click here)) are fulfilled. The change of variables tex2html_wrap_inline5053 gives:
displaymath727
where:
 equation729
can be derived from the analytic form of tex2html_wrap_inline5025. Thus, there are two more unknowns: tex2html_wrap_inline5057 and tex2html_wrap_inline5059; they fulfill a system of differential equations of first order with boundary conditions:


 equation732
here tex2html_wrap_inline5061 is computed by Eq. (15 (click here)) with the value of tex2html_wrap_inline4844 obtained at the bottom of the atmosphere. The set of equations to be solved on the equidistant grid, tex2html_wrap_inline5065 is therefore:


 equation744
The initial and boundary conditions are straightforwardly expressed in terms of q. Note that the derivative, with respect to time, of the specific internal energy and of the density should be taken along directions dtex2html_wrap_inline5069, i.e., dtex2html_wrap_inline5071, taking into account the change of mass due to the mass defect. Indeed, the solution, by the damped Newton Raphson scheme, of the non-linear Eq. (21 (click here)), necessitates the knowledge of the derivatives of tex2html_wrap_inline5073, tex2html_wrap_inline4710 and U, with respect to the mass, taking into account the changes of chemical composition; that is the more restrictive conditions imposed by the use of this automatic allotment of mesh points; it is also a consequence of the fact that the integro-differential problem, Eq. (1 (click here)), cannot be solved as a whole since, along the evolution, convective zones appear, disappear, cede or recede with not fixed limits. Moreover with an equidistant mesh in q, differences between close numbers are avoided; that is particularly sensitive in the external part of the envelope where the changes of mass between two adjacent grid points are very small.

3.2.2.1. Choice of Q.

Q should be a strictly monotonous, two times differentiable, function, and as simple as possible. By experiments, it has been foundgif that:
 equation787
is, in all, the most convenient form; for the two "distribution factors" tex2html_wrap_inline5089 and tex2html_wrap_inline5091, the heuristic values:
displaymath5081
are close to those used by Eggleton (1971). The function tex2html_wrap_inline5093 can now be explicitly calculated using Eq. (19 (click here)) and Eq. (21 (click here)). In the core, the pressure gradient is not large and the mesh refinement is monitored by the changes of tex2html_wrap_inline5095, i.e., the mass; while, in the outermost part of the envelope the repartition function is controlled by the changes of tex2html_wrap_inline5097, i.e., the pressure, due to its large gradient; there, from a grid point to the next, the mass changes are very small, typically tex2html_wrap_inline5099, even tex2html_wrap_inline5101, while for, the pressure, the changes are of the order of tex2html_wrap_inline5103 (with tex2html_wrap_inline5105, see next paragraph); a similar situation occurs on the neighborhood of shell sources.

3.2.2.2. Optimization of the number of grid points.

Between a PMS initial model and an evolved model at the beginning of the 4He burning, the central pressure is magnified by more than 30, that also affects the distribution constant C(t); the accuracy is ensured whatever the age is, if the repartition constant, is kept almost fixed with respect to time; that is done by increasing (or decreasing) the total number of shells in such a way that C(t) remains within tex2html_wrap_inline5113, of its initial value. With tex2html_wrap_inline5115, tex2html_wrap_inline5117 and tex2html_wrap_inline5119, the relative change in pressure within a shell is typically 10% and the number of zones in a PMS initial solar model is of the order of 250, it increases to tex2html_wrap_inline5121 at present solar age and more than tex2html_wrap_inline5123 at the onset of the helium flash.

3.2.2.3. Setting a grid point on a LMR.

The algorithm of automatic location of grid points has been extended in order to shift automatically a grid point in a close vicinity of each LMR; the method is described in Appendix B2.

3.2.3. Boundary conditions at center

  With respect to the independent variable q, the center corresponds to q=1, the three inner boundary conditions are simply written:
displaymath799

3.2.4. External boundary conditions

  As seen in Sect. 2.4.3 (click here), at time t, the bottom of the atmosphere is connected at the outermost boundary of the envelope by the three functions: pressure tex2html_wrap_inline4838, temperature tex2html_wrap_inline4840 and mass tex2html_wrap_inline4842 of the radius, luminosity and time; they are derived from the outer boundary conditions through a reconstitution of the atmosphere. With the variables of Eq. (15 (click here)), at q=n, the external boundary conditions for the envelope are written:
 equation808
where tex2html_wrap_inline5139, tex2html_wrap_inline5141 and tex2html_wrap_inline5061 are the values, at time t of, respectively, tex2html_wrap_inline5097, tex2html_wrap_inline5149 and tex2html_wrap_inline5095 at the bottom of the atmosphere, of radius tex2html_wrap_inline5153 and luminosity tex2html_wrap_inline5155, where the diffusion approximation becomes valid. Hence the grid adjustment solves trivially the problem of the open limit.

3.2.4.1. Simplified external boundary conditions.

In that case, tex2html_wrap_inline5157 and tex2html_wrap_inline5159; tex2html_wrap_inline4929 and tex2html_wrap_inline4856, are derived from Eq. (8 (click here)) with tex2html_wrap_inline5165 and tex2html_wrap_inline5167. The Rosseland mean opacity tex2html_wrap_inline4852 is a function of density and temperature, therefore the non-linear system of Eq. (23 (click here)) must be solved by iterations for tex2html_wrap_inline5139, tex2html_wrap_inline5141, tex2html_wrap_inline5061 and for their derivatives with respect to tex2html_wrap_inline5177 and tex2html_wrap_inline5179.

3.2.4.2. Precise external boundary conditions.

As described in Sect. 2.4.3, the precise reconstitution of an atmosphere consists in a differential problem, with boundary conditions at three different levels: tex2html_wrap_inline5181, tex2html_wrap_inline5183 and tex2html_wrap_inline5185; recall that, at tex2html_wrap_inline4919, defined by Eq. (10 (click here)), there is a open inner limit; the solution given to this numerical challenge is described in Appendix B3.

3.2.5. Gravothermal energy

  The gravothermal energy is writtengif:
 equation853
For stability purposes, at each collocation point, tex2html_wrap_inline5191 is discretized by the backward difference formula of first order:
 equation859
The use of this low order formula is justified by the fact that the entropy variations are negligible on the main-sequence, otherwise the models are so complicated that high order schemes can lead to instabilities and therefore are not recommended. In the plane (tex2html_wrap_inline5193), Eq. (24 (click here)) must be written along directions of constant mass, i.e., including the mass defects, dtex2html_wrap_inline5069 or dtex2html_wrap_inline5071; at time t, density and specific internal energy are derived, via EOS, from pressure, temperature and chemical composition (see Sect. 3.3.1 (click here)) obtained through the non-linear inverse interpolation scheme "tex2html_wrap_inline5201'':
displaymath5189
with tex2html_wrap_inline5207 (see Sect. 3.3.1 (click here)).

3.2.6. An eulerian set of variables

  Note that, with (R,t) as an eulerian independent variable, Eq. (1 (click here)) have no singularity but, as the stellar radius varies with respect to time, the external limit, at tex2html_wrap_inline5211, is an open limit; though that is not a difficulty for the numerical method of integration used - see Sect. 3.2.2 (click here) -, the lagrangian set of variables Eq. (15 (click here)), is preferred owing to its highest numerical accuracy as demonstrated Appendix B1. With the exponent 2/3 for tex2html_wrap_inline5179, in Eq. (15 (click here)), the luminosity must remain non-negative, i.e., tex2html_wrap_inline5215; otherwise, though less accurate, the following set of eulerian variables ought to be employed:
 equation889

Similarly, for the eulerian variables, one defines: tex2html_wrap_inline5217 and tex2html_wrap_inline5219. Equations, initial and boundary conditions are straightforwardly derived.

3.3. Numerical solution of the "evolution of chemicals"

  To be consistent it is desirable to be able to solve, with algorithms of same orders, the two differential problems, i.e., the "quasi-static equilibrium" and the "evolution of chemicals". One needs also a suitable monitoring of the time step derived, if possible, from an estimate of the accuracy of the integration.

3.3.1. Interpolation of chemicals

  Due to the change of mass caused by the mass defect and mass loss, the chemicals need to be known at any point in the star. Here, with the spline-collocation method employed for the numerical integration of the quasi-static equilibrium, the collocation points, where the discretized differential equation are fulfilled, differ from the grid points; moreover, due to the grid adjustment, the collocation points have not fixed values in mass; therefore an interpolation algorithm is needed for the knowledge of the chemical composition at any point of the interval tex2html_wrap_inline5227. In fact, interpolation is needed as far as grid points are moved or added during the evolution; on the other hand, interpolations create numerical diffusion which, in some extent, stabilizes the numerical solution. The interpolation scheme needs to be, at least, as precise as the integration algorithm. Here one seeks the distribution of chemicals as piecewise polynomials on a lagrangian mesh. Due to the assumption of spherical symmetry, in the vicinity of the center the gradients of abundances are written:
displaymath5221
Therefore
displaymath5222
with respect to the mass, the first derivative of the abundances have a singularity at the center so it cannot be interpolated accurately with respect to M using the variable such that tex2html_wrap_inline5207:
displaymath5223
the singularities are avoided. With diffusion (see Sect. 3.3.3 (click here)), the solution of the diffusion equation agrees with the piecewise polynomial of interpolation; otherwise piecewise polynomial interpolation, with order tex2html_wrap_inline5233, tex2html_wrap_inline5235, with respect to tex2html_wrap_inline5237 is used (see Appendix C5). An ad hoc choice of the B-spline basis allows to take the discontinuities into account. Owing to its linearity, the interpolation scheme is conservative for any linear set of the unknowns - a proof is given in Appendix C4; therefore the total charge, total baryon number and baryon numbers involved in the PP and CNO cycles remain constant, within roundoff errors.

Due to (i) the splitting in two steps of the integration of the whole problem, and (ii) to the ability of restoring the solution at any point, a grid can be especially designed for the chemicals; this net is refined in the inner parts (recall that thermonuclear reaction rates have a high power law dependence with respect to the temperature) where the nuclear reactions are active.

3.3.1.1. Management of discontinuities.

As noticed previously, a long-lasting discontinuity on chemical composition is an unphysical situation; therefore, when the diffusion is ignored, if no physical process is explicitly introduced, the discontinuities are smoothed by the numeric, the lower the order of the numerical scheme is, the more efficient is the smoothing. Satisfactory results have been obtained using, for a given time step, the mass points designed for the quasi-static problem, and for the next time step, mass points located at half distance between two neighbouring mass points designed for the quasi-static problem; ensuring, however, that the mass step, for the chemical composition is, at least, greater than tex2html_wrap_inline5239, except for each CZ where a minimum of 10 points is required. As far as a convective core increases, the chemicals undergo discontinuities at its limit, while, when it recedes, at any point localized in the zone between the previous and the new limits of the core, the values of abundances not only depend on the local temperature and density but, also, on how long that point has lasted in the mixed receding core; a similar situation occurs as soon as a MZ recedes from a radiative zone. Moreover in radiative zones, when the diffusion is ignored, though violating the physics, the discontinuities in chemicals formally stay so far they are not, again, embedded in a new extent of a convective zone. It is difficult to mimic in details and precisely all these tricky processes. In CESAM, the abundances at any point localized between the limit of a core and its location at the former time step, are obtained by linear interpolation, with respect to tex2html_wrap_inline5237, between their values at the new and at the previous locations of the limit.

3.3.2. Standard evolution

  In the radiative zones, without diffusion, the equations to be solved are written:
 equation924
In MZ, the chemical composition is homogeneous and the equations for the mean abundances can be written (see Sect. 2.3.1 (click here)):
 eqnarray930
therefore it is an integro-differential problem. Another numerical difficulty results from large ratios between the characteristic evolutionary time scales involved; they can be estimated by the ratio between the eigenvalues, tex2html_wrap_inline5245 and tex2html_wrap_inline5247, of minimum and maximum norms of the jacobian matrix:
displaymath5243
Typically, with the physical conditions at the center of the present Sun, tex2html_wrap_inline5249 K, tex2html_wrap_inline5251 g cm-3, one has:
displaymath953
Such differential problems are called "stiff" (Gear 1971; Hairer & Wanner 1991); special algorithms have been developed for their numerical solution; they ensure numerical stability even if the time step is larger than the smallest characteristic time scale. However, it is not possible to have accurate solution for all the variables, regardless of the size of the time step; therefore, owing to the stability of the scheme, the numerical errors are damped out, a given accuracy being ensured for variables of interest. Furthermore, chemical abundances being positive numbers, oscillations around zero (as observed with the trapezoidal rule) are unsatisfactory. The so-called "L-stable" schemes (Hairer & Wanner, loc. cit.) have good stability properties without oscillations; they are suitable for the integration of the evolution of chemicals abundances. Equations (27 (click here)) and (28 (click here)) and their numerical counterparts are non-linear; they are also implicit, as the L-stable schemes are. The L-stable Implicit Runge Kutta (IRK) Lobatto IIIC formula with ordersgif p=1, 2 and 4 are available in CESAM; their coefficients are reproduced Table 5 (Appendix B4), p=1 is the standard Euler's backward scheme (Hairer & Wanner, loc. cit.). For the Lobatto IIIC formulas with order p greater than two, values for the temperature and density are needed at intermediate time levels. They are estimated by interpolations of order four from successive models.

3.3.2.1. Stable integration with IRK formulas.

Emphasis is made on the fact that, with stiff problems it is of great importance to use special algorithms specially designed for IRK formula; those used in CESAM are described in Appendix B4.

3.3.2.2. Numerical control of the accuracy.

The comparison of solutions given by two IRK formula which differ by one order of accuracy, i.e., the so-called Fehlberg method (Stoer & Bulirsch 1979), allows an estimate tex2html_wrap_inline5271 of the numerical accuracy. Here the IRK formulas Radau IIA (Hairer & Wanner, loc. cit., Sect. IV.8) are used in connexion with Lobatto IIIC formulas. Let tex2html_wrap_inline5273 be the value required for the relative precision; an optimal value tex2html_wrap_inline5275 for the next time step is written:
displaymath969
here p is the order of the IRK formula. It has been observed that the robustness of the scheme is improved if only small changes for the time step are allowed for; therefore the estimate of the new time step tex2html_wrap_inline5279 is taken as:
 equation976

This precise control of the numerical accuracy, practically, doubles the computing time; it is prohibitive in most cases, therefore the time step is simply adjusted in such a way that the changes of the abundances remain within fixed limits tex2html_wrap_inline5281.

3.3.3. Evolution with diffusion

  With diffusion, for every tex2html_wrap_inline5283 (tex2html_wrap_inline5285), the set of equations to be solved is written:
 equation988
for tex2html_wrap_inline5287. As seen Sect. 2.3.1 (click here), the mixing in MZ is made by turbulent diffusion. Since Eq. (30 (click here)) holds everywhere, the evolution of the chemical composition is no longer an integro-differential problem but a differential problem with boundary conditions given by Eq. (7 (click here)) and Eq. (12 (click here)); it is a mixed parabolic/hyperbolic problem. At each LMR, the abundances Xi and the fluxes Fi are continuous functions with discontinuous first derivatives owing to the jumps of tex2html_wrap_inline5293 (see Sect. 2.3.1 (click here)). The method of integration of the diffusion equation, written in finite-elements form, is described in Appendix B5.

3.3.3.1. Efficiency of the mixing by diffusion.

Figure 1 (click here) plots, with respect to the mass fraction, the relative differences in sound velocity for two calibrated solar models calculated, respectively, with standard mixing and mixing by diffusion (tex2html_wrap_inline5295, tex2html_wrap_inline5297 and vi=0, tex2html_wrap_inline5301). The differences, at the level of 10-5, show the similar efficiency of both approaches. Figure 2 (click here) plots, with respect to the radius fraction, the normalized abundances of 2D, 3He, 7Li, 7Be, 12C at the onset of the main sequence for a non-standard solar model, evolved from PMS, including microscopic diffusion according to Michaud & Proffitt (1993); at that age (45 My) the convective core of the young Sun recedes, while the CZ is close to its present day location. One emphasizes on the well marked drop of the gradient of 2D and on the smooth profile of 7Li at the limit of the CZ; due to the mixing, in the convective core, the elements have a constant abundances except 8Be since its nuclear time is of the order of the mixing time (tex2html_wrap_inline5321100 days). As seen, the Petrov-Galerkin's solution is stable even with strong jumps of more than thirteen decades in the diffusion coefficients profiles.

  figure1012
Figure 1: Relative difference of the sound velocity between two calibrated solar models calculated with the two kinds of mixing: standard instantaneous mixing and diffusion. The low level of the differences shows that the two kinds of mixing have similar effects. The wiggly behavior for radius lesser than tex2html_wrap_inline5323 is a fossil signature of the discontinuities of chemicals at the limit of the convective core of the young sun; they are almost not smoothed because these calculations employed a low dissipative scheme for the interpolation of chemicals

  figure1017
Figure 2: Normalized abundances in a tex2html_wrap_inline4893 non-standard model at the end of the PMS. At that age (45 My) the convective core of the young Sun recedes and the CZ is closed to its present day location. At LMR the solution is stable even if jumps of more than thirteen decades affect the diffusion coefficients. The maxima respectively are: tex2html_wrap_inline5327, tex2html_wrap_inline5329, tex2html_wrap_inline5331, tex2html_wrap_inline5333, tex2html_wrap_inline5335


next previous
Up: CESAM: A code

Copyright by the European Southern Observatory (ESO)
web@ed-phys.fr