• No results found

Computational Fluid Dynamics Exercise 2 – Various discretization methods

N/A
N/A
Protected

Academic year: 2021

Share "Computational Fluid Dynamics Exercise 2 – Various discretization methods"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Computational Fluid Dynamics

Exercise 2 – Various discretization methods Description

As in Exercise 1, we consider the inhomogeneous convection-diffusion equation dφ

dx −kd2φ

dx2 = S on 0 ≤ x ≤ 1, with φ(0) = 0, φ(1) = 1.

The right-hand side is given by S(x) =

( 2 − 5x , 0 ≤ x ≤ 0.4, 0 , 0.4 < x ≤ 1.

The Matlab file cfd 2 solves this equation with a number of finite-difference (-volume) me- thods. Several types of discretization are employed; the solutions obtained with these dis- cretizations are shown in one combination figure – the exact solution is also indicated. Each figure shows eight smaller pictures, arranged as indicated below:

uniform grid upwind smart upwind

lambda schemes B3 (λ = 1/2) QUICK (λ = 1/8) central (λ = 0)

nonuniform grid upwind central A central B

Two types of grid are used: uniform grids and non-uniform (stretched) grids. The stretched grid possesses N/2 equal grid cells between 0 and 1 − 5k, and N/2 equal grid cells between 1 − 5k and 1.

The Matlab script also gives the eigenvalues of Method B; they are displayed in Matlab’s main window.

Required files

This exercise requires the files cfd 2.m, cfd upw.m, cfd lam.m, cfd cen.m, ns exact.m.

Questions to be solved on the computer

Compute the solutions for k = 0.05, k = 0.01 and k = 0.001 (i.e. P = 1, 5 and 50). Use a grid with N = 20 grid cells

1. Compare the upwind results with those of the ‘smart upwind’ method for the same values of k; give a personal opinion of the usefullness of the latter method in comparison with the ‘standard’ upwind.

2. Compare the results of the lambda-schemes (cf. Section 1.3.2) with those of the up- wind method; watch features like wiggle-dependency and artificial diffusion. Determine empirically for which value of k the QUICK method starts to wiggle, and explain this

‘wiggle boundary’ theoretically (see Question 5 below).

1

(2)

3. Finally, consider the results on the stretched grid. Compare the upwind method and both generalizations (A and B) of the central method (cf. Section 1.6). Describe the difference between the discrete solutions; why has the upwind solution not improved?

4. On the stretched grid, determine empirically the value of k for which one of the eigenva- lues of the coefficient matrix of Method B crosses the imaginary axis. Furthermore, try to find a value of k for which the coefficient matrix is approximately singular. Watch how the solution of Method B behaves at this singularity.

Questions to be solved by pencil-and-paper

5. Prove that λ ≥ max(12kh, 0) is a sufficient condition for the upwind-biased lambda schemes from Eq. (1.15) on page 12 to be wiggle-free. In particular show that the QUICK method is wiggle-free for P ≤ 8/3. Hint: Try fundamental solutions of the form ri, and monitor the sign of r.

6. Discretize the convection-diffusion equation dφ

dx −kd2φ

dx2 = 0 on 0 ≤ x ≤ 1, with Dirichlet boundary conditions

φ(0) = 0, φ(1) = 1.

Use a nonuniform grid with only one interior grid point at x = 1 − 2k; k remains an unspecified variable here. Use the discretization methods A and B. In both cases, A and B, solve the discrete system (which in fact is only one equation). Sketch both solutions using linear interpolation between the grid points. Compute the exact solution of the convection-diffusion equation (at x = 1 − 2k) as well. Which discrete solution is better?

2

Referenties

GERELATEERDE DOCUMENTEN

The results produced by the program consist of the eigenvalues of the Jacobi matrix, a plot of the iteration error (this error is written to the screen as well), the total number

The results produced by the program consist of the eigenvalues of the Jacobi matrix, a plot of the iteration error (this error is written to the screen as well), the total number

Indeed, the CPU-time per grid point and time step of both methods is comparable, a 50 3 grid has 8 times less grid points than a 100 3 grid, it allows for a twice as large a time

Figure 1.3: The number of eigenvalues located in the (unstable) left halfplane for the La- grangian methods as a function of mean mesh size (2L second-order; 4L fourth-order with

5) Carry out a Fourier stability analysis of the generalized Crank-Nicolson method, and determine the amplification factor. Show that the generalized Crank-Nicolson method

2) Use for the Poisson solver an accuracy ε = 10 −3 , and use as initial solution for the Poisson solver p = 0, i.e. start the Poisson solver from scratch. Look what happens with

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

Mocht u het idee hebben dat de bloeddrukmeter niet goed werkt, dan kunt u contact opnemen met de functieafdeling