中文 English
You are here: Expression Editor > Functions

13.3 Functions

The Functions in the Expression Editor enable mathematical and logical manipulation of both Vectors and Scalars.

The functions available in Expression Editor are explained here :

  1. Operators
    • Common to Vectors and Scalars (e.g. addition and subtraction)
    • Scalars only (e.g. square roots and logs)
    • Vectors only (e.g. dot and cross products)
  2. Logicals
  3. Trigonometric and Hyperbolic
  4. Display related functions
  5. Other functions
  6. Integration and Averaging
  7. Tables

13.3.1 Operators

13.3.2 Logicals

13.3.3 Trigonometric and Hyperbolic

13.3.4 Display related functions

13.3.5 Other functions

13.3.6 Integration and Averaging

13.3.7 Tables

Table Format: 1-D

The 1-D Table function table(filename,x) enables access to a 1-D data table located in the same directory as the project file (*.spro).

Format of the 1-D Table for Uniform Distribution :

<?xml version="1.0" encoding="ISO-8859-1"?>

<table size="n" min="xmin" max="xmax" outside="flat | extrapolation">

# comment - values (x is assumed to have uniform distribution with xmin and xmax as bounds and n values in between)

v1

v2

vn

</table>

Format of the 1-D Table for Non-Uniform Distribution is :

<?xml version="1.0" encoding="ISO-8859-1"?>

<table size="n" outside="flat | extrapolation">

# comment - values (x is assumed to have non-uniform distribution)

x1 v1

x2 v2

xn vn

</table>

In the table syntax, outside = “flat” or outside = "extrapolation"under the table tag dictates how to determine a value when the input x, y is out of the range. "flat" denotes that the value of the closest bound is considered, and "extrapolation" denotes that the values are extrapolated from the nearest bound values.

 

Note: Comments can be input by placing a hash-mark “#” in front of the text. They are not inserted before the xml line (line 1).

Table Format: 2-D

The 2-D Table function table (filename,x) enables access to a 2-D data table located in the same directory as the project file (*.spro). 2D tables are used to specify variables which depend on two other independent variables.

Format of the 2-D Table for Uniform Distribution :

<?xml version="1.0" encoding="ISO-8859-1"?>

<table size="nx my" min="xmin ymin" max="xmax ymax" outside="flat | extrapolation">

# values (x and y assumed to have uniform distribution)

v(x1,y1) v(x2,y1) … v(xn,y1)

v(x1,y2) v(x2,y2) … v(xn,y2)

v(x1,ym) v(x2,ym) … v(xn,ym)

</table>

Format of the 2-D Table for Non- Uniform Distribution :

In the format outside = “flat” or outside = "extrapolation"under the table tag dictates how to determine a value when the input x, y is out of the range.

<?xml version="1.0" encoding="ISO-8859-1"?>

<table size="nx my" outside ="flat | extrapolation">

# x and y variable ranges

x1 x2 … xn

y1 y2 … ym

# values table

v(x1,y1) v(x2,y1) … v(xn,y1)

v(x1,y2) v(x2,y2) … v(xn,y2)

v(x1,ym) v(x2,ym) … v(xn,ym)

</table>

In the table syntax, outside = “flat” or outside = "extrapolation"under the table tag dictates how to determine a value when the input x, y is out of the range. "flat" denotes that the value of the closest bound is considered, and "extrapolation" denotes that the values are extrapolated from the nearest bound values.

 

Note: Comments can be input by placing a hash-mark “#” in front of the text. They are not before the xml line (line 1).

Table Format: 3-D

The 3-D Table function table (filename,vector) enables access to a 3-D data table located in the same directory as the project file (*.spro). The 3-D tables are used to specify a variable distribution over a boundary/volume.

Format of the 3-D Table :

<?xml version="1.0" encoding="ISO-8859-1"?>

<table mapped_size="n" allowed_error="1" outside_valve="minimum">

# comment - values (x is assumed to have uniform distribution with xmin and xmax as bounds and n values in between)

x1 y1 z1 v1

x2 y2 z2 v2

Xn yn zn vn

</table>

In the table syntax,

# Extracting data from tables,

T_fluid = table("solid_temperature.txt", coord);

Mapping variables using tables

User can specify a variable distribution over a boundary/volume using a table. This is done using the X,Y,Z coordinates specifying the distribution of the variable in form of a table at that respective Geometric Entity, such as a Boundary or a Volume. This is primarily used for:

 

 

 

Copyright © 2023 Simerics Inc.,