

| | | | ||||||||
| p | r=0 | r=1 | r=2 | l=0 | l=1 | l=2 | ||||
| 0 | 2/3 | 2 | 4 | 6 | 2/3 | 4/3 | 2 | |||
| 1 | 1/3 | 1 | 2 | 3 | 1/3 | 2/3 | 1 | |||
| 2 | 2/9 | 2/3 | 4/3 | 2 | 2/9 | 4/9 | 2/3 | |||
From Table 3 (click here), with the exponents
,
and
, i.e., with the variables M2/3,
R2 and
L2/3, one ensures p=0, r=0 and l=0, therefore
,
and
as expected.
Obviously other sets of exponents can be employed, the best of them is
chosen according to the following numerical criterion:
working with a scheme of, let say, third order, between two grid
points the dependent variables are quadratic polynomials
in
; any of them,
for example, is written:
. In a neighbourhood of
,
the gradient are
; with p=0 one has:
![]()
while, if p=1:
![]()
The last approximation only uses the term in
, therefore
information is lost. Hence the set of exponents
,
and
, i.e., the variables M2/3, R2
and L2/3, are optimal.
| | | | ||||||||
| p | r=0 | r=1 | r=2 | l=0 | l=1 | l=2 | ||||
| 0 | 2 | 2/3 | 4/3 | 2 | 2/3 | 4/3 | 2 | |||
| 1 | 1 | 1/3 | 2/3 | 1 | 1/3 | 2/3 | 1 | |||
| 2 | 2/3 | 2/9 | 4/9 | 2/3 | 2/9 | 4/9 | 2/3 | |||
From table 4 (click here), where the exponents for eulerian variables are given, one sees that the highest accuracy cannot be obtained with the set of variables of Eq. (26 (click here)).
![]()
The pieces of the function
being connected by continuity:
,
.
Therefore, instead of Eq. (20 (click here)), one uses:
![]()
Note that
and
are step functions.
Due the facts (see Appendix B.5 (click here)), that at grid points first, the
differential equations are not written and, second, discontinuous derivatives
are allowed for, the discontinuities of
are implicitly managed.
Let, at time t, a solution of Eq. (21 (click here)) be known and Qi(0)(q) be
the weighted distribution function defined by Eq. (A1 (click here)) with
. Here each quantity with a "(j)'' superscript is
related to the j-th iterated model,
At the location
, where the discontinuity occurs, the distribution function,
calculated with Eq. (22 (click here)), amounts to
; let l be the index
of the nearest mesh point from the discontinuity (
) (in this
discussion
one simplifies by assuming that the index l does not change as it does,
sometimes, in the calculations); since
Q(j)(q) is a strictly monotonous function, there is only a
unique value
such that
,
therefore, for
,
, the weights
can be defined by:
and, for
:

Hence, at the iteration
, the LMR will be
closer, than previously, to the grid point with the index l.
After convergence (
),
,
.
The jump of the distribution function, between ql-1 and
will satisfy:
![]()
just that is needed.
For j=0 the weights
are initialized to unity and
updated between each Newton-Raphson iteration of the quasi-static equilibrium
problem with Q(j)(q) and q(j)D derived from the locations of the
LMR at the (j-1)-th iteration, for j>0.
Figure 7 (click here) shows a typical displacement of a grid point
toward a LMR (see also Fig. 5 (click here)). In this simplified case only
three iterations have been necessary to set a grid point on the LMR.

Figure 7: Automatic adjustment of a grid point on the limit between a radiative
and a convective zone.
Two iterations have been needed to push a grid point towards the LMR; during
the process the radiative gradient
slightly decreases and
the LMR moves
right. The adiabatic gradient
, full line, remains unchanged.
The initial
locations of the grid points (empty squares), are moved to the right at the
first iteration (empty circles) and slightly right again at the second on
(full circles)
This iterative process is only of first order. It will converge only if the functions considered are sufficiently smooth and, moreover, if the LMR is sufficiently well defined, as in the case illustrated in Fig. 7 (click here); it is the case for the external LMR of the Sun and for the convective core of stars of intermediate mass. On the other hand, for semi-convective zones or convective cores with diffuse LMR, as for the convective core of the young Sun, the closest index l, from the LMR, is not well fixed and the algorithm may not converge; fortunately, in such cases, the jump of the slope of the gradient is almost zero, therefore a mislabelling of a small jump in the slope of the gradient has almost no consequence.


where
(respt.
) if
(respt.
). The boundary
conditions are:

here:
![]()
The numerical solution of the non-linear differential problem
Eq. (A4 (click here)), with its boundary conditions at three different
levels, is solved using the B-spline collocation method
(see Appendix B.5 (click here)). The iterative process is initialized either,
with an approximate model of the solar atmosphere for PMS or ZAMS initial
models or, along the evolution, with the atmosphere of the previous model .
The solution gives
,
,
and their derivatives with respect
to
and
.
Typically, one uses from
to
grid points for
the interval
.
With B-splines of order 3, there are from 59 to 99 points where
Eqs. (A4 (click here)) are fulfilled; due to the
superconvergence (see Sect. B.5 (click here)), the order of the scheme is 4.

Table 5: Coefficients in Eq. (A5 (click here)) for the IRK formulas Lobatto IIIC
(see text) of order p=1,2,4 with s=1,2,3 steps.
As usual, the
are in the first column, the bi
in the last row, the remainder entries are the coefficient aij
of the IRK matrix ![]()

In MZ the abundances have constant values as described Sect. 3.3.2 (click here);
for the chemical species y, let
be this mean. At time
, the mean,
, is approximated using the mid-point rule:
![]()
here the sum involves all the meshes inside the MZ; y0,k+1/2
is the abundance at the mid-point,
and:
![]()
Therefore Eq. (A6 (click here)) is written:

where
(respt.
) is the temperature
(respt. the density) at the intermediate point at time
;
then is written:
![]()
The extension to several chemical elements of Eq. (A6 (click here)) to
Eq. (A10 (click here)) is straightforward. Note that, with the use of the
mid-point rule, Eq. (A8 (click here)) for
the numerical approximation the integral of Eq. (28 (click here))
over the MZ, is only of second order; a two-points Gaussian formula
(i.e. third order accuracy) will be more appropriate. The error is not
important in the solar case since the thermonuclear
reactions are not really efficient in MZ.
In CESAM, Eq. (A6 (click here)) to Eq. (A10 (click here)) are solved iteratively using
Newton-Raphson scheme
with an analytical jacobian updated at each iteration;
the initial values of the zi are fixed to zero; the quadratic iterative
process is halted as soon as the corrections on the zj are less
than 10-8 in relative values; most of the time, the
convergence is reached in less than five iterations.
![]()
Owing to the linearity of Eq. (A6 (click here)) and Eq. (A9 (click here)), for
elements, with obvious notations:
![]()
and:
![]()
therefore, with IRK formulae, the number of baryons and the number of
charges
are exactly conserved up to the accuracy of the closure of the Newton-Raphson
scheme.


One emphasizes the following three facts: (i) in Eq. (A12 (click here)) the discontinuities of the first derivatives of the Xi are implicitly taken into account by the integral formulation, (ii) the use of the B-spline basis is convenient because the algorithms remain simple even if the locations of the LMR change with time, (iii) the Petrov-Galerkin formulation only involves first order derivatives, (iv) the fully implicit scheme has no restrictive time step condition (Richmyer & Morton 1967).