Astron. Astrophys. 355, 929-948 (2000)

## Appendix A: The explicit expression of Eq. (18)

Here we sort out the explicit expression (20) of the solution (18) for , by calculating the matrix . Let us first introduce the simplified notation:

For the sake of example, we present here the detailed solution in the case of three shells (). The relevant system of equations (17) becomes:

where all the coefficients are considered as constants (see Sect. 3.2), though we have omitted the bar over and for simplicity. A system like (A.2) holds for each chemical species i, but the characteristic matrix is the same for any i (see Sect. 3.2); in this case:

Let us first note, from the definition (9), that and can never be both positive: at least one of them must be zero since they are "activated" in the opposite cases of inflow or outflow at , respectively; if there is no flow at all through , they both reduce to zero. Therefore, in our calculations we are always entitled to use the condition:

The eigenvalues of the matrix are

and the associated eigenvectors are:

From (19) we get:

where we have indicated with:

Defining:

the solution (18) in the case becomes:

With zero flow velocity (), (A.4) reduces to the solving formula of the original static model (see PCB98). Notice that the solution for the shell includes not only the contribution of the contiguous shell, but also a contribution from the shell "scaled" by its passage through the shell. Similarly, the shell is affected not only by the , but also by the shell though they are not contiguous.

With analogous procedure, for an arbitrary number N of shells the solution is of the kind:

where:

and the quantities and are constructed by means of recursive formulae:

The coefficients and describe the contribution of the generic shell l to the chemical evolution of k. Notice that a shell external to k () can influence k only if all the inflow coefficients in between l and k are non-zero, namely if there is a continuous inflow from l to k, as expected. The same holds for inner shells , whose contribution , is non-zero only if none of the intermediate outflow coefficients is zero. The solution (A.5) gets more and more complicated the larger the number N of shells considered, since each shell formally feels the contribution of all the other shells (as already noticed in the above case ). This occurs because (A.5) would be the exact an alytical solution in the case of a differential system with constant coefficients, namely if the matrix in (17) were constant. Then, (A.5) would describe the complete evolution of any shell k, which over a galaxy's lifetime would indeed process and exchange gas drifting from or to rather distant shells. But is not constant even when the flow pattern , , is constant, because and therefore evolve in time due to SF; in fact, we apply (A.5) only upon short timesteps , within which can be considered approximately constant. If is short enough with respect to the radial flow velocities - as guaranteed by the Courant condition , see Sect. 3.2 -, we can assume that within the k-th shell is affected just by the flows from the contiguous shells k+1 and k-1, and not from more distant shells, although all of them formally contribute to the solution. In this approximation we neglect all higher order terms in and , namely all the terms and , keeping only the "linear" terms of the kind and ; so the general solution (A.5) reduces in fact to (20).

## Appendix B: Testing the numerical model

Since discretized numerical solutions for partial differential equations containing an "advection term" tend to be affected by instability problems (e.g. Press et al. 1986), we tested our numerical code with gas flows against suitable analytical cases. We report here two representative tests involving pure gas flows (no SF) which allow for exact analytical solutions; to these we compare the predictions of our numerical code with a SF efficiency dropped virtually to zero.

Selecting the timestep . The first reference analytical case is that of a purely gaseous disc of infinite radial extent and flat profile, where the gas is:

1. accreting uniformly with a time-scale ;

2. flowing inward with a constant (in time) and uniform (in space) velocity v, starting from the "inflow onset time" .

Such a system is governed by the same differential equation (13) describing the adopted boundary condition at the outer disc edge in the chemical model (Sect. 3.1.2). Eq. (13) is a linear, first order, partial differential equation, equivalent to the system:

Eq. (B.1a) is solved as:

and substitution into Eq. (B.1b) yields:

This linear, first order, ordinary differential equation is solved as:

Finally, replacing back:

we get:

Let us now set the initial conditions at . If radial flows "activate" at a time the surface density distribution for is determined just by the accretion profile:

(see Eq. 2) and Eq. (B.3) becomes in fact Eq. (14). Here in our test case, Eq. (14) is the exact analytical description of the surface density profile over the whole disc (a part from the centre , which is a singular point).

As a representative test, let's consider the case  Gyr, and  km sec-1. The relevant analytical solution is plot in Fig. B.1 for  Gyr (thick solid line). The numerical models used for comparison cover the radial range 2 to 20 kpc and adopt a flat accretion profile . Their outer edge does match exactly with the analytical counterpart, since the boundary condition at  kpc is given by the analytical expression (14) itself. But the predictions of numerical models at inner radii tend to deviate from the reference density profile, and the mismatch is larger:

1. the larger the typical timestep of the model;

2. for a fixed timestep, the thinner the shells (compare upper to lower panel).

 Fig. B1. Numerical models compared to the exact analytical solution for a flat accretion profile with inflows. Different models correspond to different typical timesteps (see legend on top right) and to different shell spacing (upper to lower panel).

For a typical shell width of 1 kpc, for instance, a good match is obtained with model timesteps of  Gyr, while model shells of 0.5 kpc an acceptable profile is obtained only with timesteps of  Gyr. Therefore, a reliable representation of radial gas flows is obtained only with a suitably small timestep; how small, is related to the width of the shells, namely to the resolution of the grid spacing.

Selecting the grid spacing. Since our models are to simulate a disc with an exponential profile, as a second test we consider a gaseous disc with uniform and constant infall time-scale and inflow velocity, analogous to the previous case, but with an exponential profile. Namely, in the representative differential equation (12) the accretion profile declines exponentially outward:

Eq. (12) can then be written:

This is another linear, first order, partial differential equation of the same kind as (13), and can be solved with analogous procedure into:

Notice that Eq. (B.3) for a flat profile is recovered from (B.4) for . If radial inflows set in at time , from

we get:

We compared this second analytical case to our numerical model, where an exponential accretion profile was adopted between 2 and 20 kpc, and at the outer edge the boundary condition (14) was replaced by (B.5). Our tests showed that in this case the analytical profile is better reproduced the larger the number of shells, i.e. the finer the grid spacing. A good match is obtained especially when model shells are equally spaced in the logarithmic, rather than linear, scale; namely when the shells are chosen, in this case of an exponential accretion profile, so as to contain roughly the same mass, rather than cover the same radial width. Fig. B.2 shows in fact the analytical solution (B.5) (for  kpc, , and ) together with a corresponding numerical model with 40 shells logarithmically spaced (from 0.1 kpc wide for the inner ones to 1 kpc wide for the outer ones).

 Fig. B2. Exact analytical solution for an exponential accretion profile with inflows compared to a numerical model with 40 shells equally spaced in logarithmic scale.

With such a grid spacing, our tests with the reference flat profile of Fig. B.1 indicate  Gyr as a suitable timestep to obtain stable solutions for velocities up to the order of 1 km sec-1.

In the light of all these tests, in our chemical models we adopted a grid spacing of 35 shells from 2.5 to 20 kpc, equally spaced in logarithmic scale and a typical timestep of  Gyr (see Sect. 3.2). Of course, the suitable timestep depends also on the velocity field: flows with higher velocities require shorter integration timesteps. Whenever we need to consider much larger speeds than 1 km sec-1, as might be the case for the strong flows induced by the Bar, we reduce the timestep in proportion.

© European Southern Observatory (ESO) 2000

Online publication: March 21, 2000