This section describes all the algebraic operations for tensors that are available in
OpenFOAM. Let us first review the most simple tensor operations: addition,
subtraction, and scalar multiplication and division. Addition and subtraction are
both commutative and associative and are only valid between tensors of the same
rank. The operations are performed by addition/subtraction of respective
components of the tensors, e.g. the subtraction of two vectors and
Multiplication of any tensor by a scalar is also commutative and associative
and is performed by multiplying all the tensor components by the scalar. For
Division between a tensor and a scalar is only relevant when the scalar is the
second argument of the operation, i.e.
Following these operations are a set of more complex products between tensors of
rank 1 and above, described in the following Sections.
Some less common tensor operations and terminology used by OpenFOAM are
of a tensor is defined as the outer product of the tensor with itself,
e.g. for a vector , the square .
of a tensor is evaluated by outer products of the tensor,
e.g. for a vector , the 3rd power .
of a tensor is the th inner product of the tensor
of rank with itself, to produce a scalar. For example, for a second
rank tensor , .
is the square root of the magnitude squared, e.g. for a tensor
, . Vectors of unit magnitude are referred to as unitvectors.
is the component of the tensor with greatest
value, inclusive of sign, i.e. not the largest magnitude.
is the component of the tensor with smallest value.
is the mean of all components of a tensor.
As the name suggests, the scale function is a tool for scaling the
components of one tensor by the components of another tensor of the same
rank. It is evaluated as the product of corresponding components of 2
tensors, e.g., scaling vector by vector would produce vector whose
A second rank tensor is strictly defined as a linear vector function, i.e. it is a
function which associates an argument vector to another vector by
the inner product . The components of can be chosen to
perform a specific geometric transformation of a tensor from the , ,
coordinate system to a new coordinate system , , ; is
then referred to as the transformation tensor. While a scalar remains
unchanged under a transformation, the vector is transformed to
A second rank tensor is transformed to according to
The identity tensor is defined by the requirement that it transforms
another tensor onto itself. For all vectors
As discussed in section 1.2,
a tensor is said to be symmetric if its components are symmetric about the
diagonal, i.e. . A skew or antisymmetric tensor has
which intuitively implies that . Every second
order tensor can be decomposed into symmetric and skew parts
The trace of a tensor is a scalar, evaluated by summing the diagonal
returns a vector whose components are the diagonal components of
the second rank tensor
Deviatoric and hydrostatic tensors
Every second rank tensor can be
decomposed into a deviatoric component, for which and a
hydrostatic component of the form where is a scalar. Every
second rank tensor can be decomposed into deviatoric and hydrostatic parts
The determinant of a second rank tensor is evaluated
The minors of a tensor are evaluated for each component by deleting the
row and column in which the component is situated and evaluating the
resulting entries as a determinant. For example, the minor of
The cofactors are signed minors where each minor is component is given a
sign based on the rule
OpenFOAM supports most of the well known functions that operate on scalars, e.g.
square root, exponential, logarithm, sine, cosine etc.., a list of which can be found
in Table 1.2. There are 3 additional functions defined within OpenFOAM that are