Parameters are user-defined variables and functions that facilitate the creation and organization of a project. Once a parameter is added in the Parameters window, it can be entered into any editable field that accepts parameters and used to define multiple objects. This versatility allows users to change the shape, size, orientation, relative position, material definition, or component value of those parameterized objects by editing a single value in the parameters window.
There are two primary use cases for XF's parameterization capability:
- Referencing a commonly used number or formula.
- Perform a parameter sweep.
The first use case provides an alternative to re-entering the same value when defining multiple objects. For example, adding parameter A with a value of 1.575 in the parameters window allows users to enter the parameter name, A, into an object's editable field rather than typing 1.575 each time.
The second use case allows users to evaluate a range of parameter values without creating numerous simulations. Results analysis allows users to determine which parameter value provides the desired performance.
Users can access the Parameters window by either clicking the Parameters button on the right side of the XF window, or by selecting View ❯ Parameters in the upper-left corner.
The Parameters window contains four columns:
- Name: a user-defined descriptor for use in any editable field within XF's UI that accepts parameters.
- Formula: a mathematical expression or unitless number that defines the value of the parameter.
- Value: an uneditable field that displays the formula as evaluated by XF and converted into SI units, when applicable.
- Description: optional user-defined text and/or numbers that serves as a note or reminder for the user's benefit.
If an invalid formula is entered, an Error! warning appears in the Value field. A description of the invalidity is displayed when the mouse hovers over the icon.
Users should note that a timestep parameter exists by default. This parameter is uneditable because the timestep value is derived from the smallest grid cell's edge length, and therefore changes according to the cells in the problem space.
The Parameters window also contains several buttons:
- The button adds a new parameter to the list.
- The button deletes the selected parameters. Users should note that the timestep parameter cannot be deleted.
- The button deletes the current project's unused parameters, removing those that have not been applied to an object.
- The Import button imports saved parameters from an .xml file, allowing users to share parameters between projects.
- The Export button exports the selected parameters to an .xml file, allowing users to share parameters between projects.
- The Revert button discards changes and restores the parameters list to the previous saved version.
The workspace is navigated using the mouse and keyboard buttons:
- Entries are edited by double-clicking in the desired field.
- Tab: scrolls through the columns of each row.
- Esc: deletes the entry being edited.
Users must adhere to certain guidelines for allowable entries when defining a parameter.
The following restrictions apply to parameter names:
- A name cannot begin with a number.
- A name must only contain alpha-numeric characters and underscores (e.g., no spaces).
The following restrictions apply to parameter formulas:
- A value and its unit of measurement must be separated by a space.
- A formula can be dependent on other parameters only.
- A formula can be written using anything that is legal in the scripting language, QtScript.
- A formula cannot be used to modify a scripting object.