ANSYS FLUENT allows you to define up to
user-defined scalar (UDS) transport equations in your model. The general scalar transport equation,
this equation in the separate
Theory Guide , is shown below with the four terms (transient, flux, diffusivity, source) that you can customize. (Figure
9.1.1). You will define a UDS transport equation by setting the parameters for these four terms.
Figure 9.1.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.1.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.
The maximum number of user-defined scalar transport equations you can define is 50.
ANSYS FLUENT assigns numbers to the equations starting with
.
Note that
ANSYS FLUENT assigns a default name for each scalar equation (
User Scalar 0,
User Scalar 1, etc.). These labels will appear in graphics dialog boxes in
ANSYS FLUENT. You can change them by means of a UDF. See the separate UDF Manual for details.
Figure 9.1.2: The
User-Defined Scalars Dialog Box
2.
Enable
Inlet Diffusion 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
ANSYS FLUENT solves for the user-defined scalar. Selecting
none,
mass flow rate, or a user-defined function results in
ANSYS FLUENT solving
this equation ,
this equation , or
this equation , respectively (in the separate
Theory Guide). 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
this equation to be solved (in the separate
Theory Guide). 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 dialog box (Figure
9.1.3) and click on the
Source Terms tab. The source parameters will be displayed.
Cell Zone Conditions
Figure 9.1.3: The
Fluid Dialog Box 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 dialog box (Figure
9.1.4).
Figure 9.1.4: The
User Scalar Sources Dialog Box
(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 dialog box. 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, display the
Materials task page (Figure
9.1.5) and select either
defined-per-uds (the default) or
user-defined in the drop-down list for
UDS Diffusivity.
MaterialsCreate/Edit
Figure 9.1.5: The
Materials Dialog Box 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).
Boundary Conditions
(a)
In the
UDS tab 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 dialog box.
(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
this equation (in the separate
Theory Guide) 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 task page, 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 dialog box, the list of field variables will include the
User Defined Scalars... category, which contains the value of each UDS and its diffusion coefficient (
in
this equation ,
this equation ,
this equation , or
this equation (in the separate
Theory Guide):
Figure 9.1.6: The
User-Defined Scalars Dialog Box for a Multiphase Flow
The maximum number of user-defined scalar transport equations you can define is 50.
ANSYS FLUENT assigns numbers to the equations starting with
. The default association type is set to
mixture for all scalars.
Note that
ANSYS FLUENT assigns a default name for each scalar equation (
User Scalar 0,
User Scalar 1, etc.). These labels will appear in graphics dialog boxes in
ANSYS 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 dialog box 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.