Fluent Solverset

Embed Size (px)

Citation preview

  • 7/26/2019 Fluent Solverset

    1/35

    Fluent Inc. 2/23/01E1

    FluentSoftware Training

    TRN-99-003

    Solver Settings

  • 7/26/2019 Fluent Solverset

    2/35

    Fluent Inc. 2/23/01E2

    FluentSoftware Training

    TRN-99-003

    Outlineu Using the Solver

    l Setting Solver Parameters

    l Convergence

    n Definition

    n Monitoringn Stability

    n Accelerating Convergence

    l Accuracy

    n Grid Independence

    n Adaption

    u Appendix: Background

    l Finite Volume Method

    l Explicit vs. Implicit

    l Segregated vs. Coupled

    l Transient Solutions

  • 7/26/2019 Fluent Solverset

    3/35

    Fluent Inc. 2/23/01E3

    FluentSoftware Training

    TRN-99-003

    Modify solution

    parameters or grid

    NoYes

    No

    Set the solution parameters

    Initialize the solution

    Enable the solution monitors of interest

    Calculate a solution

    Check for convergence

    Check for accuracy

    Stop

    Yes

    Solution Procedure Overviewu Solution Parameters

    l Choosing the Solver

    l Discretization Schemes

    u

    Initializationu Convergence

    l Monitoring Convergence

    l Stability

    n Setting Under-relaxation

    n Setting Courant number

    l Accelerating Convergence

    u Accuracy

    l Grid Independence

    l Adaption

  • 7/26/2019 Fluent Solverset

    4/35

    Fluent Inc. 2/23/01E4

    FluentSoftware Training

    TRN-99-003

    Choosing a Solveru Choices are Coupled-Implicit, Coupled-Explicit, or Segregated (implicit)

    u The Coupled solversare recommended if a strong inter-dependence exists

    between density, energy, momentum, and/or species.

    l e.g., high speed compressible flow or finite-rate reaction modeled flows.

    l In general, the Coupled-Implicitsolver is recommended over the coupled-explicit

    solver.

    n Time required: Implicit solver runs roughly twice as fast.

    n Memory required: Implicit solver requires roughly twice as much memory as coupled-

    explicit orsegregated-implicit solvers! (Performance varies.)

    l The Coupled-Explicit solver should only be used for unsteady flows when the

    characteristic time scale of problem is on same order as that of the acoustics.

    n e.g., tracking transient shock wave

    u The Segregated (implicit) solveris preferred in all other cases.

    l Lower memory requirements than coupled-implicit solver.

    l Segregated approach provides flexibility in solution procedure.

  • 7/26/2019 Fluent Solverset

    5/35

    Fluent Inc. 2/23/01E5

    FluentSoftware Training

    TRN-99-003

    Discretization (Interpolation Methods)u Field variables (stored at cell centers) must be interpolated to the faces of

    the control volumes in the FVM:

    u FLUENToffers a number of interpolation schemes:

    l First-Order Upwind Scheme

    n easiest to converge, only first order accurate.

    l Power Law Scheme

    n more accurate than first-order for flows when Recell< 5 (typ. low Re flows).

    l Second-Order Upwind Scheme

    n uses larger stencil for 2nd order accuracy, essential with tri/tet mesh or

    when flow is not aligned with grid; slower convergence

    l Quadratic Upwind Interpolation (QUICK)

    n applies to quad/hex mesh, useful for rotating/swirling flows, 3rd order

    accurate on uniform mesh.

    VSAAVVt

    f

    faces

    fff

    faces

    fff

    ttt

    +=+

    +

    ,)()()(

  • 7/26/2019 Fluent Solverset

    6/35

    Fluent Inc. 2/23/01E6

    FluentSoftware Training

    TRN-99-003

    Interpolation Methods for Pressureu Additional interpolation options are available for calculating face pressure when

    using the segregated solver.

    u FLUENTinterpolation schemes for Face Pressure:

    l Standard

    n default scheme; reduced accuracy for flows exhibiting large surface-normal pressuregradients near boundaries.

    l Linear

    n useful only when other options result in convergence difficulties or unphysical

    behavior.

    l Second-Order

    n

    use for compressible flows or when PRESTO! cannot be applied.l Body Force Weighted

    n use when body forces are large, e.g., high Ra natural convection or highly swirling

    flows.

    l PRESTO!

    n applies to quad/hex cells; use on highly swirling flows, flows involving porous

    media, or strongly curved domains.

  • 7/26/2019 Fluent Solverset

    7/35

    Fluent Inc. 2/23/01E7

    FluentSoftware Training

    TRN-99-003

    Pressure-Velocity Couplingu Pressure-Velocity Coupling refers to the way mass continuity is

    accounted for when using the segregated solver.

    u Three methods available:

    l SIMPLE

    n default scheme, robust

    l SIMPLEC

    n Allows faster convergence for simple problems (e.g., laminar flows with

    no physical models employed).

    l PISO

    n useful for unsteady flow problems or for meshes containing cells with

    higher than average skew.

  • 7/26/2019 Fluent Solverset

    8/35

    Fluent Inc. 2/23/01E8

    FluentSoftware Training

    TRN-99-003

    Initializationu Iterative procedure requires that all solution variables be initialized

    before calculating a solution.

    SolveInitializeInitialize...

    l Realistic guesses improves solution stability and accelerates convergence.

    l In some cases, correctinitial guess is required:

    n Example: high temperature region to initiate chemical reaction.

    u Patch values for individual

    variables in certain regions.

    SolveInitializePatch...

    l Free jet flows(patch high velocity for jet)

    l Combustion problems

    (patch high temperature

    for ignition)

  • 7/26/2019 Fluent Solverset

    9/35

    Fluent Inc. 2/23/01E9

    FluentSoftware Training

    TRN-99-003

    Convergence Preliminaries: Residualsu Transport equation for can be presented in simple form:

    l Coefficients ap, anbtypically depend upon the solution.

    l Coefficients updated each iteration.

    u At the start of each iteration, the above equality will not hold.

    l The imbalance is called the residual,Rp, where:

    l Rpshould become negligibleas iterations increase.

    l The residuals that you monitor are summed over all cells:

    n By default, the monitored residuals are scaled.

    n You can also normalize the residuals.

    u Residuals monitored for the coupled solver are based on the rmsvalue of

    the time rate of change of the conserved variable.

    l Only for coupled equations; additional scalar equations use segregated

    definition.

    p

    nb

    nbnbpp baa =+

    p

    nb

    nbnbppp baaR +=

    ||=cells

    pRR

  • 7/26/2019 Fluent Solverset

    10/35

    Fluent Inc. 2/23/01E10

    FluentSoftware Training

    TRN-99-003

    Convergenceu At convergence:

    l All discrete conservation equations (momentum, energy, etc.) are

    obeyed in all cells to a specified tolerance.

    l Solution no longer changes with more iterations.

    l Overall mass, momentum, energy, and scalar balances are obtained.

    u Monitoring convergence with residuals:

    l Generally, a decrease in residuals by 3 orders of magnitude indicates at

    least qualitative convergence.

    n Major flow features established.

    l Scaled energy residual must decrease to 10-6for segregated solver.

    l Scaled species residual may need to decrease to 10-5to achieve speciesbalance.

    u Monitoring quantitative convergence:

    l Monitor other variables for changes.

    l Ensure that property conservation is satisfied.

  • 7/26/2019 Fluent Solverset

    11/35

    Fluent Inc. 2/23/01E11

    FluentSoftware Training

    TRN-99-003

    Convergence Monitors: Residualsu Residual plots show when the residual values have reached the

    specified tolerance.

    SolveMonitors Residual...

    All equations converged.

    10-3

    10-6

  • 7/26/2019 Fluent Solverset

    12/35

    Fluent Inc. 2/23/01E12

    FluentSoftware Training

    TRN-99-003

    Convergence Monitors: Forces/Surfacesu In addition to residuals, you can also monitor:

    l Lift, drag, or moment

    SolveMonitorsForce...

    l Variables or functions (e.g., surface integrals)

    at a boundary or any defined surface:SolveMonitorsSurface...

  • 7/26/2019 Fluent Solverset

    13/35

    Fluent Inc. 2/23/01E13

    FluentSoftware Training

    TRN-99-003

    Checking for Property Conservation

    u In addition to monitoring residual and variable histories, you should

    also check for overall heat and mass balances.

    l Net imbalance should be less than 0.1% of net flux through domain.

    Report

    Fluxes...

  • 7/26/2019 Fluent Solverset

    14/35

    Fluent Inc. 2/23/01E14

    FluentSoftware Training

    TRN-99-003

    Decreasing the Convergence Toleranceu If your monitors indicate that the solution is converged, but the

    solution is still changing or has a large mass/heat imbalance:

    l Reduce Convergence Criterion

    or disable Check Convergence.

    l Then calculate until solution

    converges to the new tolerance.

  • 7/26/2019 Fluent Solverset

    15/35

    Fluent Inc. 2/23/01E15

    FluentSoftware Training

    TRN-99-003

    Convergence Difficultiesu Numerical instabilities can arise with an ill-posed problem, poor

    quality mesh, and/or inappropriate solver settings.

    l Exhibited as increasing (diverging) or stuck residuals.

    l Diverging residuals imply increasing imbalance in conservation equations.

    l Unconverged results can be misleading!

    u Troubleshooting:

    l Ensure problem is well posed.

    l Compute an initial solution with

    a first-order discretization scheme.

    l

    Decrease under-relaxation forequations having convergence

    trouble (segregated).

    l Reduce Courant number (coupled).

    l Re-mesh or refine grid with high

    aspect ratio or highly skewed cells.

    Continuity equation convergence

    trouble affects convergence of

    all equations.

  • 7/26/2019 Fluent Solverset

    16/35

    Fluent Inc. 2/23/01E16

    FluentSoftware Training

    TRN-99-003

    Modifying Under-relaxation Factorsu Under-relaxation factor, , is

    included to stabilize the iterative

    process for the segregated solver.

    u Use default under-relaxation factors

    to start a calculation.

    SolveControlsSolution...

    u Decreasing under-relaxation for

    momentumoften aids convergence.

    l Default settings are aggressive but

    suitable for wide range of problems.l Appropriate settings best learned

    from experience.

    poldpp += ,

    u For coupled solvers, under-relaxation factors for equations outsidecoupled

    set are modified as in segregated solver.

  • 7/26/2019 Fluent Solverset

    17/35

    Fluent Inc. 2/23/01E17

    FluentSoftware Training

    TRN-99-003

    Modifying the Courant Numberu Courant number defines a time

    step size for steady-state problems.

    l A transient term is included in the

    coupled solver even for steady state

    problems.

    u For coupled-explicit solver:

    l Stability constraints impose a

    maximum limit on Courant number.

    n Cannot be greater than 2.

    s Default value is 1.

    n Reduce Courant number when

    having difficulty converging.

    u

    xt

    =

    )CFL(u For coupled-implicit solver:

    l Courant number is not limited by stability constraints.

    n Default is set to 5.

  • 7/26/2019 Fluent Solverset

    18/35

    Fluent Inc. 2/23/01E18

    FluentSoftware Training

    TRN-99-003

    Accelerating Convergence

    u Convergence can be accelerated by:

    l Supplying good initial conditions

    n Starting from a previous solution.

    l

    Increasing under-relaxation factors or Courant numbern Excessively high values can lead to instabilities.

    n Recommend saving case and data files before continuing iterations.

    l Controlling multigrid solver settings.

    n Default settings define robust Multigrid solver and typically do not need

    to be changed.

  • 7/26/2019 Fluent Solverset

    19/35

    Fluent Inc. 2/23/01E19

    FluentSoftware Training

    TRN-99-003

    Starting from a Previous Solutionu Previous solution can be used as an initial condition when changes are

    made to problem definition.

    l Once initialized, additional iterations uses current data setas starting point.

    Actual Problem Initial Condition

    flow with heat transfer isothermal solution

    natural convection lowerRa solution

    combustion cold flow solution

    turbulent flow Euler solution

  • 7/26/2019 Fluent Solverset

    20/35

    Fluent Inc. 2/23/01E20

    FluentSoftware Training

    TRN-99-003

    Multigridu The Multigrid solver accelerates convergence by using solution on

    coarse mesh as starting point for solution on finer mesh.

    l Influence of boundaries and far-away points are more easily transmitted to

    interior of coarse mesh than on fine mesh.

    l Coarse mesh defined from original mesh.n Multiple coarse mesh levels can be created.

    s AMG- coarse mesh emulated algebraically.

    s FAS- cell coalescing defines new grid.

    a coupled-explicit solver option

    n Final solution is for original mesh.

    l Multigrid operates automatically in the background.

    u Accelerates convergence for problems with:

    l Large number of cells

    l Large cell aspect ratios, e.g., x/y > 20

    l Large differences in thermal conductivity

    fine (original) mesh

    coarse mesh

    solution

    transfer

  • 7/26/2019 Fluent Solverset

    21/35

    Fluent Inc. 2/23/01E21

    FluentSoftware Training

    TRN-99-003

    Accuracyu A converged solution is not necessarily an accurate one.

    l Solve using 2nd order discretization.

    l Ensure that solution is grid-independent.

    n Use adaption to modify grid.

    u If flow features do not seem reasonable:

    l Reconsider physical models and boundary conditions.

    l Examine grid and re-mesh.

  • 7/26/2019 Fluent Solverset

    22/35

    Fluent Inc. 2/23/01E22

    FluentSoftware Training

    TRN-99-003

    Mesh Quality and Solution Accuracyu Numerical errors are associated with calculation of cell gradients and

    cell face interpolations.

    u These errors can be contained:

    l Use higher order discretization schemes.

    l Attempt to align grid with flow.l Refine the mesh.

    n Sufficient mesh density is necessary to resolve salient features of flow.

    s Interpolation errors decrease with decreasing cell size.

    n Minimize variations in cell size.

    s Truncation error is minimized in a uniform mesh.

    s Fluent provides capability to adapt mesh based on cell size variation.

    n Minimize cell skewness and aspect ratio.

    s In general, avoid aspect ratios higher than 5:1.

    s Optimal quad/hex cells have bounded angles of 90 degrees

    s Optimal tri/tet cells are equilateral.

  • 7/26/2019 Fluent Solverset

    23/35

    Fluent Inc. 2/23/01E23

    FluentSoftware Training

    TRN-99-003

    Determining Grid Independenceu When solution no longer changes with further grid refinement, you

    have a grid-independent solution.

    u Procedure:

    l Obtain new grid:

    n

    Adapts Save original mesh before adapting.

    If you know where large gradients are expected, concentrate the

    original grid in that region, e.g., boundary layer.

    s Adapt grid.

    Data from original grid is automatically interpolated to finer grid.

    n filereread-grid

    andFile

    Interpolate...

    s Import new mesh and initialize with old solution.

    l Continue calculation to convergence.

    l Compare results obtained w/different grids.

    l Repeat adaption/calculation procedure if necessary.

  • 7/26/2019 Fluent Solverset

    24/35

    Fluent Inc. 2/23/01E24

    FluentSoftware Training

    TRN-99-003

    Unsteady Flow Problemsu Transient solutions are possible with both segregated and coupled solvers.

    l Solver iterates to convergence at each time level, then advances automatically.

    l Solution Initialization provides initial condition, must be realistic.

    u For segregated solver:

    l Time step size, t, is input in Iterate panel.n t should be small enough to resolve

    time dependent features and to ensure

    convergence within 20 iterations.

    n May need to start solution with small t.

    l Number of time steps, N, is also required.

    n N*t =total simulated time.l Use TUI command it # to iterate without advancing time step.

    u For Coupled Solver, Courant number defines in practice:

    l global time step size for coupled explicit solver.

    l pseudo-time step size for coupled implicit solver.

  • 7/26/2019 Fluent Solverset

    25/35

    Fluent Inc. 2/23/01E25

    FluentSoftware Training

    TRN-99-003

    Summary

    u Solution procedure for the segregated and coupled solvers is the same:

    l Calculate until you get a converged solution.

    l Obtain second-order solution (recommended).

    l

    Refine grid and recalculate until grid-independent solution is obtained.u All solvers provide tools for judging and improving convergence and

    ensuring stability.

    u All solvers provide tools for checking and improving accuracy.

    u Solution accuracy will depend on the appropriateness of the physical

    models that you choose and the boundary conditions that you specify.

  • 7/26/2019 Fluent Solverset

    26/35

    Fluent Inc. 2/23/01E26

    FluentSoftware Training

    TRN-99-003

    Appendixu Background

    l Finite Volume Method

    l Explicit vs. Implicit

    l Segregated vs. Coupled

    l Transient Solutions

  • 7/26/2019 Fluent Solverset

    27/35

    Fluent Inc. 2/23/01E27

    FluentSoftware Training

    TRN-99-003

    Background: Finite Volume Method - 1u FLUENTsolvers are based on the finite volume method.

    l Domain is discretized into a finite set of control volumes or cells.

    u General transport equation for mass, momentum, energy, etc. is

    applied to eachcell and discretized. For cellp,

    +=+

    dVSdddV

    tAAV

    AAV

    unsteady convection diffusion generation

    Eqn.

    continuity 1x-mom. u

    y-mom. v

    energy h

    Fluid region of pipe flow

    discretized into finite set of

    control volumes (mesh).

    control

    volume

    u Allequations are solved to render flow field.

  • 7/26/2019 Fluent Solverset

    28/35

    Fluent Inc. 2/23/01E28

    FluentSoftware Training

    TRN-99-003

    Background: Finite Volume Method - 2u Each transport equation is discretized into algebraic form. For cell p,

    face f

    adjacent cells, nb

    cellp

    u Discretized equations require information at cell centers andfaces.

    l Field data (material properties, velocities, etc.) are stored at cell centers.

    l Face values can be expressed in terms of local andadjacent cell values.

    l Discretization accuracy depends upon stencil size.

    u

    The discretized equation can be expressed simply as:

    l Equation is written out for every control volume in domain resulting in an

    equation set.

    p

    nb

    nbnbppbaa =+

    VSAAVVt

    f

    faces

    fff

    faces

    fff

    t

    p

    tt

    p +=+

    +

    ,)()()(

  • 7/26/2019 Fluent Solverset

    29/35

    Fluent Inc. 2/23/01E29

    FluentSoftware Training

    TRN-99-003

    u Equation sets are solved iteratively.

    l Coefficients apand anbare typically functions

    of solution variables(nonlinear and coupled).

    l Coefficients are written to use values of solution variables from previous

    iteration.

    n Linearization: removing coefficients dependencies on .

    n De-coupling: removing coefficients dependencies on other solution

    variables.

    l Coefficients are updated with each iteration.

    n For a given iteration, coefficients are constant.

    s pcan either be solved explicitly or implicitly.

    Background: Linearization

    p

    nb

    nbnbpp baa =+

  • 7/26/2019 Fluent Solverset

    30/35

    Fluent Inc. 2/23/01E30

    FluentSoftware Training

    TRN-99-003

    u Assumptions are made about the knowledge of nb:

    l Explicit linearization- unknown value in each cell computed from relations

    that include only existingvalues (nb assumed known from previous

    iteration).

    n psolved explicitly using Runge-Kutta scheme.

    l Implicit linearization- p andnb are assumed unknown and are solved

    using linear equation techniques.

    n Equations that are implicitly linearized tend to have less restrictive stability

    requirements.

    n

    The equation set is solved simultaneously using a second iterative loop (e.g.,point Gauss-Seidel).

    Background: Explicit vs. Implicit

  • 7/26/2019 Fluent Solverset

    31/35

    Fluent Inc. 2/23/01E31

    FluentSoftware Training

    TRN-99-003

    Background: Coupled vs. Segregated

    u Segregated Solver

    l If the only unknowns in a given equation are assumed to be for asingle

    variable, then the equation set can be solved without regard for the

    solution of other variables.

    n coefficients apand anbare scalars.

    u Coupled Solver

    l If more than one variableis unknown in each equation, and each

    variable is defined by its own transport equation, then the equation set is

    coupledtogether.

    n coefficients apand anbareNeqx Neqmatricesn is a vector of the dependent variables, {p, u, v, w, T, Y}T

    p

    nb

    nbnbpp baa =+

  • 7/26/2019 Fluent Solverset

    32/35

    Fluent Inc. 2/23/01E32

    FluentSoftware Training

    TRN-99-003

    Background: Segregated Solver

    u In the segregated solver, each equation is

    solved separately.

    u The continuity equation takes the form

    of a pressure correction equation as partof SIMPLE algorithm.

    u Under-relaxation factors are included in

    the discretized equations.

    l Included to improve stability of iterative

    process.

    l Under-relaxation factor, , in effect,limits change in variable from one

    iteration to next:

    Update properties.

    Solve momentum equations (u, v, w velocity).

    Solve pressure-correction (continuity) equation.

    Update pressure, face mass flow rate.

    Solve energy, species, turbulence, and other

    scalar equations.

    Converged?

    Stop

    No Yes

    poldpp += ,

  • 7/26/2019 Fluent Solverset

    33/35

    Fluent Inc. 2/23/01E33

    FluentSoftware Training

    TRN-99-003

    Background: Coupled Solveru Continuity, momentum, energy, and

    species are solved simultaneously in the

    coupled solver.

    u Equations are modified to resolve

    compressible andincompressible flow.u Transient term is always included.

    l Steady-state solution is formed as time

    increases and transients tend to zero.

    u For steady-state problem, time step is

    defined by Courant number.l Stability issues limit maximum time step

    size for explicit solver but not for

    implicit solver.

    Solve continuity, momentum, energy,

    and species equations simultaneously.

    Stop

    No Yes

    Solve turbulence and other scalar equations.

    Update properties.

    Converged?

    u

    xt

    =

    )CFL( CFL= Courant-Friedrichs-Lewy-numberwhere u= appropriate velocity scale

    x= grid spacing

  • 7/26/2019 Fluent Solverset

    34/35

    Fluent Inc. 2/23/01E34

    FluentSoftware Training

    TRN-99-003

    Background: Segregated/Transientu Transient solutions are possible with both segregated and coupled solvers.

    l 1st- and 2nd-order time implicit discretizations (Euler) available for coupled

    and segregated solvers.

    n Procedure: Iterate to convergence at each time level, then advance in time.

    l

    2nd order time-explicit discretization also available for coupled-explicit solver.u For segregated solver:

    l Time step size, t, is input in Iterate panel.

    n t should be small enough to resolvetime dependent features.

    l Number of time steps, N, is also required.

    n N*t equals total simulated time.

    l Generally, use t small enough to ensureconvergence within 20 iterations.

    l Note: Use TUI command it # to iterate

    further without advancing time step.

  • 7/26/2019 Fluent Solverset

    35/35

    Fluent Inc. 2/23/01E35

    FluentSoftware Training

    TRN-99-003

    Background: Coupled/Transientl If implicit scheme is selected, twotransient terms are included in discretization.

    n Physical-time transient

    s Physical-time derivative term is discretized implicitly (1st or 2nd order).

    s Time step size, t, defined as with segregated solver.

    n Pseudo-time transient

    s At each physical-time level, a pseudo-time transient is driven to zero through a

    series of inner iterations (dual time stepping).

    s Pseudo-time derivative term is discretized:

    explicitly in coupled-explicit solver.

    implicitly in coupled-implicit solver.

    s Courant number defines pseudo-time step size, .

    l For explicit time stepping, physical-time derivative isdiscretized explicitly.

    n Option only available with coupled-explicit solver

    n Physical-time step size is defined by Courant number.

    s Same time step size is used throughout domain (global time stepping).