Skip to main content

Artificial viscosity in comoving curvilinear coordinates: towards a differential geometrically consistent implicit advection scheme

Abstract

We propose a modification for the tensor of artificial viscosity employable for generally comoving, curvilinear grids. We present a strong conservation form for the equations of radiation hydrodynamics for studying nonlinear pulsations of stars. However, the modification we propose is of general mathematical nature. We study a differential geometrically consistent artificial viscosity analytically and visualize a comparison of our approach to previous implementations by applying it to a simple self-similar velocity field which has a direct application in stars as the fundamental mode of pulsation is radial. We first give a general introduction to artificial viscosity and motivate its application in numerical computations. We then show how a tensor of artificial viscosity has to be designed when going beyond common static Eulerian or Lagrangian comoving rectangular grids. We derive and state the modified equations which include metrical terms that adjust the isotropic (pressure) part of the tensor of artificial viscosity.

1 Background

In astrophysics a multitude of systems and configurations are described with concepts from hydrodynamics, often combined with gravitation, radiation and/or magnetism. Mathematically radiation hydrodynamics (RHD) and magnetohydrodynamics (MHD) are described by systems of coupled nonlinear partial differential equations. The Euler equations of hydrodynamics, the Maxwell equations as well as radiative transport equations are hyperbolic PDEs that connect certain densities and fluxes via conservation laws. The numerical solutions of these equations essentially need to comprise this quality. Today there exists a wide range of numerical schemes for conservation laws that ensure the conservation of mass, momentum, energy etc. if applied properly. Multiple fields in physics and astrophysics have adopted these sophisticated numerical methods for studying various applications.

Standard numerical methods for partial differential equations are established under the assumption of classical differentiability. Routine finite difference schemes of first order usually smear or smoothen the solution in the vicinity of discontinuities as they come with intrinsic numerical viscosity. Standard second-order methods often suffer from the Gibbs phenomenon, where oscillations around shocks emerge. In the past decades so-called high-resolution methods have been developed in order to achieve proper accuracy and resolution for nonlinear, discontinuous problems as they appear also in RHD or MHD. High order explicit Gudonov schemes have been dominating numerical applications and literature for the past decades. This trend was amplified by the enormous advancements made in parallel computing over the past decades.

In this work we consider physical configurations and problems that demand implicit advection schemes due to stability requirements. The parallelization of implicit nonlinear advection schemes, however, is still merely partially possible (solvers such as GMRES (Griewank and Walther [2008]) solve the linear sub-problems in parallel but iteratively in a sequential fashion for each time step). Hence it is desired to minimize the number of grid cells particularly for implicit schemes, where usually the inversion of a nonlinear matrix consumes a major part of the computational power needed. We suggest the adoption of problem oriented grids in combination with a modified artificial viscosity (which we will motivate in Section 1.1) for curvilinear coordinates. In higher-dimensional problems this artificial viscosity emerges as a tensorial quantity, which we demonstrate in Section 1.3. The result present in this paper can be seen as a tensor analytical consequence of the artificial viscosity in general curvilinear coordinates when using consistent metric tensors. In Section 2 we propose a correction for the commonly used tensor of artificial viscosity for curvilinear grids.

This correction is motivated by astrophysical applications where we consider time-dependent comoving nonlinear coordinates represented by non-conformal (non-angle preserving) maps from spherical coordinates. The authors are currently investigating the generation of grids that are asymptotically spherical but which allow certain asymmetries that can be found in rotating configurations as well as nonlinear pulsation processes in stars. This new approach to grid-based astrophysical simulation techniques will be addressed extensively with numerical applications in a future paper.

As an example of non-conformal two-dimensional coordinates, Figure 1 shows a grid that corresponds to the map (x,y)(ξ,η),

x = ξ cos η , y = ( a 1 ξ + a 2 ξ 2 ) ( 1 + a 3 π 3 16 a 2 ξ + a 2 a 3 π 3 ξ 4 π ( 1 + a 2 ξ ) η + 4 a 2 ξ a 3 π 3 a 2 a 3 π 3 ξ π 2 ( 1 + b 2 ξ ) η 2 + a 3 η 3 ) sin η
(1)

which yields standard orthogonal polar coordinates for the choice of parameters ( a 1 , a 2 , a 3 )=(1,0,0). In such a nonorthogonal grid the metric tensor is no longer diagonal and one has to consider a consistent differential geometric approach to the formulation of the governing equations of RHD and MHD, and also to the mathematical formulation of the artificial viscosity, which will be stressed in Section 2.

Figure 1
figure 1

Example of a non-conformal non-steady 2D grid with oblateness governed by three choices of parameters ( a 1 , a 2 , a 3 ) as defined in equation ( 1 ). (a) corresponds to ( a 1 , a 2 , a 3 ):(1,0,0), (b): (0.8,0,0), (c): (0.8,0,0.5) and (c): (0.8,0.2,0.5).

The benefit of the consistent formulation is especially evident when considering time-dependent grids, e.g. when using time-dependent parameters ( a 1 , a 2 , a 3 ) in (1). We refer to the Appendix for a depiction of the system of equations of RHD for generally comoving curvilinear coordinates with time-dependent metrics.

1.1 Brief introduction to conservation laws

For the sake of stringency we recapitulate some important results from the theory and numerics of conservation laws and thereby introduce a few mathematical terms needed to motivate artificial viscosity. We refer to LeVeque ([1991]) and Richtmyer and Morton ([1994]) for the complete picture.

The equations of RHD and MHD form a system of hyperbolic conservation laws that describe the interaction of a density function d(x,t): R n ×[0,) R m and its flux f(d): R m R m × n . Equation (6) shows how a concrete choice for the density and the flux field can look like in a given coordinate system.

The temporal change of the integrated density in a connected set Ω R n then equals the flux over the boundary Ω, i.e.,

t Ω ddV+ Ω fndS=0for all t>0,
(2)

where n is the outward oriented normal of the surface.

The system is called hyperbolic if the Jacobian matrix d f associated with the fluxes has real eigenvalues and if there exists a complete set of eigenvectors. In case of MHD and RHD this property has a direct physical relevance (Pons et al. [2000]).

Assuming f to be a continuously differentiable function, equation (2) can be rewritten via the divergence theorem as

t Ω ( t d + div x f ( d ) ) d V d t = 0 for all  t > 0 , Ω R n ,
(3)

which gives a system of partial differential equations for the density function d:

t d+ div x f(d)=0for all t>0,x R n .
(4)

With an initial condition d(x,0)= d 0 (x), x R n , this is called the Cauchy problem.

In order to illustrate the connection of hydrodynamical applications to this formalism, we express the Euler equations in the form (4). The appearing variables are the gaseous density ρ(x,t), the gas velocity u(x,t), the inner energy ϵ(x,t) and the gaseous pressure tensor P(x,t). Considering the differential form (4), we recognize the continuity equation, the equation of motion and the energy equation as the components of the hyperbolic problem. In case of the most relevant problem, that of 3D hydrodynamics, the density and its flux are given as

d=( ρ ρ u ρ ϵ ) R 5 ,f(d)=( ρ u T ρ u u T + P ρ ϵ u + ( P u ) T ) R 5 × 3 .
(5)

For a given coordinate system with base vectors e i , the tensorial fields are given explicitly as (using the Einstein notation)

d=( ρ ρ u i e i ρ ϵ ),f(d)=( ρ u i e i T ( ρ u i u j + P i j ) e i e j T ( ρ ϵ u i + P j i u j ) e i T ).
(6)

The gaseous pressure tensor can be assumed to be isotropic in most applications, which means that P= g i j p where p(x,t) is the scalar gas pressure and g i j = e i T e j the contravariant metric tensor. In case of adaptive grids the base vectors are time-dependent as well, i.e., e i = e i (x,t).

Since even the simplest one-dimensional scalar conservation laws like the Burgers’ equation have classical solutions only in some special cases, one has to broaden the considered function space of possible solutions. For the so-called weak solutions, we appeal to generalized functions where the discontinuities are defined properly. The generalized concept of differentiation of distributions shifts the operations to test functions γ: R n × R + GR (G open) which are infinitely differentiable and have a compact support (meaning that for each γ there exists a closed and bounded subset K such that γ(x,t)=0 for all xGK). We denote this space of test functions by D(G). In this generalized space of solutions the Cauchy problem (3) is written as

t 0 R n ( t d + div x f ( u ) ) γdVdt=0for all γD(G).

The weak formulation of the conservation law (3) is obtained by shifting the derivatives to the test functions by partial integration, and by using the compactness of the support. We get that the following has to hold for each γD(G):

t 0 R n ( d t γ + f ( d ) x γ ) d V d t = R n γ ( x , 0 ) d 0 ( x ) d V .
(7)

The function d L is called a weak solution of the PDE (4), if it satisfies (7) and dU with d 0 L . However, there is a small drawback. This weak solution is not necessarily unique and usually further constraints have to be imposed in order to guarantee its uniqueness. This leads us to the actual topic of this paper.

1.2 Introduction to artificial viscosity

For most physical problems it is sufficient to look for weak solutions from the function space of piecewise continuously differentiable functions. Constraining the space of solutions in this way, we call the physical variables d weak solutions of the Cauchy problem (4), if they are classical solutions wherever they are continuously differentiable, and if at discontinuities (shocks) they satisfy additional conditions in order to be physically reasonable (we elaborate on these conditions below).

The mathematical theory provides several techniques to distinguish physically valuable solutions out of a manifold of mathematically possible. One method is to add an artificial viscosity term to the right-hand side of (4), to get the equation:

t d+ div x f(d)=ενΔd,ε>0
(8)

and then consider the limiting case ε0. This idea is motivated by physical diffusion which broadens sincere discontinuities to differentiable steep gradients at the (microscopic) length scale of the mean free path of the particles. The physical solution of the weakly formulated problem is thus the zero diffusion limit of the diffusive problem. However, in practice this limit is difficult to calculate analytically and hence simpler conditions have to be found. A common technique to do this is motivated by continuum physics as well. Here an additional conservation law is set to hold for another quantity - the entropy of the fluid flow - as long as the solution remains smooth. Moreover, it is known that along admissible shocks this physical variable never decreases, and the conservation law for the entropy can be formulated as an inequality.

We denote the (scalar valued) entropy function by σ(d) and the entropy flux function by ϕ(d), and they satisfy

t σ(d)+ div x ϕ(d)=0.
(9)

Assuming the functions to be differentiable, we may rewrite this conservation law via the chain rule and the equation (4) as

d σ(d) div x f(d)= div x ϕ(d),
(10)

where in higher-dimensional case the appearing matrices of gradients have to fulfill further constraints, see e.g. Godlewski and Raviart ([1992]). For scalar equations, it is always possible to find an entropy function of this kind. Furthermore it is assumed that the entropy function is convex, i.e.

d 2 σ>0,for all dU.
(11)

To get our actual entropy condition, we first rewrite our entropical conservation law (9) in the viscous form

t σ(d)+ div x ϕ(d)=ε d σ(d)Δd.
(12)

Integrating over an arbitrary time interval [ t 0 , t 1 ] and a connected set Ω R n , and using partial integration, we find that

t 0 t 1 Ω ( t σ ( d ) + div x ϕ ( d ) ) d V d t = ε t 0 t 1 Ω ( x d d σ ( d ) ) n d S d t ε t 0 t 1 Ω x , i d 2 σ ( d ) x , i d d V d t , 2 σ ( d ) > 0 .
(13)

When we now consider the non-diffusive limit ε0, the first term on the right-hand side vanishes without further restriction whereas the second term has to remain non-positive. Then, using partial integration and the divergence theorem we obtain the entropy condition

Ω σ ( d ( x , t 1 ) ) d V Ω σ ( d ( x , t 0 ) ) d V t 0 t 1 Ω ϕ ( d ) n d S d t .
(14)

For bounded, continuous pointwise solutions d of (12) such that d d for ε0, the vanishing viscosity solution d is a weak solution of the initial value problem (3) and fulfills entropy condition (14). Generally spoken, applying the entropy condition to systems with shock solutions unveils those propagation velocities that ensure that no characteristics rise from discontinuities which would be non-physical. For detailed motivation, stringent argumentation and proofs to mathematical techniques presented in this section we refer to Harten et al. ([1976]) and LeVeque ([1991]).

1.3 Numerical artificial viscosity

As mentioned we are looking for high-resolution methods for nonlinear PDEs derived from hyperbolic conservation laws. In the past decades major efforts have been made in developing numerical methods for these problems that are at least of second order. One patent attempt to finding such a high-resolution method is to adapt a well-known high-order method for linear problems for nonlinear problems (such as the Lax-Wendroff scheme (Lax and Wendroff [1960])).

As illustrated above we can add an artificial viscosity term to the conservation law in a way that the entropy condition is satisfied and non-physical solutions are excluded. The viscosity term has to be designed in such a manner that it affects sincere discontinuities but vanishes sufficiently elsewhere so that the order of accuracy can be maintained in those regimes where the solution is smooth. The idea of numerical artificial viscosity was inspired by physical dissipation mechanisms and dates back more than half a century to von Neumann and Richtmyer ([1950]).

We denote as customary the approximate solution of the exact density d(x,t) at discrete grid points d( x j , t n ) by D j n , and set D= [ D 1 D k ] T , where k is the total number of grid points. The numerical representation of the flux function f(d) is denoted respectively by F(D), where [ F ( D ) ] j =f( D j ). The numerical flux function gets modified by a an artificial viscosity Q [ D ] j for instance in the following way:

[ F visc ( D ) ] j = [ F ( D ) ] j h [ Q ( D ) ] j ( D j + 1 D j ),
(15)

where h denotes the resolution of the spatial discretization, h= x j + 1 x j . Since the original design of the additional viscous pressure in the scalar form, Q=cρ ( Δ u ) 2 , cR, as suggested in von Neumann and Richtmyer ([1950]) for one-dimensional advection t d+a x d=Q x x d, it has undergone a number of modifications and generalizations. It has turned out to be numerically preferable to add a linear term (see Landshoff ([1955])) in order to control oscillations. Generalizations to multi-dimensional flows mostly retain the original analogy to physical dissipation and reformulate the velocity term accordingly, see e.g. Wilkins ([1980]).

The artificial viscosity broadens shocks to steep gradients at some characteristic length scale, but should not cause too large smearing. The concrete composition and implementation of this artificial viscosity coefficient Q depends on the application. As an example we discuss the following form of the tensor of the artificial viscosity in higher-dimensional RHD numerics. Similar forms of artificial viscosity can be found also in pure hydrodynamics and MHD calculations in 2D and 3D.

Tscharnuter and Winkler ([1979]) pointed out that the viscous pressure in 3D radiation hydrodynamics has to unravel the normal stress, quantified by the divergence of the velocity field and the shear stress, which is expressed by the symmetrized gradient of the velocity field according to the general theory of viscosity. It is designed to switch on only in case of compression ( div x u<0), and this is all ensured by the form

Q= q 2 2 l visc 2 ρmax( div x u,0) ( [ u ] s 1 3 e div x u ) ,
(16)

where the symmetrization rule is defined componentwise for the lower indices as

( [ u ] s ) i j = 1 2 ( i u j + j u i ).

2 Numerical artificial viscosity in curvilinear coordinates

We introduced artificial viscosity in form of a three dimensional viscous pressure tensor (16) in Section 1.3 along the lines of Tscharnuter and Winkler ([1979]). In this section we want to point out, how such a definition must be adapted for curvilinear coordinates in order to ensure tensor analytical consistency.

When formulating PDEs derived from hyperbolic conservation laws on a curvilinear grid, the tensorial equations (3) have to be transformed to the according coordinate system. Not only the vectorial and tensorial quantities have to be transformed but also the differentiation operators, in particular the divergence operator in our case. The appropriate framework to do this is provided by differential geometry. Like the gradient of a scalar is natively a covector, there are rules for co- and contravariant indices of tensors such as the one we are interested in. The crucial term in (16) is the symmetrized velocity gradient [ u ] s that accounts for shear stresses, and one sees that the form (16) comes into conflict with the demand of vanishing trace (TrQ=0) when the divergence term is simply of the form e div x u, as we find it commonly in several MHD and RHD grid codes.

Proposition

The correct form of the viscous pressure tensor (16) in general coordinates is

Q= q 2 2 l visc 2 ρmax( div x u,0) ( [ u ] s 1 3 g div x u ) ,
(17)

where g is the fundamental metric tensor. We show that this tensor has the desired properties. The viscous pressure tensor must be symmetric by definition, i.e. Q i j = Q j i , which can be easily verified from (17). Also, the trace of the tensor has to vanish (TrQ= Q i i =0), as pointed out in von Neumann and Richtmyer ([1950]). To show that this holds for (17), we first consider its native covariant components

Q i j = μ 2 max ( div x u , 0 ) × ( 1 2 ( i u j + j u i ) 1 3 g i j div x u ) ,
(18)

where we have renamed q 2 2 l visc 2 ρ= μ 2 . Next, we need to raise an index with the metric,

Q j i = Q l j g l i = μ 2 max ( div x u , 0 ) × ( 1 2 g l i ( l u j + j u l ) 1 3 δ j i div x u ) ,

and use the essential identity g l i g l j = g j i = δ j i . The Ricci lemma i g j k = i g j k Γ i j l g l k Γ i k l g j l =0 for the fundamental tensor naturally also holds for the contravariant components and we can permute g into the derivatives l g l i u j and j g l i u l which yields two times the divergence i u i = div x u when we conduct the contraction ji. We use the summation δ i i =3 and obtain the desired result

Q i i == ( 1 2 ( 2 div x u ) 1 3 3 div x u ) =0.

The commonly used (see e.g. Dorfi ([1999]) in RHD, Iwakami et al. ([2008]) in MHD, Fryxell et al. ([2000]) in MHD) form of Q (16) is not compatible with these requirements since the symmetrization is only defined for lower indices, whereas the unit tensor e of a metric space is only defined for mixed indices, meaning there is no such thing as δ i j . However, the above mentioned and other authors have neglected this inconsistency since they have considered mixed indices from the start when concentrating on Cartesian or affine coordinates. Nonlinear corrections have been suggested in Benson and Schoenfeld ([1993]) albeit this approach does not explicitly concern curvilinear coordinates and is based on a TVD approach.

In several hydro- and MHD-codes that include non-Cartesian grids such as Pluto (Mignone et al. [2007]), the geometric source terms are coded explicitly for several geometries (polar, cylindrical, spherical), and not only for the artificial viscosity flux. The suggestions made e.g. in Vinokur ([1974]) lead to geometrical source terms that correct curvilinear grid effects. However the strong conservation form as elaborated in Warsi ([1981]) would need to appeal to our differential geometrically consistent approach in order to deal with the viscosity in an intrinsically consistent way. Especially when the metric tensor itself is not only a function of space but also time-dependent (as discussed in Section 1), the latter approach reaches its limits. Our correction affects curvilinear coordinates in multiple dimensions, whereas it is not necessary that the coordinates are orthogonal, i.e., the metric tensor does not need to be diagonal. Our initial motivation to study more general coordinates comes from the idea to generate problem-oriented coordinate systems for astrophysical numerical calculations. In a following paper we want to present some feasible approaches to grid generation under certain physical restrictions. Such nonlinear grids that are adaptive in multiple dimensions have time-dependent metric tensors and thus benefit directly from our consistent definition. On the contrast, when using adaptive mesh refinement, the metric tensor remains geometrically constant in time.

In order to support the theoretical results in this work, in the upcoming section we study as an example a simple velocity field with a non-vanishing divergence and visualize the according artificial viscosities for the two presented cases.

3 Application and visualization

The most common application of curvilinear coordinates in 3D is the map (x,y,z)(r R + ,ϑ[0,π],φ[0,2π]) with x=rsinϑcosφ, y=rsinϑsinφ and z=rcosϑ as spherical coordinates. The corresponding diagonal covariant metric tensor in this simple orthogonal case is given by diag(1,r,rsinϑ).

3.1 Toy model velocity field

As the presented considerations for artificial viscosity on non-steady curvilinear coordinates stem from astrophysical applications, we want to exemplarily address a velocity field with a certain practice in RHD. We study a toy model of a self-similar fluid flow solution, namely the velocity field given by

u Ex = x x 2 + y 2 + z 2 = x r
(19)

here in Cartesian coordinates. Such self-similar solutions appear in idealized spherical models of stars, for example as shocks driven by radial stellar pulsations.

This vector field is obviously symmetric with respect to the origin and has a non-vanishing divergence div x u Ex =2/r. The covariant components of this vector field are given in any other coordinates by scalar product with the base vectors, i.e. u Ex , i = u Ex e i . This leads to the covariant components (1,0,0) in spherical coordinates. The nonzero covariant components of the tensorial part ( [ u ] s 1 3 e div x u) of the artificial viscosity (17) are given for this field by

Q r r = 2 3 r , Q θ θ = r 3 , Q ϕ ϕ = r sin 2 θ 3 .
(20)

In the following section we visualize the tensor of artificial viscosity (TAV) for the velocity field (19). A uniform distribution of the leading eigenvalues over the whole domain is expected due to the symmetry of the vector field.

One easily verifies the identity Q i i =0 summing over the mixed components Q r r =2/3r, Q θ θ =1/3r, Q ϕ ϕ =1/3r.

With the previous version of the TAV from Tscharnuter and Winkler ([1979]) we would get the following covariant components of the artificial viscosity tensor:

Q r r = 2 3 r , Q θ θ = 2 3 r + r , Q ϕ ϕ = 2 3 r + r sin 2 θ .
(21)

The visualization of this non-metric version of the artificial viscosity for the symmetric velocity field (19) shows obviously a field unequal in strength and direction over the whole domain. In numerical computations this would clearly lead to artificial anisotropies in the flux of the density field and destroy all efforts in constructing a higher-order conservative numerical scheme with artificial viscosity.

3.2 Visualization of scalar and tensor fields

We can see the incorrect vs. correct behavior immediately by even just displaying the major eigenvalue or the trace of the viscosity tensor. However, since the major eigenvalue represents only one degree of freedom out of the six available in the tensor field, a measure involving all six components is a more objective metric for validation.

We used the Vish Visualization Shell (Benger et al. [2007]) to numerically sample (20) and (21) on a uniform grid for analyzing scalar fields (Figures 2 and 3) and a radial sampling distribution (Figure 4) for the full tensor field.

Figure 2
figure 2

Major eigenvalue the incorrect (a) and correct (b) viscosity, shown along the XZ plane.

Figure 3
figure 3

Trace the incorrect (a) and correct (b) viscosity, shown along the XZ plane. Note the range of values in Figure 3(b) - what we see is just numerical noise, the trace is perfectly zero within numerical precision.

Figure 4
figure 4

Reynold glyphs (Moore et al.[1995]) of the incorrect and correct viscosity tensor. The incorrect tensor shows a strongly negative component, whereas the correct tensor is balanced, indicating zero trace.

Figure 2 displays a structure of the eigenvalue corresponding to the major eigenvector of the TAV on the XZ plane (i.e., in the plane y=0), evidently showing some asymmetric coordinate-dependent behavior of the incorrect TAV, whereas the correct TAV is radially symmetric, as desirable. The tensor field is symmetric and of rank two, however it is not positive definite and may exhibit vanishing trace. The correct TAV is trace-free in the entire domain, whereas the trace of the incorrect TAV ranges through positive values (for large radial distances) to large negative values close to the coordinate origin, as depicted in Figure 3. A direct visualization method depicting the full six degrees of freedom of the tensor field is thus favorable, or even rather essential. However, many direct visualization methods for tensor fields require positive definiteness and are thus not applicable to this data. Only very few methods are suitable for general tensors. Figure 4 shows so-called Reynold glyphs (Moore et al. [1995]) for the TAV field. A Reynold glyph is the surface generated by mapping a tangential vector v(P) at each data sample point P as

PQ ( v ( P ) , v ( P ) ) .

Such glyphs shown at each sampling point provide a direct visualization of the full six degrees of freedom of the tensor properties. Reynold glyphs are also able to depict negative definite tensors, whereas a quadric surface (ellipsoids representing P1/ Q ( v ( P ) , v ( P ) ) becomes hyperbolic for negative eigenvalues and problematic for visualization purposes. The Reynold glyph directly shows the ‘directional value’ Q(v(P),v(P)) of the tensor field Q in the direction v around a the sampling point P - the resulting surface is intersecting the sampling point P whenever Q(v(P),v(P))=0, which is the case for points where the tensor is degenerating and not positive definite. In such areas the glyph will visually appear like two intersecting surfaces corresponding to the isopotential surfaces of second order spherical harmonic functions. These both surface components represent positive and negative eigenvalues of the tensor field - if both positive and negative component ‘counter-balance’ themselves they therefore indicate vanishing trace, which is the sum of the eigenvalues. If only one surface component is visible, then the tensor is either positive or negative definite on that certain point.

We used a radial sampling for the direct visualization of the tensor field in order to minimize coordinate artifacts. As depicted in Figure 4(b) and Figure 5(b) for the correct TAV all ‘modes’ are equivalently represented, indicating vanishing trace of the tensor field while being radially aligned with the underlying coordinate system. In contrast, the incorrect TAV, Figure 4(a) and Figure 5(a), exhibits a dominantly negative trace.

Figure 5
figure 5

Detailed Reynold glyphs (Moore et al.[1995]) of the incorrect and correct viscosity tensor. Glyphs of the correct tensor show spherical harmonics that are balanced in their positive and negative half-widths.

4 Conclusions

We studied a generalization of the tensor of numerical artificial viscosity for curvilinear coordinates and compared our result to previous definitions found in literature. We analyzed a symmetric toy velocity field and visualized its viscosities. Clearly, the non-metric version of the TAV as used by many authors of hydro- (HD) respectively magneto-hydro- (MHD) or radiation hydrodynamic-codes (RHD) leads to incorrect results in curvilinear coordinates, whereas our suggestion for the numerical artificial viscosity gives geometrically consistent results.

Appendix: Strong conservation form

As mentioned in Section 1, the benefit of the strong formulation of Cauchy problems arising from physical conservation laws will be discussed in more detail here.

Following the ideas of Warsi ([1981]), in non-steady coordinates the geometrically consistent strong form of tensorial conservation laws (2) is given as

t ( | g | d ) + i ( | g | f ( d ) e i ) =0,
(22)

where d and f are decomposed according to their native tensorial components. The scalar multiplication with the i th contravariant base vectors e i yields a projection on the contravariant coordinate lines which in case of generalized grids can differ in direction and length of their covariant counterparts. Equation (22) gives also the integral form of the conservation law, which should be treated numerically in a correct way for non-steady coordinates in any finite-volume discretization. The important difference to the componentwise structure ()=()+Γ(), where Christoffel symbols account for the geometry is that in this case undifferentiated terms arise (see Vinokur ([1974])) which act like geometric sources in the equations and destroy conservativeness. A comprehensive proof of Vinokurs theorem using differential forms can be found in Bridges ([2008]).

With non-steady curvilinear grids not only the nonlinearity of the metric tensor but also its time-dependence has to be taken into account numerically. The motion of the grid itself and its implications on the formulation of the set of equations respectively the calculation of the occurring fluxes is discussed in the following section.

A.1 Adaptive grids

In fluid dynamics we distinguish two main reference systems that suit unequally for various applications. The Eulerian frame is the fixed reference system of an external observer in which the fluid moves with velocity u whereas the Lagrangian approach describes the physics in the rest frame of the fluid. Between these two systems, the transformation of an advection term for a density d (that moves with a relative velocity u) is given via the material derivative D t d= t d+ud.

Hence, when we work with comoving frames, the coordinate system respectively the computational grid is time-dependent. There is a number of purposes where strict Eulerian or Lagrangian grids are suboptimal and thus we need to consider the generalized the concept of the comoving frames.

We next state the strong conservation form for time-dependent general coordinate systems. The time derivative of a density d in the coordinate system Σ ( β ) relative to a (e.g. static) coordinate system Σ ( α ) is given by t d ( β ) = t d ( α ) + ( α ) d t x ( β ) and from the view point of system Σ ( α ) , the time derivative is given as

t d ( α ) = t d ( β ) x ˙ ( α ) d T ,
(23)

where x ˙ denotes the grid velocity. The second term on the right side we call grid advection, see e.g. Warsi ([1981]) and Thompson et al. ([1985]). An inhomogeneous advective term of a conservation law K= d t +div( u T d) (in a fixed coordinate system) is given in the case of moving grid as

K= d t x ˙ d T +div ( u T d ) .
(24)

When we apply the appropriate transformation prescriptions to the spatial derivatives, we obtain the following form

K= d t x ˙ 1 | g | i ( | g | e i d ) + 1 | g | i ( | g | u e i d ) .
(25)

This is not yet geometrically conservative, since it is not of an integral structure. Following the idea of the Reynolds transport theorem we consider the temporal derivative of the volume, i.e., the determinant of the time-dependent metric tensor | g ( x , t ) | in order to study the conservation of a density function in variable volumes and obtain the strong conservation form for time-dependent coordinate systems:

| g | K= t ( | g | d ) + i ( | g | U i d ) ,
(26)

where U i denotes the contravariant velocity components relative to the moving grid, U i = e i (u x ˙ ). For the full analytic derivation we refer to Thompson et al. ([1985]) again.

A.2 Set of RHD equations in strong conservation form

We exhibit the system of equations of radiation hydrodynamics in a somewhat simplified formulation. The following system has been basis for a number of implicit RHD computations (see e.g. Dorfi ([1999])). All the astrophysical assumptions, implications and simplifications can be found in Mihalas and Mihalas ([1984]). In this paper we only want to emphasize the structural form of such a set of equations in a strong conservation form for comoving curvilinear coordinates. Note that for scalar equations the only effectively remaining geometric term inside the derivatives is the volume element | g | . The vectorial equations contain however also the time-dependent base vectors.

The equations presented in the upcoming sections as well as the coordinate transformation 1 were partially generated using the computer algebra system Mathematica (Wolfram Research [2007]). The source code can be downloaded at https://bitbucket.org/.

A.2.1 Continuity equation

The strong conservation form of the continuity equation

t ρ+div(ρu)=0

is given for time-dependent coordinates by

t ( | g | ρ ) + i ( | g | e i ( u x ˙ ) ρ ) =0.

A.2.2 Equation of motion

The equation of motion that we consider in radiation hydrodynamics contains the conservation of moment of plain fluid dynamics (5), the radiative flux as a coupling term (H, with the specific Rosseland opacity of the fluid κ R ), gravitational force (G) and the artificial viscosity term (Q from (17)):

t (ρu)+div ( ρ u T u + P + Q ) +ρG 4 π c κ R ρH=0.

We inspect the elements of the energy stress tensor a little closer before we give the consistent strong conservation form. We define an effective tensor of gaseous momentum R that accounts for the motion of the coordinates as

R= r i j e i e j =ρ(u x ˙ ) u T .

The isotropic gas pressure tensor P is defined by the scalar pressure and the metric tensor as P=pg. The viscous pressure tensor Q has to be modified in the way we suggested in (17). Since in most applications of RHD with self-gravity involved, the gravitational force G is determined by solving the Poisson equation for the potential Φ, we substitute G=Φ. The equation of motion in strong conservation form is then written as

t ( | g | ρ u ) + i ( | g | ( R + P + Q ) e i ) + ρ i ( | g | Φ e i ) 4 π c κ R | g | ρ H = 0 .

The k th component of the strong conservation equation of motion is given by the k th Cartesian component of the unit vector, e.g. in spherical coordinates e r =cosφsinϑ e x +sinφsinϑ e y +cosϑ e z and its derivatives. The projection of each physical tensor on the contravariant coordinate lines can be simplified by its contravariant components with respect to its covariant basis without losing strong conservation form, i.e. f e i = f i , j e j . We prefer this form with contravariant components since it meets the native design of the stress tensor R and the pressure tensor P. The tensor of artificial viscosity as given in (18) is brought to contravariant form by the summation

Q i j = Q l m g l i g m j = = ( g l i g m j ( l u m + j u m ) g i j 1 3 div u )

and then the equation of motion is given by

t ( | g | ρ u i e i ) + i ( | g | ( r i j + p i j + Q i j ) e j ) + ρ i ( | g | Φ e i ) 4 π c κ R | g | ρ H i e i = 0 .
(27)

A.2.3 Equation of internal energy

The energy equation

t (ρϵ)+div(uρϵ)+P u T 4π κ P ρ(JS)+Q u T =0

accounts for the thermodynamics of the fluid, namely the energy balance including kinetic and pressure parts as well as inner energy. Latter is a thermodynamic quantity which is associated with the equation of state. The specific inner energy (ϵ) is in case of an ideal fluid its thermic energy. Another term comes from the energy exchange with the radiation field ((JS)-term) containing the specific Planck opacity κ P and viscous energy dissipation, expressed by the contraction of the viscosity with the velocity gradient Q u T .

Since we assume isotropic gas pressure P=pg we can reformulate its contribution via the Ricci lemma and obtain a very simple scalar expression

P u T = g i j p i u j =p i u i =pdivu.

The viscous energy dissipation is given by the contraction

Q u T = Q i j i u j = Q i j ( i u j Γ i j k u k ) =: E diss ,

and the strong conservative form of the energy equation is then given by

t ( | g | ρ ϵ ) + i ( | g | ρ ϵ e i ( u x ˙ ) ) + | g | p div u 4 π | g | κ P ρ ( J S ) + | g | E diss = 0 .

A.2.4 Equation of radiation energy

We write a simplified frequency integrated radiation energy equation in the comoving frame as follows

t J+div(uJ)+cdivH+K u T +c χ P (JS)=0.

For the scalar energy input of radiative pressure into the material we define a new coupling variable

K u T = K i j i u j =: P coup

and in strong conservation form the equation of radiation energy is given by

t ( | g | J ) + i ( | g | e i ( J ( u x ˙ ) + c H ) ) + | g | P coup + | g | c χ P ( J S ) = 0 .

A.2.5 Radiative flux equation

Another vectorial conservation law, the radiative flux equation, is given by

t H+div(uH)+cdivK+H u T +c χ R H=0.

We define an effective radiative flux tensor L analogously to the effective tensor of gaseous momentum:

(u x ˙ )H=:L= l i j e i e j

and for the contribution of radiative momentum to the material H u T we define another coupling variable F with components

F coup j = H i i u j .

The geometrically conservative form of the radiative flux equation in non-steady coordinates is then written as

t ( | g | H ) + i ( | g | e i ( L + c K ) ) + | g | F coup + | g | κ R ρ H = 0 .

References

  1. Benger W, Ritter G, Heinzl R: The concepts of VISH. In Fourth High-End Visualization Workshop, Obergurgl, Tyrol, Austria, June 18–21, 2007. Lehmanns Media-LOB.de, Berlin; 2007:26–39.

    Google Scholar 

  2. Benson DJ, Schoenfeld S: A total variation diminishing shock viscosity. Comput. Mech. 1993, 11: 107–121.

    MathSciNet  Google Scholar 

  3. Bridges TJ: Conservation laws in curvilinear coordinates: a short proof of Vinokur’s theorem using differential forms. Appl. Math. Comput. 2008,202(2):882–885. 10.1016/j.amc.2008.02.018

    Article  MathSciNet  Google Scholar 

  4. Dorfi EA: Implicit radiation hydrodynamics for 1d-problems. J. Comput. Appl. Math. 1999,109(1–2):153–171. 10.1016/S0377-0427(99)00157-0

    Article  ADS  Google Scholar 

  5. Fryxell B, Olson K, Ricker P, Timmes FX, Zingale M, Lamb DQ, MacNeice P, Rosner R, Truran JW, Tufo H: Flash: an adaptive mesh hydrodynamics code for modeling astrophysical thermonuclear flashes. Astrophys. J. Suppl. Ser. 2000,131(1):273–334. 10.1086/317361

    Article  ADS  Google Scholar 

  6. Godlewski E, Raviart P: Numerical Approximation of Hyperbolic Systems of Conservation Laws. Springer, New York; 1992.

    Google Scholar 

  7. Griewank A, Walther A: Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation. 2nd edition. SIAM, Philadelphia, PA; 2008.

    Book  Google Scholar 

  8. Harten A, Hyman JM, Lax PD, Keyfitz B: On finite-difference approximations and entropy conditions for shocks. Commun. Pure Appl. Math. 1976,29(3):297–322. 10.1002/cpa.3160290305

    Article  MathSciNet  ADS  Google Scholar 

  9. Iwakami W, Ohnishi N, Kotake K, Yamada S, Sawada K: Numerical methods for three-dimensional analysis of shock instability in supernova cores. J. Phys. Conf. Ser. 2008.,112(4): Article ID 042021 10.1088/1742-6596/112/4/042021

    Google Scholar 

  10. Landshoff, R: A numerical method for treating fluid flow in the presence of shocks. Los Alamos National Laboratory Report LA-1930 (1955). www.dtic.mil/dtic/tr/fulltext/u2/a382679.pdf, Landshoff, R: A numerical method for treating fluid flow in the presence of shocks. Los Alamos National Laboratory Report LA-1930 (1955). http://www.dtic.mil/dtic/tr/fulltext/u2/a382679.pdf

  11. Lax P, Wendroff B: Systems of conservation laws. Commun. Pure Appl. Math. 1960,13(2):217–237. 10.1002/cpa.3160130205

    Article  MathSciNet  Google Scholar 

  12. LeVeque R: Numerical methods for conservation laws. Math. Comput. Simul. 1991,33(2):180.

    MathSciNet  Google Scholar 

  13. Mignone A, Bodo G, Massaglia S, Matsakos T, Tesileanu O, Zanni C, Ferrari A: Pluto: a numerical code for computational astrophysics. Astrophys. J. Suppl. Ser. 2007, 170: 228–242. 10.1086/513316

    Article  ADS  Google Scholar 

  14. Mihalas D, Mihalas BW: Foundations of Radiation Hydrodynamics. Oxford University Press, New York; 1984.

    Google Scholar 

  15. Moore J, Schorn S, Moore J: Methods of classical mechanics applied to turbulence stresses in a tip leakage vortex. J. Turbomach. 1995, 118: 622–629. 10.1115/1.2840917

    Article  Google Scholar 

  16. Pons JA, Ibanez JM, Miralles JA: Hyperbolic character of the angular moment equations of radiative transfer and numerical methods. Mon. Not. R. Astron. Soc. 2000,317(3):550–562. 10.1046/j.1365-8711.2000.03679.x

    Article  ADS  Google Scholar 

  17. Richtmyer RD, Morton KW: Difference Methods for Initial-Value Problems. Wiley, New York; 1994.

    Google Scholar 

  18. Thompson JF, Warsi ZU, Mastin CW: Numerical Grid Generation: Foundations and Applications. Elsevier, New York; 1985.

    Google Scholar 

  19. Tscharnuter WM, Winkler KH: A method for computing selfgravitating gas flows with radiation. Comput. Phys. Commun. 1979,18(2):171–199. 10.1016/0010-4655(79)90111-5

    Article  ADS  Google Scholar 

  20. Vinokur M: Conservation equations of gasdynamics in curvilinear coordinate systems. J. Comput. Phys. 1974,14(2):105–125. 10.1016/0021-9991(74)90008-4

    Article  MathSciNet  ADS  Google Scholar 

  21. von Neumann J, Richtmyer RD: A method for the numerical calculation of hydrodynamic shocks. J. Appl. Phys. 1950,21(3):232–237. 10.1063/1.1699639

    Article  MathSciNet  ADS  Google Scholar 

  22. Warsi ZUA: Conservation form of the Navier-Stokes equations in general nonsteady coordinates. AIAA J. 1981, 19: 240–242. 10.2514/3.7763

    Article  ADS  Google Scholar 

  23. Wilkins ML: Use of artificial viscosity in multidimensional fluid dynamic calculations. J. Comput. Phys. 1980,36(3):281–303. 10.1016/0021-9991(80)90161-8

    Article  MathSciNet  ADS  Google Scholar 

  24. Mathematica. Wolfram Research, Inc., Champaign; 2007.

Download references

Acknowledgements

We thank Franz Embacher and Helmuth Urbantke for valuable discussions on tensor analysis and differential geometry. The authors acknowledge the UniInfrastrukturprogramm des BMWF Forschungsprojekt Konsortium Hochleistungsrechnen and the Forschungsplattform Scientific Computing at LFU Innsbruck. This work was funded by the Austrian Science Fund (FWF), DK-plus Computational Interdisciplinary Modelling (W-1227-N16). This research furthermore employed resources of the Center for Computation and Technology at Louisiana State University, which is supported by funding from the Louisiana legislature’s Information Technology Initiative. We acknowledge the anonymous reviewer who helped improving the article.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Harald Höller.

Additional information

Competing interests

The authors declare that they have no competing interests.

Authors’ contributions

The main conceptual and mathematical work was done by HH. AK helped to refurbish the paper with respect to mathematical conventions and rigorosity while ED had the idea for multidimensionally adaptive grids for RHD in the first place. WB contributed the visualizations in Section 3. All authors read and approved the final manuscript.

Authors’ original submitted files for images

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (https://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Höller, H., Koskela, A., Dorfi, E. et al. Artificial viscosity in comoving curvilinear coordinates: towards a differential geometrically consistent implicit advection scheme. Comput. Astrophys. 1, 2 (2014). https://doi.org/10.1186/s40668-014-0002-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s40668-014-0002-6

Keywords