At TransCanada Transmission, TFlow as a dry gas simulator has evolved over the last five years from a VMS-based batch application to a stand-alone PC application running under Microsoft Excel. TFlow is currently in production use to calculate daily linepack for TransCanada's eastern mainline, model the North Bay (Eastern Ontario) triangle, perform transient simulations and model pipelines for international projects. TFlow is popular because it is easy to use and modify. TFlow comprises a user interface written in Microsoft Excel's Visual Basic for Applications (VBA) and a dynamic linked library (DLL) written in C++. All information needed to model a pipeline system is contained in an Excel workbook, which also displays the simulation results. Recently a detailed station model with wheel maps was added. Also, forecasted, nominated and actual volumes can be downloaded from databases to a workbook. Some of the features of TFlow are:
The program runs on a PC under the Excel interface, using its own menu, toolbar and dialogs, but with all the usual Excel features available to the user.
TFlow handles both steady-state and transient simulations using the same equations. A steady-state simulation is just a transient simulation - with long time-steps and constant boundary conditions - which continues until linepack stabilizes.
Networks of any complexity can be modelled. Elements include pipe segments, valves and compressors. Compressor stations can be either simple blocks of power or sub-networks containing multiple compressors in series and/or parallel arrangements.
The program automatically sets up the equations and unknowns. Users do not have to determine which parameters are known or unknown in order to make the number of equations and unknowns balance.
A special steady-state feature is capability calculation to a given node, without violating any constraints (maximum power, maximum compression ratios, maximum discharge pressures, minimum delivery pressures, etc.)
Output can be written directly to Excel worksheets, displayed on schematics and in user-configurable reports. The paper consists of a description of TFlow's equations, the program design, its interface, features and sample results.
The first version of TFlow was a batch application (with punched card I/O) written in Fortran for the IBM 1800 and put into production in 1975. It was used to model sections of the TransCanada Pipelines systemdownstream of storage which were subject to daily load patterns. TFlow was upgraded to run on IBM 370s in the early 1980s, and later VAX machines under VMS, but still under batch mode. In 1994 with the advent of desktop computers having the calculation power of the earlier mainframes, TFlow was rewritten in C to run on a Macintosh, including a custom Mac user interface of menus and dialogs. Input was in the form of tab-delineated text files prepared using Microsoft Excel or similar applications. Output was written to scrolling windows which could saved be saved as text files and subsequently opened by any word processor or spreadsheet program.