It is often useful to use a CEL expression as the argument of an integrated quantity function. For example, for monitoring purposes. Unfortunately, it is not possible to use a CEL expression as an argument of an integrated quantity function, as only variables are permitted as arguments to this type of function. A workaround to this problem is described below. Note that this restriction only applies to integrated quantity CEL functions. Other functions can take expressions as arguments.
This restriction can be worked around by using an algebraic additional variable.
For example, suppose the following expression had been defined:
var1 = 0.5*Density*u*abs(u)
It the volume integral of this expression was required at a particular subdomain, it would be tempting to use the expression shown below:
However, due to the restriction already discussed, this expression would cause the solver to fail. The workaround for this would be to create an additional variable of type scalar (e.g. called 'var1'). In the domain, set option for this variable as algebraic. You can then set the required expression for the additional variable, which in this case would be:
The expression shown below would then be accepted by the solver:
NOTE ON VECTORS:
In cases where vectors are to be dealt with, it is possible to use vector additional variables, thus avoiding the proliferation of additional variables. If a vector additional variable is selected, three expressions will be required. Extending the previous example to all three components of velocty, these would be:
The suffix _x, _y or _z allows the components of a vector additional variable to be used as arguments of an integrated quantity function. e.g.