Add Scalar Injection¶
Introduction¶
This functionality allows users to define custom scalar injection regions with local injection rates. Whereas children geometry attached to the scalar parent inherit the injection properties defined by the parent, scalar injection regions allow for differentiated scalar injection characteristics within a scalar family.
Scalar injections must have children geometry that specify the location of the injection region within the simulation domain. Since the scalar injection region is a child to the scalar parent, any children geometry attached to the scalar injection region can be conceptualized as grandchildren to the scalar parent. These grandchildren geometry do not inherit injection properties from the grandparent scalar family—they inherit properties from their parent (which in this case is the scalar injection region).
Importantly, scalar injection regions allow for differentiated scalar injection characteristics between different grandchildren geometry across a single scalar family. This behavior differs from that of children geometry attached directly to the scalar parent, which are all assigned the same injection properties. This functionality, as configured here for scalar fields, mirrors the functionality of the particle injection for particle fields.
In the example below, a single scalar parent contains two distinct injection regions (bolus additions). We use two injection regions to introduce two scalar additions with distinct concentrations. Each injection region has a single child geometry, which defines where the species will enter the system.
Download Sample File: Scalar Injection
Access¶
When you select Add Scalar Injection on the context-specific toolbar, a new Add Geometry window will launch, and after you select your specifications, the property grid below will appear.

Property Grid¶
General
¶
- Base Units
read only | This parameter defines the base unit used to characterize the local species concentration. The base unit of the species can be specified in terms of moles, volume, or mass. These base units are defined and edited on the scalar field parent and stated here for reference.
Child Geometry Injection
¶
This parameter defines how species concentrations are modified inside the child geometry attached to the parent. Options are available to specify a set species concentration or a set species addition/removal rate. These values can be defined to occur either (i) across the interior volume of the child geometry or (ii) along the surface of the child geometry.
- Specification
This parameter defines the units of measure applied to the species concentration. The specification can be either a concentration (per unit volume), a number, or a rate. The base unit defines which unit to apply to the specification. The relationship between the specification, base unit, and corresponding species concentration unit is summarized in the following table:
- Per Unit Volume
Species addition is defined on a per-volume basis (concentration). The injection specification may be mol/L, volume fraction, or g/L, depending on the base units. This option is useful when modeling two miscible fluids with a set initial configuration.
- Number
Species addition is defined on a number basis. The injection specification may be mol, m 3, or g, depending on the base units. This option is useful when modeling pulse additions of species to the system.
- Rate
Species addition is defined on a rate basis. The injection specification may be mol/s, m 3 /s, or g/s, depending on the base units. This option is useful when modeling feed additions of species to the system.
- UDF
Species addition is defined on a per-volume basis (concentration) per a user-defined expression.
- Injection Location
This parameter defines where the species addition/removal will occur with reference to the child geometry.
- Inject In Volume
The scalar boundary condition is imposed on all points contained inside the geometry.
- Inject At Surface
The scalar boundary condition is imposed on the surface of the child geometry.
- Child Geometry Value UDF
base units | This UDF defines how the species concentration will be added (or removed) from the system along the child geometry. The behavior of the system is informed by the injection specification. The UDF output units are determined by scalar field background specification. This can be either a System UDF or a Local UDF, depending on the Child Geometry Injection Specification.
Download Sample File:
Child Geometry UDF
If the Child Geometry Injection Specification is set to Per Unit Volume (concentration) or Number, the values defined in the UDF will overwrite any existing scalar field values within (or along) the child geometry. When applied at the start of the simulation, it can establish a non-uniform initial species distribution. When applied later, it can simulate a bolus-type species addition. This configuration uses a System UDF.
If the Child Geometry Injection Specification is set to Rate, the UDF-defined rate will be superimposed onto any existing scalar field values within (or along) the child geometry. The UDF specifies the rate at which the local species concentration changes over time. This setup models processes like pouring, where an ongoing addition supplements the local species concentration. This configuration also uses a System UDF.
If the Child Geometry Injection Specification is set to UDF, the values defined in the UDF will overwrite any existing scalar field values within (or along) the child geometry. The UDF defines the local and instantaneous concentration across the child geometry over time. One output must be specified: a floating-point variable named
{scalar}
, where {scalar} is the dynamic name of the scalar field. This configuration uses a local UDF, calculated on a voxel-by-voxel basis within the child geometry using local fluid properties.
- Injection Time Span
This setting defines the duration of the child geometry addition.
- Entire Simulation
Maintains the Child Geometry UDF over the entire simulation. The UDF will be evaluated at each simulation time step.
- Impulse
Applies the Child Geometry UDF at a single time step. The UDF will be evaluated once at this set impulse time.
- Injection Impulse Time
Injection Impulse Time.
- Time Window
Applies the Child Geometry UDF over a user-defined time window. The UDF will be evaluated over the duration of this time window.
- Injection Window Start
Injection Window Start.
- Injection Window Stop
Injection Window Stop.
- Delayed Start
Following an initial delay, maintains the Child Geometry UDF over the entire simulation. The UDF will be evaluated at each simulation time step later than the time specified here.
- Injection Window Start
Injection Window Start.
- UDF
Offers a user-defined start and stop time.
- Injection Start Time UDF
s | This UDF defines the time at which to begin the addition process within the child geometry. This is a System UDF.
- Injection Stop Time UDF
s | This UDF defines the time at which to stop the addition process within the child geometry. This is a System UDF.
Download Sample File:
Injection Start & Stop Time
Location¶
The Add Scalar Injection function is found on the following context-specific toolbar: