Cfd Class April 13 2010

download Cfd Class April 13 2010

of 21

Transcript of Cfd Class April 13 2010

  • 7/27/2019 Cfd Class April 13 2010

    1/21

    LTNT - ETH Zurich 1

    Finite Volume Method in CFD software packages

    About 80% of commercial CFD packages utilize FVM

    Example: Steady-state specie convection:

    Mass balance over the control volume contains

    values at the faces. These values have to be determined

    from interpolation of the values in the cell centers:

  • 7/27/2019 Cfd Class April 13 2010

    2/21

    LTNT - ETH Zurich 2

    Example- continued (discretization)

    Interpolation assumption: the value at the face is equal to the value in thecenter of the cell upstream of the face: Upwind scheme .

    Notation:

    Face areas:

    Concentration at the

    centers:

    Components of 2D velocity at

    the centers:

    Source at the center: Diffusion:

  • 7/27/2019 Cfd Class April 13 2010

    3/21

    LTNT - ETH Zurich 3

    Example- continued (algebraic equations)

    Re-arrangement:

    Simplified notation (index nb refers to the neighboring centers) :

    or

    The concentration is calculated by recalculating cP from the equation iteratively

    for all cells in the domain.

    How many members in the sum if mesh is tetrahedral ?

  • 7/27/2019 Cfd Class April 13 2010

    4/21

    LTNT - ETH Zurich 4

    Residuals and convergence

    Depending of the interpolation scheme thecoefficients in final equation may depend on the

    unknown function so equation: becomes non-linear

    The equation is solved by an iterative process. Absolute residuals measure

    imbalance in conservation equations at every iteration:

    Scaled residual in single cell

    Scaled residual of a mesh

    Can quality of mesh affect convergence ?

  • 7/27/2019 Cfd Class April 13 2010

    5/21

    LTNT - ETH Zurich 5

    The residuals show how fast the solution (of discretized algebraic system)converge

    Small values of the residuals are necessary but not sufficient conditions to stop

    the iterations

    Solutions of CFD problems are considered to converge when the flow field andscalar fields are no longer changing.

    Common practice is to monitor residuals and averaged flow parameters:

    Residuals and convergence

  • 7/27/2019 Cfd Class April 13 2010

    6/21

    LTNT - ETH Zurich 6

    First well-documented use was by Evans and Harlow (1957) atLos Alamos and Gentry, Martin and Daley (1966): efficient, iterative

    solvers are well developed.

    Stable: even if variable fields are not smooth across shocks and

    other discontinuities, mass, momentum and energy are alwaysconserved.

    FVM has an advantage in memory use and speed for very large

    problems, higher speed flows, turbulent flows, and source term

    dominated flows (like combustion).

    Basic FV control volume balance does not limit cell shape; mass,

    momentum, energy conserved even on coarse grids;

    Disadvantages: false diffusion, i.e. initial sharp distribution of

    variables are smeared out during the solution

    Finite Volume Method: pros and contras

  • 7/27/2019 Cfd Class April 13 2010

    7/21LTNT - ETH Zurich 7

    Example: artif icial dif fusion of temperature in 1D velocity field

    www.bakker.org

    Artificial diffusion is caused by numerical rounding during the iterat ions

    If the thermal diffusivity coefficient is

    set to zero, the temperature will be

    exactly 100 C everywhere above the

    diagonal and exactly 0 C everywherebelow the diagonal.

  • 7/27/2019 Cfd Class April 13 2010

    8/21LTNT - ETH Zurich 8

    Example: arti ficial diffusion: temperature contour plot

    Grid refinement coupled with a higher-order interpolation scheme will

    minimize the false diffusion.

  • 7/27/2019 Cfd Class April 13 2010

    9/21LTNT - ETH Zurich 9

    The value at the face is the same as

    the cell centered value in the cell

    upstream of the face.

    The main advantages are that it iseasy to implement and that it results in

    very stable calculations, but it also

    very diffusive. Gradients in the flow

    field tend to be smeared out

    This is often the best scheme to start

    calculations with.

    First-order upwind scheme

  • 7/27/2019 Cfd Class April 13 2010

    10/21LTNT - ETH Zurich 10

    Central Differencing Scheme

    The value of unknown function is

    determined at the face by linear

    interpolation between the cell centered

    values.

    The scheme often leads to

    oscillations in the solution or

    divergence if advection dominates

    diffusive transport:

    Switching to first order upwind in

    cells where >2

    is called a hybrid scheme.

  • 7/27/2019 Cfd Class April 13 2010

    11/21LTNT - ETH Zurich 11

    The value of the function is

    interpolated from the cell values in the

    two cells upstream of the face.

    In regions with strong gradients it can

    result in face values that are outside ofthe range of cell values. It is then

    necessary to apply limiters to the

    predicted face values.

    Second-order upwind with limiters isone of the most popular numerical

    schemes because of its combination of

    accuracy and stability.

    Second-order upwind scheme

  • 7/27/2019 Cfd Class April 13 2010

    12/21LTNT - ETH Zurich 12

    QUICK: A quadratic curve is fitted through two upstream nodes andone downstream node.

    Power Law Scheme: The face value is determined from an

    exponential profile through the cell values.

    Different pressure-velocity (SIMPLE, SIMPLEC, PISO) coupling

    algorithms are used to derive equations for the pressure from the

    momentum equations and the continuity equation.

    It is recommended to start calculations with first-order upwind and

    after about 100 iterations to switch over to second-order upwind.

    Other schemes may speed up convergence but instability is

    possible

    Other schemes and solution tactic (ANSYS FLUENT)

  • 7/27/2019 Cfd Class April 13 2010

    13/21LTNT - ETH Zurich 13

    Suppression of osci llation in numerical solut ion with

    high-order schemesAt each iteration, at each cell, a new value for unknown variable in

    cell P can then be calculated from equation:

    U is so-called underrelaxation parameter. It is usually set form 0 to 1

    Underrelaxation factors that are too small will significantly slow down

    convergence, sometimes to the extent that the user thinks the solution is

    converged when it really is not.

    The recommendation is to always use underrelaxation factors that are ashigh as possible, without resulting in oscillations or divergence.

    When the solution is converged but the pressure residual is still relatively

    high, the factors for pressure and momentum can be lowered to further refine

    the solution.

  • 7/27/2019 Cfd Class April 13 2010

    14/21LTNT - ETH Zurich 14

    The finite volume solution method can either use a segregated or a

    coupled solution procedure.

    With segregated methods an equation for a certain variable is solved for all

    cells, then the equation for the next variable is solved for all cells, etc.

    With coupled methods, for a given cell equations for all variables are solved,

    and that process is then repeated for all cells.

    The segregated solution method is the default method in most commercial

    finite volume codes. It is best suited for incompressible flows or compressible

    flows at low Mach number.

    Compressible flows at high Mach number, especially when they involve

    shock waves, are best solved with the coupled solver.

    Solution methods for algebraic system generated in FVM

  • 7/27/2019 Cfd Class April 13 2010

    15/21LTNT - ETH Zurich 15

    Unsteady solution procedure

  • 7/27/2019 Cfd Class April 13 2010

    16/21LTNT - ETH Zurich 16

    Boundary conditions

    Dirichlet boundary conditions: value of unknown function is

    specified, e.g. velocity is zero at boundary

    Neumann boundary conditions: gradient of unknownfunction is specified, e.g. temperature gradient is zero

    Mixed boundary condition: linear combination of Dirichlet

    and Neumann is set

    At a given boundary, different types of boundary conditions can

    be used for different variables

    Adiabat ic BC is Dirichlet or Neumann or mixed ?

  • 7/27/2019 Cfd Class April 13 2010

    17/21LTNT - ETH Zurich 17

    Outflow boundaries cannot beused:

    With compressible flows.

    With the pressure inlet boundary

    condition (use velocity inlet instead)

    because the combination does not uniquely

    set a pressure gradient over the whole

    domain. In unsteady flows with variable

    density.

    Do not use outflow boundaries where:

    Flow enters domain or when backflow

    occurs (in that case

    use pressure b.c.).

    Gradients in flow direction are

    significant.

    Conditions downstream of exit plane

    impact flow in domain.

    Restrict ion on outf low boundary conditions

    Can converged simulation with backflow represent a real flow ?

  • 7/27/2019 Cfd Class April 13 2010

    18/21LTNT - ETH Zurich 18

    Pressure boundary conditions

    Incompressible flow Compressible flow

    Backflow can occur at pressure outletboundaries:

    During solution process or as part of solution.

    Backflow is assumed to be normal to the

    boundary.

    Convergence difficulties minimized by realisticvalues for backflow quantities.

    Value specified for static pressure used as

    total pressure wherever backflow occurs.

    Pressure outlet must always be used when

    model is set up with a pressure inlet.

  • 7/27/2019 Cfd Class April 13 2010

    19/21LTNT - ETH Zurich 19

    Symmetry boundaries

    Used to reduce computational effort in problem. Flow field and geometry must be symmetric:

    Zero normal velocity at symmetry plane.

    Zero normal gradients of all variables at

    symmetry plane.

    Also used to model slip walls in viscous flow.

    Periodic boundaries

    Used when physical geometry of interestand expected flow pattern and the thermal

    solution are of a periodically repeating

    nature.

    Is it possible to have periodic boundaries

    while modeling a heat transfer problem ?

  • 7/27/2019 Cfd Class April 13 2010

    20/21LTNT - ETH Zurich 20

    Axis boundary conditions

    Used at the centerline (y=0 in Fluent)

    of a 2-D axisymmetric grid.

    CFX requires 3D mesh even for

    axisymmetric flow

    Axisymmetric BC is Dirichlet or Neumann or mixed ?

  • 7/27/2019 Cfd Class April 13 2010

    21/21

    Modeling the pressure drop through

    a car catalytic converter when air

    enters the inlet at 25 m/s, and exits

    the outlet at a static pressure of 1

    atm. Assume that the catalytic

    converter contains isothermal air at

    a temperature of 600 K.

    CFX tutor ial: Flow in a Catalyt ic Converter

    Quiz questions 1) where did you set under relaxation factor in this simulation? 2)