Variable Declaration
A Variable Declaration () specifies a variety of properties for a variable. You can also right-click to add and define Variable Definition, Component Settings, and Disable in Solvers subnodes.
To add a Variable Declaration first add a Component, Feature, Property, Physics Interface, or Multiphysics Interface node then:
From the contextual toolbar for Component, Feature, Property, Physics Interface, or Multiphysics Interface, click the Variable Declaration () button. For example, add a Component node under Building Blocks>Components. Then on the Component 1 toolbar, click Variable Declaration (). Or
Right-click the Component, Feature, Property, or Physics Interface node and select it from the Variables submenu.
To find the definitions of the variable, click the Find Declarations of this Variable button () on the Settings window, or click the node and press F7, or right-click the node and choose Search>Find Definitions.
The Settings window has the following sections:
Declaration
Enter a Variable name and a Description to include text for the variable when shown in analysis and variable listings. You can pass the component’s arguments to the description. The argument name must be placed between two # characters. For example, if you have an argument arg.param = material, the string #Plot_in the _#arg.param#_frame will be displayed as Plot in the material frame.
Enter a LaTeX-encoded string in the Symbol (LaTeX encoded) field to define a symbol (\mu, for example, to display the Greek letter μ).
Select a Dimension: Scalar, Vector (3x1), Matrix (3x3), or Custom. For Custom, you can specify a nonstandard dimension as an MxN[xKxL] array, where M, N, K, and L are integers, and K and L are optional (for example, 3x3x3 if you need a tensor of rank 3 with indices of dimension 3).
For Custom you can enter two special formats for dynamically setting the size:
Enter par.<name> or arg.<name>, where <name> is a valid user input or argument, to use the size specification stored in the value of the user input named <name>. If the value of the user input is 3x4, this variable is a 3-by-4 matrix. Make sure that the user input only can contain valid size strings (NxMx...) before using this format.
Enter size(<prefix>.<name>), where <prefix> is par or arg. It tries to evaluate the size of the given argument to the size operator. In case of <prefix> = par, this returns the size of the referenced user input. This can also be used to use the size of a different variable, although this usage is not recommended. The variable must be declared before this size evaluation, which cannot be guaranteed. All unknown variables return a scalar size.
The Physical quantity list defines the unit of the variable and is the same as a Dependent Variable Declaration.
If you have defined a customized Physical Quantity, choose Locally defined from the Physical quantity list and then choose the customized option from the Link list. Click the Add button () to display a quick menu where you can select a source to add in to the list and use it as the current reference. A Confirm Operation dialog box will appear and ask for confirmation if there is already a reference exist in the Link list. Click the Go to Source button to move to the referenced node in the Link list.
If there is no physical quantity defined, enter an SI unit for the dependent variable in the SI unit field. It is possible, in some contexts, to use arguments and values of user inputs to define the unit; this way you can enable dynamic units from arguments or other user inputs. There is also an operator, evalUnit, that you can use to parse units of known variables, typically dependent variables (example, evalUnit(dep.u)).
Entering Names and Expressions you can find more detailed information about how you can customize variable names with scopes and parameter values.
Preferences
In this section, specify options about the variable.
Operation Between Multiple Definitions
Select an option from the Operation between multiple definitions list: Replace, Add, Multiply, Logical or, Logical and, or Inner product.
Any variable definition for this variable uses the selected operator to combine multiple variable definitions of the same variable. You typically use the option Add when several contributing features add contributions to the same variable (heat sources, for example).
Interpret as Right-Hand Side
Select the Interpret as right-hand side check box if you use the variable in any right-hand side of an expression. Such variables get an extra factor
that enables plotting and animations of the entire harmonic cycle in frequency-domain simulations. It is also used to identify right-hand sides for harmonic perturbation features; see Harmonic Perturbation.
Include in Load Groups
Select the Include in load groups check box if the variable should be affected by load grouping. To enable load groups for a feature add an Auxiliary Settings node and select the setting Enable load groups.
Matrix Symmetry for Square Matrix
If the matrix is square (for example, if you select Matrix (3x3) from the Dimension list), you can force a matrix symmetry with the options in the Matrix symmetry for square matrix list. The choices are Diagonal, Symmetric, and Anisotropic (the default), and controls the cells that the user can edit. This option also adds a check to the data field, so the user cannot enter a matrix structure that is more complex than the selected option. For example, choosing Symmetric does not allow an anisotropic matrix but it allows both isotropic and diagonal matrices.
Show in Plot Menu
Select the Show in plot menu check box (the default) if you want the variable to show up when a user clicks the Insert expression () and Replace expression () buttons in any of the Results nodes during a Model Builder session. Edit the Menu field to group the variable into a submenu. The default setting is to place the variable directly under the menu of the physics interface. From the Show Add all list, select For more 2 components, Yes, or No to control if the All expressions in this group option should appear for a plot group of related variables.
Announce Variable to Feature Inputs
Select the Announce variable to feature inputs check box so the variable notifies its existence to all physics interfaces. The variable uses the selected physical quantity as an identifier. Any feature input parameter with the same physical quantity can pick up an announced variable, so that the variable can be used by the physics interface that the feature input belongs to.
An example of a feature input is any of the model input parameters in the Model Inputs section of a physics feature instance in the Model Builder. It is also possible to supply an extra Match tag to the announced variable. The predefined options here are None (the default), and all physical quantity field names. None is equivalent to an empty tag and should be used unless it is necessary to limit the matching in some sense. In such cases, enter an arbitrary but relevant tag — for example, relative or absolute to distinguish between pressure fluctuations and absolute pressure levels. You typically need physical quantity options for synchronized matching.
Click the Select Physical Quantity as Tag button () to pick a physical quantity from the list in the Physical Quantity dialog box that appears. Click the Custom Tag button ()to use a custom tag that you type in for the announce tag. Click the Reset to None button () to reset the filter to None.
Select the Announce variable to common inputs check box to notify this variable to the common model input variable list.
Advanced
This section contains advanced options that you do not have to change in most cases. In the Base vector system list you can override the base vector system specified by the parent (for example, a feature or property) by choosing something other than the option Same as parent. The Declare on all frame systems option results in three variable declarations, one for each of the frames (geometry, material, and spatial). The naming convention for components is done by appending the coordinate names of the frames. A consequence of this strict convention is that the Component Settings node cannot be allowed, so you cannot add it with this setting active. Any existing Component Settings node will automatically be disabled. In addition, the Base vector system column for individual tensor indices is also disabled and locked to the Use common setting option.
If the Variable Declaration node has a Variable Definition subnode, there will also be one definition added per frame system. The context’s frame will also change, so the parsing may behave differently depending on the current frame system used.
For 3-by-1 (vector) and 3-by-3 (matrix) tensors, the Frame information rule list contains the following options:
Automatic (the default), which automatically adds frame information if there are split frames in the model.
No frame information, which never appends any frame information for a variable.
Spatial frame information, which adds spatial frame information.
Material frame information, which adds material frame information.
For tensors, choose a type from the Tensor type list: Normal tensor, Tensor density, or Tensor capacity. A tensor density is a concentration, for example, where it is multiplied with the volume factor. A tensor capacity is the inverse.