Search for question
Question

I) The 3D dataset is the same DNS of turbulent channel flow from the homework assignment (3 velocity components, u, v and w). The first order filter schemes are included in the matlab code for you. a) (15%) Plot contours of instantaneous and filtered velocity components side by side in x=const, y=const and z=const sections, and discuss what you observe. (you must have 9 pairs of contour plots). b) (15%) Plot the unfiltered and filtered velocity components u, v and w, along a line in the x direction (e.g., middle of the domain). Superpose both instantaneous and filtered velocity components on the same graph. (you must have 3 figures). What do you observe? c) (10%) Calculate the SGS residual stress tensor components (equation 13.90 from the textbook), and plot distributions along a line in the x direction (e.g., middle of the domain). Note that you have to re-use the filtering loop to filter the product of instantaneous velocities. d) (10%) Implement the second and fourth order filter schemes (from last class lecture), and compare the filtered velocity component u along a line (in the x direction) among the three filter schemes. clear all x1 = y1 z 1 ul = = = load('matFiles/x'); load('matFiles/y'); load('matFiles/z'); load('matFiles/u'); v1 = w1 = load ('matFiles/v'); load ('matFiles/w'); ni = 241; nj = 80; nk = 101; for i=1:ni; for j=1:nj; for k=1:nk; = x1 (i); y(i,j,k) x(i,j,k) end; end; end u = V = W = reshape (ul, [ni,nj,nk]); reshape (v1, [ni,nj,nk]); reshape (w1, [ni,nj,nk]); %begin filtering = yl (j); z(i,j,k) = z1(k); uf = u; vf = V; wf = w; for i=3:ni-2; for j=3:nj-2; for k=3:nk-2; uf (i,j,k) = vf(i,j,k) = wf(i,j,k) = u (i,j,k) +0.25* (u(i-2,j,k) −2*u (i, j, k) +u (i+2,j,k) ) +0.25* (u(i,j−2,k) −2*u (i, j, k) +u (i,j+2,k)) +0.25* (u(i,j,k−2) −2*u (i, j, k) +u (i,j,k+2)); v(i,j,k)+0.25*(v(i-2,j,k) −2*v (i, j, k) +v (i+2,j,k))... +0.25*(v(i,j−2,k) −2*v (i, j, k) +v (i,j+2,k)). +0.25*(v(i,j,k−2) −2*v (i, j, k) +v (i,j,k+2)); w(i,j,k) +0.25* (w(i-2,j,k) −2*w (i,j,k) +w (i+2,j,k)).. +0.25* (w (i,j−2,k) −2*w (i, j, k) +w (i, j +2,k)) +0.25* (w(i,j,k−2) −2*w (i,j,k) +w (i,j,k+2)); end; end; end %end filtering