Abstract:
A method for constructing a velocity vector field from a grid and a set of fluxes for each face of the grid cells. The cells are first subdivided and internal fluxes are calculated for each cell subject to the constraints of the flux for each cell and to achieve the minimum energy state for the each cell. The minimum energy state is computed efficiently using a divergence-free correction method without introducing a pressure variable. Then, the velocity vector field is constructed from the subcell fluxes using mixed finite element interpolation.

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
       [0001]    This application claims the benefit of U.S. Provisional Patent Application 61/072,295 filed Mar. 28, 2008 entitled Computing A Consistent Velocity Vector Field From A Set of Fluxes, the entirety of which is incorporated by reference herein. 
     
    
     BACKGROUND OF THE INVENTION 
       [0002]    1. Field of the Invention 
         [0003]    This disclosure relates generally to the field of building numerical models suitable for computer simulation of diffusive processes in heterogeneous media, such as fluid flow in underground porous rock formations like oil and gas reservoirs and/or aquifers. 
         [0004]    2. Description of Related Art 
         [0005]    Computer simulation of fluid flow in porous media is widely used in the oil industry, hydrology, environmental studies, and remediation of contaminated groundwater. Simulation predictions often have a significant impact on the economic valuation of assets and government environmental policies. This invention is related to a key step in building accurate simulation models. In the preferred embodiments, reference is made to the application of the disclosure to hydrocarbon recovery, but the scope of the invention is not limited to the simulation of hydrocarbon recovery. 
         [0006]    Very often, there is a need to compute a velocity vector field consistent with a set of fluxes given with respect to a structured or unstructured simulation grid. Since many fluid flow simulators use Finite Difference (FD) or Control Volume discretizations, they do not compute a fluid velocity vector field directly but rather generate a set of fluxes on cell faces. Therefore, there is the need to convert a set a fluxes into a velocity field. 
         [0007]    Once an explicit velocity vector field is available, it may be used to compute streamlines and dispersion tensor coefficients. Streamlines can be used for visualization or streamline simulations. 
         [0008]    Another example of using a velocity vector field is to compare fluxes computed on a fine grid to fluxes on several coarse grids for the purpose of evaluating the quality of different coarse (simulation scale) grids. Similarly, one could use such fine-coarse grid flux comparisons for evaluating and/or generating upscaled reservoir properties. Also, fluxes may be used to convert from an unstructured grid to a structured grid for visualization purposes. A comparison of fluxes computed on unstructured and structured grids can be used for testing and validating the computer code that uses the unstructured grid discretization. In particular, the effect of non-orthogonalities in the grid upon the accuracy of the computed fluxes may be tested. Since flux comparison is local, it could help pinpoint problem areas. 
         [0009]    Comparing fluxes computed with respect to different grids is a non-trivial task. Although, strictly speaking, fluxes are scalars, they contain geometric information which has to be taken into account for any meaningful comparison. This geometric information includes the area and the orientation of the surface with respect to which the fluxes are computed. The problem of comparing fluxes on different grids is somewhat similar to comparing two vectors with components given with respect to two different coordinate systems. In order to obtain a meaningful comparison, one needs to know the components of the two vectors with respect to the same coordinate system. Similarly, one needs to transfer the two fluxes to a single grid in order to be able to perform a meaningful comparison. As a transfer mechanism, we suggest using a physically realistic velocity vector field, which is defined at every point and is computed using the unstructured grid fluxes, the grid-block geometry, and the underlying permeability field. 
       SUMMARY OF INVENTION 
       [0010]    A method for reconstructing a velocity vector field from a given set of fluxes defined on the faces of cells comprising an unstructured grid is disclosed. The method generally comprises at least some of the following steps: subdividing each cell into triangular prisms with a common edge (subcells); using a divergence-free correction method to reduce the number of equations (for calculating the flux across faces between subcells) to be solved per cell; finding a solution that satisfies the flux constraints and minimizes the complementary energy for each cell; and creating a set of velocity vectors from the fluxes. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0011]      FIG. 1  illustrates the vector basis function associated with the i th  edge is identically zero outside the two triangles sharing edge i. 
           [0012]      FIG. 2  illustrates the vector functions associated with the edges of a reference triangle. 
           [0013]      FIG. 3  illustrates the affine mapping F from the reference triangle {circumflex over (τ)} to the physical triangle τ. 
           [0014]      FIG. 4  illustrates a grid-block G subdivided into s triangles. 
           [0015]      FIG. 5  illustrates a 2.5D grid block split into prisms. 
           [0016]      FIG. 6  illustrates a reference triangle prism. 
           [0017]      FIG. 7  is a flowchart illustrating one embodiment of the disclosed method. 
           [0018]      FIG. 8  is a flowchart illustrating another embodiment of the disclosed method. 
       
    
    
     DETAILED DESCRIPTION 
       [0019]    In this disclosure, a new method for calculating a velocity vector field consistent with fluxes computed on an unstructured grids is described. By consistent, the following is meant:
       on the boundaries (faces) of each grid block, the velocity vector field generates fluxes that are identical to the fluxes given by the unstructured grid discretization;   inside each grid block, the velocity vector field chooses the paths of least resistance by minimizing a discrete complementary energy functional; and   the velocity vector field can be point-wise divergence-free, which ensures mass conservation with respect to any volume.       
 
         [0023]    To obtain a consistent velocity vector field, solve a steady-state, single-phase pressure equation inside each grid-block with specified flux boundary conditions. The preferred method for solving the pressure equation is the Mixed Finite Element (MFE) Method with the lowest-order Raviart-Thomas-Nedelec (RTN) velocity vector field defined on triangular prisms (see P.-A. Raviart and J.-M. Thomas,  A mixed finite element method for second order elliptic problems , Mathematical Aspects of the Finite Element Method (A. Dold and B. Eckmann, eds.), Lecture Notes in Mathematics, vol. 606, Springer—Verlag, Heidelberg, 1977, pp. 292-315; J. C. Nedelec,  Mixed finite elements in R   3 , Numer. Math. 35 (1980), 315-341; J. C. Nedelec,  A new family of mixed finite elements in R   3 , Numer. Math. 50 (1986), 57-81). 
         [0024]    The choice of solution method is determined by the following requirements: 
         [0025]    (1) The velocity vector field must be defined at every point. This requirement suggests using a Finite Element Method rather than Finite Differences. 
         [0026]    (2) The velocity vector field must have a continuous normal component with respect to arbitrary surfaces. This requirement suggests using a discretization technique with separate unknowns for the velocity and pressure variables, thus excluding the standard (pressure based) Finite Element Method. Also, it excludes Control Volume Methods that involve vector fields with normal component continuous only at a discrete set of points. 
         [0027]    (3) The velocity vector field must allow to be point-wise divergence-free, so that it can conserve mass with respect to arbitrary volumes. This requirement suggests using a Raviart-Thomas-Nedelec (RTN) type of velocity space. 
         [0028]    (4) The velocity vector field must be well-defined on triangular prisms, so that unstructured irregular grids can be accommodated. This requirement suggests using a Mixed Finite Element Method. 
         [0029]    (5) The discretization technique must be able to impose exactly flux boundary conditions, so that the velocity vector field can be consistent with the fluxes computed by using unstructured grids. Again, Mixed Finite Element Methods satisfy this condition. 
         [0030]    The disclosed approach offers new capabilities and advantages over the existing technology. It allows treatment of both compressible and incompressible fluids. It increases the resolution of the simulation grid by about 5-6 times at a very small extra computational and memory cost. The computation of the velocity vector field is done locally, separately on each grid block. The computation of the velocity vector field involves solving a 1×1 linear system per grid block regardless of the number of faces that define the grid block. It provides a new capability for computing streamlines on unstructured 2.5D grids. It provides a new capability for testing the effect of non-orthogonalities in a grid upon the accuracy of the computed fluxes. 
         [0031]    We begin with a brief review of the Mixed Finite Element Method (MFEM) with lowest-order Raviart-Thomas-Nedelec (RTN) (see Raviart et al., supra; Nedelec,  Mixed finite elements in R   3 , supra; Nedelec,  A new family of mixed finite elements in R   3 , supra) approximation space for second-order elliptic boundary value problems in three dimensions corresponding to single-phase, steady-state Darcy flow in porous media. The standard notation (see R. Adams,  Sobolev spaces , Academic Press, New York, 1975) L 2 (Ω) for the space of functions that are square integrable over a bounded, open domain Ω⊂R 3  with Lipschitz continuous boundary ∂Ω are used. H 1 (Ω) denotes the space of functions that are in L 2 (Ω) together with all their first derivatives. 
         [0032]    Consider a pure Neumann boundary value problem: find pεH 1  (Ω) such that 
         [0000]    
       
         
           
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             
                               - 
                               ∇ 
                             
                             · 
                             
                               ( 
                               
                                 K 
                                  
                                 
                                   ∇ 
                                   p 
                                 
                               
                               ) 
                             
                           
                         
                       
                       
                         
                           
                             
                               ( 
                               
                                 K 
                                  
                                 
                                   ∇ 
                                   p 
                                 
                               
                               ) 
                             
                             · 
                             n 
                           
                         
                       
                     
                      
                     
                       
                         
                           = 
                         
                       
                       
                         
                           = 
                         
                       
                     
                      
                     
                       
                         
                           
                             f 
                             , 
                           
                         
                         
                           in 
                         
                         
                           
                             Ω 
                             , 
                           
                         
                       
                       
                         
                           
                             g 
                             , 
                           
                         
                         
                           on 
                         
                         
                           
                             
                               ∂ 
                               Ω 
                             
                             , 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where fεL 2  (Ω) satisfies the relation: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         ∫ 
                         Ω 
                       
                        
                       
                         f 
                          
                         
                             
                         
                          
                         
                            
                           x 
                         
                          
                         
                            
                           y 
                         
                          
                         
                            
                           z 
                         
                       
                     
                     = 
                     
                       
                         ∫ 
                         
                           ∂ 
                           Ω 
                         
                       
                        
                       
                         g 
                          
                         
                             
                         
                          
                         
                            
                           S 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0000]    and n denotes the unit outward normal vector to ∂Ω. The symbols ∇· and ∇ stand for the divergence and gradient operators, respectively. Assume that K=(K ij ) 3×3  is a given real-valued symmetric matrix function with bounded and measurable entries K ij  (i,j=1, 2, 3) and satisfies the ellipticity condition, i.e., there exist positive constants α i  and α 2  such that 
         [0000]      α 1 ξ t ξ≦ξ t   K ( x,y,z )ξ≦α 2 ξ t ξ  (3) 
         [0000]    for all ξεR 3  and almost all (x,y,z)ε  Ω . 
         [0033]    In the context of single-phase, steady-state fluid flow in porous media, for example, p is the fluid pressure, v=−K∇p is the fluid (Darcy) velocity, K is the permeability tensor of the porous media, g is the specified flux on the boundary and f represents sources (sinks). 
         [0034]    As usual, without loss of generality, consider the case of homogeneous boundary conditions, i.e., g=0. 
         [0035]    Use the following space to define the mixed variational problem. Let 
         [0000]        H (div;Ω)≡{ wεL   2 (Ω) 3   |∇·wεL   2 (Ω)}, 
         [0000]    which is a Hilbert space (a complete norm vector space) equipped with the norm 
         [0000]      ∥ w∥   H(div;Ω) ≡(∥ w∥   L     2     (Ω)     3     2   +∥∇·w∥   L     2     (Ω)   2 ) 1/2    
         [0000]    and the associated inner product. By introducing the velocity variable 
         [0000]    
       
      
       v=−K∇p,  
      
     
         [0000]    which is of practical interest for many physical problems (including fluid flow in porous media), we can rewrite the second-order partial differential equation (PDE) of (1) as a first-order system 
         [0000]    
       
         
           
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             
                               K 
                               
                                 - 
                                 1 
                               
                             
                              
                             v 
                           
                           + 
                           
                             ∇ 
                             
                                 
                             
                              
                             p 
                           
                         
                       
                       
                         = 
                       
                       
                         
                           0 
                           , 
                         
                       
                     
                     
                       
                         
                           ∇ 
                           
                             · 
                             v 
                           
                         
                       
                       
                         = 
                       
                       
                         
                           f 
                           , 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0000]    and obtain the mixed formulation of (1): find (v,p) E VxA such that 
         [0000]    
       
         
           
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             a 
                              
                             
                               ( 
                               
                                 v 
                                 , 
                                 w 
                               
                               ) 
                             
                           
                           - 
                           
                             b 
                              
                             
                               ( 
                               
                                 w 
                                 , 
                                 p 
                               
                               ) 
                             
                           
                         
                       
                       
                         = 
                       
                       
                         
                           0 
                           , 
                         
                       
                       
                         
                           
                             ∀ 
                             
                               w 
                               ∈ 
                               V 
                             
                           
                           , 
                         
                       
                     
                     
                       
                         
                           b 
                            
                           
                             ( 
                             
                               v 
                               , 
                               λ 
                             
                             ) 
                           
                         
                       
                       
                         = 
                       
                       
                         
                           
                             ( 
                             
                               f 
                               , 
                               λ 
                             
                             ) 
                           
                           , 
                         
                       
                       
                         
                           ∀ 
                           
                             λ 
                             ∈ 
                             
                               Λ 
                               . 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0036]    Here V=H 0  (div;Ω)≡{wεH(div;Ω)|w ·n=0 on ∂Ω}, ∇ is the quotient space L 0   2 (Ω)=L 2 (Ω)/{constants}, the bilinear forms a(·,·):V×V→R and b(·,·):V×∇→R are defined by 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       a 
                        
                       
                         ( 
                         
                           w 
                           , 
                           u 
                         
                         ) 
                       
                     
                     = 
                     
                       
                         ∫ 
                         Ω 
                       
                        
                       
                         
                           
                             ( 
                             
                               
                                 K 
                                 
                                   - 
                                   1 
                                 
                               
                                
                               w 
                             
                             ) 
                           
                           · 
                           u 
                         
                          
                         
                             
                         
                          
                         
                            
                           x 
                         
                          
                         
                            
                           y 
                         
                          
                         
                            
                           z 
                         
                       
                     
                   
                    
                   
                       
                   
                    
                   
                     
 
                   
                    
                   
                     
                       and 
                        
                       
                           
                       
                        
                       
                         b 
                          
                         
                           ( 
                           
                             w 
                             , 
                             λ 
                           
                           ) 
                         
                       
                     
                     = 
                     
                       
                         ∫ 
                         Ω 
                       
                        
                       
                         
                           ( 
                           
                             ∇ 
                             
                               · 
                               w 
                             
                           
                           ) 
                         
                          
                         λ 
                          
                         
                             
                         
                          
                         
                            
                           x 
                         
                          
                         
                            
                           y 
                         
                          
                         
                            
                           z 
                         
                       
                     
                   
                 
               
               
                 
                     
                 
               
             
           
         
       
     
         [0000]    for any w,uεV and λε∇, respectively, and (·,·) denotes the L 2 (Ω) inner product. 
         [0037]    To discretize the mixed formulation (5), assume that there are two given finite-dimensional finite element subspaces: 
         [0000]      V h ⊂V and ∇ h ⊂∇ 
         [0000]    defined on a unstructured mesh with elements of size O(h). The mixed approximation to (v,p) is defined to be the pair, (v h ,p h )εV h ×∇ h , satisfying 
         [0000]    
       
         
           
             
               
                 
                   { 
                   
                     
                       
                         
                           
                             a 
                              
                             
                               ( 
                               
                                 
                                   v 
                                   h 
                                 
                                 , 
                                 w 
                               
                               ) 
                             
                           
                           - 
                           
                             b 
                              
                             
                               ( 
                               
                                 w 
                                 , 
                                 
                                   p 
                                   h 
                                 
                               
                               ) 
                             
                           
                         
                       
                       
                         = 
                       
                       
                         
                           0 
                           , 
                         
                       
                       
                         
                           
                             ∀ 
                             
                               w 
                               ∈ 
                               
                                 V 
                                 h 
                               
                             
                           
                           , 
                         
                       
                     
                     
                       
                         
                           b 
                            
                           
                             ( 
                             
                               
                                 v 
                                 h 
                               
                               , 
                               λ 
                             
                             ) 
                           
                         
                       
                       
                         = 
                       
                       
                         
                           
                             ( 
                             
                               f 
                               , 
                               λ 
                             
                             ) 
                           
                           , 
                         
                       
                       
                         
                           ∀ 
                           
                             λ 
                             ∈ 
                             
                               
                                 Λ 
                                 h 
                               
                               . 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0038]    Refer to Raviart et al., supra; F. Brezzi and M. Fortin,  Mixed and hybrid finite element methods , Springer Series of Computational Mathematics, Springer-Verlag New York Inc., New York, 1991 ; Nedelec, Mixed finite elements in R   3 , supra; and Nedelec,  A new family of mixed finite elements in R   3 , supra for the definition of classes of approximation subspaces V h  and ∇ h . In 2-D, those spaces are defined on triangles and quadrilaterals. In 3-D, they are defined on tetrahedra, hexahedra and triangular prisms. The meshes can be unstructured and distorted, thus allowing compliance with complex geometries. For simplicity, in this disclosure only the lowest-order R-T-N space defined on a triangular prismatic partition of Ω will be considered. Such a space for the velocity consists of vector functions which are piecewise polynomial with respect to the triangular prisms and whose normal component is continuous across element boundaries. The corresponding pressure space ∇ h  consists of discontinuous piecewise constants with respect to the triangulation T h  with a fixed value on one element. Specifically, let T h  denote a partition of Ω into non-overlapping triangular prisms. Then the lowest-order R-T-N approximation space for the velocity on a triangular prism τεT h  (assuming the two triangular faces are parallel to the plane z=const.) is defined by 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         V 
                         h 
                       
                        
                       
                         ( 
                         τ 
                         ) 
                       
                     
                     = 
                     
                       [ 
                       
                         
                           
                             
                               a 
                               + 
                               dx 
                             
                           
                         
                         
                           
                             
                               b 
                               + 
                               dy 
                             
                           
                         
                         
                           
                             
                               c 
                               + 
                               ez 
                             
                           
                         
                       
                       ] 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
         [0000]    and the corresponding pressure space is 
         [0000]      ∇ h (τ)=constant,  (8) 
         [0000]    where a, b, c, d and e are the five constants which uniquely determine the velocity vector inside the triangular prism τ. In 2D, the constants c and e are identically zero. It is well-known that the above R-T-N space satisfies the Babuska-Brezzi stability condition (cf. Raviart et al., supra): there exists a positive constant β independent of the mesh size h of T h  such that 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         sup 
                         
                           w 
                           ∈ 
                           
                             V 
                             h 
                           
                         
                       
                        
                       
                         
                           b 
                            
                           
                             ( 
                             
                               w 
                               , 
                               λ 
                             
                             ) 
                           
                         
                         
                           
                              
                             w 
                              
                           
                           
                             H 
                              
                             
                               ( 
                               
                                 div 
                                 , 
                                 Ω 
                               
                               ) 
                             
                           
                         
                       
                     
                     ≥ 
                     
                       β 
                        
                       
                         
                            
                           λ 
                            
                         
                         
                           
                             L 
                             2 
                           
                            
                           
                             ( 
                             Ω 
                             ) 
                           
                         
                       
                     
                   
                   , 
                   
                     ∀ 
                     
                       λ 
                       ∈ 
                       
                         
                           Λ 
                           h 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
         [0039]    The stability condition (9) is used in (Raviart et al., supra; Brezzi et al., supra) to rigorously prove the convergence rate of the MFEM. The lowest-order R-T-N space defined in (7)-(8) is first-order convergent both with respect to the pressure and the velocity variables. First-order convergence means that if (v,p) is the exact solution to the continuous problem (5) and (v h ,p h ) is the MFEM approximation obtained by solving the discrete problem (6), then there exists a positive constant C independent of the mesh parameter h, such that 
         [0000]      ∥ p−p   h ∥ L     2(Ω)     +∥v−v   h ∥ H (div;Ω) ≦Ch (∥ p∥   H     1     (Ω)   +∥v∥   H     1     (Ω)     3   ).  (10) 
         [0040]    Also, Raviart and Thomas in (Raviart et al., supra) demonstrated the existence of a projection operator Π h :V→V h  such that, for any vεV, 
         [0000]        b (Π h   v ,λ)= b ( v ,λ),∀λε∇ h ,  (11) 
         [0000]      ∥Π h   v−v∥   L     2     (Ω)   3   ≦Ch∥v∥   H     1     (Ω)     2   .  (12) 
         [0041]    Once a basis is selected for ∇ h  and V h , one can write the discrete equations in a matrix form. Let {v i } i=1   L  be a basis for V h  and {θ k } k=1   M  be a basis for ∇ h . Then, (6) leads to the matrix equation 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         [ 
                         
                           
                             
                               M 
                             
                             
                               B 
                             
                           
                           
                             
                               
                                 B 
                                 T 
                               
                             
                             
                               0 
                             
                           
                         
                         ] 
                       
                        
                       
                         [ 
                         
                           
                             
                               V 
                             
                           
                           
                             
                               P 
                             
                           
                         
                         ] 
                       
                     
                     = 
                     
                       [ 
                       
                         
                           
                             0 
                           
                         
                         
                           
                             F 
                           
                         
                       
                       ] 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   13 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where V and P are coefficient vectors representing the vector and pressure unknowns, respectively, and the matrices M and B are given by 
         [0000]        M   i,j   =a ( v   i   ,v   j ) 
         [0000]        B   i,k   =−b ( v   i ,θ k ) 
         [0000]        F   k =−( f,θ   k ).  (14) 
         [0042]    The rectangular matrix −B is the discrete gradient operator while its adjoint, B T  is the discrete divergence operator. The mass matrix M is symmetric and positive definite. The matrix in (13) is symmetric but indefinite (it has both positive and negative eigenvalues). 
         [0043]    In the case when MFEM is used to discretize the equations for the time-dependent Darcy flow in porous media, the corresponding matrix equations take the form: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         [ 
                         
                           
                             
                               M 
                             
                             
                               B 
                             
                           
                           
                             
                               
                                 B 
                                 T 
                               
                             
                             
                               
                                 - 
                                 D 
                               
                             
                           
                         
                         ] 
                       
                        
                       
                         [ 
                         
                           
                             
                               V 
                             
                           
                           
                             
                               P 
                             
                           
                         
                         ] 
                       
                     
                     = 
                     
                       [ 
                       
                         
                           
                             0 
                           
                         
                         
                           
                             F 
                           
                         
                       
                       ] 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   15 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where the matrix D is diagonal with strictly positive diagonal entries. 
       2D Formulation 
       [0044]    In this section practical algorithms that implement the general abstract formulation of the MFEM from the previous section are described. 
         [0045]    Next, a particular choice of vector basis functions that span the lowest-order R-T (see Raviart et al., supra) space on triangles are described. Each vector basis function is chosen to be non-zero in the union of two triangles sharing the same edge and zero everywhere else. Thus, there is one basis function associated with each triangle edge (except edges that are part of the boundary ∂Ω). Also, each basis function has unit flux across the common edge and zero fluxes across all other edges, as illustrated in  FIG. 1 ). 
         [0046]    Every vector basis function is defined separately in each of the two triangles by first defining it on a reference triangle. Then using a (specific for each triangle) transformation the basis function is defined on the “real” triangle. It is convenient to use a reference triangle determined by the points with coordinates (0, 0), (1, 0) and (0, 1). As illustrated in  FIG. 2 , define three vector functions, each associated with one edge of the reference triangle: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         v 
                         ^ 
                       
                       1 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             
                               - 
                               
                                 x 
                                 ^ 
                               
                             
                           
                         
                         
                           
                             
                               1 
                               - 
                               
                                 y 
                                 ^ 
                               
                             
                           
                         
                       
                       ] 
                     
                   
                   , 
                   
                     
                       
                         v 
                         ^ 
                       
                       2 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             
                               - 
                               
                                 x 
                                 ^ 
                               
                             
                           
                         
                         
                           
                             
                               - 
                               
                                 y 
                                 ^ 
                               
                             
                           
                         
                       
                       ] 
                     
                   
                   , 
                   
                     
                       
                         v 
                         ^ 
                       
                       3 
                     
                     = 
                     
                       
                         [ 
                         
                           
                             
                               
                                 
                                   - 
                                   1 
                                 
                                 + 
                                 
                                   x 
                                   ^ 
                                 
                               
                             
                           
                           
                             
                               
                                 y 
                                 ^ 
                               
                             
                           
                         
                         ] 
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   16 
                   ) 
                 
               
             
           
         
       
     
         [0047]    Let τ be an arbitrary triangle with vertices at (x 0 ,y 0 ), (x 1 ,y 1 ) and (x 2 ,y 2 ). Now that the vector functions on the reference triangle t are defined, consider the mapping F:{circumflex over (τ)}→τ from the reference triangle to the physical triangle, illustrated in  FIG. 3 , such that the point (0,0) is mapped to (x 0 ,y 0 ), (1,0) to (x 1 ,y 1 ) and (0,1) to (x 2 ,y 2 ). It is easy to verify that the mapping (x,y)=F ({circumflex over (x)},ŷ) is given by the following formula: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       [ 
                       
                         
                           
                             x 
                           
                         
                         
                           
                             y 
                           
                         
                       
                       ] 
                     
                     = 
                     
                       
                         [ 
                         
                           
                             
                               
                                 x 
                                 0 
                               
                             
                           
                           
                             
                               
                                 y 
                                 0 
                               
                             
                           
                         
                         ] 
                       
                       + 
                       
                         
                           [ 
                           
                             
                               
                                 
                                   x 
                                   10 
                                 
                               
                               
                                 
                                   x 
                                   20 
                                 
                               
                             
                             
                               
                                 
                                   y 
                                   10 
                                 
                               
                               
                                 
                                   y 
                                   20 
                                 
                               
                             
                           
                           ] 
                         
                          
                         
                           [ 
                           
                             
                               
                                 
                                   x 
                                   ^ 
                                 
                               
                             
                             
                               
                                 
                                   y 
                                   ^ 
                                 
                               
                             
                           
                           ] 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   17 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where the notation x ij =x i −x j  and y ij =y i −y j  is used. Note that the Jacobian matrix B of the mapping F 
         [0000]    
       
         
           
             
               
                 
                   B 
                   = 
                   
                     [ 
                     
                       
                         
                           
                             x 
                             10 
                           
                         
                         
                           
                             x 
                             20 
                           
                         
                       
                       
                         
                           
                             y 
                             10 
                           
                         
                         
                           
                             y 
                             20 
                           
                         
                       
                     
                     ] 
                   
                 
               
               
                 
                   ( 
                   18 
                   ) 
                 
               
             
           
         
       
     
         [0000]    is constant, i.e. independent of ({circumflex over (x)},ŷ). Such mappings are called affine and the following formula holds: 
         [0000]    
       
         
           
             
               
                 
                   
                     area 
                      
                     
                         
                     
                      
                     
                       ( 
                       τ 
                       ) 
                     
                   
                   = 
                   
                     
                       1 
                       2 
                     
                      
                     
                       
                          
                         
                           det 
                            
                           
                               
                           
                            
                           B 
                         
                          
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   19 
                   ) 
                 
               
             
           
         
       
     
         [0048]    Given a vector function {circumflex over (v)} on the reference triangle, its image v on the physical triangle can be defined by 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       v 
                        
                       
                         ( 
                         
                           x 
                           , 
                           y 
                         
                         ) 
                       
                     
                     = 
                     
                       
                         1 
                         
                            
                           
                             det 
                              
                             
                                 
                             
                              
                             B 
                           
                            
                         
                       
                        
                       B 
                        
                       
                           
                       
                        
                       
                         
                           v 
                           ^ 
                         
                          
                         
                           ( 
                           
                             
                               
                                 x 
                                 ^ 
                               
                                
                               
                                 ( 
                                 
                                   x 
                                   , 
                                   y 
                                 
                                 ) 
                               
                             
                             , 
                             
                               
                                 y 
                                 ^ 
                               
                                
                               
                                 ( 
                                 
                                   x 
                                   , 
                                   y 
                                 
                                 ) 
                               
                             
                           
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   20 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where {circumflex over (x)}={circumflex over (x)}(x,y) and ŷ=ŷ(x,y) are the components of the inverse transformation F −1 :τ→{circumflex over (τ)}. Formula (20) is usually called contravariant or Piola&#39;s transformation and has some very useful properties:
       Piola&#39;s transformation preserves the normal components of the vector;   Piola&#39;s transformation preserves divergence-free vectors.       
 
         [0051]    Moreover, the following formula holds (see Brezzi et al., supra): 
         [0000]    
       
         
           
             
               
                 
                   
                     div 
                      
                     
                         
                     
                      
                     v 
                   
                   = 
                   
                     
                       1 
                       
                          
                         
                           det 
                            
                           
                               
                           
                            
                           B 
                         
                          
                       
                     
                      
                     div 
                      
                     
                         
                     
                      
                     
                       
                         v 
                         ^ 
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   21 
                   ) 
                 
               
             
           
         
       
     
         [0052]    Since the vector functions defined in (16) have unit normal flux across one of the edges of {circumflex over (τ)} and zero normal flux across the other two edges, the same is true for their images, due to the first property. Also, by the second property and from (19), for i=1, 2, 3, 
         [0000]    
       
         
           
             
               
                 
                   
                     div 
                      
                     
                         
                     
                      
                     
                       v 
                       i 
                     
                   
                   = 
                   
                     
                       
                         1 
                         
                            
                           
                             det 
                              
                             
                                 
                             
                              
                             B 
                           
                            
                         
                       
                        
                       div 
                        
                       
                           
                       
                        
                       
                         
                           v 
                           ^ 
                         
                         i 
                       
                     
                     = 
                     
                       
                         ± 
                         
                           2 
                           
                              
                             
                               det 
                                
                               
                                   
                               
                                
                               B 
                             
                              
                           
                         
                       
                       = 
                       
                         ± 
                         
                           
                             1 
                             
                               area 
                                
                               
                                   
                               
                                
                               
                                 ( 
                                 τ 
                                 ) 
                               
                             
                           
                           . 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   22 
                   ) 
                 
               
             
           
         
       
     
         [0053]    The Mixed Finite Element problem on any grid-block may now be defined. As illustrated in  FIG. 4 , let (x 0 ,y 0 ) be any interior point of the grid-block G. Then divide G into s triangles by connecting (x 0 ,y 0 ) to each vertex (x i ,y i ), for i=1, 2, . . . , s. Let triangle τ i  have permeability k i . The reference triangle {circumflex over (τ)} is mapped onto each triangle τ i  by an affine mapping F i  with the following Jacobian matrices: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       B 
                       1 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             
                               x 
                               
                                 s 
                                  
                                 
                                     
                                 
                                  
                                 0 
                               
                             
                           
                           
                             
                               x 
                               10 
                             
                           
                         
                         
                           
                             
                               y 
                               
                                 s 
                                  
                                 
                                     
                                 
                                  
                                 0 
                               
                             
                           
                           
                             
                               y 
                               10 
                             
                           
                         
                       
                       ] 
                     
                   
                   , 
                   
                     
                       B 
                       i 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             
                               x 
                               
                                 
                                   i 
                                   - 
                                   1 
                                 
                                 , 
                                 0 
                               
                             
                           
                           
                             
                               x 
                               
                                 i 
                                  
                                 
                                     
                                 
                                  
                                 0 
                               
                             
                           
                         
                         
                           
                             
                               y 
                               
                                 
                                   i 
                                   - 
                                   1 
                                 
                                 , 
                                 0 
                               
                             
                           
                           
                             
                               y 
                               
                                 i 
                                  
                                 
                                     
                                 
                                  
                                 0 
                               
                             
                           
                         
                       
                       ] 
                     
                   
                   , 
                   
                     
 
                   
                    
                   
                     
                       for 
                        
                       
                           
                       
                        
                       i 
                     
                     = 
                     2 
                   
                   , 
                   3 
                   , 
                   … 
                    
                   
                       
                   
                   , 
                   
                     s 
                     . 
                   
                 
               
               
                 
                   ( 
                   23 
                   ) 
                 
               
             
           
         
       
     
         [0054]    Let v i  be the basis vector function associated with the i th  interior edge and let b i  be the basis vector function associated with the i th  boundary edge. In this disclosure, the counter-clockwise direction is considered to be positive for the interior edges and for the boundary edges, the positive direction is pointing inwards the grid-block. Let b 1 , b 2 , . . . , b s  be the given fluxes across the corresponding boundary edges. It is assumes (without loss of generality) that the boundary data is consistent with zero interior sources (sinks), i.e. 
         [0000]    
       
         
           
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 s 
               
                
               
                 b 
                 i 
               
             
             = 
             0. 
           
         
       
     
         [0000]    The choice of positive direction implies that positive boundary fluxes correspond to fluid entering the grid-block. Denote by v h  the vector function which is the MFEM solution to the grid-block problem. Since v h  has known fluxes across all boundary edges, only the interior fluxes need to be solved, i.e. we need to find a vector function v h   0 =v h −b, where 
         [0000]        b=b   1   b   1   +b   2   b   2   + . . . +b   s   b   s .  (24) 
         [0000]      Let 
         [0000]        v   0   h   =V   1   v   1   +V   2   v   2   + . . . +V   s   v   s   (25) 
         [0055]    be the (unique) representation of the function v h   0  with respect to the chosen basis functions v 1 , v 2 , . . . , v s . 
         [0056]    Normally, one needs to solve a (2s)×(2s) linear system of the type (13) for the unknown coefficients V 1 , V 2 , . . . , V s  and the unknown pressures. Using the divergence-free correction approach (see, e.g., Z. Cai, R. R. Parashkevov, T. F. Russell, and X. Ye,  Overlapping domain decomposition for a mixed finite element method in three dimensions , Domain Decomposition Methods in Sciences and Engineering (Bergen, Norway) (P. E Bjørstad, M. S. Espedal, and D. E. Keyes, eds.), Ninth International Conference, Domain Decomposition Press, 1998, pp. 188-96 and the references therein) reduces the system to 1×1. In other words, explicit formulae for the MFEM solution in this special case can be written. The divergence-free subspace is one-dimensional and is spanned by the vector function d, where 
         [0000]        d=v   1   +v   2   + . . . +v   s .  (26) 
         [0057]    The transpose C of the coefficient vector of the function d 
         [0000]      C=[1,1, . . . , 1] 1×s   (27) 
         [0000]    is a discrete analogue of the differential operator 
         [0000]    
       
         
           
             curl 
             = 
             
               [ 
               
                 
                   
                     
                       ∂ 
                       
                         ∂ 
                         y 
                       
                     
                   
                 
                 
                   
                     
                       - 
                       
                         ∂ 
                         
                           ∂ 
                           x 
                         
                       
                     
                   
                 
               
               ] 
             
           
         
       
     
         [0000]    and plays an important role in the algorithms described below. 
         [0058]    The first step of the divergence-free approach is to compute an initial guess v I  for the velocity field, such that:
       v I  satisfies no-flow boundary conditions;   ∫ τ     i    div v     I   =b   i   , for. i=1,2, . . . , s          
 
         [0061]    If 
         [0000]        v   I   =V   1   I   v   1   +V   2   I   v   2   + . . . +V   s   I   v   s ,  (28) 
         [0000]    then the following Algorithm computes its coefficient vector: 
         [0062]    Set V 1   I =1. 
         [0063]    For i=2, 3, . . . , s, 
         [0064]    set V 1   I =V i−1   I +b i . 
         [0065]    The solution v 0   h  can now be computed by adding a divergence-free correction to the initial guess v I : 
         [0000]    
       
         
           
             
               
                 
                   
                     v 
                     0 
                     h 
                   
                   = 
                   
                     
                       v 
                       I 
                     
                     - 
                     
                       
                         
                           
                             ∫ 
                             G 
                           
                            
                           
                             
                               
                                 k 
                                 
                                   - 
                                   1 
                                 
                               
                                
                               
                                 ( 
                                 
                                   
                                     v 
                                     I 
                                   
                                   + 
                                   b 
                                 
                                 ) 
                               
                             
                             · 
                              
                           
                         
                         
                           
                             ∫ 
                             G 
                           
                            
                           
                             
                               k 
                               
                                 - 
                                 1 
                               
                             
                              
                             
                                
                               
                                 · 
                                  
                               
                             
                           
                         
                       
                        
                       
                          
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   29 
                   ) 
                 
               
             
           
         
       
     
         [0066]    One can easily verify that v h =v 0   h +b minimizes the so-called  Complementary Energy  (see Brezzi et al., supra) functional F given by 
         [0000]        F ( w )=∫ G   k   −1   w·w,   (30) 
         [0000]    over the set of divergence-free vector functions in the lowest-order R-T space satisfying the prescribed flux boundary conditions. In contrast, the exact solution of the PDE (5) v minimizes F over the set of all divergence-free vector functions satisfying the prescribed flux boundary conditions. The physical interpretation of F is that its minimum realizes the velocity field which corresponds to the path of minimum resistance. 
         [0067]    Next, formulae for evaluating the integrals that appear in (29) are given. The integral in the denominator can be evaluated either by 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             ∫ 
                             G 
                           
                            
                           
                             
                               k 
                               
                                 - 
                                 1 
                               
                             
                              
                             
                                
                               
                                 · 
                                  
                               
                             
                           
                         
                         = 
                         
                           
                             ∑ 
                             
                               i 
                               = 
                               1 
                             
                             s 
                           
                            
                           
                             
                               ∫ 
                               
                                 τ 
                                 i 
                               
                             
                              
                             
                               
                                 k 
                                 i 
                                 
                                   - 
                                   1 
                                 
                               
                                
                               
                                  
                                 
                                   · 
                                    
                                 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         
                           = 
                           
                             
                               
                                 1 
                                 2 
                               
                                
                               
                                 
                                   
                                     x 
                                     
                                       1 
                                        
                                       s 
                                     
                                     2 
                                   
                                   + 
                                   
                                     y 
                                     
                                       1 
                                        
                                       s 
                                     
                                     2 
                                   
                                 
                                 
                                   
                                     k 
                                     1 
                                   
                                    
                                   
                                      
                                     
                                       
                                         det 
                                          
                                         B 
                                       
                                       1 
                                     
                                      
                                   
                                 
                               
                             
                             + 
                             
                               
                                 1 
                                 2 
                               
                                
                               
                                 
                                   ∑ 
                                   
                                     i 
                                     = 
                                     2 
                                   
                                   s 
                                 
                                  
                                 
                                   
                                     
                                       x 
                                       
                                         i 
                                         , 
                                         
                                           i 
                                           - 
                                           1 
                                         
                                       
                                       2 
                                     
                                     + 
                                     
                                       y 
                                       
                                         i 
                                         , 
                                         
                                           i 
                                           - 
                                           1 
                                         
                                       
                                       2 
                                     
                                   
                                   
                                     
                                       k 
                                       i 
                                     
                                      
                                     
                                        
                                       
                                         
                                           det 
                                            
                                           B 
                                         
                                         1 
                                       
                                        
                                     
                                   
                                 
                               
                             
                           
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   ( 
                   31 
                   ) 
                 
               
             
           
         
       
     
         [0000]    or by 
         [0000]      ∫ G   k   −1   d·d=CMC   T ,  (32) 
         [0000]    where M is the s×s mass matrix with entries 
         [0000]    
       
         
           
             
               
                 
                   
                     m 
                     ij 
                   
                   = 
                   
                     
                       
                         ∫ 
                         G 
                       
                        
                       
                         
                           k 
                           
                             - 
                             1 
                           
                         
                          
                         
                           
                             v 
                             i 
                           
                           · 
                           
                             v 
                             j 
                           
                         
                       
                     
                     = 
                     
                       
                         
                           ∫ 
                           G 
                         
                          
                         
                           
                             k 
                             
                               - 
                               1 
                             
                           
                            
                           
                             
                               v 
                               j 
                             
                             · 
                             
                               v 
                               i 
                             
                           
                         
                       
                       = 
                       
                         
                           m 
                           ij 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   33 
                   ) 
                 
               
             
           
         
       
     
         [0068]    M is a sparse, symmetric and positive definite matrix and has exactly three non-zero entries per row: 
         [0000]    
       
         
           
             
               
                 
                   M 
                   = 
                   
                     
                       [ 
                       
                         
                           
                             
                               m 
                               11 
                             
                           
                           
                             
                               m 
                               12 
                             
                           
                           
                             0 
                           
                           
                             ⋯ 
                           
                           
                             0 
                           
                           
                             
                               m 
                               
                                 1 
                                  
                                 s 
                               
                             
                           
                         
                         
                           
                             
                               m 
                               21 
                             
                           
                           
                             
                               m 
                               22 
                             
                           
                           
                             
                               m 
                               23 
                             
                           
                           
                             0 
                           
                           
                             ⋯ 
                           
                           
                             0 
                           
                         
                         
                           
                             
                                 
                             
                           
                           
                             
                                 
                             
                           
                           
                             ⋱ 
                           
                           
                             ⋱ 
                           
                           
                             ⋱ 
                           
                           
                             
                                 
                             
                           
                         
                         
                           
                             0 
                           
                           
                             ⋯ 
                           
                           
                             0 
                           
                           
                             
                               m 
                               
                                 
                                   s 
                                   - 
                                   1 
                                 
                                 , 
                                 
                                   s 
                                   - 
                                   2 
                                 
                               
                             
                           
                           
                             
                               m 
                               
                                 
                                   s 
                                   - 
                                   1 
                                 
                                 , 
                                 
                                   s 
                                   - 
                                   1 
                                 
                               
                             
                           
                           
                             
                               m 
                               
                                 
                                   s 
                                   - 
                                   1 
                                 
                                 , 
                                 s 
                               
                             
                           
                         
                         
                           
                             
                               m 
                               
                                 s 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                             
                           
                           
                             0 
                           
                           
                             ⋯ 
                           
                           
                             0 
                           
                           
                             
                               m 
                               
                                 s 
                                 , 
                                 
                                   s 
                                   - 
                                   1 
                                 
                               
                             
                           
                           
                             
                               m 
                               ss 
                             
                           
                         
                       
                       ] 
                     
                     
                       s 
                       × 
                       s 
                     
                   
                 
               
               
                 
                   ( 
                   34 
                   ) 
                 
               
             
           
         
       
     
         [0069]    One can use the following expressions to evaluate the integral in the nominator of formula (29): 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         ∫ 
                         G 
                       
                        
                       
                         
                           k 
                           
                             - 
                             1 
                           
                         
                          
                         
                           
                             v 
                             I 
                           
                           · 
                            
                         
                       
                     
                     = 
                     
                       CMV 
                       I 
                     
                   
                   , 
                   
                     
 
                   
                    
                   and 
                 
               
               
                 
                   ( 
                   35 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       
                         ∫ 
                         G 
                       
                        
                       
                         
                           k 
                           
                             - 
                             1 
                           
                         
                          
                         
                           b 
                           · 
                            
                         
                       
                     
                     = 
                     
                       
                         ∑ 
                         
                           i 
                           = 
                           1 
                         
                         s 
                       
                        
                       
                         
                           b 
                           i 
                         
                          
                         
                           F 
                           i 
                         
                       
                     
                   
                   , 
                   
                     
 
                   
                    
                   where 
                 
               
               
                 
                   ( 
                   36 
                   ) 
                 
               
             
             
               
                 
                   
                     F 
                     i 
                   
                   = 
                   
                     
                       
                         ∫ 
                         G 
                       
                        
                       
                         
                           k 
                           
                             - 
                             1 
                           
                         
                          
                         
                           
                             b 
                             i 
                           
                           · 
                            
                         
                       
                     
                     = 
                     
                       
                         ∫ 
                         
                           τ 
                           i 
                         
                       
                        
                       
                         
                           k 
                           i 
                           
                             - 
                             1 
                           
                         
                          
                         
                           
                             b 
                             i 
                           
                           · 
                           
                              
                             . 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   37 
                   ) 
                 
               
             
           
         
       
     
         [0070]    Finally, the equivalent to formula (29) in terms of coefficient vectors is given by 
         [0000]    
       
         
           
             
               
                 
                   
                     Set 
                      
                     
                         
                     
                      
                     V 
                   
                   = 
                   
                     
                       V 
                       I 
                     
                     - 
                     
                       
                         
                           
                             CMV 
                             I 
                           
                           + 
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               s 
                             
                              
                             
                               
                                 b 
                                 i 
                               
                                
                               
                                 F 
                                 i 
                               
                             
                           
                         
                         
                           CMC 
                           T 
                         
                       
                        
                       
                         
                           C 
                           T 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   38 
                   ) 
                 
               
             
           
         
       
     
         [0071]    Once the coefficient vector V is known, so is the MFEM solution according to formula (25). 
         [0072]    The definition (33) of the mass matrix is based on Assumption 3, which states that the permeability is strictly positive. If that assumption is violated, then the mass matrix is not well-defined. However, the ratio 
         [0000]    
       
         
           
             
               
                 CMV 
                 I 
               
               + 
               
                 
                   ∑ 
                   
                     i 
                     = 
                     1 
                   
                   s 
                 
                  
                 
                   
                     b 
                     i 
                   
                    
                   
                     F 
                     i 
                   
                 
               
             
             
               CMC 
               T 
             
           
         
       
     
         [0000]    tends to a finite limit as the permeability in one or several triangles approaches zero. 
       2.5D Formulation 
       [0073]    In this section, the application of the disclosed method to 2.5D unstructured grids is described. First, connect the centers of the top and bottom face with a straight line segment. Next connect with straight line segments the center of the top face to all its corners. 
         [0074]    In a similar way, partition the bottom face into triangular subfaces. Now the original 2.5D grid block can be regarded as a collection of s triangular prisms all of them sharing the same central edge, as shown in  FIG. 5 . 
         [0075]    Note that the above construction does not assume that any faces of the original grid block are planar. To handle this general geometry, again as in the 2D case, introduce a reference triangular prism, illustrated in  FIG. 6 , and a mapping F from the reference unit prism to the physical space. 
         [0076]    On the reference prism, define five vector basis functions associated with each face (Nedelec,  Mixed finite elements in R   3 , supra; Nedelec,  A new family of mixed finite elements in R   3 , supra). On the two triangular faces, as shown in  FIG. 6 , the vector functions are 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         v 
                         ^ 
                       
                       1 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             0 
                           
                         
                         
                           
                             
                               
                                 - 
                                 1 
                               
                               + 
                               
                                 y 
                                 ^ 
                               
                             
                           
                         
                         
                           
                             0 
                           
                         
                       
                       ] 
                     
                   
                   , 
                   
                     
                       
                         v 
                         ^ 
                       
                       2 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             0 
                           
                         
                         
                           
                             
                               y 
                               ^ 
                             
                           
                         
                         
                           
                             0 
                           
                         
                       
                       ] 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   39 
                   ) 
                 
               
             
           
         
       
     
         [0000]    and the functions on the quadrilateral faces are 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         v 
                         ^ 
                       
                       3 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             
                               
                                 - 
                                 1 
                               
                               + 
                               
                                 x 
                                 ^ 
                               
                             
                           
                         
                         
                           
                             0 
                           
                         
                         
                           
                             
                               z 
                               ^ 
                             
                           
                         
                       
                       ] 
                     
                   
                   , 
                   
                     
                       
                         v 
                         ^ 
                       
                       4 
                     
                     = 
                     
                       [ 
                       
                         
                           
                             
                               x 
                               ^ 
                             
                           
                         
                         
                           
                             0 
                           
                         
                         
                           
                             
                               
                                 - 
                                 1 
                               
                               + 
                               
                                 z 
                                 ^ 
                               
                             
                           
                         
                       
                       ] 
                     
                   
                   , 
                   
                     
                       
                         v 
                         ^ 
                       
                       5 
                     
                     = 
                     
                       
                         [ 
                         
                           
                             
                               
                                 x 
                                 ^ 
                               
                             
                           
                           
                             
                               0 
                             
                           
                           
                             
                               
                                 z 
                                 ^ 
                               
                             
                           
                         
                         ] 
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   40 
                   ) 
                 
               
             
           
         
       
     
         [0077]    The mapping F from the reference prism to the physical prism is given by 
         [0000]    
       
         
           
             
               
                 
                   
                     [ 
                     
                       
                         
                           x 
                         
                       
                       
                         
                           y 
                         
                       
                       
                         
                           z 
                         
                       
                     
                     ] 
                   
                   = 
                   
                     
                       F 
                        
                       
                         [ 
                         
                           
                             
                               
                                 x 
                                 ^ 
                               
                             
                           
                           
                             
                               
                                 y 
                                 ^ 
                               
                             
                           
                           
                             
                               
                                 z 
                                 ^ 
                               
                             
                           
                         
                         ] 
                       
                     
                     = 
                   
                 
               
               
                 
                   ( 
                   41 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       P 
                       000 
                     
                     + 
                     
                       
                         ( 
                         
                           
                             P 
                             100 
                           
                           - 
                           
                             P 
                             000 
                           
                         
                         ) 
                       
                        
                       
                         x 
                         ^ 
                       
                     
                     + 
                     
                       
                         ( 
                         
                           
                             P 
                             010 
                           
                           - 
                           
                             P 
                             000 
                           
                         
                         ) 
                       
                        
                       
                         y 
                         ^ 
                       
                     
                     + 
                     
                       
                         ( 
                         
                           
                             P 
                             001 
                           
                           - 
                           
                             P 
                             000 
                           
                         
                         ) 
                       
                        
                       
                         z 
                         ^ 
                       
                     
                     + 
                     
                       
                         ( 
                         
                           
                             P 
                             110 
                           
                           - 
                           
                             P 
                             100 
                           
                           + 
                           
                             P 
                             000 
                           
                           - 
                           
                             P 
                             010 
                           
                         
                         ) 
                       
                        
                       
                         x 
                         ^ 
                       
                        
                       
                         y 
                         ^ 
                       
                     
                     + 
                     
                       
                         ( 
                         
                           
                             P 
                             011 
                           
                           - 
                           
                             P 
                             010 
                           
                           + 
                           
                             P 
                             000 
                           
                           - 
                           
                             P 
                             001 
                           
                         
                         ) 
                       
                        
                       
                         y 
                         ^ 
                       
                        
                       
                         z 
                         ^ 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   42 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where P 000  for example is the vector of physical coordinates of the point that corresponds to the reference point (0, 0, 0). Note that this mapping F:{circumflex over (τ)}→τ is no longer affine as it was in 2D, and as a consequence, in general, the integrals (33) cannot be evaluated analytically. One should use quadrature formulas to numerically approximate the integrals, for example 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         ∫ 
                         
                           τ 
                           ^ 
                         
                       
                        
                       
                         
                           f 
                            
                           
                             ( 
                             
                               
                                 x 
                                 ^ 
                               
                               , 
                               
                                 y 
                                 ^ 
                               
                               , 
                               
                                 z 
                                 ^ 
                               
                             
                             ) 
                           
                         
                          
                         
                            
                           
                             x 
                             ^ 
                           
                         
                          
                         
                            
                           
                             y 
                             ^ 
                           
                         
                          
                         
                            
                           
                             z 
                             ^ 
                           
                         
                       
                     
                     = 
                     
                       
                         
                           1 
                           2 
                         
                          
                         
                           f 
                            
                           
                             ( 
                             
                               
                                 1 
                                 3 
                               
                               , 
                               
                                 1 
                                 2 
                               
                               , 
                               
                                 1 
                                 3 
                               
                             
                             ) 
                           
                         
                       
                       + 
                       
                         O 
                          
                         
                           ( 
                           
                             h 
                             2 
                           
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   43 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where h is the diameter of the physical prism. 
         [0078]    If the original 2.5D griblock is split into s triangular prisms then equation (24) should now read 
         [0000]        b=b   1   b   1   +b   2   b   2   + . . . +b   3s   b   3s ,  (44) 
         [0000]    since there are now 3 given boundary fluxes: b i   top , b i   bot  and b i   side  for each prism τ i . Also, the initial guess (28) must now satisfy ∫ τ     i    div v I =b i   top +b i   bot +b i   side  for i=1, 2, . . . , s . The algorithm for computing the initial guess changes to 
         [0079]    Set V 1   I =1. 
         [0080]    For i=2, 3, . . . , s 
         [0081]    set V i   I =V i−1   I +b i   top +b i   bot +b i   side . 
         [0082]    The algorithm for computing the velocity vector becomes: 
         [0000]    
       
         
           
             
               
                 
                   
                     Set 
                      
                     
                         
                     
                      
                     V 
                   
                   = 
                   
                     
                       V 
                       I 
                     
                     - 
                     
                       
                         
                           
                             CMV 
                             I 
                           
                           + 
                           
                             
                               ∑ 
                               
                                 i 
                                 = 
                                 1 
                               
                               
                                 3 
                                  
                                 s 
                               
                             
                              
                             
                               
                                 b 
                                 i 
                               
                                
                               
                                 F 
                                 i 
                               
                             
                           
                         
                         
                           CMC 
                           T 
                         
                       
                        
                       
                         
                           C 
                           T 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   ( 
                   45 
                   ) 
                 
               
             
           
         
       
     
         [0083]    Although the present invention has been described with respect to specific details, it is not intended that such details should be regarded as limitations on the scope of the invention, except as and to the extent that they are included in the accompanying claims.