An Analysis of Finite Volume, Finite Element, and Finite Difference Methods Using Some Concepts from Algebraic Topology
by
Claudio Mattiussi
Isaac Dooley Parallel Programming Lab CS Department
Overview
• Finite Element and Finite Volume Methods from an Algebraic Topology perspective • Thermostatics Example in FE and FV formulations • Optimization of Cells in FV
Finite Element Basics
• Mesh of nodes and elements • Commonly used for structural simulations • Relate nodal displacements to nodal forces
!
• • • • •
K = element property matrix (stiffness) q = vector of unknowns (nodal displacements) Q = vector of nodal forcing parameters Boundary values provide Q, Elements provide K Solve for q
[K ]{q} = {Q}
Finite Volume Basics
Commonly used for fluid flows simulations Subdivide spatial domain into cells Maintain an approximation of " q over each cell In each timestep we update the approximation of q for each cell using an approximation to the flux through the boundary of the cell ! • Explicit time stepping may be performed • May be formulated with n-point stencil formulas • • • •
Finite Volume Basics
• Upwind methods may use only some subset of possible inflow cells since flow is in a fixed direction. • 5-point stencil:
Thermostatics Equations
• Unknown Temperature Field T • Given Source Field "
• Can be discretized by separating into a system of equations
!
Thermostatics Equations
Balance Equations
• Generally relate quantities produced in a volume to the outflow and stored amounts • Transition from smooth to discrete takes place without any approximation error • Terminology:
– Local = smooth = differential – Global = discrete
• Include conservation laws, equilibrium equations, and static balances.
Constitutive Equations
• Require use of metric concepts like length, area, volume, angle, etc. • May include physical constants • Depend upon properties of the medium • Also called material equations or equations of state
Kinematic Equations
• No approximation involved in discrete rendering
Chains & Cochains
• A chain can represent a collection of cells with integer multiplicity. • Interpretation of a chain is a set of oriented domains with weighting function defined over them. • Recall: Boundary of Chain
Chains & Cochains
• A field is represented as a set of discrete values associated with suitable p-cells. No approximation of the field is required. • For thermostatics we have:
• Cochains constitute a representation for fields over discretized domains.
Kinematic Equations
• Can be represented as a cochain:
Cochains & Coboundary
• A topological equation asserts the equality of two global quantities, one associated with a geometric object, and the other with its boundary. • So we can define a 3-cochain • This can simply be written:
!
"Q(2) flow
such that:
Cochains & Coboundary
Coboundary
• Coboundary acts as discrete counterpart to div, curl, grad • The definition of coboundary guarantees the conservation of physical quantities possibly expressed by the topological equations will remain in the discretized equations
Balance Equations in FV
• In FV we have an enforcement of 3D heat balance equation such as: • This simply is an application to each 3-cell. • No need to average over cells
Balance Equations in FE
• In case of weighted residues, we start with continuous balance equation div q = " and enforce the corresponding weighted residual equation for each node of the grid:
!
Balance Equations in FE
• We can rewrite (31) using a geometric interpretation as: • The balance equations as written by FE:
Balance Equations FE vs. FV
• Compare (29) in FV with (34) in FE
Constitutive Equations
• Connect left and right columns of factorization diagram • A bridge between field variables associated with primary cells, and field variables associated with secondary cells • Discretized using exterior derivative
Constitutive Equations in FV
Constitutive Equations in FE
• We need to use a cochain approximation to describe this transformation from a discrete representation to a local one
Strategies for Discretizing Constitutive Equations
• We can use any method to compute a set of coefficients " ij • No alternative choices exist when choosing how to discretize the topological equations
!
p-Cochain Approximations
• P chain approximation represented in diagram by ( p ) " • We should only use approximations or interpolations of global/discrete values associated with a chain • It is common in electromagnetics but bad to interpolate E and H from local nodal vectors. Instead should interpolate with scalar valued pcochain approximations since global quantities are scalars.
!
Example
• 2D example with orthogonal rectangular grid • Element Edges coincide with primary 1–cells • The four primary 0–cells are nodes of the element
Example FE
• Use 0-cochain approximation and define an interpolation function over a cell, the bilinear polynomial suffices • In a local coordinate system for an element we can find the interpolated temperature to be
Example FE
• Applying interpolated temperature function to differential kinematic equation and the constitutive equation we get a relation which holds within each element:
Example FV
˜ • For FV we reconstitute the secondary 2-cochain Q flow ˜ from field function q . To do this we perform an ˜ integration of q on secondary 1-cells. ! • Use a secondary grid staggered from the primary one. • We can obtain this relation:
! !
(2)
Example FV
• We next write the balance equations:
Example FE
• The balance equation for FE requires integrating flow density over elements belonging to the support of the weighting functions. • A secondary 2-cell overlaps with four elements which we call d(2)
Example FE
• The balance equation for FE is therefore:
• And similarly to FV we get a result involving nine temperatures:
FV Cell Optimization Overview
• Is it necessary to choose cells which coincide exactly with a staggered secondary grid? • We will show that a bilinear approximation function on a staggered grid is as good as a quadratic one on a generic grid. • Then we will show that optimal biquadratic interpolations on the proper grid perform as well as a complete third-order polynomial. • There exists a common misconception that higher order methods do not perform well.
Cell Optimization Example #1
• Note: All quadratic functions through two points have the same value of the derivative midway between the two points. • A piecewise linear interpolation on staggered mesh gives exact value of the derivative at the midpoints or nodes.
Cell Optimization Example #1
• We will compare bilinear approximations to quadratic approximations
Cell Optimization Example #1
• Next we look for a curve " (s) lying in the element which satisfies at each point s on the curve:
! • Or satisfying this equation equating the flow through the curve:
Cell Optimization Example #1
• We examine the parametric curves:
ˆ • And then we have an expression for n" ( x )
!
• Substituting into (72) we get an equality:
Cell Optimization Example #1
• (80) can be satisfied for arbitrary ", # by
! • This means that the axes of symmetry of the primary 2cells are optimal loci for the evaluation of the normal flow and, therefore, for the placement of secondary 1-cells • Using a bilinear interpolation polynomials, we obtain the same degree of accuracy obtainable by interpolating with complete second-order polynomials
Cell Optimization Example #2
• Similar to previous example, but with 4 cells per element • Now 9 primary 0-cells per element • We can use a biquadratic approximation polynomial
Cell Optimization Example #2
• We will determine optimal placement for cells using a biquadratic approximation. Optimality is determined by comparing to a higher order approximation, just as in previous example.
• Want to find a curve where approximations yield same results:
Cell Optimization Example #2
• The previous equality (84) gives rise to:
• Which is satisfied by:
Cell Optimization Example #2
• 1. 2. 3. We get then three kinds of optimal secondary 2-cells: Large square cells interior to the element (9-point formula) Medium-sized rectangular cells astride to the elements (15-point formula) Small square cells centered in the element vertices (25-point formula)
Cell Optimization Summary
• Thus in this case, placing 1-cells on the axes of symmetry of the primary 2-cells is not an optimal choice. Such a choice is common, and leads people to ignorantly discount higher order approximations in FV. • Some are under the wrong impression that FV performs well with low-order interpolation, but not as well for higher order approximations. • The paper provides a general form for the determination of FV Optimal Cells in section 8.1
Finite Difference
• A more historical approach, which doesn’t yield great results. • FD aims to determine a local discrete approximation for the operator constituting the field equation • In this case getting the optimal nine-point FD formula, which appears to be the traditional FD five-point formula for the laplacian
Finite Difference
• FD is significantly different from FV:
– FV optimizes the approximation of the constitutive equation, and thereby flow through the boundary of the secondary cells – FD formula constitutes an optimal approximation for the laplacian operator in the central point of a patch
Summary
• FE and FV have many similarities in their formulation for the thermostatics problem. • Various types of equations in physics involve approximations or exact discretizations. • Proper choice of cells in FV is important, and often done incorrectly.
Additional Reference:
• E. Tonti “On the Formal Structure of Physical Theories” 1975 • PDF downloadable from internet. • It contains diagrams of the differential forms as well as various equations for almost all physical theories