
Chapter 2 Advection Equation Let us consider a continuity equation for the one-dimensional drift of incompress- ible fluid. In the case that a particle density u(x,t) changes only due to convection processes one can write u(x, t + △t)= u(x − c△t, t). If △t is sufficient small, the Taylor-expansion of both sides gives ∂u(x,t) ∂u(x,t) u(x,t)+ △t ≃ u(x,t) − c△t ∂t ∂x or, equivalently ∂u ∂u + c = 0. (2.1) ∂t ∂x Here u = u(x,t), x ∈ R, and c is a nonzero constant velocity. Equation (2.1) is called to be an advection equation and describesthe motion of a scalar u as it is advectedby a known velocity field. According to the classification given in Sec. 1.1, Eq. (2.1) is a hyperbolic PDE. The unique solution of (2.1) is determined by an initial condition u0 := u(x,0) u(x,t)= u0(x − ct), (2.2) where u0 = u0(x) is an arbitrary function defined on R. One way to find this exact solution is the method of characteristics (see App. B). In the case of Eq. (2.1) the coefficients A = c, B = 1, C = 0 and Eqn. (B.2) read dt = 1 ⇔ |t(0)= 0| ⇔ t = s, ds dx = c ⇔ |x(0)= x | ⇔ x = x + ct. ds 0 0 Hence, Eq. (B.3) becomes 13 du = 0 with s(0)= u (x ). ds 0 0 Alltogether the solution of (2.1) takes the form (2.2). The solution (2.2) is just an initial function u0 shifted by ct to the right (for c > 0) or to the left (c < 0), which remains constant along the characteristic curves (du/ds = 0). Now we focus on different explicit methods to solve advection equation (2.1) nu- merically on the periodic domain [0, L] with a given initial condition u0 = u(x,0). 2.1 FTCS Method We start the discussion of Eq. (2.1) with a so-called FTCS (forward in time, centered in space) method. As discussed in Sec. 1.2 we introduce the discretization in time on the uniform grid t j = t0 + j △t , j = 0 ... T . Furthermore, in the x-direction, we discretize on the uniform grid L x = a + i△x, i = 0 ... M , △x = . i M Adopting a forward temporal difference scheme (1.3), and a centered spatial differ- ence scheme (1.7), Eq. (2.1) yields j j u j+1 − u j u − u i i = −c i+1 i−1 ⇔ △t 2△x c△t u j+1 = u j − u j − u j . (2.3) i i 2△x i+1 i−1 j Here we use a notation ui := u(xi, t j). Shematic representation of the FTCS approx- imation (2.3) is shown on Fig. 2.1. e t j+1 7 6SoS S Fig. 2.1 Schematic visu- S alization of the FTCS- S method (2.3). S u u u t j xi−1 xi xi+1 von Neumann Stability Analysis To investigate stability of the scheme (2.3) we follow the concept of von Neumann, introduced in Sec. 1.3. The usual ansatz ε j ikxi i ∼ e leads to the following relation c△t c△t ε j+1 = eikxi − eik(xi+△x) − eik(xi−△x) = 1 − eik△x − e−ik△x ε j , i 2△x 2△x i g(k) | {z } ε j+1 where i stands for the cumulative rounding error at time t j. The von Neumann’s stability condition (1.22) for the amplification factor g(k) reads: |g(k)|≤ 1 ∀k. In our case one obtains: c2△t2 |g(k)|2 = 1 + sin2(k△x), △x2 One can see that the magnitude of the amplification factor g(k) is greater than unity for all k. This implies that the instability occurs for all given c, △t and △x, i.e., the FTCS scheme (2.3) is unconditionally unstable. 2.2 Upwind Methods The next simple scheme we are intersted in belongs to the class of so-called upwind methods – numerical discretization schemes for solving hyperbolic PDEs. Accord- ing to such a scheme, the spatial differences are skewed in the “upwind” direction, i.e., the direction from which the advecting flow originates. The origin of upwind methods can be traced back to the work of R. Courant et al. [3]. The simplest upwind schemes possible are given by j j u j+1 − u j u − u i i = c i i−1 ⇔ △t △x c△t u j+1 = u j − u j − u j , (c > 0). (2.4) i i △x i i−1 and j j u j+1 − u j u − u i i = c i+1 i ⇔ △t △x c△t u j+1 = u j − u j − u j (c < 0). (2.5) i i △x i+1 i Note that the upwind scheme (2.4) corresponds to the case of positive velocities c, whereas Eq. (2.5) stands for the case c < 0. The next point to emphasize is that both schemes (2.4)–(2.5) are only first-order in space and time. Shematic represen- tations of both upwind methods is presented on Fig. 2.2 In the matrix form the upwind scheme (2.4) takes the form u j+1 = Au j, (2.6) where u j is a vector on the time step j and A is a n × n matrix (h := △t/△x), 1 − ch 0 0 ... ch ch 1 − ch 0 ...0 A = 0 ch 1 − ch ...0 ......................... 0 ... ch 1 − ch The boxed element A1n indicates the influence of the periodic boundary conditions. Similary, one can also represent the scheme (2.5) in the form (2.6) with matrix 1 + ch −ch 0 ...0 0 1 + ch −ch ...0 A = ........................ 0 ... 1 + ch −ch −ch ... 0 1 + ch Again, the boxed element An1 displays the influence of periodic boundary condi- tions. (a) (b) e t j+1 e t j+1 7 6 6SoS S S S S u u u t j u u u t j xi−1 xi xi+1 xi−1 xi xi+1 Fig. 2.2 Schematic visualization of the first-order upwind methods. (a) Upwind scheme (2.4) for c > 0. (b) Upwind scheme (2.5) for c < 0. t=0 1 t=50 Fig. 2.3 Advection of a one- t=100 t=150 dimensional Gauß–pulse 0.8 t=200 2 u0 = exp(−(x − 0.2) ) with the scheme (2.4). Numerical 0.6 calculation performed on u(x) the interval x ∈ [0, 10] using 0.4 c = 0.5, △t = 0.05, △x = 0.1. Numerical solutions at 0.2 different times t = 0, t = 50, 0 t 100, t 150, t 200 are 0 2 4 6 8 10 = = = x shown. von Neumann Stability Analysis In order to investigate the stability of the upwind scheme (2.4) (or (2.5) ) we start with the usual ansatz ε j ikxi i ∼ e , leading to the equation for the cumulative rounding error at time t j+1 ε j+1 ε j i = g(k) i , where the amplification factor g(k) for, e.g., the upwind scheme (2.4) is given by c△t c△t ϕ g(k)= 1 − 1 − e−ik△x = α = , ϕ = −k△x = 1 − α + αei . △x △x The stability condition (1.22) is fulfilled for all k as long as c△t △x |g(k)|≤ 1 ⇔ 1 − α ≤ 0 ⇔ ≤ 1 ⇔ c ≤ . (2.7) △x △t That is, the method (2.4) is conditionally stable, i.e., is stable if and only if the ”physical“ velocity c is not bigger than the spreading velocity △x/△t of the nu- merical method. This is equivalent to the condition that the time step, △t, must be smaller than the time taken for the wave to travel the distance of the spatial step, △x. Condition (2.7) is called a Courant-Friedrichs-Lewy (CFL) stability criterion whereas α is. The condition (2.7) is named after R. Courant, K. Friedrichs, and H. Lewy, who described it in their paper in 1928 [9]. Numerical results Figure 2.3 shows an example of the calculation in which the upwind scheme (2.4) is used to advect a Gauß–pulse. Parameters of the calculation are choosen as Space interval L=10 2 Initial condition u0(x)= exp(−(x − 2) ) Space discretization step △x = 0.1 Time discretization step △t = 0.05 Velocity c = 0.5 Amount of time steps T = 200 For parameter values given above the stability condition (2.7) is fulfilled, so the scheme (2.4) is stable. On the other hand, one can see, that the wave-form shows evidence of dispersion. We discuss this problem in details in the next section. 2.3 The Lax Method Let us consider a minor modification of the FTCS-method (2.3), in which the term j in ui has been replaced by an average over its two neighbours (see Fig. 2.4): 1 c△t u j+1 = u j + u j − u j − u j . (2.8) i 2 i+1 i−1 2△x i+1 i−1 In this case the matrix A of the linear system (2.6) is given by a sparse matrix with zero main diagonal 0 a 00 ... 00 b b 0 a 0 ... 00 0 0 b 0 a ... 00 0 .................. A = , .................. .................. 0 000 ... b 0 a a 000 ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages13 Page
-
File Size-