cfd1-pt4

Upload: chitrarthlav

Post on 03-Jun-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 cfd1-pt4

    1/6

  • 8/12/2019 cfd1-pt4

    2/6

  • 8/12/2019 cfd1-pt4

    3/6

    - p. 9

    Evaluating Diffusive Fluxes

    The diffusive fluxes can then be approximated by

    Z

    U

    xdy

    ew

    +

    Z

    U

    ydx

    ns

    U

    xy

    ew

    +

    U

    yx

    ns

    (13)

    The gradientsU/xand U/yat the east, west, north and south faces can be evaluatedusing a central difference, so that the diffusion terms become

    (y)eUE UP

    x (y)w

    UP UW

    x + (x)n

    UN UP

    y (x)s

    UP US

    y (14)

    This is, again, a second order approximation.

    The discretized diffusion terms in the transport equation can thus be written as

    ad

    e

    UE+ ad

    w

    UW +ad

    n

    UN+ ad

    s

    US ad

    p

    UP (15)

    where

    ade = (y/x)e adw = (y/x)w

    adn = (x/y)n ads = (x/y)s (16)

    andadp = ade + a

    dw+a

    dn+a

    ds .

    - p. 10

    Evaluating Convective Fluxes

    The convection terms can be approximated as

    Z U2dy

    ew

    +

    Z UV dx

    ns

    U2yew

    + [UVx]ns

    = (Uy)eUe (Uy)wUw+ (Vx)nUn (Vx)sUs

    =CxeUe CxwUw+ CynUn CysUs

    whereCxe,Cxw, etc are simply the mass fluxes through the east, west, north and southfaces.

    The values ofUat the cell faces, Ue,Uw,Un and Us need to be obtained by interpolationbetween nodal values.

    The scheme used to interpolate these values will affect both the stability and accuracy of theoverall solution, and a few commonly-used alternatives are outlined below.

    - p. 11

    First Order Upwind Scheme

    A very simple scheme for approximating cell face values for the convective terms is thefirst-order upwind convection scheme:

    Ue = (UP forCxe > 0UE forCxe 0

    (17) P Ee

    This gives a convection contribution to the discretized transport equation of

    aceUE acwUW a

    cnUN a

    csUS +a

    cpUp (18)

    where

    ace = max(Cxe, 0) acw = max(Cxw, 0)

    acn = max(Cyn, 0) acs = max(Cys, 0) (19)

    andacp = ace+a

    cw+a

    cn+a

    cs+ (Cxe Cxw+Cyn Cys)

    Note that the coefficientsace, etc are all positive, as isacp. Moreover, the final set of terms in

    acp represents the total net mass flux into the cell, which should be zero, so that in practice

    acp can simply be taken as the sum ace+a

    cw+a

    cn+a

    cs.

    - p. 12

    Combining the convection and diffusion terms results in a discretized equation of the form

    apUP =aeUE +awUW +anUN+ asUS+ su (20)

    whereae = ade+ ace, etc,ap = ae+ aw+ an+ as, andsurepresents the source terms arising

    from the pressure gradient.

    We thus get a set of equations relating UP to the values ofUat the surrounding nodes.

    Having obtained the coefficients and source terms for each grid cell, the resulting system of

    equations can be solved by a suitable numerical algorithm.

    The above upwind scheme is always bounded. However, as implied by its name, it is onlyfirst order accurate.

    To illustrate this, we assume that Cxe> 0. Then the scheme approximates

    CxeUe CxeUP =Cxe

    Ue+ (xe xP)

    U

    x

    e

    +O((xe xP)2)

    (21)

    The leading error term in this can thus be written as

    (u)e

    U

    x

    e

    y

    where the numerical viscosity (u)e = Cxex/(2y).

  • 8/12/2019 cfd1-pt4

    4/6

    - p. 13

    The error is therefore diffusive in nature, and so tends to make the solution stable, butinaccurate.

    Recall that the order of accuracy gives information on how rapidly numerical errors decreaseas the grid is refined. Since the error in the above scheme decreases only linearly with gridspacing, a very fine grid can be needed in order to achieve sufficient accuracy.

    For this reason, whilst first order schemes are often used, it is usually preferable to employ ahigher order convection scheme.

    Note, however, that in practical applications it is a fairly common practice to begin acalculation with a first order scheme, for its stability, and then switch to a higher order oneonce the solution is closer to convergence.

    - p. 14

    Central Difference Scheme

    This scheme simply interpolates linearly betweenUP andUE to approximate Ue. For auniform grid this gives

    Ue = 0.5(UE+ UP) (22)

    This is a second order approximation, which can be seen by writing Taylor series expansionsforUe and UE:

    Ue = UP + (xe xP)Ux

    P

    +O(x2) (23)

    UE =UP + (xE xP)

    U

    x

    P

    +O(x2)

    =UP + 2(xe xP)

    U

    x

    P

    +O(x2) (24)

    Subtracting0.5 equation (24) from equation (23) then gives

    Ue = 0.5(UE +UP) +O(x2) (25)

    The central difference scheme is thus more accurate than the first order upwind scheme,although it can produce oscillatory solutions.

    - p. 15

    QUICK Scheme

    The QUICK (Quadratic Upwind Interpolation for Convection Kinetics) scheme fits a parabolabetween three points to approximate Ue.

    IfCxe > 0 a parabola is fitted through the

    pointsW,P andE.

    IfCxe < 0 a parabola is fitted through thepointsP,Eand EE.

    P E EEeW

    ForCxe > 0, on a regular grid we get

    e = P +E P

    2

    1

    8(E 2P +W) (26)

    The QUICK scheme can be shown to be third orderaccurate.

    However, it is not bounded, and can produceundershoots and overshoots in regions of steepgradients.

    P

    W

    E

    - p. 16

    Note that the discretization stencil associated with the QUICK scheme is larger than that ofthe first and second order schemes outlined earlier, since contributions from UEE ,UWW,UNN andUSS now appear.

    However, the QUICK (and other) schemes are often coded as deferred corrections. Thismeans that the upwind scheme contributions are included in the coefficients ae,aw, etc.whilst the additional contributions from the QUICK (or other) scheme are simply placed inthe source term Su.

    Higher order schemes can also be devised and employed. However, in order to benefitsignificantly from them the simple formulations introduced earlier for approximating surfaceand volume integrals (which are only second order accurate) should also be replaced by ahigher order method.

  • 8/12/2019 cfd1-pt4

    5/6

    - p. 17

    Convection Scheme Performances

    As an example, we consider the pure convection problem:

    U

    x +

    V

    y = 0 (27)

    on the box0 < x < 1,0 < y 0

    The graphs on the following slides show results with U= 0and U= 0 using the threeconvection schemes outlined earlier on grids ranging from 10 to 160 points in thex direction.

    - p. 18

    y

    x

    V = 1,U = 0

    - p. 19

    y

    x

    V = 1,U= 0.2

    - p. 20

    In theU= 0case the flow is aligned with the grid lines and all the schemes performreasonably well (obviously resolving the step change better as the grid is refined).

    WhenU= 0 the flow is not aligned with the grid lines.

    In this case the numerical diffusion introduced by the first order upwind scheme is clearlypresent.

    The centred scheme captures the steep gradient better, but shows significant oscillations.

    The QUICK scheme also represents the steep gradients quite well, but does show someover- and under-shoots at the base and crest of the step.

  • 8/12/2019 cfd1-pt4

    6/6