next previous
Up: CESAM: A code

B. Appendix B

B.1. Sets of variables without central singularities

  With the lagrangian independent variable tex2html_wrap_inline5671, and for the variables tex2html_wrap_inline5673 and tex2html_wrap_inline5675 in place of R and L, one seeks exponents tex2html_wrap_inline5681, tex2html_wrap_inline5683 and tex2html_wrap_inline5685 in such a way that the gradients of pressure, radius and luminosity are O(1) in a neighborhood of the center, M=0. The gradients are written:
eqnarray1315
In the vicinity of the center the density, tex2html_wrap_inline5073, is tex2html_wrap_inline5693, therefore R=O(M1/3) and tex2html_wrap_inline5697; similarly, L=O(M) and tex2html_wrap_inline5701 and, at the limit tex2html_wrap_inline5703:
eqnarray1329
The singularities at M=0 are avoided if the exponents p, r and l are non negative integers; in Table 3 (click here) the exponents tex2html_wrap_inline5681, tex2html_wrap_inline5683 and tex2html_wrap_inline5685, deduced from the previous set of equations, are given for the values 0, 1 and 2, for p, r and l.

   

tex2html_wrap_inline5681 tex2html_wrap_inline5683 tex2html_wrap_inline5685
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
Table 3: With a lagrangian independent variable, the exponents tex2html_wrap_inline5681, tex2html_wrap_inline5683 and tex2html_wrap_inline5685 are given for the values 0, 1 and 2, for p, r and l. As seen the optimal accuracy (p=r=l=0), is reached only with non integer exponents for the mass and the luminosity, i.e., with tex2html_wrap_inline5739, tex2html_wrap_inline5741 and tex2html_wrap_inline5743

From Table 3 (click here), with the exponents tex2html_wrap_inline5739, tex2html_wrap_inline5741 and tex2html_wrap_inline5769, i.e., with the variables M2/3, R2 and L2/3, one ensures p=0, r=0 and l=0, therefore tex2html_wrap_inline5783, tex2html_wrap_inline5785 and tex2html_wrap_inline5787 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 tex2html_wrap_inline5095; any of them, tex2html_wrap_inline5097 for example, is written: tex2html_wrap_inline5793. In a neighbourhood of tex2html_wrap_inline5703, the gradient are tex2html_wrap_inline5797; with p=0 one has:
displaymath1351
while, if p=1:
displaymath1353
The last approximation only uses the term in tex2html_wrap_inline5803, therefore information is lost. Hence the set of exponents tex2html_wrap_inline5739, tex2html_wrap_inline5741 and tex2html_wrap_inline5769, i.e., the variables M2/3, R2 and L2/3, are optimal.

   

tex2html_wrap_inline5683 tex2html_wrap_inline5681 tex2html_wrap_inline5685
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
Table 4: The same as Table 3 (click here) but for eulerian variables. Note that the optimal accuracy (p=r=l=0) is not reached with tex2html_wrap_inline5819, i.e., with the variables used in . (26 (click here))

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)).

B.2. Setting a grid point at a given location.

  At each LMR the derivative of the temperature gradient is a discontinuous function. The numerical technique used for the integration of the equations of internal structure is based on an approximation of the unknown functions by piecewise polynomials (see Appendix B.5 (click here)). Between two mesh points, each polynomial piece is a differentiable function, therefore their derivatives are allowed to be discontinuous only at grid points where the polynomial pieces are connected; as a consequence, each LMR must be localized precisely on a knot; this allows, with an ad hoc choice of the basis, to have different values on left and right for the derivatives of the unknown functions. For sake of clarity in the discussion and the notation, one assumes that there is only one LMR where a discontinuity arises (labeled hereafter with the subscript "d''); the extension to several discontinuities is straightforward. The location of each discontinuity on a knot is obtained by a slight change of the algorithm used for the automatic mesh refinement; it is, basically, an inverse linear interpolation: The grid points are localized in such a way that, from a mesh to the next, the change of the distribution function is constant; inside each mesh, indexed by i, the relative weights of the variables are defined by the distribution factors tex2html_wrap_inline5089 and tex2html_wrap_inline5091 known within a factor tex2html_wrap_inline5847, tex2html_wrap_inline5849, which was, up to now, implicitly assumed to be the unity for each mesh, but it could be adjusted (iteratively) in order to set each LMR on the closest grid point; in other words, locally, for both sides of each LMR, instead of using the constant value C(t) the repartition constant is adjusted to the amounts just needed for fitting a grid point right on the LMR. Doing that, instead of Q(q), for tex2html_wrap_inline5855, one uses a "weighted distribution function", defined by pieces, as:


 equation1378
Analogously one also defines:


displaymath1381
The pieces of the function tex2html_wrap_inline5857 being connected by continuity: tex2html_wrap_inline5859, tex2html_wrap_inline5861. Therefore, instead of Eq. (20 (click here)), one uses:


 equation1388
Note that tex2html_wrap_inline5847 and tex2html_wrap_inline5865 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 tex2html_wrap_inline5867 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 tex2html_wrap_inline5873. Here each quantity with a "(j)'' superscript is related to the j-th iterated model, tex2html_wrap_inline5879 At the location tex2html_wrap_inline5881, where the discontinuity occurs, the distribution function, calculated with Eq. (22 (click here)), amounts to tex2html_wrap_inline5883; let l be the index of the nearest mesh point from the discontinuity (tex2html_wrap_inline5887) (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 tex2html_wrap_inline5881 such that tex2html_wrap_inline5895, therefore, for tex2html_wrap_inline5855, tex2html_wrap_inline5849, the weights tex2html_wrap_inline5901 can be defined by: tex2html_wrap_inline5903 and, for tex2html_wrap_inline5905:
displaymath1411
Hence, at the iteration tex2html_wrap_inline5905, the LMR will be closer, than previously, to the grid point with the index l. After convergence (tex2html_wrap_inline5915), tex2html_wrap_inline5917, tex2html_wrap_inline5919. The jump of the distribution function, between ql-1 and tex2html_wrap_inline5923 will satisfy:
displaymath1441
just that is needed. For j=0 the weights tex2html_wrap_inline5901 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.

  figure1467
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 tex2html_wrap_inline5937 slightly decreases and the LMR moves right. The adiabatic gradient tex2html_wrap_inline5939 , 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.

B.3. Precise external boundary conditions.

  As described Section 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. In the numerical solution of Eq. (11 (click here)), one assigns, among the tex2html_wrap_inline5367 grid points allowed for the atmosphere, a fixed index tex2html_wrap_inline5369 to the moving limit tex2html_wrap_inline4891; that is done by the piecewise logarithmic linear mapping: tex2html_wrap_inline5961 of tex2html_wrap_inline5963 in tex2html_wrap_inline5965 defined by:
 equation1489
Here the slopes tex2html_wrap_inline5969 and tex2html_wrap_inline5971 are defined by:
displaymath1499
hence one has:
tex2html_wrap_inline5973, at the bottom of the atmosphere where tex2html_wrap_inline4917,
tex2html_wrap_inline5977, at the inner limit where tex2html_wrap_inline4905,
tex2html_wrap_inline5981, at the upper limit of the atmosphere where tex2html_wrap_inline4911;

the index tex2html_wrap_inline5369 is a open parameter; with tex2html_wrap_inline5987, tex2html_wrap_inline5989 will lie in the vicinity of the middle of the interval tex2html_wrap_inline5991. From this mapping results a constant mesh size, it is an advantage of the algorithm. For the numerical solution it is convenient to add one more unknown: the temperature T, which fulfills the scalar equation tex2html_wrap_inline5995, and the boundary condition tex2html_wrap_inline5997. With the following variables, employed for the reconstitution of the atmosphere: tex2html_wrap_inline5999, tex2html_wrap_inline6001, tex2html_wrap_inline6003, tex2html_wrap_inline6005, tex2html_wrap_inline6007 and tex2html_wrap_inline6009, Eq. (11 (click here)) are written:


 equation1522
where tex2html_wrap_inline6011 (respt. tex2html_wrap_inline5971) if tex2html_wrap_inline6015 (respt. tex2html_wrap_inline6017). The boundary conditions are:


displaymath1557
here:
displaymath5945
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 tex2html_wrap_inline6019, tex2html_wrap_inline6021, tex2html_wrap_inline6023 and their derivatives with respect to tex2html_wrap_inline5141 and tex2html_wrap_inline6027. Typically, one uses from tex2html_wrap_inline6029 to tex2html_wrap_inline6031 grid points for the interval tex2html_wrap_inline5963. 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.

    tex2html_wrap6085
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 tex2html_wrap_inline6039 are in the first column, the bi in the last row, the remainder entries are the coefficient aij of the IRK matrix tex2html_wrap_inline6045

B.4. Stable integration with IRK formulas.

  With stiff problems, care must be taken for saving the stability; the procedures are briefly recalled here in the case of only one chemical element; let y0 (respt. y) be the abundance of that element at time t (respt. tex2html_wrap_inline6093). With the coefficients reproduced in Table 5 (click here), the IRK scheme is written:
 equation1628
where Tj, tex2html_wrap_inline6097 and yj are, respectively, the temperature, density and abundance at intermediate times tex2html_wrap_inline6101, tex2html_wrap_inline6103; s is the number of steps of the IRK formulae. This standard formulation for IRK schemes does not give satisfactory results for the evolution of the chemical composition: negative values for the abundances are observed; that is due to the amplification of the errors by large Lipschitz constants. The round-off errors are reduced if the first Eq. (A5 (click here)) is rewritten for the smaller quantities zi=yi-y0 (Hairer & Wanner, loc. cit., Sect. IV.8) as:
 equation1638
The matrix tex2html_wrap_inline6109 of any IRK Lobatto IIIC formulas is invertible therefore, with tex2html_wrap_inline6111, one hasgif dj=0 if tex2html_wrap_inline6119 and ds=1; then the second Eq. (A5 (click here)) is simply written:
 equation1655

B.4.1. Instantaneous mixing with IRK formulas.

In MZ the abundances have constant values as described Sect. 3.3.2 (click here); for the chemical species y, let tex2html_wrap_inline6127 be this mean. At time tex2html_wrap_inline6129, the mean, tex2html_wrap_inline6131, is approximated using the mid-point rule:
displaymath6123
here the sum involves all the meshes inside the MZ; y0,k+1/2 is the abundance at the mid-point, tex2html_wrap_inline6135 and:
 equation1666
Therefore Eq. (A6 (click here)) is written:
 equation1676
where tex2html_wrap_inline6137 (respt. tex2html_wrap_inline6139) is the temperature (respt. the density) at the intermediate point at time tex2html_wrap_inline6101; tex2html_wrap_inline6127 then is written:
 equation1701
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 schemegif 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.

B.4.2. Conservation of nucleus and charge numbers.

  For a number of chemicals tex2html_wrap_inline6159, let at time t:
displaymath6151
be any linear relationship between the abundances with fixed coefficient tex2html_wrap_inline6163, e.g. conservation of baryon and charge numbers are relationships of that form, then:


displaymath6152
Owing to the linearity of Eq. (A6 (click here)) and Eq. (A9 (click here)), for tex2html_wrap_inline4728 elements, with obvious notations:
displaymath6153
and:
displaymath6154
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.

B.5. Integration of the diffusion equation

  One seeks the Xi as piecewise polynomials of order tex2html_wrap_inline6169 with discontinuous first derivative at each LMR, i.e., tex2html_wrap_inline6171. For the calculations it is convenient to project them on their normalized B-spline basis, tex2html_wrap_inline6173 (see App. B (click here)), tex2html_wrap_inline6175, tex2html_wrap_inline6177 is the dimension of the basis; therefore tex2html_wrap_inline6179 is written:
 equation1747
One looks for the weak solutions of Eq. (30 (click here)) using the Petrov-Galerkin's formalismgif (Schatzman et al. ; Marchouk & Agochkov, ; Quarteroni & Valli, ): Let tex2html_wrap_inline6183 be the B-spline basis without discontinuity, i.e., tex2html_wrap_inline6185, constructed on the grid of tex2html_wrap_inline5527 - schematic representations of nodal vectors of tex2html_wrap_inline5527 and tex2html_wrap_inline6191 can be found App. B.5.2 (click here); for tex2html_wrap_inline6193, multiply both sides of Eq. (30 (click here)) with tex2html_wrap_inline6181, and integrate over the whole star:
 equation1771
with the standard notation tex2html_wrap_inline6197 for the inner product of two functions f and g. Due to the continuity of the fluxes Fi, the standard integration by parts gives:
 equation1780
Owing to the boundary conditions, tex2html_wrap_inline6205 at the center tex2html_wrap_inline6207, tex2html_wrap_inline6209 at the outer limit tex2html_wrap_inline6211 of the envelope and to the continuity of Xi and Fi, the set of Eq. (A12 (click here)) is written:
 eqnarray1791
here all the quantities are taken at the time tex2html_wrap_inline6093 except Xi(t) taken at time t. This fully implicit scheme is of order tex2html_wrap_inline5233 in space and of first order in time.

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).


next previous
Up: CESAM: A code

Copyright by the European Southern Observatory (ESO)
This email address is being protected from spambots. You need JavaScript enabled to view it.