MCEN90008 Matlab分析

MCEN90008 Fluid Dynamics 2023PART I OF ASSIGNMENT FOR POTENTIAL FLOW

1. Instructions:

  • Assignment to be handed in by 23:59 on Sunday 17th September 2023.
  • This assignment should be done in groups of 2 students. Both studentsin the group will get the same mark for this assignment.Ifyou chooseto do the assignment alone, no concession will be given. Your assignmentwill 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.
Should you decide to write your computer program in MATLAB, youare not allowed to use the streamline, odexx or similar functions in MATLAB i.e. you need to write the program to solve the ordinarydifferentialequations yourself and not simply use the functions in MATLAB. Also donot merely use the contour function of ψ to visualise streamlines. Theaim of this assignment is for you to produce a set of tools to enable youcompute the coordinates of pathlines. The same rules apply if you useother languages.
• Please submit your assignment as aa zipped package containing
– Copies of all computer programs (appended as .m files if using Matlab).
– Written documentation with computer generated graphs and sketches.
This documentation must contain all discussions and all the exercisesthat you were asked to do in the main part of thisassignment.
• Marks will be deducted for incorrect or absent axis labels.
• Unless stated otherwise, please use equal scaling along each axis(this isachieved by setting daspect([1 1 1]) In Matlab).
For the first part of this assignment, you will write codes toaccurately plot pathlines from given startingpositions. For steady flows, pathlines are the same as streamlines. Make sure you get this question right.For the later parts of this assignment you will build on the computer program which you have writtenhere to study much more complex flows.

  1. (Total marks for question = 27) In order to write a computer code to sketch streamlines, it is
    best to first start by writing a computer program to solve a simple problem.
    (a) Write down the analytical solution to the following ordinary differential equation (ODE) in
    (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 equationfrom 0 ≤ t ≤ tf where tf = 0.2, 0.4, 0.6, 0.8 and 1.0. Perform your computations with
    (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
    (d) Extend your program from part (1b) so that it can solve the set of equations given by the setof Equations (3) for 0 ≤ t ≤ tf . Check your program by completing the table below for bothx and y for various tf and time-steps h. To save time in future questions, youshould try towrite your program such that you can easily changethe set of equations f(x, y) and g(x, y) asdefined in the Appendix.

2. Part II

  1. (Total marks for question = 20) The streamfunction for a potential vortex (with positiveanti-clockwise circulation) is given by
    where Γ is the circulation and r is the distance from the centre of the vortex. The center coordinatesare given by (x0,y0).
    (a) Show that the time it takes for a fluid particle to circulate around this vortex, tc, is given byNote that u(x, y) and v(x, y) are singular at (x, y) = (x0, y0). Analytically, this is not usually an
    issue. However, when you are writing a computer program to solveproblems or track particles,functions that have singularitieswill usually cause your program to “blow up”.
    (b) In order to regularise u and v, it is proposed to use the following streamfunction,ψδ(r) = Show that the Cartesian components of velocity, u and v can be written asComment on the assumption of irrotational flow for a vortex asdefined in equation (9) shift
    text (3 Marks)
    (c) Four vortices of the form given in equation (9) with δ = 0.2, are arranged in an unboundedspace with the following properties to model a mixing flow due to four fixed stirrers.Use the quiver command in Matlab to plot the velocity vector field associated with thisarrangement. (use a vector spacing of 0.2 in the x and ydirections). (3 Marks)
    (d) On Canvas you will find a Matlab data filecalled:particle_positions_2023.matThis file contains the x and y locations of 10050 particles of fluidat time t = 0 within the
    mixing system described above. You may read in the data using thecommand:load(‘particle_positions_2023.mat’);You can view theparticle locations using:plot(xp,yp, ‘k.’)Use your RK4 codes to track these particles over 1001 steps of h = 0.1. Plot the final particlelocations and submit this in your report. The stirrers (vortices) arefixed in physical space anddo not mutually induce motion in eachother. You only need to track the particle trajectoriesunder the influence of the 4 stirrers. (6 Marks)
    (e) Comment on how realistic such a scenario might be? (2 Marks)
    (f) Again using the particle starting locationsgivenin‘particle_positions.mat’, this time useyour Euler codes to track these particles over 1001 steps of h = 0.1. Plot the final particlelocations and submit this in your report. Comment onthe comparison to the RK4 result.shift text (4 Marks)
    Joukowski airfoil at α = 8◦. Plot also on the same figure (with a different colour line) the Cpsame angle of attack (if youIf you are asked to solve a system consisting of a set of coupled ordinary differential equationsthe approximate numerical solution can be obtained using the Euler and 4th order Runge-Kutta

你可能感兴趣的:(机器学习)