Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MCEN90008 Fluid Dynamics 2022

PART I OF ASSIGNMENT FOR POTENTIAL FLOW

Instructions:

.  Assignment to be handed in by 23:59 on Sunday 18th September 2022.

.  This assignment should be done in groups of 2 students.  Both students in the group will get the same mark for this assignment.  If you choose to do the assignment alone, no concession will be given. Your assignment will be marked the same as an assignment done by two students.

.  Please choose your group partner carefully.

.  Only hand in one assignment per group.

. You can use any programming language to complete this assignment.  If you should decide to write your computer program in MATLAB, you are not allowed to use the streamline, odexx or similar functions in MATLAB i.e.    you  need  to  write  the  program  to  solve  the  ordinary  dierential equations yourself and not simply use the functions in MATLAB. Also do not merely use the  contour function of ψ to visualise streamlines.   The aim of this assignment is for you to produce a set of tools to enable you compute the coordinates of pathlines.   The same rules apply if you use other languages.

. When you submit your assignment, please include

–  Copies of all computer programs appended as pdf   les.

– Written documentation with computer generated graphs and sketches. This documentation must contain all discussions and all the exercises

that you were asked to do in the main part of this assignment.

.  Marks will be deducted for incorrect or absent axis labels.

.  Unless stated otherwise, please use equal scaling along each axis (this is achieved by setting daspect([1 1 1]) In Matlab).

Part I

For the irst part of this assignment, you will write codes to accurately plot pathlines - which for steady lows are the same as streamlines - from given starting positions. Make sure you get this question right. For the later parts of this assignment you will build on the computer program which you have written here to study much more complex lows.

1.  (Total marks for question = 27) In order to write a computer code to sketch streamlines, it is best to irst start by writing a computer program to solve a simple problem.

(a) Write down the analytical solution to the following ordinary diferential equation (ODE)

dx

dt

with the initial condition

x = 1     at     t = 0                                                         (2)

(1 Mark)

(b) Write a computer program to solve Eq. (1) using Euler’s (EU) and the 4th order Runge Kutta (RK-4) method (see the appendix for more information on EU and RK-4). Solve the equation from 0 t tf  where tf  = 0.2, 0.4, 0.6, 0.8 and 1.0. Perform your computations with various step sizes, (h = 0.1, 0.01, 0.001), and tabulate your results in the table shown below (show 4 decimal places).

EU

RK-4

tf

Analytical answer

h = 0.1

h = 0.01

h = 0.001

h = 0.1

h = 0.01

h = 0.001

0.2

0.4

0.6

0.8

1.0

The  output from your computer program must  approach the  analytical answer  as  h gets smaller.  Plot the analytical solution (x vs t) along with the EU and the RK4 solution for h = 0.01 and 0 < t < 1. Use the axis limits axis([0 1 0 150]) and daspect([1 150 1]). Which is the more accurate numerical method? EU or RK-4? (8 Marks)

(c) Write down the analytical solution (write them as equations of the form x = f(t) and y = f(t)) to the following set of coupled ODE

dx dt

dy dt

You are given that at time, t = 0

=   x 2y

=   x y

(3)

(4)

{  y(x)  } = { 3  } .

(5)

(3 Marks)

(d)  Extend your program from part (1b) so that it can solve the set of equations given by Eq.

(4) for 0 t tf .  Check your program by completing the table below for both x and y for various tf  and time-steps h.  To save time in future questions, you should try to write your program such that you can easily change the set of equations f(x,y) and g(x,y) as deined in the Appendix.

EU

RK-4

tf

Analytical answer

h = 0.1

h = 0.01

h = 0.001

h = 0.1

h = 0.01

h = 0.001

2

4

6

8

10

(8 Marks)

Which is the more accurate numerical method?  Use the more accurate numerical method in ALL subsequent parts of this assignment.

(e)  Plot y vs x for h = 0.1, h = 0.01 and h = 0.001 for both EU and RK-4 with tf  = 2T .  Plot the EU and RK4 calculations on separate igures. Should the lines join up? Do the lines join up?                                                                                                                                 (4 Marks)

(f)  Use your computer program to plot the streamline pattern for the low described by Eq.  (4) i.e. plot y vs x for a set of initial conditions, where tf  = 10 and h = 0.01. You should modify your program such that you can pass it a number of starting positions xs  and ys , the time step h and total time of integration tf . In matlab, this could be achieved by writing your program as a function where you pass the variables xs  and ys  (which could be vectors) and tf  and h. This function would then be used as follows,

[xr yr] = my_streamline_function(xs, ys, tf, h)

where xr and yr are the returned coordinates (matrices) of the streamline and xs and ys are the start locations,

xs = [-1 -2 -3];

ys = [0 0 0];

For non-Matlabers, your program could read an input ile where the irst line contains the number of streamlines, Nl , the time of integration tf  and the time step h. The subsequent Nl lines in the input ile should contain the location of the initial points of the streamlines, (x0i y0i).  For example, the input ile to draw three solution trajectories that start from (0, — 1), (0, — 2) and (0, —3) with h = 0.01 and 0 < t < 10 will look something like,

3 10 0.01

-1.0 0

-2.0 0

-3.0 0

(3 Marks)

2.  (Total marks for question = 23) Consider the scenario shown in the igure 1 below.  Some people are contaminated, and they are stood in a uniform low of strength Ufrom right to left. Containment is attempted via an extraction fan in the location shown. We will model this scenario as a source of strength Qc  representing the contaminant release, a sink of strength Qe   = RQc , representing the extraction fan, and a uniform low from left to right. The ratio of the strength of the contaminant release Qc  to the extraction fan strength Qe  is given by R(= Qe /Qc ).

(a)  Show that the stagnation points are given by the following equation,

x = 12  「(l)1 — RC ± 4 ( )2 + 4s (s + ( )) ,

where C = (2TU)/Qc .

(6)

(4 Marks)

y

Uniform   ow U

s = 1m       s = 1m

x

❅、❅

Contaminant        release,   modeled by   a   source   of strength Qc

Figure 1:  A plan view explaining the location of the contaminant release, extraction and uniform low for question 2.

(b)  Show that this reverts to the full-Rankine solution and the half-Rankine solution with the

appropriate value of R                                                                                                  (4 Marks)

(c)  Assuming that U= 2 ms 1 , U/Qc  = 1, and R = 0.5, use your computer program writ- ten in Question 1 and sketch the low pattern resulting from the scenario shown in igure 1. Again, your program should accept an input that gives the start positions in x and y for the streamlines, the time step and the total time (tf ) of integration.  As a starting point, use a time-step h = 0.01.

Please start your streamlines in sensible places to really show the important low features. To begin with I suggest 30 starting positions around the smokers at radius = 0.05, equally spaced in the azimuthal direction.  Also add other streamlines coming from the left of your igure. You may wish to add other streamlines to best represent the entire lowield. Use blue lines to represent the smoke and black lines to represent the other low. Clearly mark the lines of sepa- ratrix and stagnation points in red. Choose appropriate x and y axis limits to show the entire low ield. I suggest limits — 2.5 < x < 2.5 and — 2 < y < 2 (axis([-2.5 2.5 -2.0 2.0])).

For 30 radially spaced positions about the smokers

r = 0.05;

theta = 0:(2*pi./30):2*pi;

xs = s + [r.*cos(theta)];

ys = [r.*sin(theta)];

There are singularities at the center of the source and sink. Depending on your time-stepping you will need to add some error trapping to catch these.  One method is to check the radial distance from the sink, and if this position is less than some threshold (say r = 0.1), set the u and v to zero. This will prevent your pathline from reaching the singularity (provided your timestep is small enough!!). You can use lower thresholds if you use smaller timesteps/

re = sqrt((x+s).^2 + y.^2);

dxdt((re<0.1)) = 0;

dydt((re<0.1)) = 0;

(6 Marks)

(d)  Comment on the width of the contaminated region at x → -∞ . You should be able to show this analytically.

(1 Marks)

(e)  The ratio R is now increased to 4. Again plot the low ield, following the same plotting criteria shown above, clearly showing all stagnation points and lines of separatrix in red.  (6 Marks)

(f)  Comment on the width of the outer curved separatrix when x → ∞ . You should be able to show this analytically.                                                                                                  (1 Marks)

(g) The inner closed separatrix is kind of aerodynamically styled (teardrop or approximate airfoil geometry).   Explain why replacing this streamline with a solid body would not be a good model for an airfoil.                                                                                                      (1 Marks)

3.  (Total marks for question = 14) Four potential vortices all of counter-clockwise rotation and = 0.9 are located at,

x     y

-2     0

2     0

0     -2

0     2

(a) Plot the instantaneous streamline pattern associated with this low.  Choose your streamline locations to best illustrate the low features.                                                              (4 Marks)

(b)  As has been explained in lectures, the low ield created by a system of potential vortices is unsteady  (time dependent).   This is because the vortex will be advected by the local luid velocity that is generated by all other vortices in the system.  The motion of each vortex is given by

dxjdt = - 12 i(yj  - yi)ri2j

ij

dyjdt = 12 i(xj  - xi)ri2j

ij

(7)

(8)

where (xj ,yj ) is the position of the jth vortex and rij  is the distance between the jth and ith vortices.

Or in terms of the complex velocity,

dwjdz = - i2 izj-zi

ij

(9)


Use an RK4 or Euler scheme to plot the trajectories of these 4 vortices as they mutually induce motion in one another. Plot trajectories for numerous time-steps to illustrate convergence (for example h = 1, 0.1 and 0.01). Please submit with your report the computer program used to

calculate vortex trajectories. What should the solution converge to?                      (4 Marks)