XLThermo Documentation Help

Working with different units

The default units system in XLThermo is the International System of Units (SI). However, you may want to use metric units (roughly the same as SI units, but with some differences) or imperial units (common in the United States and some other countries). Please refer to the documentation for an overview of the units for the different quantities available in XLThermo.

In this tutorial, you will learn how to input and output units when doing flash calculations in XLThermo.

Changing the input and output units of flash calculations

In the Basic Usage tutorial, you can compute a multitude of thermodynamic properties for a given state. However, the default units for the input and output of these calculations are SI units. In the flash calculation functions, there are two optional parameters, called in-units and out-units, that allow you to control the units of the input and output.

  1. The in-units and out-units parameters are text strings representing the unit system to use. these can be "SI" (the default), "METRIC", or "IMPERIAL".

  2. To compute the enthalpy for water at 1 bar and 25 °C, enter the following into a worksheet cell in Excel:

    =XLT.REF.FLASH.PT("WATER", 1, 25, "H", "METRIC")

    The output will be the enthalpy of water at the specified conditions. In this case 104.9 kJ/kg.

    Metric input units
  3. If you want to control both the input and output units, you need to specify both the in-units and out-units parameters. To compute the enthalpy for water at 1 bar and 25 °C and get the result in imperial units (Btu/lb), enter the following into a worksheet cell in Excel:

    =XLT.REF.FLASH.PT("WATER", 1, 25, "H", "METRIC"; "IMPERIAL")

    The output will be the enthalpy of water at the specified conditions. In this case 45.1 Btu/lb.

    Metric input units, imperial output

Unit conversion outside flash calculations

While selecting input and output units for flash calculations, it may also be necessary to arbitrarily convert values computed in one unit system to another. This can be done using the XLT.CONVERT utility function.

The function signature for the XLT.CONVERT function is as follows:

XLT.CONVERT(Property, Value, in-units, out-units)
  1. Property is text string representing the property to be converted, e.g. "ENTHALPY" or simply "H". A full list of the available properties can be found here.

  2. Value is a number representing the value to be converted.

  3. in-units and out-units are text strings representing the unit system to use. These can be "SI", "METRIC", or "IMPERIAL".

  4. To convert the enthalpy of water at 1 bar and 25 °C from imperial units to metric units, enter the following into a worksheet cell in Excel:

    =XLT.CONVERT("H", 45.1, "IMPERIAL", "METRIC")

    The output will be the enthalpy of water at the specified conditions. In this case 104.9 kJ/kg.

    Unit conversion

Determine property units

Occasionally, it may also be useful to determine the units of a property at a given unit system programmatically, i.e. without looking up the units manually. This can be done using the XLT.UNITS utility function.

The function signature for the XLT.UNITS function is as follows:

XLT.UNITS(Property, Units)
  1. Property is text string representing the property to be converted, e.g. "ENTHALPY" or simply "H". A full list of the available properties can be found here.

  2. Units is a text strings representing the unit system to use. This can be "SI", "METRIC", or "IMPERIAL".

  3. To determine the unit for enthalpy in imperial units, enter the following into a worksheet cell in Excel

    =XLT.Units("H", "IMPERIAL")

    In this case the output will be "Btu/lb".

    Unit system

What you've learned

In this tutorial, you have learned how to work with different units in XLThermo:

  • How to change the input and output units of flash calculations.

  • How to convert units outside flash calculations.

  • How to determine property units.

Last modified: 17 March 2025