Fill out the form to download

Required field
Required field
Not a valid email address
Required field
Required field

Documentation

Field Calculator Filter in Post-processing

The Field Calculator (Beta) is a powerful filter that allows the user to create new fields in the post-processor. This article will go through the basics, limitations, and available functions/operations.

Overview

The Field Calculator feature is available in the Filters toolbar from the SimScale’s online post-processor:

field calculator filter post-processor
Figure 1: Creating a new Field Calculator post-processing filter

Once a new filter is created, a configuration window appears. Under Name in the configuration window, the user can define a name for the new field. A second entry, named Enter formula, allows the user to type in a formula for the computation of the new field.

Once the formula is correct, you can calculate the new field by clicking on Compute Formula. Now, the new field will be available in the post-processor to be evaluated.

For demonstration purposes, a couple of examples will be explored in the next sections.

Example 1: Total Pressure

To illustrate the Field Calculator workflow, let’s obtain a new post-processing field containing total pressure data. As a reminder, for an incompressible simulation, the default pressure levels in the post-processor are static gauge pressures.

Equation 1 below shows the correlation between static pressure \(p\) and total pressure \(p_0\). Furthermore, \(\rho\) represents the density of the fluid, and \(|\vec{U}|\) is the velocity magnitude.:

$$ p_0 =p + 0.5 \rho\ |\vec{U}|^2 \tag{1} $$

The formula configuration is done one term/operation at a time. To input the pressure term, type in ‘Pressure’ in the field and choose the correct entry from the list:

inputting a new parameter in field calculator
Figure 2: Once you type in a parameter or operator, a drop-down window shows up. Click on the entry in the list to select it.
  1. Type in the parameter or operator of interest
  2. Choose the desired entry from the list

This process is followed for each parameter/operator from the formula, one parameter at a time. Still following equation 1, the next term is the plus operator:

adding an operator to field calculator
Figure 3: Adding an operator to the Field Calculator filter

The process continues until the formula is fully set. At this point, you can click on ‘Compute Formula’ to obtain data from the new field.

calculating a new filter in the post-processor
Figure 4: After calculating the formula, a new field is available in the post-processor

The new field is now available for further post-processing. You can use it in conjunction with other filters, as well as features such as Statistics and Point Inspection.

analyzing a new post-processing field in the post-processor
Figure 5: Once the new field is calculated, it can be used as any other field in the post-processor with all other features available.

Example 2: Safety Factor

Another interesting application for the Field Calculator is the safety factor for FEA studies. The safety factor is the ratio of the maximum allowable stress and working stress.

For demonstration purposes, let’s use the von Mises criterion, assuming steel as material (yield strength = 350 \(MPa\)):

safety factor calculation field calculation
Figure 6: In this example, the safety factor is given by the ratio of yield strength to the von Mises stress

For safety factor evaluation, using an inverted color scheme visualization is usually insightful. This can be achieved by right-clicking on the scale bar and changing the color scheme to ‘Normal Inverted’.

changing color scale factor of safety
Figure 7: With this color scheme, regions with low safety factors will be colored in red.

Finally, the iso volume filter allows the user to pinpoint the regions with the smallest safety factor values:

filtering areas with low safety factors with iso volumes
Figure 8: Pinpointing regions with low safety factors using an iso volume filter

With this approach, the user can quickly pinpoint low safety factor regions for potential improvements.

Functions and Operators

Besides the default post-processing quantities (such as pressure, velocity, von Mises stress, etc.), the Field Calculator supports a series of functions and operators. Find below a table with information:

Function/OperatorEffect
*Multiplied by
/Divided by
+Plus
Minus
(Left parenthesis (grouping operator)
)Right parenthesis (grouping operator)
^Raised to the power of
,Comma
sinSine (angle in radians)
cosCosine (angle in radians)
tanTangent (angle in radians)
sinhHyperbolic sine (angle in radians)
coshHyperbolic cosine (angle in radians)
tanhHyperbolic tangent (angle in radians)
asinArc sine
acosArc cosine
atanArc tangent
absAbsolute value of a scalar
ceilOutputs the first integer greater or equal to the input
dotDot product between two vectors
expExponential function
floorOutputs the first integer less or equal to the input
lnNatural logarithm
log10Base 10 logarithm
normalizeKeeps the direction of a vector, and changes its magnitude to 1
magMagnitude of a vector
sqrtSquare root
Table 1: Functions and operators available in the Field Calculator filter

Limitations

The Field Calculator filter is currently in a Beta testing phase and has some known limitations, listed below:

  • Terms can only be added to the end of the formula. If a term was forgotten and needs to be added at the beginning, the formula needs to be erased until that point.
  • No editing is possible after creating the field.
  • A field generated with the field calculator filter cannot be used for the calculation of a second field.
  • Units are not supported (the legend has no units).
  • There is no dimensional analysis/validation done on the inputs. We recommend that the user runs a dimensional analysis to make sure that the formula makes sense physically. For example, it is possible to sum a velocity magnitude in \(\frac{m}{s}\) with pressures in \(Pa\).

Important

Given its beta testing phase status, we strongly appreciate feedback/comments related to your experience with the Field Calculator filter.

Last updated: April 13th, 2022

Contents