cess of Front Tracking: software design and organization { modularity, data structures and data hiding. 1 Introduction. Front tracking is a numerical method which ...
Front Tracking: A Parallelized Approach? for Internal Boundaries and Interfaces James Glimm1 , ?? John Grove1, Xiao Lin Li2 , Robin Young1 , Yanni Zeng1, Qiang Zhang1 2
1 The University at Stony Brook, Stony Brook, NY 11794-3600 Department of Mathematics, Indiana University Purdue University, Indianpolis
Abstract. Internal boundaries and interfaces are an important part of
many uid and solid modeling problems. Front Tracking contains a general interface framework, closely related to the non-manifold geometry used in CAD solid modeling packages, to support numerical simulation of such uid problems. It can thus be considered to be a systematic application of the ideas of computational geometry to computational uid dynamics. It is based on the principle that nite dierences behave best when applied to dierentiable functions, and that weak derivatives of nondierentiable functions can be replaced by regularized expressions such as jump conditions. Front Tracking oers superior resolution for
uid problems with important discontinuities and interfaces, and in some cases, it has provided the unique method to obtain correct answers. Here we present Computer Science issues which have contributed to the success of Front Tracking: software design and organization { modularity, data structures and data hiding.
1 Introduction Front tracking is a numerical method which assigns explicit computational degrees of freedom to surfaces of discontinuity. Additional, grid based degrees of freedom, represent continuously varying solution values. This method is ideal for solutions in which discontinuities are an important feature, and especially where their accurate computation is dicult by other methods. Phase transition boundaries, deposition and etching fronts, material boundaries, slip surfaces, shear bands, and shock wavesprovide important examples of such problems. Richtmyer [25] rst proposed this method. Moretti [22] [23] [24] used it for high quality aerodynamic computations. Supported by the Applied Mathematics Subprogram of the U.S. Department of Energy DE-FG02-90ER25084. ?? Also supported by the Army Research Oce, grant DAAL03-92-G-0185 and through the Mathematical Sciences Institute of Cornell University under subcontract to the University at Stony Brook, ARO contract number DAAL03-91-C-0027, and the National Science Foundation, grant DMS-9201581. ?
A systematic development of front tracking in two dimensions has been carried out by the authors and coworkers [12], [7], [13], [14], [11], [5], [17]. See [27], [26], [20], [6], [1], [21] for other approaches to front tracking in two dimensions. Special purpose front tracking codes have been also developed, as well as a number of one dimensional front tracking codes. We draw two conclusions from this body of work. First, front tracking is feasible for geometrically complex fronts. Examples include complex shock and wave front interaction problems, with bifurcations, i.e. changes of wave front topology, as occurs after interaction, or crossing of one wave (tracked discontinuity) by another. The second conclusion is that the front tracking solutions are often (a) better and (b) obtained on signi cantly coarser grids [16], [19], [18], [2], [5], [3], [4]. In Fig. 1, we show the interaction of a shock wave with a randomly perturbed planar contact discontinuity in two dimensions, representing a density discontinuity layer between two gases. The original computation and two levels of zoomed enlargement are displayed in the three panels. The most enlarged panel occupies only a few mesh blocks, and shows a highly resolved and complex set of incident, re ected, and transmitted waves.
Fig. 1. Tracked waves to represent the passage of a shock wave through a perturbed planar interface separating two compressible uids of dierent densities. The three frames show successive zoom enlargments of a single timestep in the interaction.
2 Modularity and Data Structures Modern programming languages and modular organization have been an integral part of our methodology for many years, and are essential for the work presented here. Due to the growing interest in object oriented programming and modular algorithm design, we include a discussion of this aspect of our methods. The discussion is organized by increasing levels of speci city:
1. Utilities and software tools. 2. Geometrical and topological structures (e.g. grids). Only the independent variables of the problem are available to the routines de ned at this level. 3. General equation and problem types and solution methods: hyperbolic, parabolic, elliptic (e.g. Godunov, conjugate gradient, nite elements, interpolation). The dependent variables of the problem are available in symbolic form only, as addresses of storage locations. As such, routines at this level can copy (bitwise) and allocate storage for dependent variables and pass them as arguments of functions. 4. Physical laws: compressible gas dynamics, elastic-plastic ow, etc. (e.g. Riemann solvers). The full set of dependent and independent variables de ned in the problem are available to the routines de ned at this level. 5. Material speci cation (e.g. equation of state, constitutive laws). The equations of physics close at this level, with all nonlinear function fully de ned in their functional form. Material constants would normally not appear in the source code, but exist in separate tables, to be read upon run time initialization, or as initialization parameters. If the constituitive response functions are give in tabular form, these tables are read at run time as input data for level 3 interpolation functions available in the source code. Modular code is organized into libraries, each carrying a speci city level (1 to 5), which governs the scope and sharing of data and variables. Public data and structures de ned at level n are usually available to all higher speci city levels m n, but not to lower speci city levels. 2.1
Interface
We rst discuss the interface library, a level 2 library which describes the geometry and topology of piecewise smooth manifolds with piecewise smooth boundaries, embedded in R3 . Boundary operators, to map from a manifold to its boundary, and to the manifolds which it bounds, are included in this library. We begin with a description of the main data structures (whose names are in capital letters) and their interrelationships. The library compiles and runs independently of other libraries with equal or higher speci city. At a continuum level, an INTERFACE in R2 [15] is a collection of non-intersecting oriented CURVEs, meeting only at endpoints (called NODEs), and thus dividing the R2 into distinct connected components. We designate as COMPONENT, some labeling scheme, i.e. equivalence class, for components. Thus several components may constitute one COMPONENT. Each SIDE of each CURVE is labeled by the COMPONENT adjacent to that SIDE. Each NODE has a list of its incoming and outgoing CURVEs. The same concepts apply in R3 , with the addition of an oriented SURFACE as a new structure. The SURFACEs divide R3 , so that each SIDE of a SURFACE is labeled by a COMPONENT. The SURFACEs are bounded by and may meet along CURVEs. There is no consistent orientation for the INTERFACE as a whole. SURFACEs and the CURVEs which bound them do not have consistent orientation. The boundary of a SURFACE may consist
of several CURVEs, and each CURVE may bound several SURFACEs (or none at all). In cases where the components on the two sides of the SURFACE are the same, SIDE is useful as a local generalization of COMPONENT. The discretized version of the INTERFACE has this same structure with a piecewise linear description built from doubly linked lists of simplices of the appropriate dimensions. In Fig. 2, we illustrate the geometric data structures used for the front tracking method in three dimensions. BONDs
TRIANGLEs CURVEs
REGIME OF COMPONENT 1
POINTs
SURFACEs NODE REGIME OF COMPONENT 2
Fig. 2. An illustration of the geometric data structures used for the front tracking method in three dimensions.
An INTERFACE, in the C language, is a data structure with arrays of pointers to SURFACEs, CURVEs, and NODEs. The SURFACEs, CURVEs, and NODEs are also data structures. They contain arrays of pointers to their bounding and co-bounding objects, i.e. arrays of pointers to CURVEs, for the SURFACEs, etc. The SURFACEs and CURVEs also contain reference to the rst and last simplices (TRIANGLEs and BONDs) in the linked list which de nes them. The TRIANGLEs and BONDs are data structures de ned in terms of POINTs and neighbors (adjacent TRIANGLEs or BONDs). For computational eciency, they contain additional information, namely, length for BONDs, area and positive unit normal for TRIANGLE. A POINT is also a data structure, with data
to represent its coordinate description. To achieve modularity between dimensions, the coordinates are represented as pointer to an array of dim = 1; 2 or 3 oating point variables. Here dim is a run time variable associated with a speci c INTERFACE. Since one of the applications of the interface library is to support the ecient interpolation of piecewise smooth functions, it would be bene cial to allow arbitrary positive integer values for the dimension dim. In this case, the interface is a generalization of the notion of a simplicial complex [10] of dimension dim ? 1 imbedded in Rdim. Multiple INTERFACEs and their uses, even within a single computation, prevent dim from being a globally de ned variable. Each of the elementary objects in an INTERFACE (including the INTERFACE itself) has support routines, for initializing, copying, printing, reading of printed format, and modifying. These routines are exported, and publically available to the rest of the code. In addition, the INTERFACE has hidden, or private, data and support functions. The interface library supports its own storage allocation scheme. Storage allocation is a level 1 module, built as an extension of the Unix routine malloc. As a hidden variable, a linked list of all active interfaces is maintained, and for each a separate instance of the level 1 storage allocation scheme is maintained. Storage for an interface is allocated in blocks of a designated size. These are used as needed for the allocation of SURFACEs, etc. In this way, the storage is (more nearly) contiguous in physical memory, and paging ineciencies for access of computationally related variables are minimized. Deleted objects are not deallocated; rather the knowledge of their addresses is eliminated, so that they are deaddressed. The reason for this choice is that available deaddressed space is highly fragmented. Much of the data consists of pointers, so that compression by recopy of data is incorrect. Upon deletion of the entire INTERFACE, all of its storage is deallocated and returned to the system. The combination of copy INTERFACE to get a new INTERFACE and delete (old) INTERFACE will free deaddressed storage, reset pointers correctly and accomplish compression. Storage allocation is a private aspect of the publicly callable functions to initialize an INTERFACE object. It is frequently necessary to determine the topology associated with an INTERFACE. INTERFACEs are required to be non-self intersecting (so that SURFACEs can meet only along their bounding CURVEs, etc.). After each timestep in the dynamical evolution, it is necessary to check the propagated INTERFACE for intersections. If intersections arise, signaling a bifurcation of the topology, a call will be made to a physics-speci c routine, to modify and reconnect the INTERFACE, with the possible introduction of additional re ected waves, as required by the physics. A second topological requirement is to determine the COMPONENT of a given location in space. These requirements lead to a private INTERFACE data structure of hashed lists of hypersurface simplices (BONDs or TRIANGLEs) stored according to their intersection with each mesh cell. The intersection routine checks all pairs of hypersurface simplices for intersections, and returns a list of intersecting hypersurfaces and their intersection
locations. In three dimensions, the intersections are organized into CURVEs, while in two dimensions, they are isolated NODEs. By use of this hashed list, intersections are tested only for pairs meeting a common mesh block. Since the local density of hypersurface elements is normally bounded, the O(n2 ) intersection computation is reduced to O(n) in complexity for typical problems. 2.2
Front
An INTERFACE, with generic physics dependent information, is called a FRONT. The resulting algorithms de ne a level 3 library. At level 3, the POINT acquires new structure: physical STATEs, associated with each SIDE of the hypersurface on which the POINT is located. At level 3, a STATE is the address of allocated storage of known size. It can be passed as a function argument, and its contents can be copied (bitwise), but it cannot be otherwise accessed. For co-dimension two POINTs, such as where multiple SURFACEs meet along a CURVE, there are two STATEs (one for each hypersurface SIDE) for each such hypersurface; this storage is associated with the hypersurface, rather than with the POINT. The hypersurfaces also acquire new structure: a wave type, which designates physics speci c information about the type of front. At level 4 speci city, these wave types can be read fully, but at level 3, only generic wave types de ning boundary conditions (NEUMANN, DIRICHLET, PERIODIC) can be read. Passing to speci city level 4, meaning is attached to the ( oating point and integer) data a STATE contains. Thus the simplest idea of a STATE for three dimensional compressible uid ow would be ve oating point numbers. It is convenient to have the equation of state addressible through the STATE itself, for application to multicomponent or multiphase ow problems. Thus the address of the equation of state data base is added to the STATE structure, at speci city level 5. Apart from support routines for front-associated data structures, the main operations performed within the front library are (a) remeshing of the FRONT, (b) propagation routines for both regular (co-dimension one) and irregular (codimension two or higher) POINTs (x3), and (c) untangle of self-intersecting FRONTs with only scalar degrees of freedom (x3). A FRONT with scalar degrees of freedom is one whose physical quantities transform as a scalar (e.g. a material boundary or contact discontinuity). Such fronts generally have degenerate light cones and simple wave interaction laws. In contrast, vector fronts, such as shock waves, interact so as to create both re ected and transmitted waves, even in the simplest cases. The FRONT data structure contains parameters to control these operations (a) { (c), including function pointers to level 4 physics functions for propagation details. 2.3
Interpolation
Three other libraries complete the level 3 code for conservation laws. A hyperbolic library is concerned with states and propagation at regular grid points. A driver library contains the main program initialization, time loop control, and
i/o capabilities. Another level 3 library, discussed here, supports interpolation, based on state data from the front and hyperbolic libraries. The ability to interpolate piecewise smooth functions with arbitrary discontinuities across interfaces is of considerable independent interest, and has been developed as an isolated capability. It is used to support equation of state tables, with phase transitions as the source of discontinuity [8], [9]. To ensure the integrity of the interpolation process, only state values from a single COMPONENT can be interpolated. State data is stored at grid cell centers. For interpolation, we consider the dual grid, with states stored at grid cell corners. For a regular (dual grid) cell, i.e. one which does not intersect the front, bilinear interpolation gives interpolated state values. For an irregular cell, in two dimensions, we introduce a triangulation which respects the interface, and which uses only the points for which the states are already known: the dual grid corners and the (one-sided) front points. Three dimensional simplicial cells (tetrahedra) are constructed on each side of the interface within a rectangular grid block. We use the Delaunay triangulation algorithm to achieve an optimal aspect ratio for the tetrahedra, so that the interpolation is based on the most reasonable simplices. The triangulated three dimensional cells near the interface and the intersection between the interface and the rectangular grid lines provide a dynamical coupling between the front and the interior uid components. The former provides a robust way to calculate the uid states for the propagation of front and the latter seperates dierent uid components and interior numerical solvers so that no numerical diusion will be cross the interface.
3 Mathematical Theory and Modeling The solution of conservation laws, of the form Ut + r F(U ) = Source are supported by the general framework discussed in x2. The nature of the propagation is governed by the codimension of the point. The codimension is the codimension of the maximal space-time manifold containing the point locally, on which the solution is smooth. In simple examples, the codimension equals the number of (simple jump) discontinuities present simultaneously in the solution at a given point in space and time. For time dependent problems in dim space dimensions, 0 codimension dim + 1. The codimension 1 points are located on the front, but are otherwise regular. They are points of simple jump discontinuity. They lie on the interior of a surface in 3 spatial dimensions and on the interior of a curve in 2 dimensions. The propagation of the front coordinates and states is performed in a single step. Operator splitting, in a rotated coordinate system, allows a separate propagation step in the directions normal to and tangential to the front. The propagation of a discontinuity, in the direction normal to the discontinuity surface, is given by the solution of a Riemann problem. This is the one dimensional Cauchy problem,
Fig. 3. The triangulated interface between two uids of diering density, subject to a gravitational (Rayleigh-Taylor) instability. This computation shows four bubbles of light uid rising. The computational mesh is 10 10 20. Periodic boundary conditions are imposed in the x and y directions. The uid interface is patched with a buer zone at the periodic boundary and at the parallelization subdomain boundaries. with idealized initial conditions consisting of a single jump discontinuity. An extensive body of theory has been developed in recent years for the analysis of such Riemann solutions.
4 Applications and Results The study of instabilities of an interface separating distinct uids has been one of the important applications of front tracking. Acceleration, either impulsive (as in the Richtmyer-Meshkov instability) or steady (as in the Rayleigh-Taylor instability) provide examples. We consider here a gravitational acceleration force. The mixing zone is de ned as the portion of the z-axis from the lowest to the highest interface position. The size and growth rate of the mixing zone is a matter of considerable interest. Consistent results comparing laboratory experiments, front tracking simulations and simple theoretical models (based on the renormalization group) have been obtained for the mixing rate. In Fig. 3 we present a simulation of an unstable interface in three dimensions.
References 1. Bell , J. B., Colella , P., Welcome, M. L.: Conservative front-tracking for inviscid compressible ow. UCRL-JC-105251, preprint (1991) 2. Boston, B., Glimm, J., Grove, J. W., Holmes, R., Zhang, Q.: Multiscale Structure for Hyperbolic Waves. Report No. SUNYSB-AMS-93-18, State Univ. of New York
at Stony Brook (1993) In: Proceedings of the International Conference on Nonlinear Evolution Partial Dierential Equations, Beijing, P.R. China 1993 3. Boston, B., Grove, J. W., Henderson, L. F., Holmes, R., Sharp, D. H., Yang, Y., Zhang, Q.: Shock Induced Surface Instabilities and Nonlinear Wave Interactions. Report No. SUNYSB-AMS-93-20 (1993), State Univ. of New York at Stony Brook In: Proceedings of Eleventh Army Conference on Applied Mathematics and Computing 4. Boston, B., Grove, J. W., Holmes, R.: Front Tracking Simulations of Shock Refractions and Shock Induced Mixing. Report No. SUNYSB-AMS-93-19 (1993), State Univ. of New York at Stony Brook. In: Proceedings of the 19th International Symposium on Shock Waves 5. Chen, Y., Deng, Y., Glimm, J., Li, G., Sharp, D. H., Zhang, Q.: A Renormalization Group Scaling Analysis For Compressible Two-Phase Flow. Phys. Fluids A 5 (1993) 2929{2937 6. Chern, I-L., Colella, P.: A Conservative Front Tracking Method for Hyperbolic Conservation Laws. LLNL Rep. No. UCRL-97200 (1987) 7. Chern, I-L., Glimm, J., McBryan, O., Plohr, B., Yaniv, S.: Front Tracking for Gas Dynamics. J. Comput. Phys. 62 (1986) 83{110 8. Coulter, L., Grove, J. W.: The Application of Piecewise Smooth Bivariate Interpolation to Multiphase Tabular Equation of States. Report No. SUNYSB-AMS-92-11 (1992) University at Stony Brook 9. Lisa Osterman Coulter: Piecewise Smooth Interpolation and the Ecient Solution of Riemann Problems with Phase Transitions. Ph.D. Thesis New York Univ. 1991 10. Eilenberg, S., Steenrod, N.: Foundations of Algebraic Topology. Princeton University Press, Princeton, 1952 11. Glimm, J., Grove, J., Lindquist, W. B., McBryan, O., Tryggvason, G.: The Bifurcation of Tracked Scalar Waves. SIAM J. Sci. Stat. Comput. 9 (1988) 61{79 12. Glimm, J., Isaacson, E., Marchesin, D., McBryan, O.: Front Tracking for Hyperbolic Systems: Adv. Appl. Math. 2 (1981) 91{119 13. Glimm, J., Klingenberg, C., McBryan, O., Plohr, B., Sharp, D., Yaniv, S.: Front Tracking and Two Dimensional Riemann Problems. Adv. Appl. Math. 6 (1985) 259{290 14. J. Glimm W. B. Lindquist O. McBryan L. Padmanabhan A Front Tracking Reservoir Simulator, Five-Spot Validation Studies and the Water Coning Problem. In: Frontiers in Applied Mathematics. SIAM, Philadelphia, PA, 1 (1983) 107 15. Glimm, J., McBryan, O.: A Computational Model for Interfaces. Adv. Appl. Math. 6 (1985) 422{435 16. Grove, J., Holmes, R., Sharp, D. H., Yang, Y., Zhang, Q.: Quantitative Theory of Richtmyer-Meshkov Instability. Phys. Rev. Lett. 71 (1993) 3473{3476 17. Grove, J. W.: Applications of Front Tracking to the Simulation of Shock Refractions and Unstable Mixing. J. Appl. Num. Math. 14 (1994) 213{237 18. Grove, J. W., Yang, Y., Zhang, Q., Sharp, D. H., Glimm, J., Boston, B., Holmes,R.: The Application of Front Tracking to the Simulation of Shock Refractions and Shock Accelerated Interface Mixing. In: Proceedings of the 4th International Workshop on the Physics of Compressible Turbulent Mixing Cambridge Univ., Cambridge (1993), Report No. SUNYSB-AMS-93-21 State Univ. of New York at Stony Brook 19. Holmes, R., Grove, J. W., Sharp, D. H., Numerical Investigation of RichtmyerMeshkov Instability Using Front Tracking. J. Fluid Mech. (To Appear 1995) 20. LeVeque, R. J., Shyue, K.-M.: Two-dimensional front tracking based on high resolution wave propagation methods: submitted to J. Comput. Phys.
21. Mao, D.-K.: A treatment of discontinuities for nite dierence methods in the two-dimensional case. J. Comp. Phys. 104 (1993) 377{397 22. Moretti, G.: Thoughts and Afterthoughts About Shock Computations. Rep. No. PIBAL-72-37, Polytechnic Institute of Brooklyn, 1972 23. Moretti, G.: Computations of Flows with Shocks. Ann Rev Fluid Mech, 19 (1987), 313{337 24. Moretti, G., Grossman, B., Marconi, F.: A Complete Numerical Technique for the Calculation of Three Dimensional Inviscid Supersonic Flow. American Institute for Aeronautics and Astronautics, Rep. No. 72-192, (1972) 25. Richtmyer, R., Morton, K.: Dierence Methods for Initial Value Problems. Interscience, New York, 1967 26. Zhu, Y.-L., Chen, B.-M., Wu, X.-H., Xu, Q.-S.: Some New Developments of the Singularity-Separating Dierence Method. Lecture Notes in Physics, SpringerVerlag, Heidelberg 170 (1982) 27. Zhu, Y.-L., Chen, B.-M.: A Numerical Method with High Accuracy for Calculating the Interactions between Discontinuities in Three Independent Variables. Scientia Sinica 23 (1980)
This article was processed using the LATEX macro package with LLNCS style