CHAPTER 12       

Units Conversion

Introduction

When using GPS-X, a better understanding of the plant can be gained if the units are presented to the user in a form that is consistent with data available at the plant. This is useful for preventing data conversion errors, and for allowing the direct use of measured plant data, regardless of the units used for measurement. To facilitate this, unit conversion is provided in GPS-X. This allows the user to select which unit will be used to present a particular variable or parameter.

Unit Systems

Two systems of units are provided with GPS-X, an SI system and a US system. These systems of units define the default set of units that appear in all menus, input controls, and displays.

Current Layout

The desired unit system is saved for each individual layout.  The current system for the layout is displayed (and can be changed) via the Units drop-down menu on the Main Toolbar as shown below.

image

Figure 121 –Unit System for the Current Layout

Default for New Layouts

The default system that newly create layouts will use is selected in the View > Preferences dialog on the ‘Layout’ tab.

Selecting Individual Units

Almost everywhere a unit is displayed (both inputs and outputs), you click left or right click on it to change it to a different compatible unit.

Units Data File

All the unit conversion information in GPS-X is in a data file called "units.cvt". There are two main parts to this file.

The first section is used to define the default system of units. The file provided with GPS-X provides a list of SI units and US units. The SI units listed in this first section of the units file must not be modified under any circumstances. The SI unit list must not be modified since it corresponds to all the internal GPS-X units. All changes in units are based on conversions from the default SI units to the unit of choice.

The second section of "units.cvt" contains conversion factors to convert from the SI units to any comparable unit. The default list is quite comprehensive, but the user may add other unit conversions if desired.

The file "units.cvt" is located in the /bin/gpsx/resources subdirectory of the GPS-X installation directory.

Customizing a Unit System

In the units files, the first section begins with the header:

!SYSTEMS: SI US

On each subsequent line in this section of the supplied data file, the first unit is the default SI unit. The second unit is used for the US unit system. Any text that follows an exclamation mark (!) denotes a comment and is ignored by GPS-X.

You may edit the US unit system, but DO NOT change the SI unit system.  The unit in the US column must be compatible with the unit in the SI column.  The compatible unit groups are listed in the second section of this file.

Adding New Unit Conversions

If you want to add new conversion factors to make them available in GPS-X, you can edit the second part of the file.  You can either just add new units to existing groups or create your own groups.

This section, which constitutes the remainder of the file, starts at the line:

!CONVERSIONS:

The conversions part of the file is divided into sections of equivalent units (e.g., the flow units are grouped together).

Groups of similar units are separated by a blank line.

The first line in each group lists the default SI unit followed by the value of 1.  DO NOT edit this line in the existing groups.

The remaining lines in each group contain units and their related conversion factors.

The default file contains a comprehensive, though not exhaustive, list of units. Some units are presented in multiple formats (i.e., million US gallons per day is given as MGD(US)and Mgal/d(US)). The user may wish to add extended ASCII characters to the file to improve the appearance of the units (i.e., for m3/d you may wish to provide an option for m3/day).

The conversion factor is what the new unit is multiplied by to convert it to the default SI unit.

For example, the unit conversion factor for Mgal/d (US) is 3785.41, which means that 1 Mgal/d(US) is equal to 3785.1 m3/d.

Special Case

A special case format for unit conversions is used when the conversion between units is not a simple ratio.  This is really only the case for temperature.

For example, to convert degrees Fahrenheit (F) to Celsius (C) requires the equation: C = 0.55556 (F - 32) which is represented by the conversion factor 0.55556/32 in the units file. Note that the slash (/) is not a divider but a delimiter that separates the multiplier from the constant.