Basic usage
In this tutorial, we’ll cover the basics of XLThermo, focusing on how to compute fluid properties at a fixed flash specification, such as pressure and temperature, or pressure and enthalpy. If you are new to XLThermo, this guide will get you started.
Before you start
Make sure that XLThermo is installed and properly registered in Excel. Everything should be done automatically during the installation process. To verify that XLThermo is installed and working correctly, please follow the steps below:
First, open Excel and click the "Insert Function" button on the "Formulas" tab.
Second, in the drop-down list, select "XLThermo" to see the list of available functions. If there is no "XLThermo" function category, it means that XLThermo has not been correctly installed. Please re-run the installer.
- Function documentation
Help on the function arguments can be found using the Excel function wizard. Simply select the function from Insert Function dialog which will open the Function Arguments dialog. This dialog will provide a description of the function and its arguments. For more detailed information, click the "Help on this function" link at the bottom of the dialog to open the function documentation.
Computing a single property
The most common flash specification is fixed pressure and temperature, the so-called PT flash, so we will use that in the examples below. But the same principles apply to other flash specifications. Please refer to the reference model documentation for a full list of available functions.
The function signature for the PT flash is as follows:
The function parameters Fluid
, P
, T
, and Properties
are required, whereas the in-units
and out-units
parameters are optional.
Fluid
is text string representing the fluid for which to compute properties, e.g. "WATER". A full list of the available fluids can be found here.P
is a number representing the flash pressure. The default input unit for pressure isPascal
, but this can be changed using thein-units
parameter. Please refer to the documentation.T
is a number representing the flash temperature. The default input unit for temperature isKelvin
, but this can be changed using thein-units
parameter. Please refer to the documentation.Properties
is text string representing the property or properties to be computed, e.g. "ENTHALPY" or simply "H". A full list of the available properties can be found here.To compute the enthalpy for water at atmospheric pressure and 300 K, enter the following into a worksheet cell in Excel:
=XLT.REF.FLASH.PT("WATER", 101325, 300, "H")The output will be the enthalpy of water at the specified conditions. In this case 112654.9 J/kg. The units of the output can be changed using the
out-units
parameter.
Computing multiple properties
Often you will need to compute several properties at the same flash conditions, e.g. enthalpy, entropy, density etc. This can of course be done as is usually done in Excel, by copying the formula and changing the property name accordingly. However, XLThermo provides a more efficient way to do this, by using dynamic arrays. One of the benefits of using this approach, is that XLThermo will then be able to compute all the properties with a single flash calculation, significantly improving the performance
- Dynamic arrays
Array formulas are not something new in Excel, but was very difficult to use, so most users avoided them. However, with the introduction of dynamic arrays in Excel 365, array formulas are now much easier to use. In short, an array formula is a formula that can output multiple values, and the dynamic array feature will automatically spill the output to the adjacent cells. This means that you can compute multiple properties with a single formula, and the output will be automatically spilled to the adjacent cells. Please refer to the Microsoft Excel documentation for more information on dynamic arrays.
The
Properties
parameter described earlier can be a single text string or an array of text strings, each representing a property to compute. To compute multiple properties, enter an array of property names, e.g. {"H";"S";"RHO"}.However, a better way is to simply refer to an array of text strings representing the properties to compute. For this example, let's assume that the properties to compute (H, S, and Rho) are contained in the cells A1 to A3.
To compute the properties of water at the same specification as previously, enter the following into a worksheet cell in Excel:
=XLT.REF.FLASH.PT("WATER", 101325, 300, A1:A3)You will notice that although the formula is only written into a single cell, all the computed properties will automatically spill down to the cells below.
What you've learned
In this tutorial you have learned the basic usage of XLThermo worksheet functions:
How to check if XLThermo has been properly installed and registered with Microsoft Excel
How to compute a single property at a fixed flash specification.
How to compute multiple properties at a fixed flash specification using dynamic arrays.