36.9. Initializing the Solution

Before starting your CFD simulation, you must provide Ansys Fluent with an initial “guess” for the solution flow field. In many cases, you must take extra care to provide an initial solution that will allow the desired final solution to be attained. A real-life supersonic wind tunnel, for example, will not “start” if the back pressure is simply lowered to its operating value; the flow will choke at the tunnel throat and will not transition to supersonic. The same holds true for a numerical simulation: the flow must be initialized to a supersonic flow or it will simply choke and remain subsonic.

There are two methods for initializing the solution:


Important:
  • Before patching initial values in selected cells, you must first initialize the entire flow field. You can then patch the new values over the initialized values for selected variables.

  • If you are using one of the following in your analyses:

    • user-defined real gas model (UDRGM)

    • user-defined density (via UDF)

    • solution-dependent expressions

    then before initializing the solution using either the Hybrid Initialization method or values from a specific zone selected in the Compute from drop-down list, you must first perform standard initialization with no zone selected from the Compute from drop-down list.

    In the first step, the standard initialization will yield the preliminary solution values, which will be then used in the second step to obtain the desired initial values. The recommended workflow will help resolve potential circular dependencies (such as the dependence of solution initialization values on material properties or expressions and dependence of material properties or expressions on solution values).


36.9.1. Initializing the Entire Flow Field Using Standard Initialization

Before you start your calculations or patch initial values for selected variables in selected cells (Patching Values in Selected Cells) you must initialize the flow field in the entire domain. The Solution Initialization Task Page (Figure 36.15: The Solution Initialization Task Page) allows you to set initial values for the flow variables and initialize the solution using these values.

  Solution   Initialization

Figure 36.15: The Solution Initialization Task Page

The Solution Initialization Task Page

You can compute the values from information in a specified zone, enter them manually, or have the solver compute average values based on all zones. You can also indicate whether the specified values for velocities are absolute or relative to the velocity in each cell zone. The steps for standard initialization are as follows:

  1. Select Standard Initialization as the Initialization Method.

  2. Set the initial values:

    • To initialize the flow field using the values set for a particular zone, select the zone name in the Compute from drop-down list. All values under the Initial Values heading will automatically be computed and updated based on the conditions defined at the selected zone.

    • To initialize the flow field using computed average values, select all-zones in the Compute from drop-down list. Ansys Fluent will compute and update the Initial Values based on the conditions defined at all boundary zones.

    • If you want to change one or more of the values, you can enter new values manually in the fields next to the appropriate variables. If you prefer to enter all values manually, you can do so without selecting a zone in the Compute from list. For species transport cases with a single phase flow, you can select boundary species to be displayed in the list using the Select Boundary Species dialog box (see Figure 19.3: The Select Boundary Species Dialog Box) that can be accessed by clicking Species in the Solution Initialization task page.

  3. If your problem involves moving reference frames or sliding meshes, indicate whether the initial velocities are absolute velocities or velocities relative to the motion of each cell zone by selecting Absolute or Relative to Cell Zone under Reference Frame. (If no zone motion occurs in the problem, the two options are equivalent.) The default reference frame for velocity initialization in Ansys Fluent is relative. If the solution in most of your domain is rotating, using the relative option may be better than using the absolute option.

  4. After you are satisfied with the Initial Values displayed in the task page, you can click the Initialize button to initialize the flow field. If solution data already exist (that is, if you have already performed some calculations or initialized the solution), you must confirm that it is OK to overwrite those data.

36.9.1.1. Saving and Resetting Initial Values

When you initialize the solution by clicking on Initialize, the initial values will also be saved; should you need to reinitialize the solution later, you will find the correct values in the task page when you reopen it.

If you accidentally select the wrong zone from the Compute from list or manually set a value incorrectly, you can use the Reset button to reset all fields to their “saved” values.

36.9.2. Patching Values in Selected Cells

Once you have initialized (or calculated) the entire flow field, you may patch different values for particular variables into different cells. If you have multiple fluid zones, for example, you may want to patch a different temperature in each one. You can also choose to patch a custom field function (defined using the Custom Field Function Calculator Dialog Box) instead of a constant value. If you are patching velocities, you can indicate whether the specified values are absolute velocities or velocities relative to the cell zone’s velocity. You can also use expressions to patch cell zones and cell registers (refer to Fluent Expressions Language for additional information on expressions). All patching operations are performed with the Patch Dialog Box (Figure 36.16: The Patch Dialog Box).

  Solution Initialization   Patch...

  Solution   Initialization Patch...

Figure 36.16: The Patch Dialog Box

The Patch Dialog Box

  1. Select the variable to be patched in the Variable list.


    Note:  For species transport cases with a single phase flow, you can select boundary species to be displayed in the Variable list using the Select Boundary Species dialog box (see Figure 19.3: The Select Boundary Species Dialog Box) that can be accessed by clicking the Species button in the Solution Initialization task page.


  2. Choose the zone(s) and/or register(s) where you want to patch a value for the selected variable, in the Zones to Patch and/or Registers to Patch lists.


    Important:  When a shell zone has been created (that is, by enabling shell conduction for a wall and running the calculation), the name of the shell zone will be listed in the Zones to Patch list as shell : < wall-name >, where < wall-name > is the name of the wall in which shell conduction has been enabled. Only temperature can be patched into the cells of a shell, and the same value or field function will be patched into every layer of the shell.


  3. If you want to patch a constant value, simply enter that value in the Value field. If you want to specify a value that is more complex, you can either use an expression or a field function.

    • To use an expression, select Expression from the drop-down list to the right of the Value field, and click ( ) to open Figure 5.2: The Expression Editor Dialog Box.

    • To use a field function, enable the Use Field Function option and select the appropriate function in the Field Function list.

  4. If you selected a velocity in the Variable list, and your problem involves moving reference frames or sliding meshes, indicate whether the patched velocities are absolute velocities or velocities relative to the motion of each cell zone by selecting Absolute or Relative to Cell Zone under Reference Frame. (If no zone motion occurs in the problem, the two options are equivalent.) The default reference frame for velocity patching in Ansys Fluent is relative. If the solution in most of your domain is rotating, using the relative option may be better than using the absolute option.

  5. Click the Patch button to update the flow-field data. (Note that patching will have no effect on the iteration or time-step count.)


Important:  If you apply a patch when setting up an Ansys Fluent simulation from Ansys Workbench, the patch will not be automatically performed during future automatic solution updates from Workbench. If you need to apply the patch each time the solution is updated from Workbench, you can do so by adding the text command /solve/patch (with appropriate arguments) to the Original Settings command list in the Case Modification tab of the Automatic Solution Initialization and Case Modification dialog box. See Automatic Initialization of the Solution and Case Modification in this manual and Case Modification Strategies with Fluent and Workbench in the Fluent in Workbench User's Guide for more details on automatic case modification.


36.9.2.1. Using Registers

The ability to patch values in cell registers gives you the flexibility to patch different values within a single cell zone. For example, you may want to patch a certain value for temperature only in fluid cells with a particular range of concentrations for one species. You can create a cell register (basically a list of cells) using the cell registers feature (Using Cell Registers). These functions allow you to mark cells based on physical location, cell volume, gradient or isovalue of a particular variable (using a field variable register), and other parameters. Once you have created a register, you can patch values in it as described above.

36.9.2.2. Using Field Functions

By defining your own field function using the Custom Field Function Calculator Dialog Box, you can patch a non-constant value in selected cells. For example, you may want to patch varying species mass fractions throughout a fluid region. To use this feature, simply create the function as described in Custom Field Functions, and then perform the function-patching operation in the Patch Dialog Box, as described above.

36.9.2.3. Using Patching Later in the Solution Process

Since patching affects only the variables for which you choose to change the value, leaving the rest of the flow field intact, you can use it later in the solution process without losing calculated data. (Initialization, on the other hand, resets all data to the initial values). For example, you might want to start a combustion calculation from a cold-flow solution. You can simply read in (or calculate) the cold-flow data, patch a high temperature in the appropriate cells, and continue the calculation.

Patching can also be useful when you are solving a problem using a step-by-step technique, as described in Step-by-Step Solution Processes.