Pipeline simulation always brings up the question of which mesh (or "knot spacing") to use. More mesh points mean improved accuracy, but also slower simulation. In addition, if the spatial mesh isn't chosen appropriately for the time step (which may itself be changing), the model can become unstable. These issues don't really have anything to do with pipelines, and it would be nice if the pipeline modeller didn't have to think about them.

This is the promise of an automatically adaptive mesh. Ideally, adaptive techniques will add mesh points when and where they're needed, get rid of them when they aren't, and maintain a guarantee that the model solution is accurate to some user-specified level. Adaptive meshes are widely used in fields such as reservoir simulation[1] and pipe stress simulation[2], where 2D and 3D partial differential equations (PDEs) are solved, but haven't found wide application to the 1D+time PDEs in our pipeline models. This is because 2D and 3D PDEs often end up with so many mesh points that non-adaptive techniques just aren't feasible. In pipelines, however, if we're willing to wait a little while for the solution, we can always just throw more knots at the problem.

The big question when developing an adaptive technique is how to tell where to add the mesh points. The goal is to keep the truncation error - the error introduced by the limited mesh - under specified limits. The straightforward approach to adding mesh is to compare model results between a solution with the current mesh and a denser mesh; where results differ, this suggests more mesh is needed. This involves running the model twice, once with a denser mesh than is necessary, so if a heuristic could instead be developed to estimate the needed mesh that could provide better performance.

This paper will examine this two-mesh approach, comparing its performance with a fixed constant-density mesh. There are several options available for the exact algorithm used, which will be investigated. There will also be discussion of heuristics for mesh determination and the advantages and problems the author has encountered in some years of adaptive mesh use.


Pipeline models solve some set of conservation equations for mass, momentum, and/or energy. These are partial differential equations and are generally complicated and nonlinear, and so must be solved numerically. In the pipeline simulation industry, the most popular approach for doing this is the method of finite differences. That means either the user or the simulation program must pick a mesh of points in space and time to use for the solution.

If the mesh is chosen poorly, the user risks model instability - meaning, a solution that contains obviously nonphysical oscillations and is not usable; or, a simulator that runs very slowly; or, just a solution that looks plausible, but isn't very accurate. (This error introduced into the model solution due to limitations of the mesh, either in space or time, is called the truncation error.) Most of the commercial simulators now automate the selection of time mesh spacing (the " timestep") but it is generally still left up to the user to choose the spatial mesh. A major component of learning to use a pipeline simulation tool is learning what kind of mesh spacing to use in what circumstances.

This content is only available via PDF.
You can access this article if you purchase or spend a download.