FLUENT allows you to define up to
user-defined scalar (UDS) transport equations in your model. The general scalar transport equation (Equation
9.3-1) from the previous theory section is shown below with the four terms (unsteady, flux, diffusivity, source) that you can customize. (Figure
9.3.1). You will define a UDS transport equation by setting the parameters for these four terms.
Figure 9.3.1: Generalized UDS Transport Equation
In addition, you can set boundary conditions for the variables within cells of a fluid or solid zone for a particular scalar equation. This is done by fixing the value of
in Figure
9.3.1. When
is fixed in a given cell, the UDS scalar transport is not solved and the cell is not included when the residual sum is computed. Additionally, you can also specify custom boundary conditions in the mixture on all wall, inflow, and outflow boundaries on a per-scalar basis.
The procedures for setting up a user-defined scalar (UDS) equation for single-phase and multiphase flows are outlined below. Note that a significant difference between a UDS for a single-phase versus a multiphase application is that you will need to associate each UDS with its corresponding phase domain or mixture domain, depending on your application. If you supply UDFs for transient terms, convective fluxes, and sources, you will need to be aware that they are directly called from the phase or mixture domains, according to the scalar association settings.
See the separate
UDF Manual for information on using UDFs to define scalar quantities.
Single Phase Flow
1.
Specify the number of UDS equations you require in the
User-Defined Scalars panel (Figure
9.3.2).
DefineUser-DefinedScalars...
The maximum number of user-defined scalar transport equations you can define is 50.
FLUENT assigns numbers to the equations starting with
.
Note that
FLUENT assigns a default name for each scalar equation ((
User Scalar 0,
User Scalar 1, etc.). These labels will appear in graphics panels in
FLUENT. You can change them by means of a UDF. See the separate UDF Manual for details.
Figure 9.3.2: The
User-Defined Scalars Panel
2.
Keep the default
Inlet Diffusion enabled if you want to include the diffusion term in the UDS transport equation for all inflow and outflow boundaries.
3.
Set the first user-defined scalar equation parameters by making sure that the
UDS Index is set to
.
(a)
Specify the
Solution Zones you want the scalar equation to be solved in as
all fluid zones,
all solid zones,
all zones (fluid and solid) or
selected zones. If you choose
selected zones, click on the
Edit button to view the list of zones you can select.
(b)
Specify the
Flux Function to be
none,
mass flow rate, or a user-defined function (UDF). The
Flux Function determines how the convective flux is computed, which determines the equation that
FLUENT solves for the user-defined scalar. Selecting
none,
mass flow rate, or a user-defined function results in
FLUENT solving
9.3-2,
9.3-3, or
9.3-4, respectively. See the separate UDF Manual for details on flux UDFs.
(c)
Specify the
Unsteady Function to be
none,
default, or a user-defined function (UDF). Select
none for a steady state solution and
default if you want the transient term in Equation
9.3-1 to be solved. See the separate UDF Manual for details on unsteady UDFs.
(d)
Repeat this process for each scalar equation by incrementing the
UDS Index.
(e)
Click
OK when all user scalar equations have been defined.
4.
To specify source term(s) for each of the
UDS equations, enable the
Source Terms option in the
Fluid or
Solid panel (Figure
9.3.3) and click on the
Source Terms tab. The source parameters will be displayed.
DefineBoundary Conditions...
Figure 9.3.3: The
Fluid Panel with Inputs for Source Terms for a User-Defined Scalar
(a)
Specify the number of sources you require for each scalar equation by clicking on the
Edit... button next to the scalar name (e.g.,
User Scalar 0). This will open the
User Scalar 0 Sources panel (Figure
9.3.4).
Figure 9.3.4: The
User Scalar Sources Panel
(b)
Specify the
Number of User Scalar Sources for the scalar equation by incrementing the counter. Based on the value you have chosen, the sources will be added to the list in the panel. Specify each source to be
none,
constant, or a user-defined function (UDF). For details on defining a UDF scalar source, see the separate UDF Manual. Click
OK when you have specified all scalar sources.
5.
To specify diffusivity for each of the
UDS equations, open the
Materials panel (Figure
9.3.5) and select either
defined-per-uds (the default) or
user-defined in the drop-down list for
UDS Diffusivity.
DefineMaterials...
Figure 9.3.5: The
Materials Panel with Input for Diffusivity for UDS Equations
See Section
8.6 for details on the different options available to you for defining diffusion coefficients.
6.
To specify boundary conditions for the user-defined scalars on wall, inflow, and outflow boundaries, you can define a specific value or a specific flux for each scalar. A coupled boundary condition can be specified on two-sided walls for scalars that are to be solved in regions on both sides of the wall (i.e., scalars solved in both
fluid and solid zones).
DefineBoundary Conditions...
(a)
Under
User Defined Scalar Boundary Condition, select either
Specified Flux or
Specified Value in the drop-down list next to each scalar (e.g.,
User Scalar 0) for a boundary wall. For interior walls, select
Coupled Boundary if the scalars are to be solved on both sides of a two-sided wall. Note that the
Coupled Boundary option will only show up in the drop-down list if the scalar is defined in the
fluid and solid zones in the
User-Defined Scalars panel.
(b)
Under
User Defined Scalar Boundary Value, enter a constant value or select a user-defined function from the drop-down list for each scalar. If you select
Specified Flux, your input will be the value of the flux at the boundary (i.e., the negative of the term in parenthesis on the left hand side of Equation
9.3-2 dot [as in the dot product of]
[as in the vector, n], where
is the normal into the domain). If you select
Specified Value, your input will be the value of the scalar itself at the boundary. See the separate UDF Manual for information on using UDFs for UDS boundary conditions.
7.
Set the solution parameters in the
Solution Controls panel, specify an initial value for each UDS (as you do for all other scalar transport equations), and calculate a solution.
8.
Examine the results using the usual postprocessing tools. In each postprocessing panel, the list of field variables will include the
User Defined Scalars... category, which contains the value of each UDS and its diffusion coefficient (
in Equation
9.3-1,
9.3-2,
9.3-3, or
9.3-4):
User Scalar-n
Diffusion Coef. of Scalar-n
Multiphase Flow
1.
Specify the number of scalars in the
User-Defined Scalars panel (Figure
9.3.6).
DefineUser-DefinedScalars...
Figure 9.3.6: The
User-Defined Scalars Panel for a Multiphase Flow
The maximum number of user-defined scalar transport equations you can define is 50.
FLUENT assigns numbers to the equations starting with
. The default association type is set to
mixture for all scalars.
Note that
FLUENT assigns a default name for each scalar equation ((
User Scalar 0,
User Scalar 1, etc.). These labels will appear in graphics panels in
FLUENT. You can change them by means of a UDF. See the separate UDF Manual for details.
2.
Keep the default
Inlet Diffusion enabled if you want to include the diffusion term in the UDS transport equation for all inflow and outflow boundaries.
3.
Set the first user-defined scalar equation parameters by making sure that the
UDS Index is set to
.
(a)
Select the
Phase you want the scalar equation solved in as a primary phase, secondary phase, or the mixture.
(b)
Specify the
Solution Zones you want the scalar equation to be solved in as
all fluid zones,
all solid zones,
all zones (fluid and solid) or
selected zones. If you choose
selected zones, click on the
Edit button to view the list of zones you can select.
(c)
Specify the
Flux Function to
Unsteady Function the same way as you would for a single phase flow (see above).
(d)
Repeat this process for each scalar equation by incrementing the
UDS Index.
(e)
Click
OK when all user scalar equations have been defined.
4.
Specify source term(s) for each of the
UDS equations in the
Fluid or
Solid panel as described for a single phase flow(see above).
5.
Specify boundary conditions for the user-defined scalars in the mixture on all wall, inflow, and outflow boundary as described for a single phase flow (see above).
6.
Set the solution parameters, specify an initial value for each UDS (as you do for all other scalar transport equations), and calculate a solution.