19.10. Using CFX-4 Routines in CFX

With the availability of CFX Expression Language (CEL), many of the documented user routines presented in CFX can be set up using CEL in CFX. For details, see CFX Expression Language (CEL) in the CFX Reference Guide.The following table lists some user routines from CFX-4, and how they can be set up in CFX.

CFX routine and description

How to set up in CFX

USRBCS

A routine that enables the specification of real information at inlets, mass flow boundaries, pressure boundaries, walls and conducting boundaries, both at the start of a run and on each timestep.

An inlet profile using User Fortran is described in Junction Box Example 1. For details, see Junction Box Example 1: Profile Boundary Conditions. Time-varying boundary conditions can be set up using CEL, with an expression containing t.

USRBF

To enable you to specify body forces in the momentum equations.

This routine has been replaced by both CEL and loss models. For details, see Sources.

USRDEN

Used to overwrite the default equation of state in a compressible flow, or to set a varying density in an incompressible flow.

There is no need to set as this is calculated by the solver. Density can be specified using CEL.

USRDIF

used to overwrite the default diffusion coefficients in each transport equation. The routine is called for each equation. The equation label enters through the argument list.

Can be specified using CEL, except for orthotropic diffusivity.

USRDMP

Enables more complex control of output files.

Output control in CFX-Pre largely replaces the need for this routine. For details, see Output Control in the CFX-Pre User's Guide.

USRDRG

Enables you to overwrite the standard drag factor on particles in the particle transport model. This would normally involve setting the CD factor as a function of the relative speed of the particle and surrounding fluid.

Particle User Fortran can be used in CFX. For details, see Particle User Sources.

USRGRD

Enables you to define a grid and to specify movement of the grid with time.

This is covered by the explicit mesh movement feature of the moving mesh capability. For details, see Mesh Deformation in the CFX-Pre User's Guide.

USRINT

Used to overwrite the initial conditions, particularly on restarts.

CCL and/or CEL can be used here.

USRIPM

Used to set complex interphase mass transfer terms.

CEL

USRIPT

Used to set complex interphase transfer terms.

CEL

USRRAC

To enable you to inspect or change reaction rate constants and their derivatives.

CEL and/or CCL

USRSLP

To enable you to specify the slip velocity in the algebraic slip model.

CEL can be used.

USRSPH

To enable you to specify specific heat as an arbitrary constitutive function.

CEL can be used.

USRSRC

This routine enables you to intervene and change the equations; in particular, to add sources and sinks of momentum and energy.

This can be carried out using User CEL. An example is available in User CEL Example 1: User Defined Momentum Source.

USRTRN

The routine is called after the initial guess and at the end of each timestep. The routine can be used to monitor the calculation, or to produce special output for each timestep. It may also be used at the end of the job to calculate additional quantities from the basic solution variables.

The User Junction Box routines can handle this type of application.

USRVIS

enables you to specify a variable viscosity as a function of any combination of the other variables for use in a laminar flow calculation.

CEL

USRWRK

This routine enables you to reserve work space that may then be accessed in any of the user-defined routines.

This operation is implemented by making space available in the /USER data area. Space can be created using the MAKDAT routine. For details, see MAKDAT.