3.5.2. Variables Details View

The Variable details view is used to change the definition of fundamental (system) variables, and to create and edit user variables.

To edit an existing variable, either:

  • Double-click the variable in the tree view

  • Right-click the variable, then choose Edit from the shortcut menu.

The above actions cause the Variables details view to appear.

3.5.2.1. Fundamental Variables

Fundamental variables (variables provided by the solver) can have their units changed. This would enable you to create a legend that uses alternative temperature units (such as degrees Celsius).


Note:  These settings override the global units setting (defined in the Options dialog box, accessible from the Edit menu).


  1. Toggle between Hybrid and Conservative values.

    This affects any dependent variables and expressions as well. For details, see Hybrid and Conservative Variable Values.

  2. Select the units.

  3. Click Reset to restore the variable settings stored in the database.

    Use this to undo changes if you have not yet clicked Apply.

3.5.2.1.1. Saving Variables Back to the Results File

In cases other than transient blade row cases, fundamental variables can be redefined using expressions and then saved back into the results file for later use. To do this, select the Replace with expression (write to results) check box, enter one or more expressions, then click Apply. To change a vector variable, you must write three expressions: one expression for each direction (X, Y, and Z). The result file is updated when you click Apply. To restore a fundamental variable to its original state, clear the Replace with expression (write to results) check box and click Apply.

One reason for modifying the variables in a results file is to modify the initial conditions for a new solver run. In this case, you must modify the principal variable for each affected equation.

In CFX-Pre, in most cases, the principal variable for a given equation is the same as the variable used to specify initial conditions, but there are some exceptions, as shown in the table below:

EquationCFX-Pre VariablePrincipal Variable
Thermal EnergyTemperatureStatic Enthalpy
Total EnergyTemperatureTotal Enthalpy
Mass FractionsMass FractionConservative Mass Fraction
Volume FractionsMass FractionConservative Volume Fraction
Continuity (with cavitation activated)PressureSolver Pressure

For example, to initialize the mass fractions equation in CFX-Pre, you would set Mass Fraction. In order to modify the initial conditions for the same equation in a results file, you would set Conservative Mass Fraction instead.


Note:
  • For the thermal energy and total energy equations, you must set Temperature as well as the principal variable.

  • When overwriting the mesh Total Mesh Displacement, the locations of the mesh nodes in CFD-Post will not be affected, only the variable values.

  • For transient blade row cases, solution variables will not be overwritten because the variables displayed in CFD-Post are not directly loaded from the results file, but are reconstructed from the available Fourier coefficients stored in the results file.

  • The variable ranges stored in the results file are not updated to reflect the modified variable values. This implies that if the new variable data is used to modify the initial conditions for a restart, the "Variable Range Information" displayed in the CFX-Solver Output file at the start of the run will not reflect the new variable values.


3.5.2.2. Radius and Theta

The variables Radius and Theta are available only when the rotational axis has been defined. The rotational axis can either be defined in the results file or in CFD-Post through the Initialization panel in the Turbo workspace.

3.5.2.3. Boundary-Value-Only Variables

Some variables in the CFX results file take meaningful values only on the boundaries of the geometry. Examples of this sort of variable are Yplus, Wall Shear, Heat Transfer Coefficient, and Wall Heat Flux. For details, see CFX-Solver Output File in the CFX-Solver Manager User's Guide.

To obtain sensible plots when using these variables, use them to color only boundary objects. If, for example, you try to color a slice plane through the center of the geometry with one of these variables, you will see a large area of color that is meaningless; only at the very edges of the geometry will there be useful coloration.

For boundary-value-only variables, only hybrid values exist (as they are undefined away from a boundary).

3.5.2.4. User Variables

To create a new user variable, click Insert > Variable, or right-click a variable in the tree view and select New from the shortcut menu.

There are three basic types of user variables, depending on the value of the Method setting:

  • Expression

    The Expression user variable is defined by one or three expressions, depending on whether the Scalar or Vector option is selected. You can enter new expressions or select existing expressions. For details, see Expressions Workspace.

    If Calculate Global Range is selected then, after you click Apply, the range data is computed and displayed in the details view. If Calculate Global Range is not selected when you click Apply then you still have the option of selecting this option and clicking Apply again in order to compute and display the range data.

    For an Expression user variable, and any user variable that depends on it, the Boundary Data setting (which can normally be set to Hybrid or Conservative) is not applicable. Whenever the defining expression is evaluated, the values of any underlying independent variables are hybrid and/or conservative in accordance with the Boundary Data settings (at the time of evaluation) of those independent variables. The defining expression of an Expression user variable is automatically re-evaluated whenever you change the Boundary Data setting of any underlying independent variable.

  • Frozen Copy

    At the time you click Apply, the Frozen Copy user variable is defined by copying the current values of an existing scalar variable (which is specified by the Copy From setting). Hybrid and conservative values are copied as available. If both hybrid and conservative values are available, then after you click Apply to create the Frozen Copy user variable, the Boundary Data setting becomes available, enabling you to select between hybrid or conservative values; your selection affects all objects and expressions that depend on the Frozen Copy user variable. Toggling between hybrid and conservative selects data within the copy. It does not cause data to be copied again from the Copy From variable.

    The Frozen Copy user variable values remain constant even if the variable from which the copy was made subsequently changes in any way, for example, by switching to a different time step.

    After you create a Frozen Copy user variable, changing the Copy From variable and clicking Apply causes the Frozen Copy user variable to be redefined at that time.


    Note:  If a Frozen Copy is created from another user variable of the Expression type, the plotting or calculation from data on element faces is not supported.


  • Gradient

    The Gradient user variable is defined as a vector variable that represents the gradient of the selected scalar variable, or the gradient of the magnitude of the selected vector variable.

    If both hybrid and conservative values are available for the selected variable, then after you click Apply to create the Gradient user variable, the Boundary Data setting becomes available, enabling you to select between hybrid or conservative values; your selection affects all objects and expressions that depend on the Gradient user variable.


Note:
  • You cannot create a variable with the same name as an existing expression or object.

  • To preserve Frozen Copy user variables between sessions, you can use the New Session Command to record your current session in a session file. Note that state files will not preserve your Frozen Copy user variables.