Solver Settings
Introduction to CFX
4-1
Solver Settings
Training Manual
Solver Manager
Note: This chapter considers solver settings for steady-state simulations. Settings specific to transient simulation are discussed in a later chapter.
4-2
Solver Settings
Initialization
Training Manual
Iterative solution procedures require that all solution variables are assigned initial values before calculating a solution A good initial guess can reduce the solution time In some cases a poor initial guess may cause the solver to fail during the first few iterations The initial values can be set in 3 ways: 1. Solver automatically calculates the initial values 2. Initial values are entered by the user 3. Initial values are obtained from a previous solution Initial values can be set on a per-domain basis or globally for all domains
4-3
April 28, 2009 Inventory #002598
Solver Settings
Training Manual
Solver Settings
Training Manual
The Automatic with Value option means that the specified value will be used unless a previous results file is provided
Can use a constant value or an expression
4-5
Solver Settings
Training Manual
4-6
Solver Settings
Training Manual
4-7
Solver Settings
Training Manual
4-8
Solver Settings
Training Manual
Unsteady
Advection
Diffusion
Generation
Three schemes are available, High Resolution, Upwind and Specified Blend
Discussed in more detail next
There is rarely any reason to change from the default High Resolution scheme
4-9
Solver Settings
Training Manual
Solution data is stored at nodes, but variable values are required at the control volume faces to calculate fluxes
The upstream nodal values (fup) are interpolated to the integration points (fip) on the control volume faces using:
fip = fup + b f r fip = gradient fup + b f r is the vector between the Where f is the variable and upstream node and the integration point In other words, the ip value is equal to the upstream value plus a correction due to the gradient b can have values between 0 and 1
4-10
Solver Settings
Training Manual
Theory
1 0
The Specified Blend scheme allows you to specify b between 0 and 1 (i.e. between no correction up to full correction)
But this is not guaranteed to be bounded, meaning that when the correction is included it can overshoot or undershoot what is physically possible
b=1.00
The High Resolution scheme maximizes b throughout the flow domain while keeping the solution bounded
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-11
Solver Settings
Training Manual
4-12
Solver Settings
Training Manual
When the Solver finishes you should always check why it finished Fluid Timescale Control sets the timescale in a steady-state simulation
4-13
Solver Settings
Training Manual
A steady-state simulation is a transient evolution of the flow from the initial guess to the steady-state conditions
Converged solution is independent of the timescale used
150 iterations
Final Solution
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-14
Solver Settings
Training Manual
4-15
Solver Settings
Training Manual
For advection dominated flow, a fraction of the fluid residence time is often a good estimate for the timescale
A timescale of 1/3 of (Length Scale / Velocity Scale) is often optimal May need a smaller timescale for the first few iterations and for complex physics, transonic flow,..
4-16
Solver Settings
Training Manual
4-17
Solver Settings
Training Manual
Timescale factor (default = 1) is a multiplier which can be changed to adjust the automatically calculated timescale
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-18
Solver Settings
Training Manual
Local Timescale =
Smaller Timescale in high velocity and/or fine mesh regions Can accelerate convergence when vastly different local velocity scales exist
E.g. a jet entering a plenum
Best used on fairly uniform meshes, since small element will have a small timescale which can slow convergence Local Timescale Factor is a multiplier of the local timescale Never use as final solution; always finish off with a constant timescale
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-19
Solver Settings
Training Manual
Residuals are a measure of how accurately the set of equations have been solved
Since we are iterating towards a solution, we never get the exact solution to the equations Lower residuals mean a more accurate solution to the set of equations (more on the next slide) Do not confuse accurately solving the equations with overall solution accuracy the equations may or may not be a good representation of the true system! Residuals are just one measure of accuracy and should be combined with other measures:
Monitor Points (ch. 8) and Imbalances (below)
4-20
Solver Settings
Training Manual
The continuous governing equations are discretized into a set of linear equations that can be solved. The set of linear equations can be written in the form: [A] [] = [b] where [A] is the coefficient matrix and [] is the solution variable If the equation were solved exactly we would have: [A] [] - [b] = [0] The residual vector [R] is the error in the numerical solution: [A] [] - [b] = [R] Since each control volume has a residual we usually look at the RMS average or the maximum normalized residual
4-21
Solver Settings
Training Manual
R
i
2 i
Residual Target
For reasonable convergence MAX residuals should be 1.0E-3, RMS should be at least 1.0E-4 The targets dependent on the accuracy needed
Lower values may be needed for greater accuracy
4-22
Solver Settings
Training Manual
% Imbalance
The imbalances measure the overall conservation of a quantity (mass, momentum, energy) in the entire flow domain
Clearly in a converged solution Flux In should equal Flux Out Its good practice to set a Conservation Target and/or monitor the imbalances during the run When set, the Solver must meet both the Residual and Conservation Target before stopping (assuming Max. Iterations is not reached) Set a target of 0.01 (1%) or less
Flux In Flux Out < 1%
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-23
Solver Settings
Solver Control Elapsed Time and Interrupt Control Elapsed Time Control
Can specify the maximum wall clock time for a run Solver will stop after this amount of time regardless of whether it has converged
Training Manual
Interrupt Control
Can specify other criteria for stopping the Solver based on logical CEL expressions When the expression returns true the solver will stop
Any value >= 0.5 is true
Examples
If temperature exceeds a specified value
if(areaAve(T)@wall>200[C],1,0)
4-24
Solver Settings
Training Manual
The solid timescale is automatically calculated as function of the length scale, thermal conductivity, density and specific heat capacity
Or you can choose the Physical Timescale option and provide a timescale directly
4-25
Solver Settings
Training Manual
Advanced Options
Advanced solver control options Rarely needed
4-26
Solver Settings
Training Manual
4-27
Solver Settings
Training Manual
Can also manually request a backup file from the Solver Manager at any time
Frequency of output can be adjusted
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-28
Solver Settings
Training Manual
The Cartesian Coordinates Option is used to track the value of a variable at a specific X, Y, Z location The Expression Option is used to monitor the values of a CEL expression
E.g. Calculate the area average of Cp at the inlet boundary: areaAve(Cp)@inlet E.g. Mass flow of particular fluid through an outlet: oil.massFlow()@outlet
In steady-state simulations you should create monitor points for quantities of interest
One measure of convergence is when these values are no longer changing
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-29
Solver Settings
Solver Manager
Define a run Control the CFX-Solver interactively View information about the emerging solution Export data
Training Manual
4-30
Solver Settings
Training Manual
To make a physics change and restart a solution, create a new .def file and provide it as the Solver Input File then select the .res, .bak or _full.trn file in the Initial Values Specification section
If both files have the same physics, this is the same as picking the .res/.bak/_full.trn file as the input file
Use Mesh From selects which mesh to use. If the meshes are identical can use either option, otherwise:
If you use the Solver Input File mesh, the Initial Values solution is interpolated onto the input file If you use the Initial Values mesh only the physics from the Solver Input File is used
Continue History From carriers over convergence history and iteration counters
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-31
Solver Settings
Training Manual
Set the Run Mode to one of the parallel options to make use of multiple cores/processors
Requires parallel licenses Allows you to divide a large CFD problem into smaller partitions
Faster solution times Solve larger problems by making use of memory (RAM) on multiple machines
The Local Parallel options should be used when running on a single machine The Distributed Parallel options should be used when running across multiple machines
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-32
Solver Settings
Training Manual
Local Parallel
Distributed Parallel
4-33
Solver Settings
Training Manual
Multidomain Option:
Independent Partitioning: Each domain is partitioned into n partitions Coupled Partitioning: All domains are combined and then partitioned into n partitions
Theres a specific option for Transient Rotor Stator cases
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-34
Solver Settings
Training Manual
The Solver estimates its memory requirements upfront Memory Alloc Factor is a multiplier for this estimate
Use when the solver stops with an Insufficient Memory Allocated error
ANSYS, Inc. Proprietary 2009 ANSYS, Inc. All rights reserved.
4-35
Solver Settings
Training Manual
During a solution Edit Run in Progress lets you make changes on the fly
4-36
Solver Settings
Training Manual
.out file
4-37
Solver Settings
Training Manual