4.5.2. User Expressions

By default, properties defined in Aria provide an expression with the same name. For example, density = constant value = 1 will provide an expression for DENSITY. Aria defines many property expressions that can be defined in this way, but sometimes for post-processing or complex intermediate quantities a user may want to provide their own expression with an arbitrary name. The user expression provides this capability.

One common usage is to do unit conversion - for example if you want to use temperature in Celsius as an input to a table function, you could do

user expression = scalar_string_function user_tag = "Tcelsius" \$
    f = "temperature - 273.15"

density = user_function name = my_rho_Tc_table X = Tcelsius

Here Tcelsius could later be used with a postprocessor to populate a nodal field containing the temperature in Celsius (assuming the model is defined in SI units).

postprocess Tcelsius on block_1

The user_tag argument defines the name of the provided expression. There are some rules about what this name can be. In general, you should not use a reserved suffix like _X or a species name (e.g. my_foo_x or my_foo_CO2) or a reserved prefix like GRAD_ or OLD_.

Warning

If you provide a user tag that conflicts with an existing expression (e.g. user_tag = "density") you will most likely get an error about a duplicate provided expression, however in rare cases your contribution may be silently added to the other expression.