Kelvin-Helmholtz instability of a shear layer

    This is probably the first instability of fluid mechanics. Helmholtz wrote “the surfaces of discontinuity behave to some extent like bodies in unstable equilibrium”. These “surfaces of discontinuity” are his discontinuous idealization of the progressive zone through which the velocity goes from one constant to an other one (the “shear layer” or also the “mixing layer”.

    This code resembles very much poiseuille_uvp.m, except for two things:

    • the base flow is now tanh(y)
    • we use a differentiation based on Hermite polynomials instead of Chebychev polynomial.

    Chebychev polynomials have dense collocation nodes (gridpoints) close to the boundaries so they are good for boundary value problems. On the other hand, Hermite polynomial collocation nodes are dense in the center, precisely where we have our shear layer. Hermite polynomials naturally assume that the variable tends to zero at infinity, so there is no boundary condition to be enforced. Hermite polynomials go from -\infty to +\infty, so there are no “boundaries” indeed.


    • herdif.m That builds the differentiation matrices based on Hermite polynomials
    • herroots.m That is used by herdif.m
    • poldif.m That is used by herdif.m
    clear all; clf;
    alpha=0.5;    % the wave number
    L=30;        % the height of the domain, from -1 to 1
    Re=10000;    % the Reynolds number
    N=100;      % the number of grid points

    In herdif, the first input is the number of nodes, the second one is the desired order of derivation and the third one is a scaling parameter for the distance between the farthest nodes. Make it smll for a “large domain”.

    % Hermite differentiation matrices
    [y, DM] = herdif(N,2,1);
    Z=zeros(N,N); I=eye(N); 
    % renaming the differentiation matrices
    dy=D; dyy=DD;
    dx=i*alpha*I; dxx=-alpha^2*I;
    % base flow

    System matrices

    The matrices E and A are the same as for poiseuille_uvp.m.

    % the matrices
    A=[ ...
        S, -diag(Uy), -dx; ...
        Z, S, -dy; ...
        dx, dy, Z];
    % computing eigenmodes 
    s=diag(S);  [t,o]=sort(-real(s)); s=s(o); UU=UU(:,o);
    rem=abs(s)>1000; s(rem)=[]; UU(:,rem)=[];


    We validate our computation based on figure 4.27 page 238 in the book “Drazin and Reid, Hydrodynamic stability, Cambridge university press”. Here we use the wavelike formulation \displaystyle u(x,y,t)=\hat{u}(y)\exp(i\alpha x+st) but the classical one (used in the book) is \displaystyle u(x,y,t)=\hat{u}(y)\exp(i\alpha(x-ct)) such that the real part of c is the wave speed, and the exponential growth rate is the imaginary part of c. This is what is plotted on the graph.

    % loading the scanned figure for comparison and plotting
    a=imread('kelvin_helmholtz_ref.png'); ss=size(a);
    image(xx,yy,a); axis xy; hold on
    % validation
    grid on
    xlabel('wavenumber alpha'); 
    ylabel('exponential growth rate/alpha')

    Velocity field

    We show the velocity field of the unstable eigenmode and as well the associated pressure field as a colormap.

    % showing the velocity field
    u=1:N; v=u+N; p=v+N; 
    Lx=2*pi/alpha;  x=linspace(-Lx/2,Lx/2,Nx);
    % expand to physical space
    % add the base flow to the perturbations
    % show the velocity field
    quiver(x,y(sely),uu(sely,:),vv(sely,:),'k'); hold on
    surf(x,y,pp-10,'facealpha',0.5); shading interp;
    xlabel('x'); ylabel('y'); title('Velocity field of the initial condition');
    The figure

    The figure


    • Please find a way to validate the figure of the book as well for \alpha>1 where the mode becomes stable
    • Please find the book and try to understand what is the second curve below and compare it to our code
    • Please do the comparison of our code to the following figure in the book where the is the neutral curve for viscous shear layers, showing the dividing line between unstable wavelengthes and stable ones as the Reynolds number is changed
    • Please use the eigenmode from this code as an initial condition in Gerrris and validate the coparison linear/nonlinear ———–>kelvin_helmholtz_gerris.m