Matlab Vortex

Embed Size (px)

Citation preview

  • 7/29/2019 Matlab Vortex

    1/7

    AOE 5104 Assignment 6 solution

    1) An airfoil in ground effect: Airfoils behave a little differently when they fly near the ground duringtake off and landing. There are some planes that are design to always fly near the ground.

    Modify your MATLAB program that calculates the flow around a NACA0012 airfoil so that the leading

    edge is one-half chord above the ground and the center line of the foil makes a 10o

    angle with the horizontal.

    Calculate the flowfield including the loads and make a graphic showing the velocity field around the airfoil.

    (Suggestion: modify the function vpan so that it calculates the velocity from the panel on the actual wing aswell as from the mirror image of this panel below the ground. The velocity field will show the no-

    penetration condition to be satisfied along the ground, because of the symmetry, as well as on the surfaces of

    both the actual airfoil and its mirror image.)

    ground

    In Problem 1, when adding the contributions to the disturbance velocity field from the panel on the image to

    those from the panel on the actual airfoil, you must add components in the same reference frame (the globalframe works for this). One needs to pay attention to the direction of the vorticity in the image: is it the same

    as on the airfoil ?

  • 7/29/2019 Matlab Vortex

    2/7

  • 7/29/2019 Matlab Vortex

    3/7

    Additional suggestions and hints:

    Answer to requests to furnish an algorithm for calculating loads:

    %**************** calculate lift and drag ****************************Gamma = sum(ucp.*dl)

    Lift = 2*Gamma % only good in an infinite flowfield

    % velocity component tangent to the surface at the control pointsucp = 0.5*( G1(1:n) + G1(2:npts) );

    % pressure coefficient on the surface at the control points

    Cp = 1 - ucp.*ucp;

    % pressure at the control points x the unit vector normal to the surface x the length of the element -- recall% the normal vector used here is not a unit vector; it's multiplied by the length of the panel

    Fx = 0;

    Fy = 0;fori = 1:n

    Fx = Fx + Cp(i)*nx(i);Fy = Fy + Cp(i)*ny(i);

    end

    lift = Fy*ca - Fx*sa % ca is the cos (alpha) and sa is the sin (alpha)drag = Fy*sa + Fx*ca

    Note: here the addition of forces is carried out in the same (global) reference frame; the contributions of

    each element are given in the same x- andy-directions for all elements.

    % st r eam l i nes f or a doubl et , wi t h and wi t hout a f r eest r eam, wi t h and% wi t hout a vor t excl ccl ear

    % i nput gr i d- gener at i on par amet er s[ x, y] = meshgr i d( - 5: 0. 02: 5, - 4. 6: 0. 02: 4. 6 ) ;

    % i nput t he val ues of psi on t he desi r ed st r eaml i nesv = [ - 2: 0. 2: 2 ] ;

    % i nput t he f r eest r eamA = 1; % 1 f or t he f r eest r eam, 0 no f r est r eam% i nput t he st r engt h of t he vor t exB = 2. 5;

    % i nput t he or i ent at i on of t he doubl et ' s axi s% and t he di r ect i on of t he f r eest r eam t o al i gn

  • 7/29/2019 Matlab Vortex

    4/7

    % wi t h t he doubl et s axi sal pha = 0 % degr ees

    % conver t t o radi ansal f ar = al pha*pi / 180;

    % comput e a common f actor so t hat t he cal cul at i on of t he% exponent doesn' t have to be repeat ed numerous t i mes

    f acdb = exp( i *al f ar ) ; % f act or f or t he doubl et f acf s = exp( - i *al f ar ) ; % f actor f or t he f r eest r eam% combi ne x and y to f orm t he compl ex var i abl e at t he% gr i d poi nt sz = compl ex( x, y ) ;

    % comput e t he i magi nar y par t of t he compl ex pot ent i al ( t he% st r eam f uncti on) at t he gr i d poi nt spsi = i mag( i *B*l og( z) + A*z* f acf s + f acdb. / z ) ;

    % pl ot t he cont our s; i . e. , t he l i nes of const ant psi ,% wi t h t he val ues vcont our ( x, y, psi , v, ' b' , ' l i newi dt h' , 1. 2 ) ;

    % use t he same scal e on bot h axes t o el i mi nat e di st or t i onaxi s equal axi s ( [ - 5, 5, - 2. 5, 2. 5 ] )

    % l abel t he axesxl abel ( ' \ i t x' , ' f ont s i ze' , 14 )yl abel ( ' \ i t y' , ' f ont s i ze' , 14 )

    % r ot at e t he yl abel set ( get ( gca, ' YLabel ' ) , ' Rot at i on' , 0. 0 )

    t i t l e( [ ' doubl et st r eaml i nes f or \ al pha = ' , num2st r ( al pha) , . . . ' , vor t ex st r engt h = ' , num2st r ( B) ] , ' f ont s i ze' , 14)

    % opt i onal gr i d

    2) Doublets et al.: Using complex arithmetic and the MATLAB module contour,write a program to

    plot the streamlines for a doublet with its axis aligned with the x-axis, with line at 45o from the x-axis,and with the y-axis. Make three graphics showing the streamlines. (see special topics threesingularities)

  • 7/29/2019 Matlab Vortex

    5/7

  • 7/29/2019 Matlab Vortex

    6/7

    3) a) Add a uniform freestream to the flow around a doublet. b) Then add a vortex at the origin to theflow around a doublet and the freestream. In both cases have the uniform stream be parallel to the x-axis.

    Select the strength of the vortex to be such that a rear stagnation point occurs 30o

    below the x-axis.

    Doublet, no vor tex (B=0), + freestream (A=1)

  • 7/29/2019 Matlab Vortex

    7/7

    doublet + vortex (B=1) + freestream (A=1)

    doublet + vor tex (B=1), no freestream (A=0)