Equations

define functions, equations, and algebraic expressions

In most positions within the USER_common_variables in the RightHandSideExpression it is possible to include user defined equations, e.g. into boundary conditions, initial conditions, user defined variables, and many more. The equation is then evaluated on point basis, in particular the equation is automatically evaluated for each the statement on the left hand side concerning point. Equations can be defined and invoked in the following ways:

(explicit) Definition - UseByReference

An equation definition for a user chosen Reference Name $EquationName$ and a user chosen BodyOfEquation takes the general form:
begin_equation{$EquationName$} BodyOfEquation end_equation

BodyOfEquation

Many of the equations are evaluated on point basis. The values of physical and organizational quantities can be accessed by the Y-Syntax by an index from __Indices__

Y%index%
Example 1: kinetic energy of a MESHFREE point uses pointwise quantities
begin_equation{$KineticEnergy$} 0.5*Y%ind_r%*( Y%ind_v(1)%^2 + Y%ind_v(2)%^2 + Y%ind_v(3)%^2 ) end_equation
The BodyOfEquation can moreover incorporate: Example 2: boolean returning 1 if point is a free surface point
begin_equation{$IsFreeSurface$} if (Y%ind_kob% = %BND_free%) :: 1 else :: 0 end if end_equation

Referencing

These equations can be referenced by their $EquationName$ in two ways:
  • directly on the RightHandSideExpression of statements by equn{$EquationName$} , see Example 3.
  • within another equation definition by using the Function equn($EquationName$) , see Example 4.
  • Inside a curve definition (Curves), see Example 5.

Examples (Referencing)

Example 3: Dirichlet temperature boundary condition with temperature given by the evaluation of the equation
BC_T($wall$) = (%BND_DIRICH%, equn{$EquationName$})
Example 4: Referring to an equation from another equation:
begin_equation{$AnotherEquation$} ... equn($EquationName$) ... end_equation
Example 5: Referring from a curve to an equation:
begin_curve{$CurveName$} 0 equn{$EquationName$} 1 2 3 87.5 end_curve

Inline definition of equations

If the equation is not so complicated and only used on one location within the setup, then there is a comfortable way of defining the equation inline by using the inline square bracket []-syntax .

Example 6
BC_T($wall$) = (%BND_DIRICH%, [BodyOfEquation])

Equations for boundary elements

Most equations are evaluated for the pointcloud, but we also have a limited amount of functions, that can be used in the context of boundary elements.

(e.g. for SAVE_BE_ITEM): these are all functions starting with BE* in the list of Functions.
List of members:
Functions Functions for usage in equations
Operators standard math operators