ANSYS Fluent allows you to define up to user-defined scalar
(UDS) transport equations in your model. The general scalar transport
equation, Equation 1–8 in the Theory Guide, is shown below with the four terms (transient, flux, diffusivity,
source) that you can customize. (Equation 8–13). You will define a UDS transport equation by setting the parameters
for these four terms.
(8–13) |
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 Equation 8–13. 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 must 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 must be aware that they are directly called from the phase or mixture domains, according to the scalar association settings.
When setting up a UDS, ensure that the scalar transport problem is well defined with proper Dirichlet/Neumann boundary conditions. Depending on the nature of the problem, the UDS equation may need to converge further than the default convergence criterion of 0.1. Set the convergence criterion according to your needs.
In some instances, the residuals may not reflect the quality of the solution. In these cases you should create monitors on the UDS and use these monitors to judge solution convergence. There are several controls that you can adjust to improve convergence, however some of these adjustments can increase the computation time. The following controls can help with convergence:
Using a fixed cycle, such as F-Cycle in place of Flexible cycle in the Advanced Solution Controls dialog box.
Using an additional stabilizer such as the Biconjugate gradient stabilization method.
Using an ILU smoother.
Increasing the pre- and post-sweeps available in the Advanced Solution Controls dialog box.
Adjusting the under relaxation factors.
See the Fluent Customization Manual for information on using UDFs to define scalar quantities.
Specify the number of UDS equations you require in the User-Defined Scalars Dialog Box (Figure 8.1: The User-Defined Scalars Dialog Box).
Parameters & Customization → User
Defined Scalars
New...
Important: The maximum number of user-defined scalar transport equations
you can define is 50. ANSYS Fluent assigns numbers to the equations
starting with .
Important: Note that ANSYS Fluent assigns a default name for each scalar
equation (User Scalar 0, User
Scalar 1, and so on). These labels will appear in graphics
dialog boxes in ANSYS Fluent. You can change them by means of a UDF. See
the Fluent Customization Manual for details.
Enable Inlet Diffusion if you want to include the diffusion term in the UDS transport equation for all inflow and outflow boundaries.
Set the first user-defined scalar equation parameters
by making sure that the UDS Index is set to .
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 the button to view the list of zones you can select.
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 Equation 1–9, Equation 1–10, or Equation 1–11, respectively (in the Theory Guide). See the Fluent Customization Manual for details on flux UDFs.
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 1–8 in the Theory Guide). See the separate Fluent Customization Manual for details on unsteady UDFs.
Repeat this process for each scalar equation by incrementing the UDS Index.
Click when all user scalar equations have been defined.
To specify source term(s) for each of the UDS equations, enable the Source Terms option in the Fluid or Solid dialog box (Figure 8.2: The Fluid Dialog Box with Inputs for Source Terms for a User-Defined
Scalar) and click the Source Terms tab. The source
parameters will be displayed.
Setup →
Cell Zone Conditions
Specify the number of sources you require for each scalar equation by clicking on the button next to the scalar name (for example, User Scalar 0). This will open the User Scalar 0 sources dialog box (Figure 8.3: The User Scalar Sources Dialog Box).
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 Fluent Customization Manual. Click when you have specified all scalar sources.
To specify diffusivity for each of the UDS equations, display the Materials Task Page (Figure 8.4: The Materials Dialog Box with Input for Diffusivity for UDS
Equations) and select either defined-per-uds (the default) or user-defined in the drop-down list for UDS Diffusivity.
Setup →
Materials → Create/Edit
See User-Defined Scalar (UDS) Diffusivity for details on the different options available to you for defining diffusion coefficients.
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 (that is, scalars solved in both fluid and solid zones).
Setup →
Boundary Conditions
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 (for example, 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.
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
(that is, the negative of the term in parenthesis on the left-hand
side of in the 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 Fluent Customization Manual for information on
using UDFs for UDS boundary conditions.
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.
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 Equation 1–8, Equation 1–9, Equation 1–10, or Equation 1–11 (in the Theory Guide):
User Scalar-n
Diffusion Coef. of Scalar-n
Specify the number of scalars in the User-Defined Scalars Dialog Box (Figure 8.5: The User-Defined Scalars Dialog Box for a Multiphase Flow).
Parameters & Customization → User
Defined Scalars
New...
Important: 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.
Important: Note that ANSYS Fluent assigns a default name for each scalar
equation (User Scalar 0, User
Scalar 1, and so on). These labels will appear in graphics
dialog boxes in ANSYS Fluent. You can change them by means of a UDF. See
the Fluent Customization Manual for details.
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.
Set the first user-defined scalar equation parameters
by making sure that the UDS Index is set to .
Select the Phase you want the scalar equation solved in as a primary phase, secondary phase, or the mixture.
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 the button to view the list of zones you can select.
Specify the Flux Function to Unsteady Function the same way as you would for a single phase flow (see above).
Repeat this process for each scalar equation by incrementing the UDS Index.
Click when all user scalar equations have been defined.
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).
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).
Set the solution parameters, specify an initial value for each UDS (as you do for all other scalar transport equations), and calculate a solution.