﻿ Defining Functions
Manufacturing Solutions

# Defining Functions   # Defining Functions    HyperXtrude allows you to input fluid properties and boundary conditions as a function of space. This is done using the FUNCTIONS block. The function can be an expression, a one-dimensional table, or a two-dimensional table.

Syntax

BEGIN FUNCTIONS

Function_Type Variable { Expression/Data }

END

Valid entries for Function_Type are: CONSTANT, TABLE1, and EXPRESSION. Variable is the name of the data field represented as a function. Expression denotes algebraic expression used to compute the variable. Data denotes the tabular data used to compute the variable. Examples of syntax for the function types are provided below.

### TABLE1 Example

This example illustrates the definition of viscosity (kg/m-sec) as a function of temperature (K).

BEGIN FUNCTION

TABLE1 Viscosity_vs_Temp {

250.0 1.606E-05

300.0 1.853E-05

350.0 2.081E-05

400.0 2.294E-05

450.0 2.493E-05

500.0 3.682E-05 }

END

### EXPRESSION Example

This example illustrates the definition of inlet velocity as a function of coordinates (x, y, z) and time (t). The input variables to the expression are (x,y,z,t).

BEGIN FUNCTION

# (Parabolic velocity at inlet)

EXPRESSION XVelocity "{x y z t} {expr 240*(\$y)*(1.0 - (\$y))}"

END

BEGIN FUNCTION

# (Time dependent velocity)

EXPRESSION XVelocity "{x y z t} {expr 20.00*(cos(3.141592654*(\$t)))}"

END