CFD-101: The Basics of Computational Fluid Dynamics Modeling
To Conserve or Not
The mathematical formulation of fluid dynamics is based on a conservation of mass, momentum and energy. Because of this fact, there is a strong motivation to preserve these conservation properties when making numerical approximations. In practice, however, there are many situations where adherence to strict conservation principals is not a good idea. An understanding of those situations provides good insight into the subtleties of numerical approximation. Three examples will serve to illustrate this point.
Consider a convective flow in a region that is subdivided into set of fixed control volumes (i.e., a grid). The flow of energy (temperature) through these volume elements must be computed. It is natural to want the energy leaving one volume to be equal to the energy entering a neighboring volume. This is an expression of thermal energy conservation.
In most natural convection problems the temperature differences driving a flow are small and the flow behaves as though it is nearly incompressible. Incompressibility means that the volume of fluid leaving a control volume must equal the volume entering that volume. Should excess volume enter a volume element, then excess energy will accumulate there as well, leading to a local increase in temperature (i.e., a numerical compression). Correspondingly, a loss of volume (expansion) results in a temperature reduction in the element.
Because it is numerically difficult to insure a strict balance of volume fluxes over a large number of control volumes, a numerical method that tries to conserve thermal energy typically exhibits results having a considerable amount of "thermal noise." Often times the noise makes the computed results useless.
The solution to this computational problem is to abandon conservation and use a non-conservative approximation for temperature or energy convection. In particular, one should use an approximation that omits the compression/expansion terms that are supposed to be zero anyway.
In hypersonic flow regimes the kinetic energy of the flow is generally much larger than its internal energy. When this happens, the use of numerical approximations that conserve mass, momentum and total energy can lead to substantial errors in fluid temperatures (sometimes even yielding negative values). This happens because the approximations for momentum always include some error, which is then magnified when used to compute the kinetic energy. When the kinetic energy is subtracted from the total energy, one of the conserved quantities that is computed, the resulting internal energy (or temperature) reflects this error. Since there is more kinetic energy than internal energy under hypersonic conditions, a small error in momentum may result in a large error in temperature.
The usual solution to this computational accuracy problem is to abandon the conservation of total energy and simply deal with internal energy directly.
In non-uniform grids there is a potential problem with low-order numerical approximations, especially when used in conjunction with conservative formulations. A non-uniformity in the size of grid elements generally means a loss in numerical accuracy of one order. This arises from the fact that differences in fluxes on opposite sides of a control volume have errors that cancel in pairs when the grid is uniform, but don't cancel when the sizes of elements change.
One consequence of this is that a first-order approximation for a conserved quantity on a uniform grid will be zeroth order accurate on a non-uniform grid. Zeroth order means that the approximation can never converge to the correct result even when the size of the control volumes approach zero -- not a good idea.
To maintain the order of an approximation when changing from a uniform to non-uniform grid, it is necessary to abandon conservative formulations. Modified equation forms can be easily derived that preserve the conservation property in uniform grids, and retain the same order of accuracy when grid non-uniformities are introduced. FLOW-3D is an example of a program that uses all three of the above approaches to enhance its computational results.