 |  |
Astron. Astrophys. 343, 251-260 (1999)
3. Versatile advection code
In this section, we discuss the software and numerical method used.
The physics results are described from Sect. 4 onwards. The Versatile
Advection Code (VAC, see Tóth 1996, 1997) is a general purpose
software package for solving a conservative system of hyperbolic
partial differential equations with additional non-hyperbolic source
terms, such as the MHD equations. VAC runs on PC's, on a variety of
workstations, on vector platforms, and we can also run in parallel on
a cluster of workstations, and on distributed memory architectures
like the Cray T3D and T3E, and the IBM SP (Keppens & Tóth
1998, Tóth & Keppens 1998). The code is written in the
dimension independent LASY syntax (Tóth 1997), so it can be
used as a convenient tool to handle HD and MHD one-, two-, or
three-dimensional problems in astrophysics and laboratory plasma
physics. The dimensionality of the problem and the actual set of
equations to solve are easily selected in a preprocessing step.
VAC uses a structured finite volume grid and offers a choice of
conservative, second order accurate, shock-capturing, spatial and
temporal discretization schemes. The spatial discretizations include
two Flux Corrected Transport variants and four Total Variation
Diminishing (TVD) schemes (Tóth &
Odstr il 1996). Temporal
discretization can be explicit, semi-implicit, or fully implicit. It
was recently demonstrated (Keppens et al. 1998, Tóth et al.
1998) how the implicit approach can be used very efficiently, for
steady-state and time-accurate problems possibly containing
discontinuities. Here, we expect smooth solutions to the steady-state
HD and MHD equations, so one can greatly benefit computationally from
fully implicit time stepping.
In this paper, we solve the polytropic HD
( ) Eqs. (1) and (2) in
Sects. 4.1 and 5. Magnetohydrodynamic equations are solved in
Sects. 4.2 and 6. We solve one-dimensional problems in Sect. 4
and two-dimensional problems in Sects. 5 and 6. In practice, this
means that the stellar winds we model are solutions of the equations
under the additional assumption of a prescribed symmetry in the
ignored directions. One-dimensional problems assume a spherical
symmetry, while 2D solutions assume .
Here, denotes the angle in a
cylindrical coordinate system
centered on the star with its polar and rotation axis as
z-axis.
Since we are interested in steady-state solutions, we use fully
implicit time stepping as detailed and demonstrated in Keppens et al.
(1998) and Tóth et al. (1998). The linear systems arising in
the linearized fully implicit backward Euler scheme are solved using a
direct block tridiagonal solver for the 1D problems and using a
preconditioned Stabilized Bi-Conjugate Gradient iterative solver (van der Vorst 1992) for the 2D cases. The Modified Block Incomplete
LU preconditioner is described in van der Ploeg et
al. (1997). We consistently used the TVD Lax-Friedrich (TVDLF)
spatial discretization (Yee 1989, Tóth &
Odstr il 1996) using
Woodward limiting (Collela & Woodward 1984). We typically
took Courant numbers . For all 1D
solutions and for the 2D hydrodynamic solutions, the steady-state is
reached when the relative change in the conservative variables from
one time level to the next drops below
. We use a normalized measure defined
by (Tóth et al. 1998)
![[EQUATION]](img22.gif)
where is the number of conserved
variables , and the superscripts
indicate the pseudo time level .
Since we are solving for smooth solutions, the numerical schemes can
easily achieve such accuracy in the steady-state solutions.
For the axisymmetric 2D MHD solutions, the way to ensure a zero
divergence of the magnetic field is non-trivial. Unless one uses a
scheme which keeps exactly in some
discretization, like the constrained transport method (Evans &
Hawley 1988), corrective action needs to be taken during the time
integration. This involves either including corrective source terms in
the equations which are proportionate to the numerically generated
divergence (Powell 1994, their use for TVDLF was first advocated by
Tóth & Odstr il
1996), or making use of a projection scheme (Brackbill & Barnes
1980) which involves the solution of a Poisson equation. These two
approaches can even be combined and such combination is also
beneficial for fully implicit schemes (Tóth et al. 1998). For
the 2D axisymmetric MHD wind solutions presented in Sect. 6, it proved
difficult to ensure a divergence free solution in a fully implicit
manner. Using explicit time stepping and employing the projection
scheme before every time step, we could get steady-state solutions
where which have acceptable
, although this time-marching method
is computationally much more costly than the implicit approach. The
use of Powell source terms alone proved inadequate for these wind
solutions, as fairly large errors are then advected into the whole
solution domain from the stellar boundary outwards.
VAC makes use of two layers of ghost cells surrounding the physical
domain to implement boundary conditions. A symmetry condition at a
boundary is then imposed by mirroring the calculated values in the two
physical cell layers adjacent to the boundary in these ghost cells.
The boundary conditions imposed at the stellar surface are extremely
important. We will emphasize them for all cases considered.
© European Southern Observatory (ESO) 1999
Online publication: March 1, 1999
helpdesk.link@springer.de  |