For some component variables, the coordinate system they refer to is written out in the variable’s description, which is visible in postprocessing, in Equation View and in
Replace Expression menu trees. But in many cases, component properties are implied by the type of variable the components belong to and by the indices uses to generate unique variable names for its components. This section intends to provide some guidance for interpreting the meaning of tensor component variables based on their name and origin.
Tensor component variable names are generally generated from a base name (the tensor name) by adding one or two indices. This is done using one of two available principles: either indices are coordinate names from the coordinate system to which the index refers, or they are numbers
1,
2 and
3.
The most common situation is that a vector or matrix variable is exported as components in one of the four standard frames, and then normally uses that frame’s coordinate names as indices. All frame coordinate names which are currently used in a Component can be inspected (and changed) in the Component node’s
Settings window. The default names for the spatial and material frames in a 3D model are
x,
y,
z and
X,
Y,
Z, respectively. For example, a vector
a in the material frame has components denoted by
aX,
aY, and
aZ, while one in the spatial frame would have components
ax,
ay, and
az.
Remaining tensors have their components denoted by numerical indices. For example, a vector a can have components
a1,
a2, and
a3. Such indices are always used when components refer to some implicit coordinate system (which does not exist as a node in the Model Builder tree), but also in other situations where it has been found more convenient to avoid dynamically changing component names when frame or coordinate system coordinate names are changed. This is for example the case for components of base vectors and transformation matrices defined by coordinate system nodes, and for tensors used internally in structural mechanics interfaces.
Tensor objects used inside a physics interface are tied to a coordinate system, that can be a standard frame, one defined by the user under Variable Utilities>Coordinate Systems, or created implicitly inside the interface. Each component (each index) of a tensor is also set to be either covariant or contravariant. In some cases, it is important to keep track of this.
By convention, all user inputs that may have matrix or vector form are set to be fully contravariant. This is not explicitly stated. For example, in the Heat Transfer in Solids interface, two possible inputs are the velocity vector v and the thermal conductivity matrix
k. What is entered as the components for those tensors is treated as being contravariant components. This does not matter as long as only orthonormal coordinate systems are used, but it will make a difference otherwise. Just like the unit needs to be specified when entering numerical values, the basis in which the components represent the tensor needs to be known in order for the values to have a meaning.
A few examples of this can be taken from different physics interfaces. In the Structural Mechanics Module, two second order tensors are the stress tensor σ and the strain tensor
ε. The colon product between these tensors appears in expressions for energy, and in particular in the weak formulation used to build the stiffness matrices in the finite element formulation. It is therefore more convenient if one is covariant and one is contravariant, since then
There is one more important property that variable components can have, namely whether they are tensor densities or not. A tensor density is, generally speaking, something that is measured per volume or
per area. Such variables need an extra multiplication by a volume factor when transformed between coordinate systems. There are also tensor capacities which transform
as a volume or under a change of coordinate system. Note that in addition to vectors and matrices, also scalars can be densities or capacities. The common mass density is an example of the former, while the
dvol variable representing mesh element volume is a scalar capacity.
Raising and lowering indices is done by contraction with the metric tensor, which in COMSOL is denoted by gSub or
gSup, depending on whether it is covariant (subscripted indices) or contravariant (superscripted indices). It is used when tensors are entered into expressions on the ‘wrong’ form. For example, if a dot product is taken between two vectors
a and
b, they need to be on the opposite form since