Artificial viscosity in comoving curvilinear coordinates: towards a differential geometrically consistent implicit advection scheme
© Höller et al.; licensee Springer 2014
Received: 31 January 2014
Accepted: 26 May 2014
Published: 11 September 2014
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.
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 ) 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.
The benefit of the consistent formulation is especially evident when considering time-dependent grids, e.g. when using time-dependent parameters 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 () and Richtmyer and Morton () 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 and its flux . Equation (6) shows how a concrete choice for the density and the flux field can look like in a given coordinate system.
where n is the outward oriented normal of the surface.
The system is called hyperbolic if the Jacobian matrix 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. ).
With an initial condition , , this is called the Cauchy problem.
The gaseous pressure tensor can be assumed to be isotropic in most applications, which means that where is the scalar gas pressure and the contravariant metric tensor. In case of adaptive grids the base vectors are time-dependent as well, i.e., .
The function is called a weak solution of the PDE (4), if it satisfies (7) and with . 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).
and then consider the limiting case . 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.
For bounded, continuous pointwise solutions of (12) such that for , 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. () and LeVeque ().
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 )).
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 ().
where h denotes the resolution of the spatial discretization, . Since the original design of the additional viscous pressure in the scalar form, , , as suggested in von Neumann and Richtmyer () for one-dimensional advection , it has undergone a number of modifications and generalizations. It has turned out to be numerically preferable to add a linear term (see Landshoff ()) 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 ().
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.
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 (). 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 that accounts for shear stresses, and one sees that the form (16) comes into conflict with the demand of vanishing trace () when the divergence term is simply of the form , as we find it commonly in several MHD and RHD grid codes.
The commonly used (see e.g. Dorfi () in RHD, Iwakami et al. () in MHD, Fryxell et al. () 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 . 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 () 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. ), 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 () lead to geometrical source terms that correct curvilinear grid effects. However the strong conservation form as elaborated in Warsi () 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 with , and as spherical coordinates. The corresponding diagonal covariant metric tensor in this simple orthogonal case is given by .
3.1 Toy model velocity field
here in Cartesian coordinates. Such self-similar solutions appear in idealized spherical models of stars, for example as shocks driven by radial stellar pulsations.
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 summing over the mixed components , , .
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.
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 becomes hyperbolic for negative eigenvalues and problematic for visualization purposes. The Reynold glyph directly shows the ‘directional value’ 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 , 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 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.
where d and f are decomposed according to their native tensorial components. The scalar multiplication with the i th contravariant base vectors 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 ()) 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 ().
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 .
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.
where denotes the contravariant velocity components relative to the moving grid, . For the full analytic derivation we refer to Thompson et al. () 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 ()). All the astrophysical assumptions, implications and simplifications can be found in Mihalas and Mihalas (). 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 . 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 ). The source code can be downloaded at https://bitbucket.org/.
A.2.1 Continuity equation
A.2.2 Equation of motion
A.2.3 Equation of internal energy
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 (-term) containing the specific Planck opacity and viscous energy dissipation, expressed by the contraction of the viscosity with the velocity gradient .
A.2.4 Equation of radiation energy
A.2.5 Radiative flux equation
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.
- 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
- Benson DJ, Schoenfeld S: A total variation diminishing shock viscosity. Comput. Mech. 1993, 11: 107–121.MathSciNetGoogle Scholar
- 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.018MathSciNetView ArticleGoogle Scholar
- Dorfi EA: Implicit radiation hydrodynamics for 1d-problems. J. Comput. Appl. Math. 1999,109(1–2):153–171. 10.1016/S0377-0427(99)00157-0ADSView ArticleGoogle Scholar
- 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/317361ADSView ArticleGoogle Scholar
- Godlewski E, Raviart P: Numerical Approximation of Hyperbolic Systems of Conservation Laws. Springer, New York; 1992.Google Scholar
- Griewank A, Walther A: Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation. 2nd edition. SIAM, Philadelphia, PA; 2008.View ArticleGoogle Scholar
- 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.3160290305MathSciNetADSView ArticleGoogle Scholar
- 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/042021Google Scholar
- 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
- Lax P, Wendroff B: Systems of conservation laws. Commun. Pure Appl. Math. 1960,13(2):217–237. 10.1002/cpa.3160130205MathSciNetView ArticleGoogle Scholar
- LeVeque R: Numerical methods for conservation laws. Math. Comput. Simul. 1991,33(2):180.MathSciNetGoogle Scholar
- 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/513316ADSView ArticleGoogle Scholar
- Mihalas D, Mihalas BW: Foundations of Radiation Hydrodynamics. Oxford University Press, New York; 1984.Google Scholar
- 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.2840917View ArticleGoogle Scholar
- 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.xADSView ArticleGoogle Scholar
- Richtmyer RD, Morton KW: Difference Methods for Initial-Value Problems. Wiley, New York; 1994.Google Scholar
- Thompson JF, Warsi ZU, Mastin CW: Numerical Grid Generation: Foundations and Applications. Elsevier, New York; 1985.Google Scholar
- 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-5ADSView ArticleGoogle Scholar
- Vinokur M: Conservation equations of gasdynamics in curvilinear coordinate systems. J. Comput. Phys. 1974,14(2):105–125. 10.1016/0021-9991(74)90008-4MathSciNetADSView ArticleGoogle Scholar
- 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.1699639MathSciNetADSView ArticleGoogle Scholar
- Warsi ZUA: Conservation form of the Navier-Stokes equations in general nonsteady coordinates. AIAA J. 1981, 19: 240–242. 10.2514/3.7763ADSView ArticleGoogle Scholar
- 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-8MathSciNetADSView ArticleGoogle Scholar
- Mathematica. Wolfram Research, Inc., Champaign; 2007.
This article is published under license to BioMed Central Ltd. Open Access This is an Open Access article distributed under the terms of the Creative Commons Attribution License http://creativecommons.org/licenses/by/2.0, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly credited.