Creating a Field Function for the Grid Velocity

A radial velocity is to be set at the cylinder wall using a field function based on the axial position.

The variation of the radial velocity with axial distance is shown in the figure below:

The equation for this profile is:
vr={18xzforxz<218(4xz)forxz2

where vr is the radial velocity in m/s and xz is the z (or axial) coordinate of the face centroid in m.

The field function for this profile is implemented as follows:

  1. Right-click the Automation > Field Functions node and select New > Vector.
  2. Rename the User Field Function 1 node to Cylinder Radial Velocity.
  3. Select the Cylinder Radial Velocity node and set the following properties:
    Property Setting
    Function Name CylinderRadialVelocity
    Dimensions Velocity
    Definition [(($$Position("Cylindrical 1")[2] < 2) ? -0.125*$$Position("Cylindrical 1")[2] : -0.125*(4-$$Position("Cylindrical 1")[2])), 0, 0]
    Note: the function $$Position("Cylindrical 1") returns a cartesian vector of the position coordinates in local coordinate system Cylindrical 1; the subscript operator [] is appended to access a single component of the position vector (with an index of [0], [1], or [2]).