32.3.1. Establishing Table Data and Creating Table Functions

To create a table function:

  1. In the Outline tree view, right-click Simulation > Expressions, Functions and Variables > User Functions and select Insert > Table Function.

    The Insert Function dialog box appears.

  2. Specify a name for the table function and click OK.

    The table editor appears.

  3. Use the table editor to establish (create/import/edit) the table data.

    You can optionally use the Auto Fill Values dialog box, which is available from the table editor, to automatically generate table data that is suitable for providing input parameter values for operating points.

  4. Optionally export the table data to a file.

  5. If a table data file is involved, optionally specify, via the Table Data Storage setting, whether the simulation should refer to the table data file (Use External File) for the latest definition of the table data, or whether the simulation should use the internally stored copy of the table data (Copy Table Data Into Setup).

  6. Click OK to close the table and initialize the table data.

    Table data initialization results in the creation of a table function, which is listed in the Outline tree view under Simulation > Expressions, Functions and Variables > User Functions.

    If required, you can subsequently right-click the table function in the Outline tree view and select Edit Table Data to re-invoke the table editor with the table data displayed and ready to edit, export, etc.

If you have table data in a .csv file, you can alternatively skip the above procedure and create a table function without using the table editor by using the Tools > Initialize Profile Data command. In this case, the table function is named according to the table name in the table data file. For details, see Initialize Profile Data.

32.3.1.1. Table Data Format

Table data is formatted the same as profile data except that:

  • Table data contains index fields instead of spatial fields.

  • Table parameters (fixed values that would appear under the heading [Parameters]) can be present but they are not supported by the table editor. Table files containing table parameters must be initialized from the Tools > Initialize Profile Data command.

A table data file is formatted as follows:

  [Name]
      Input Parameter Values

      [Parameters]
      Coefficient ABC = 12.8
      Coefficient2 = -5500
      Parameter123 = 123.5 [K]

      [Index Fields]
      Table Index

      [Data]
      Table Index, massFlowOut2 [kg s^-1], InletTemp [K]
      1, 1.23, 345.0
      3, 1.24, 345.0
      5, 1.23, 350.0
      7, 1.24, 350.0

Notes about the table data format:

  • The "Index Fields" section is optional; if it is omitted, the table data is indexed by row number.

  • Any fields used as index fields must contain only integer values.

  • If the "Index Fields" section is specified then each row in the table must correspond to a different set of index field values.

Notes pertaining to the profile data format also apply to the table data format. For details, see Profile Data Format.

32.3.1.2. Table Editor

The table editor provides the following functions:

  • View table data

  • Create table data:

    Click table cells and enter values directly.

  • Import table data from a file:

    • Click Import, specify a file name, and click Open.

  • Edit table data:

    • Click and type in any cell to edit the cell value.

    • Right-click a row/column label to add/delete/move a row/column.

    • Right-click a column label to rename it, and to assign units for the data in the column, via the Edit Column Header command.

    • Right-click a row/column label to hide/show the row. Hidden rows/columns do not appear in the saved table file.

    • Click Revert to re-read the table data from the file from/to which you last loaded/saved.

  • Export table data to a file:

    • Click Export, specify a file name, and click Save.

      Table data is written to a text file with extension .csv.

  • For a new table function, the Table Data Storage setting is available. The options are:

    • Use External File

      With this option, the simulation gets table data directly from the table data file. Any changes to numerical values in the file take effect when the simulation is run. More substantial changes (new or renamed columns, etc.) require re-initialization in CFX-Pre, either via the table editor or via the Tools > Initialize Profile Data command.

    • Copy Table Data Into Setup

      With this option, the table data is copied into the current case definition and the table data file is no longer referenced. Any changes to the table data file require re-initialization in CFX-Pre in order to take effect; re-initialization can be done either via the table editor or via the Tools > Initialize Profile Data command.

    The Table Data Storage setting is not available after you create the table function. In this case, a change to this setting can be made by re-creating the table function.

When you click OK in the table editor, the table data is initialized, resulting in a table function that can be used in your setup via CEL expressions. The table function is listed in the Outline tree view under Simulation > Expressions, Functions and Variables > User Functions.

Buttons of the table editor:

  • The Apply button effectively saves the table data.

  • The Close button closes the table editor without saving the data at that time.

  • The OK button is equivalent to Apply followed by Close.

Toolbar icons of the table editor:

  • Import — Select a .csv file from which to import data. The .csv file must contain a single profile of type Table. Note that, when you create a table using the table editor, the table name in the table data file is ignored.

  • Clear Values — Remove all the table values, leaving the index values and column headings unchanged.

  • Reset — Remove all of the table data, resetting the table to a blank state.

  • Revert — If changes to the table data have been made manually but have not been applied, revert to the data that was last saved.

  • Export — Export the table data to the selected .csv file.

  • Auto Fill — Show the Auto Fill Values dialog box, which enables you to automatically generate table data that is suitable for providing input parameter values for operating points. For details, see Auto Fill Values Dialog Box.

32.3.1.2.1. Auto Fill Values Dialog Box

The Auto Fill Values dialog box is available from the table editor. Using this dialog box, you can automatically generate table data that is suitable for providing input parameter values for operating points. The feature uses "Design of Experiments" algorithms (see DOE Types in the DesignXplorer User's Guide) to provide suitable sampling points, given ranges for the input parameters and the target number of points.

To use the Auto Fill Values dialog box:

  1. Leave Method set to the only option: Optimal Space Filling.

  2. Set Number of Samples to the number of table rows to generate.

  3. Fill in the ranges of values to generate.

  4. Click OK or Apply to generate the table values, or click Cancel to do nothing.


Note:  After generating table values, the lower and upper bounds (range limits) that you specified in the Auto Fill Values dialog box are stored with the table as parameters, accessible as usual for table parameters; for details, see Using Table Data User Functions in CEL Expressions. For example, the bounds for table column MassFlowRate would be named MassFlowRate Generation Lower Bound and MassFlowRate Generation Upper Bound.


32.3.1.3. Table Function Details View

The table function details view shows basic information about the table function.