The convection (transport) equation

Directly to the input form

 
  • The convection equation in one space dimension reads
    (d/dt)u + a (d/dx)u = 0,
    where we consider the region x > 0, t > 0 and a constant convection parameter a. With any smooth real function h obviously
    u(x,t) = h(x-a*t)
    is a solution. The characteristics of this equation are
    x-a*t = const
    that means lines in the (x,t) plane of the form
    t = (1/a)*x +const
    The solution u is constant along these lines. We assume that the convection parameter a satisfies a > 0, hence transport goes ''from left to right''. In order to have a well posed problem we choose as initial values
    u(x,0) = h(x) and u(0,t) = h(-a*t).
  • As region we use [0,xend] × [0,tend] .
  • We solve this problem here using finite difference methods. A necessary condition for the convergence of these methods is the so called Courant-Friedrichs-Levy condition, shortly CFL, which requires that for any computed grid point the interval(s) along the boundary, from which the value of the computed u depends (the ''numerical dependency region'') contains the intersection of the characteristic through that grid point with the initial line (either on the x or the t axis) (the ''analytical dependency region'')
  • The timestep which we will use is computed as
    δt = tend/m
    and the space-grid as
    δx = xend/n
  • We take 2n grid points for the initial values on the x-axis.
  • Convection equations (which can have a much more general form, for example with a dependent on x,t,u), describe transport phenomena. In the case we consider here this is quite obvious: the initial value is shifted along the characteristics without any alteration. a > 0 has the meaning of transport speed here.
  • The three methods which we present here (Friedrichs-, Lax-Wendroff- and upwind) are difference methods. Friedrichs and upwind are consistent of order one and Lax-Wendroff of order two (and convergent with this order, if CFL is satisfied)
  • The formulas are:
    ui,j+1 = (1/2)*(ui+1,j+ui-1,j) +a*δt/(2*δx)*(ui+1,j-ui-1,j) Friedrichs
    ui,j+1 = ui,j+ a*δtx*(ui,j-ui-1,j) Upwind
    ui,j+1 = ui,j+a*δt/(2*δx)*(ui+1,j-ui-1,j) +(1/2)*(a*δtx)2(ui+1,j -2*ui,j+ui-1,j) Lax Wendroff
    Here i denotes the x- and j the t-grid.
  • These methods approximate the solution on a grid (i*δx,j*δt) .
  • CFL can be expressed here as
    a*(δtx) <= 1.
  • Because of the quite special solution behaviour you have the chance to produce a discretization error zero here.
 

Input

 
  • You can choose between the three methods.
  • You specify the function h. There is a predefined case showing a wave going from left to right and you have the possibility to define h yourself. This must follow FORTRAN conventions!
  • You specify a. Important: a > 0 !
  • You fix the grid parameters xend, n, tend, m.
    Remember CFL !
  • You can restrict the graphical output to a number of lines in x resp. t direction (gridx resp. gridt) and define your view point by the rotation angles of the x and the u axis.
 

Output

 
  • You get a graphical output of the discretization error udel - u, where ''del'' represents δt or equivalently δx.
 

Questions ?

 
  • What takes place if you have a nonsmooth initial value, for example h(x) = sign(1.0e0,x) ?
  • What would take place if you would violate CFL ?
  • Can you verify the claimed convergence order ?
 

To the input form

 
Back to the top!

28.10.2010