udf UDF Region

Introduction

UDF Regions provide a way to restrict user-defined functions (UDFs) to specific areas of the computational domain. Conceptually, a UDF region is a Boolean mask applied to the lattice: voxels that fall inside the defined region evaluate to 1 (true), while those outside evaluate to 0 (false). By multiplying UDF expressions with this mask, it is possible to localize variable definitions, reactions, or outputs to particular zones of interest rather than applying them across the entire domain.

A UDF region must be defined by either attaching a child geometry or defining fill points. Child geometry can be used to prescribe the region boundaries directly. This provides precise spatial control over the mask and is recommended when the region of interest has a complex or irregular shape. A fill point automatically generates a fill volume centered on the selected location, producing a mask that isolates voxels inside that volume.

There is no property grid associated with this family. All behavior of a UDF region is controlled through its fill point or child geometry. Inside a UDF, regions are typically invoked by multiplying the region mask with the relevant function.

UDF regions are useful for restricting reaction kinetics to targeted sub-volumes or for defining sampling regions when extracting flow statistics. Multiple UDF regions can be combined within a single function using Boolean operators, enabling flexible and modular spatial targeting.

In the example below, a UDF Region is incorporated into a porous media zone to create a selective filter. The porous medium simulates the physical resistance of the membrane, allowing the liquid to pass through under a pressure gradient, just as it would through a physical filter. To achieve selective filtration, a Scalar Slip Velocity UDF is applied to the scalar that enters the UDF Region.


Download Sample File: UDF Region

UDF Region Toolbar

Context-Specific Toolbar Forms

Description

addG Add Geometry

The Add Geometry form adds child geometry by importing from external CAD files, extracting from external CAD assemblies, or defining internally using built-in parametric geometry.

move Move

The Move form enables three-dimensional rigid body transform of object through free drag or point-to-point snapping.

rotate Rotate

The Rotate form enables three-dimensional rotation of geometry.

scale Scale

The Scale form enables volumetric scaling of a geometry about a set anchor point.

mate Mate

The Mate form allows surface-to-surface mating and alignment.

point Add Fill Point

The Add Fill Point selects which space will initially be 3D-filled with a liquid.

help Help

The Help command launches the M-Star reference documentation in your web browser.

See also Child Geometry Context Specific Toolbar.

For a full description of each selection on the Context-Specific Toolbar, see Toolbar Selections.