%FINAL PROJECT #9--------------COMPUTATION OF LINEARIZED EULER EQUATIONS %Lance Simms 12/2005 % %u=velocity in x direction v=velocity in y direction %Flow is flowing in from left. Assumed to be uniform rho=1, u=M_inf, v=0 %Linearization about p=1, u=M_inf, v=0 % %Thin airfoil present having shape given by % ywall=Tx(1-x)/2 01 % %Euler Equations are written as % % DQ DQ DQ % -- + A -- + B -- = 0 % Dt Dx Dy % % where: | 0 1 0 | | rho | % A = | -M_inf^2 2 M_inf 0 |, Q = | rho u | % | 0 0 M_inf | | rho v | % % | 0 0 1 | % B = | 0 0 M_inf | % | 1 0 0 | % Inputs: % M_inf : Free Stream Mach number % nx : Number of points on airfoil (x=0,1) % cfl : dt = min(dx,dy)*cfl/(M_inf+1 + 1) % where Spectral radius of A is (M_inf+1) and B is 1 % nmax : Number of time steps to go % nout : Output frequency of plot of cp (0 for no plots) % meth : 1: Explicit Euler / 2: RK4 / 3: Implicit Euler % order : 0 : central 2nd / 1 : 1st order upwind / 2 : 2nd order upwind % ichar : 0 : simple bc / 1 : char bc / -1 simpler bc % % clear; %MACH NUMBER M_inf=.8; M_inf=input('Enter M_inf'); %Grid Generation xmin=-1.0; xmax=3.0; ymin=0.0; ymax=2.0; nx=10; nx=input('Enter number of points on body:'); dx=1.0/(nx-1); dy=dx; x=[xmin:dx:xmax]'; y=[ymin:dy:ymax]'; jmax=size(x,1); kmax=size(y,1); %Generate meshgrid having x values as rows and y values as columns [X,Y]=meshgrid(x,y); jle=nx; jte=2*nx-1; fprintf('Leading edge point= %g trailing edge point = %g \n', jle,jte); fprintf('X of Leading edge point =%g X of trailing edge point = %g \n', x(jle),x(jte)); %Surface Definition: tau is the thickness tau=0.1; %tau=input ('tau); s=[jle:jte]; ys=zeros(jmax,1); ys(s)=tau*0.5*x(s).*(1.0-x(s)); %Try to figure out indices of airfoil foil=0; for xind=1:length(x) newfoil=find(y