+ All Categories
Home > Documents > Solver Control

Solver Control

Date post: 03-Apr-2018
Category:
Upload: helen-hamoudi
View: 250 times
Download: 0 times
Share this document with a friend

of 38

Transcript
  • 7/28/2019 Solver Control

    1/38

    4-1ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Chapter 4

    Solver Settings

    Introduction to CFX

  • 7/28/2019 Solver Control

    2/38

    Solver Settings

    4-2ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualOverview

    Initialization

    Solver Control

    Output Control

    Solver Manager

    Note: This chapter considers solver settings for steady-state simulations.

    Settings specific to transient simulation are discussed in a later chapter.

  • 7/28/2019 Solver Control

    3/38

    Solver Settings

    4-3ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    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. Solverautomatically calculates the initial values

    2. Initial values are entered by the user3. Initial values are obtained from a previous solution

    Initial values can be set on a per-domain basis or globally for all

    domains

    Initialization

  • 7/28/2019 Solver Control

    4/38

    Solver Settings

    4-4ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualInitialization Setting Initial Values

    Insert Global Initialisationfrom the toolbar or by right-

    clicking on Flow Analysis 1

    Edit each Domain to set initial

    values on a per-domain basis

    When both are defined the

    domain settings take

    precedence

    Solid domain must have

    initial conditions set on a per-

    domain basis

  • 7/28/2019 Solver Control

    5/38

    Solver Settings

    4-5ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualInitialization Setting Initial Values

    The Automatic option means that theCFX-Solver will calculate an initial value

    for the solved variable unless a previous

    results file is provided

    Will be based on boundary condition

    values and domain settings

    The Automatic with Value option meansthat the specified value will be used

    unless a previous results file is provided

    Can use a constant value or an expression

  • 7/28/2019 Solver Control

    6/38

    Solver Settings

    4-6ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualInitialization Using a Previous Solution

    To use a previous solution as the

    initial guess enable the Initial ValuesSpecification toggle when launchingthe Solver

    You can provide multiple initial values

    files

    When simulating a system you can

    provide previous solutions for eachcomponent of the system as the initial

    guess

    Usually each file would correspond to a

    separate region of space

    It is best if domains in the Solver Input

    File do not overlap with multiple initialvalues files

  • 7/28/2019 Solver Control

    7/38

    Solver Settings

    4-7ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    Edit the Solver Control object in the Outline tree

    Solver Control Editing

  • 7/28/2019 Solver Control

    8/38

    Solver Settings

    4-8ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    The Solver Control panel contains

    various controls that influence the

    behavior of the solver

    These controls are important for the

    accuracy of the solution, the stability of

    the solver and the length of time it takesto obtain a solution

    Solver Control Options

  • 7/28/2019 Solver Control

    9/38

    Solver Settings

    4-9ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Control Advection Scheme

    The Advection Scheme refers to the way the

    advection term in the transport equations is

    modeled numerically i.e. the term that accounts for bulk fluid motion

    Often the dominant term

    Three schemes are available, HighResolution, Upwind and Specified Blend

    Discussed in more detail next

    There is rarely any reason to change from the

    default High Resolution scheme

    Unsteady Advection Diffusion Generation

  • 7/28/2019 Solver Control

    10/38

    Solver Settings

    4-10ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Control Advection Scheme Theory

    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 integrationpoints (fip) on the control volume faces using:

    Where is the variable gradient and is the vector between the

    upstream node and the integration point

    In other words, the ip value is equal to the upstream value plus acorrection due to the gradient

    bcan have values between 0 and 1

    fip

    fup

    b f r+=

    f r

  • 7/28/2019 Solver Control

    11/38

    Solver Settings

    4-11ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Control Advection Scheme Theory

    Ifb = 0 we get the Upwind advectionscheme, i.e. no correction

    This is robust but only first order accurate

    Sometimes useful for initial runs, but

    usually not necessary

    The Specified Blend scheme allows you tospecify b between 0 and 1 (i.e. between nocorrection up to full correction)

    But this is not guaranteed to be bounded,

    meaning that when the correction is

    included it can overshoot or undershootwhat is physically possible

    The High Resolution scheme maximizes bthroughout the flow domain while keeping

    the solution bounded

    fip fup b f r+=Theory

    High Resolution

    Scheme

    Upwind Scheme

    b=1.00

    Flow is misaligned

    with mesh

    0

    1

  • 7/28/2019 Solver Control

    12/38

    Solver Settings

    4-12ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Control Turbulence Numerics

    Regardless of the Advection Scheme

    selection, the Turbulence equations

    default to the First Order (Upwind)

    scheme

    Usually this is sufficient

    The High Resolution scheme can beselected for additional accuracy

    Can give better accuracy in boundary

    layers on unstructured meshes

  • 7/28/2019 Solver Control

    13/38

    Solver Settings

    4-13ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Control Convergence Control

    The Solver will finish when it reaches Max.Iterations unless convergence is achieved

    sooner IfMax. Iterations is reached you may not have

    a converged solution

    Can be useful to set Max. Iterations to a largenumber

    When the Solver finishes you should always

    check why it finished

    Fluid Timescale Control sets the timescale in

    a steady-state simulation

  • 7/28/2019 Solver Control

    14/38

    Solver Settings

    4-14ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    ANSYS CFX employs the so called False Transient Algorithm

    A timescale is used to move the solution towards the final answer

    In a steady-state simulation the timescale provides relaxation of the

    equation non-linearities

    A steady-state simulation is a transient evolution of the flow from theinitial guess to the steady-state conditions

    Converged solution is independent of the timescale used

    Initial Guess

    50 iterations

    100 iterations

    150 iterations

    Final Solution

    Solver Control Timescale Background

  • 7/28/2019 Solver Control

    15/38

    Solver Settings

    4-15ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    For obtaining successful

    convergence, the selection of thetimescale plays an important role

    If the timescale is too large, the

    convergence becomes bouncy or

    may even lead to the failure of theSolver

    If the timescale is too small, the

    convergence will be very slow and

    the solution may not be fully

    accurate

    Solver Control Timescale Selection

  • 7/28/2019 Solver Control

    16/38

    Solver Settings

    4-16ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Control Timescale Selection

    For advection dominated flow, a fraction of the fluid residence time is

    often a good estimate for the timescale A timescale of1/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,..

    For rotating machines, 1/ ( in rad/s) is a good choice For buoyancy driven flows, the timescale should be based on a

    function of gravity, thermal expansivity, temperature difference and

    length scale (see documentation)

  • 7/28/2019 Solver Control

    17/38

    Solver Settings

    4-17ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    Timescale Control can be Auto Timescale,Physical Timescale orLocal Timescale

    Factor

    Physical Timescale

    Specify the timescale. Usually a constant but

    can also be variable via an expression

    Can often set a better timescale than AutoTimescale would produce fasterconvergence

    Solver Control Timescale Control

  • 7/28/2019 Solver Control

    18/38

    Solver Settings

    4-18ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Control Timescale Control

    Auto Timescale

    The Solver calculates a timescale based onboundary / initial conditions or current solutionand domain length scale

    Use a Conservative orAggressive estimate forthe domain length scale, or a specified value

    Timescale is re-calculated and updated everyfew iterations as the flow field changes

    Can set a Maximum Timescale to provide anupper limit

    Tends to produce a conservative timescale

    Timescale factor (default = 1) is a multiplierwhich can be changed to adjust theautomatically calculated timescale

  • 7/28/2019 Solver Control

    19/38

    Solver Settings

    4-19ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    Local Timescale Factor

    Timescale varies throughout the domain

    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

    Local Timescale =Local Mesh Length Scale

    Local Velocity Scale

    Smaller Timescale in high

    velocity and/or fine mesh regions

    Solver Control Timescale Control

  • 7/28/2019 Solver Control

    20/38

    Solver Settings

    4-20ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Control Convergence Criteria

    Convergence Criteria settings determine

    when the solution is considered converged

    and hence when the Solver will stop Assuming Max. Iterations is not reached

    Residuals are a measure of how accurately

    the set of equations have been solved

    Since we are iterating towards a solution, we neverget 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 truesystem!

    Residuals are just one measure of accuracy and

    should be combined with other measures:

    Monitor Points (ch. 8) and Imbalances (below)

    S l S i

  • 7/28/2019 Solver Control

    21/38

    Solver Settings

    4-21ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    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

    Solver Control Residuals Theory

    S l S tti

  • 7/28/2019 Solver Control

    22/38

    Solver Settings

    4-22ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    Residual Type

    MAX: Convergence based on maximum

    residual anywhere RMS: Convergence based on average

    residual from all control volumes

    Root Mean Square =

    Residual Target

    For reasonable convergence MAX residualsshould 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 greateraccuracy

    n

    2

    i

    iR

    Solver Control Residuals

    S l S tti

  • 7/28/2019 Solver Control

    23/38

    Solver Settings

    4-23ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Control Conservation Target

    The Conservation Target sets a target for theglobal imbalances

    The imbalances measure the overallconservation of a quantity (mass, momentum,energy) in the entire flow domain

    FluxMaximum

    OutFluxInFluxImbalance%

    Clearly in a converged solution Flux In should equal Flux Out

    Its good practice to set a Conservation Target and/or monitor theimbalances during the run

    When set, the Solver must meet both the Residual and Conservation Targetbefore stopping (assuming Max. Iterations is not reached)

    Set a target of 0.01 (1%) or less

    Flux In Flux Out < 1%

    S l S tti

  • 7/28/2019 Solver Control

    24/38

    Solver Settings

    4-24ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    Elapsed Time Control

    Can specify the maximum wall clock timefor a run

    Solver will stop after this amount of timeregardless of whether it has converged

    Interrupt Control

    Can specify other criteria for stoppingthe Solver based on logical CELexpressions

    When the expression returns true thesolver will stop

    Any value >= 0.5 is true

    Solver Control Elapsed Time and Interrupt Control

    Examples

    If temperature exceeds a specified valueif(areaAve(T)@wall>200[C],1,0)

    If mesh quality drops below a specified value in a moving mesh case

    More on logical expressions in the CEL lecture

    S l S tti

  • 7/28/2019 Solver Control

    25/38

    Solver Settings

    4-25ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    This option is only available when a soliddomain is included in the simulation

    The Solid Timescale should be selected suchthat it is MUCH larger than the fluid timescale(100 times larger is typical)

    the energy equation is usually very stable inthe solid zone

    solid timescales are typically much larger thanfluid timescales

    Solver Control Solid Timescale Control

    The fluid timescale is estimated using Length Scale / Velocity Scale

    The solid timescale is automatically calculated as function of the lengthscale, thermal conductivity, density and specific heat capacity

    Or you can choose the Physical Timescale option and provide a timescaledirectly

    Solver Settings

  • 7/28/2019 Solver Control

    26/38

    Solver Settings

    4-26ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    The Equation Class Settings tab is an

    advanced option that can be used toset Solver controls on an equation

    specific basis

    Not usually needed

    Will override the controls set on BasicSettings for the selected equation

    Advanced Options

    Advanced solver control options

    Rarely needed

    Solver Control Equation Class Settings

    Solver Settings

  • 7/28/2019 Solver Control

    27/38

    Solver Settings

    4-27ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualOutput Controls Results

    The Output Control settings control the outputproduced by the Solver

    TheTrn Results,Trn Stats and Export tab only apply totransient simulations and are covered in the Transient

    chapter

    The Results tab controls the final .res file

    Generally do not use the Selected Variables (orNone!)option since it probably wont contain enough

    information to restart the run later

    Output Equation Residuals is useful if you need tocheck where convergence problems are occurring

    Extra Output Variables Listcontains variables that are not

    written to the standard resultsfile

    E.g. Vorticity

    Solver Settings

  • 7/28/2019 Solver Control

    28/38

    Solver Settings

    4-28ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    Frequency of output can be adjusted

    Output Controls Backup

    The Backup tab controls if and whenbackup results files are automatically

    written by the Solver

    Recommend for long Solver runs in case

    of power failure, network interruptions, etc

    Option: Standard: Like a full results file

    Essential: Allows a clean solver restart

    Smallest: Can restart the solver, but

    therell be a jump in the residuals

    Selected Variables: Not recommended

    Can also manually request a backup file

    from the Solver Manager at any time

    Solver Settings

  • 7/28/2019 Solver Control

    29/38

    Solver Settings

    4-29ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    The Monitor tab allows you to create MonitorPoints

    These are used to track values of interest asthe Solver runs

    The Cartesian Coordinates Option is used totrack the value of a variable at a specific X, Y,Z location

    The Expression Option is used to monitor thevalues of a CEL expression

    E.g. Calculate the area average ofCp at theinlet boundary: areaAve(Cp)@inlet

    E.g. Mass flow of particular fluid through an

    outlet: oil.massFlow()@outlet

    In steady-state simulations you should createmonitor points for quantities of interest

    One measure of convergence is when thesevalues are no longer changing

    Output Controls Monitor

    Solver Settings

  • 7/28/2019 Solver Control

    30/38

    Solver Settings

    4-30ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    The CFX-Solver Manager is a graphical user interface used to:

    Define a run

    Control the CFX-Solver interactively

    View information about the emerging solution

    Export data

    Solver Manager

    Solver Settings

  • 7/28/2019 Solver Control

    31/38

    Solver Settings

    4-31ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    Define a new Solver run

    Solver Input File should be the .deffile Can also pick .res, .bak or_full.trn files to restart a

    previous incomplete run

    To make a physics change and restart a solution,create a new .deffile and provide it as the SolverInput 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 themeshes are identical can use either option,otherwise:

    If you use the Solver Input File mesh, the InitialValues solution is interpolated onto the input file

    If you use the Initial Values mesh only the physicsfrom the Solver Input File is used

    Continue History From carriers over convergencehistory and iteration counters

    Solver Manager Defining a Run

    Solver Settings

  • 7/28/2019 Solver Control

    32/38

    Solver Settings

    4-32ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Manager Defining a Parallel Run

    By default the Solver will run in serial

    A single solver process runs on the local

    machine

    Set the Run Mode to one of the parallel optionsto make use of multiple cores/processors

    Requires parallel licenses

    Allows you to divide a large CFD problem intosmallerpartitions

    Faster solution times

    Solve larger problems by making use of memory

    (RAM) on multiple machines

    The Local Parallel options should be usedwhen running on a single machine

    The Distributed Parallel options should beused when running across multiple machines

    Solver Settings

  • 7/28/2019 Solver Control

    33/38

    Solver Settings

    4-33ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    Serial

    Local Parallel

    Distributed Parallel

    Different communication methods are available (MPICH2, HP MPI, PVM)

    See documentation When To Use MPI or PVM for more details, but HP MPI is

    recommended in most cases

    Solver Manager Defining a Parallel Run

    Solver Settings

  • 7/28/2019 Solver Control

    34/38

    Solver Settings

    4-34ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    The Show Advanced Control toggle enables the

    Partitioner, Solver and Interpolator tabs

    On the Partitioner tab you can pick differentpartitioning algorithms

    Partitioning is always a serial process

    Can be a problem for v.large cases since you

    cannot distribute the memory load across multiplemachines

    The default MeTiS algorithm uses more memorythan others, so if you run out of memory use adifferent method (see documentation for details)

    Multidomain Option:

    Independent Partitioning: Each domain ispartitioned into n partitions

    Coupled Partitioning: All domains are combinedand then partitioned into n partitions

    Theres a specific option for Transient Rotor Statorcases

    Solver Manager Define Run Advanced Controls

    Solver Settings

  • 7/28/2019 Solver Control

    35/38

    Solver Settings

    4-35ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    On the Solver tab you can select the DoublePrecision option

    The solver will use more significant figures in itscalculations

    Doubles solver memory requirements

    Use when round-off error could be a problem if

    small variations in a variable are important,

    where small is relative to the global range of

    that variable, e.g: Many Mesh Motion cases, since the motion is often

    small relative to the size of the domain

    Most CHT cases, since thermal conductivity is

    vastly different in the fluid and solid

    If you have a wide pressure range, but small

    pressure changes are important

    Small values by themselves do not need DP

    Solver Manager Define Run Advanced Controls

    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

    Solver Settings

  • 7/28/2019 Solver Control

    36/38

    Solver Settings

    4-36ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training ManualSolver Manager Interactive Solver Control

    During a solution Edit Run in Progress lets you make changes on the fly

    Models generally cannot be changed, but timescales, BCs, etc can

    Solver Settings

  • 7/28/2019 Solver Control

    37/38

    Solver Settings

    4-37ANSYS, Inc. Proprietary

    2009 ANSYS, Inc. All rights reserved.April 28, 2009

    Inventory #002598

    Training Manual

    .out fileMonitor Plot

    Solver Manager Additional Solution Monitors

    Right-click

    By default monitor plots

    are created showing the

    RMS residuals for eachequation solved, plus one

    plot for any monitor points

    Right-click to switch

    between RMS and MAX

    Additional monitors can beselected showing:

    Imbalances

    Boundary fluxes (FLOW)

    Boundary forces

    Tangential (viscous)

    Normal (pressure)

    Source terms

    New Monitor

    Solver Settings

  • 7/28/2019 Solver Control

    38/38

    Solver Settings

    Training Manual

    Start a new

    Simulation

    Monitor Run

    in Progress

    MonitorFinished Run Stop CurrentRun

    Save Current

    Run

    Switch

    Residual Plot

    between

    RMS andMAX

    By dragging the cursor over any icon, the feature

    description will appear

    Solver Manager Additional Icons


Recommended