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:

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:

- Type in the parameter or operator of interest
- 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:

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.

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*.

## 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\)):

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’**.

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

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/Operator | Effect |

* | Multiplied by |

/ | Divided by |

+ | Plus |

– | Minus |

( | Left parenthesis (grouping operator) |

) | Right parenthesis (grouping operator) |

^ | Raised to the power of |

, | Comma |

sin | Sine (angle in radians) |

cos | Cosine (angle in radians) |

tan | Tangent (angle in radians) |

sinh | Hyperbolic sine (angle in radians) |

cosh | Hyperbolic cosine (angle in radians) |

tanh | Hyperbolic tangent (angle in radians) |

asin | Arc sine |

acos | Arc cosine |

atan | Arc tangent |

abs | Absolute value of a scalar |

ceil | Outputs the first integer greater or equal to the input |

dot | Dot product between two vectors |

exp | Exponential function |

floor | Outputs the first integer less or equal to the input |

ln | Natural logarithm |

log10 | Base 10 logarithm |

normalize | Keeps the direction of a vector, and changes its magnitude to 1 |

mag | Magnitude of a vector |

sqrt | Square root |

*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.