Shape Function Variables
A finite element defines a number of variables, typically a dependent variable and its derivatives. Such variables are called shape functions variables because they are computed directly from shape functions and the degrees of freedom.
When a physics interface is selected, you can enter names for the dependent variables; these names are used to construct the finite elements. The dependent variable name is the basis for additional variable names that the finite elements generate.
When entering the shape function variables, replace the letters highlighted below in italic font with the actual names for the dependent variables (solution components) and independent variables (spatial coordinates) for the Component.
For example, replace u with the names of the dependent variables in the individual Component, and replace x, y, and z with the first, second, and third spatial coordinate variable, respectively. xi represents the ith spatial coordinate variable. If the Component contains a deformed mesh or the displacements control the spatial frame (in solid mechanics, for example), you can replace the symbols x, y, z with either the spatial coordinates (x, y, and z by default) or the material/reference coordinates (X, Y, and Z by default).
An Example of Lagrange Element Variables
For the Lagrange element, which is the element type used by most physics interfaces, Table 5-10 lists the available variable names, assuming you gave the name u as the argument to the shape function, and that the names x, y, and z are provided for the independent variables.
u, uTx, uTy, uTz
u, uTx, ut, uTxt
u, uTx, uTy, ut, uTxt, uTyt
u, uTx, uTy, uTz, ut, uTxt, uTyt, uTzt
u, ux, uxx, ut, uxt, uxxt, utt, uxtt, uxxtt,
u, ux, uy, uxx, uxy, uyx, uyy, ut, uxt, uyt, uxxt, uxyt, uyxt, uyyt, utt, uxtt, uytt, uxxtt, uxytt, uyxtt, uyytt
u, ux, uy, uz, uxx, uxy, uxz, uyx, uyy, uyz, uzx, uzy, uzz, ut, uxt, uyt, uzt, uxxt, uxyt, uxzt, uyxt, uyyt, uyzt, uzxt, uzyt, uzzt, utt, uxtt, uytt, uztt, uxxtt, uxytt, uxztt, uyxtt, uyytt, uyztt, uzxtt, uzytt, uzztt
For example, with a fluid flow physics interface, you get the set of variables indicated in Table 5-10 for u, v, w, and p, respectively.
The variables ux, uy, and uz are the components of the gradient u, that is, the 1st-order spatial derivatives.
The variables uxx, uxy, uxz, uyx, uyy, uyz, uzx, uzy, and uzz are the 2nd-order space derivative components. They are meaningful only if the degree of the polynomial shape function used in an element is high enough. For first-order elements all these variables evaluate to zero.
If the model uses a deformed mesh, each finite element is associated with a certain frame (the spatial frame or the material frame). The frame determines the names of the variables generated by the finite element. For instance, if the spatial frame is used, the Lagrange element computes derivatives with respect to the spatial coordinates, ux, uy, and uz. If the material frame is used, the Lagrange element computes derivatives with respect to the material coordinates uX, uY, and uZ.
The Time Derivatives of the Dependent Variables
The variable ut is the time derivative of the dependent variable u. You can also form mixed space-time derivatives as uxit, for example, uxt,
The t must be last in a mixed derivative. The second time derivatives can also be used, such as utt or uxtt (but not higher derivatives in time).
If the model contains a deformed mesh, there is, in addition to the usual time derivative ut, the mesh time derivative uTIME. This also holds for mixed space-time derivatives.
Tangential Derivative Variables
On boundaries, edges, and points you also have access to tangential derivative variables. They have names such as uTx, uTy, and uTz. Using these variables, it is possible to create models with phenomena on boundaries, edges, or points as described with PDEs.
The tangential derivative variables represent the Cartesian components of the tangential projection of the gradient of shape function variables:
In this equation, (∇u)T is the tangential gradient, which consists of the tangential derivatives in each spatial direction, I is the unity tensor, n is the outward unit normal vector, and u is the gradient of u.
Lagrange Multiplier Variables
If weak constraints are activated for boundary conditions that are constraints (Dirichlet boundary conditions), COMSOL Multiphysics adds variables for the Lagrange multipliers (one for each dependent variable) by adding _lm as a suffix to the dependent variable name. For example, for a dependent variable u, the corresponding Lagrange variable is u_lm. The Lagrange multipliers are available on boundaries, and you can also evaluate them on edges (in 3D) and points (in 2D and 3D).
Variable Inheritance
On boundaries, edges, and points, gradients and second derivatives of the shape functions are available by inheritance; that is, the average of the values of the variables from the adjacent domains are computed. This process can progress for several levels.
For example, ux is the average on a boundary from the adjacent domains, then the average on an edge from the adjacent boundaries, and finally, the average at the points from the adjacent edges.
If possible, avoid using variable inheritance for gradients and second derivatives in a model. Instead, use the tangential derivative variables for equation-based modeling on boundaries, or use the up(expr), down(expr), and side(dom,expr) as appropriate to move the evaluation to the adjacent domain.
For computations of integrals of reaction forces and fluxes, use the reacf operator.
For high accuracy reaction forces and fluxes in other circumstances, use weak constraints and Lagrange multipliers on boundaries instead of directly accessing the gradient through inheritance (see Computing Accurate Fluxes).