• Abramowitz, M., and I. A. Stegun, 1964: Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. Vol. 55. U.S. Government Printing Office, 1046 pp.

    • Crossref
    • Export Citation
  • Berrut, J.-P., and G. Klein, 2014: Recent advances in linear barycentric rational interpolation. J. Comput. Appl. Math., 259, 95107, https://doi.org/10.1016/j.cam.2013.03.044.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Bickley, W., 1941: Formulae for numerical differentiation. Math. Gaz., 25, 1927, https://doi.org/10.1017/S002555720007008X.

  • Fjørtoft, R., 1950: Application of integral theorems in deriving criteria of stability for laminar flows and for the baroclinic circular vortex. Geofys. Publ., 17 (6), 152.

    • Search Google Scholar
    • Export Citation
  • Fornberg, B., and J. Zuev, 2007: The Runge phenomenon and spatially variable shape parameters in RBF interpolation. Comput. Math. Appl., 54, 379398, https://doi.org/10.1016/j.camwa.2007.01.028.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Goldstein, S., 1931: On the stability of superposed streams of fluids of different densities. Proc. Roy. Soc. London, 132A, 524548, https://doi.org/10.1098/rspa.1931.0116.

    • Search Google Scholar
    • Export Citation
  • Gregg, M., E. D’Asaro, J. Riley, and E. Kunze, 2018: Mixing efficiency in the ocean. Annu. Rev. Mar. Sci., 10, 443473, https://doi.org/10.1146/annurev-marine-121916-063643.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Hazel, P., 1972: Numerical studies of the stability of inviscid stratified shear flows. J. Fluid Mech., 51, 3961, https://doi.org/10.1017/S0022112072001065.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Howard, L. N., 1961: Note on a paper of John W. Miles. J. Fluid Mech., 10, 509512, https://doi.org/10.1017/S0022112061000317.

  • Klein, G., and J.-P. Berrut, 2012: Linear rational finite differences from derivatives of barycentric rational interpolants. SIAM J. Numer. Anal., 50, 643656, https://doi.org/10.1137/110827156.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Liu, Z., 2010: Instability of baroclinic tidal flow in a stratified fjord. J. Phys. Oceanogr., 40, 139154, https://doi.org/10.1175/2009JPO4154.1.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Liu, Z., S. A. Thorpe, and W. D. Smyth, 2012: Instability and hydraulics of turbulent stratified shear flows. J. Fluid Mech., 695, 235256, https://doi.org/10.1017/jfm.2012.13.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Maslowe, S. A., 1986: Critical layers in shear flows. Annu. Rev. Fluid Mech., 18, 405432, https://doi.org/10.1146/annurev.fl.18.010186.002201.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Miles, J. W., 1961: On the stability of heterogeneous shear flows. J. Fluid Mech., 10, 496508, https://doi.org/10.1017/S0022112061000305.

  • Putrevu, U., and I. A. Svendsen, 1992: Shear instability of longshore currents: A numerical study. J. Geophys. Res., 97, 72837303, https://doi.org/10.1029/91JC02988.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Rayleigh, L., 1880: On the stability or instability of certain fluid motions. Scientific Papers, Vol. 3, Cambridge University Press, 594–596.

  • Rees, T., and A. Monahan, 2014: A general numerical method for analyzing the linear stability of stratified parallel shear flows. J. Atmos. Oceanic Technol., 31, 27952808, https://doi.org/10.1175/JTECH-D-14-00034.1.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Schlichting, H., and K. Gersten, 2016: Boundary-Layer Theory. Springer, 805 pp.

  • Smyth, W. D., and W. R. Peltier, 1989: The transition between Kelvin–Helmholtz and Holmboe instability: An investigation of the overreflection hypothesis. J. Atmos. Sci., 46, 36983720, https://doi.org/10.1175/1520-0469(1989)046<3698:TTBKAH>2.0.CO;2.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Smyth, W. D., and J. R. Carpenter, 2019: Instability in Geophysical Flows. Cambridge University Press, 338 pp.

    • Crossref
    • Export Citation
  • Smyth, W. D., J. N. Moum, and J. D. Nash, 2011: Narrowband oscillations in the upper equatorial ocean. Part II: Properties of shear instabilities. J. Phys. Oceanogr., 41, 412428, https://doi.org/10.1175/2010JPO4451.1.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Smyth, W. D., J. N. Moum, L. Li, and S. A. Thorpe, 2013: Diurnal shear instability, the descent of the surface shear layer, and the deep cycle of equatorial turbulence. J. Phys. Oceanogr., 43, 24322455, https://doi.org/10.1175/JPO-D-13-089.1.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Sun, C., W. Smyth, and J. Moum, 1998: Dynamic instability of stratified shear flow in the upper equatorial Pacific. J. Geophys. Res., 103, 10 32310 337, https://doi.org/10.1029/98JC00191.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Taylor, G. I., 1931: Effect of variation in density on the stability of superposed streams of fluid. Proc. Roy. Soc. London, 132A, 499523, https://doi.org/10.1098/rspa.1931.0115.

    • Search Google Scholar
    • Export Citation
  • Trefethen, L. N., 2000: Spectral Methods in MATLAB. Society for Industrial and Applied Mathematics, 165 pp.

    • Crossref
    • Export Citation
  • View in gallery

    Relative error in the growth rate σ for case 1 with different numerical methods as shown in the legend.

  • View in gallery

    Relative error in the growth rate for case 1 using finite-difference methods of different order on uniform and nonuniform grids.

  • View in gallery

    (a) Improvement index ϒ [defined in Eq. (8)] vs the clustering parameter a at N = 113. The black pentagrams highlight the optimal values. (b) Optimal value of a vs N. The dashed lines indicate the convergence value for FD2c, FD4c, and FD6c, which are 0.85, 0.60, and 0.60, respectively.

  • View in gallery

    Eigenfunction of the fastest-growing mode for case 1. (a) Background velocity profile for reference. (b) Real and imaginary parts of eigenfunction w^. (c) Eigenfunction magnitudes for target and the FD4c method with N = 11. (d) Relative error in the eigenfunction with different numerical methods as shown in the legend.

  • View in gallery

    Relative error in the growth rate σ for case 2 with the FDc, Fourier, and Chebyshev methods. As in Fig. 2, but with Rib = 0.15.

  • View in gallery

    Relative error in the growth rate σ for case 3 using the FDc, Fourier, and Chebyshev methods. As in Fig. 2, but with Re = 10.

  • View in gallery

    Growth rate vs wavenumber and Reynolds number for case 4: plane Poiseuille flow with uniform viscosity.

  • View in gallery

    Relative errors of the growth rate for case 4 with Re = 105 and k = 1.55 (black dot in Fig. 7).

  • View in gallery

    Background profiles observed at a mooring station (55°21′N, 5°4′W) in the Clyde Sea at 2000 LT 29 Jun 2002 (case 5). (a) Zonal (u) and meridional (υ) velocity components. Circles indicate the original data and the dashed lines show the extrapolated values. (b) Squared shear S2 = (du/dz)2 + (/dz)2 and fourfold squared buoyancy frequency 4Bz. The black dots indicate measurement depths where the gradient Richardson number Bz/S2 is below 0.25. (c) Turbulent viscosity/diffusivity. Horizontal dot-dashed lines show the lowest extent of the measurements. Values below this depth are extrapolated as described in the text. All panels are plotted vs height above the seabed.

  • View in gallery

    Growth rate σ on the θλ space for case 5. Here, θ is the wave vector direction and λ is the wavelength. For each k, growth rate is calculated using the Fourier method with high resolution with N = 801. The black dot indicates the fastest-growing mode. The title shows the maximum value of σ and the corresponding wavenumbers.

  • View in gallery

    Relative error in the growth rate σ for the FD, Fourier, and Chebyshev methods applied to case 5.

  • View in gallery

    Relative error in the growth rate σ for the FD and FDc methods of different order applied to case 5. The value of σ is computed by Eq. (7) with targeted θ and λ shown in Fig. 10.

  • View in gallery

    Case 6: Background profiles observed at a mooring station (55°21′N, 5°4′W) in the Clyde Sea at 0300 LT 30 Jun 2002. (a) Zonal (u) and meridional (υ) velocities. (b) Squared shear S2, fourfold squared buoyancy frequency 4Bz, and the gradient Richardson number, which is below a quarter. (c) Turbulent viscosity and diffusivity. (d) Histogram of the critical level having positive growth rates. The red and blue triangles show all mode families that are found. The horizontal dash–dotted lines in (a)–(c) show the high-shear layers induced by extrapolated velocity. The dashed lines in (b) represent the critical-level depth of mode families found in (d).

  • View in gallery

    (a) Growth rates, (b) wave vector direction, and (c) critical-level depths vs wavelength for the eight mode families for case 6. Pentagrams show the fastest-growing mode of three main mode families.

  • View in gallery

    Eigenfunctions of modes 1, 5, and 6 for case 6. (a) Vertical velocity eigenfunction. (b) Vertical velocity eigenfunction magnitudes. (c) Buoyancy eigenfunction. (d) Buoyancy eigenfunction magnitudes. The maximum magnitude of the vertical velocity and buoyancy of each mode is normalized to unity.

  • View in gallery

    Numerical methods’ ability to catch the characteristic parameter of mode family 6 for case 6. (a) Growth rate of the fastest-growing mode σ vs number of grid points N. (b) Corresponding wavelength λ vs N. (c) Corresponding wave vector direction θ vs N. (d) Critical level zc vs N. The blue arrows and values on the right-hand edge of each plot indicate the convergency values of σ, λ, θ, and zc.

  • View in gallery

    Relative error in the internal gravity wave speed c. The target speed c0 is defined using the Fourier–Galerkin method with N = 801. For other methods with smaller N, c is computed from Eq. (5) with Eq. (11), k = 10−6, U = 0, Re = 1010, Pr = 1, and Rib = 1.

  • View in gallery

    (a) Relative error in the internal gravity wave speed c for the FD and FDc methods of different order. (b) Relative error in the internal gravity wave speed c for the FDc, Fourier, and Chebyshev methods.

All Time Past Year Past 30 Days
Abstract Views 149 149 19
Full Text Views 65 65 17
PDF Downloads 83 83 21

Numerical Computation of Instabilities and Internal Waves from In Situ Measurements via the Viscous Taylor–Goldstein Problem

View More View Less
  • 1 State Key Laboratory of Marine Environmental Science, and Department of Physical Oceanography, College of Ocean and Earth Sciences, Xiamen University, Xiamen, China
  • | 2 College of Earth, Ocean and Atmospheric Science, Oregon State University, Corvallis, Oregon
  • | 3 State Key Laboratory of Marine Environmental Science, and Department of Physical Oceanography, College of Ocean and Earth Sciences, Xiamen University, Xiamen, China
© Get Permissions
Free access

Abstract

We explore numerical methods for the stability analysis of stratified, parallel shear flows considering the effects of small-scale turbulence represented by eddy viscosity and diffusivity. The result is an extension of the classical Taylor–Goldstein problem applicable to oceanic and atmospheric flows. Solutions with imaginary frequency describe shear and convective instabilities, whereas those with real frequency represent internal gravity waves. Application to large observational datasets can involve considerable computation and therefore requires a compromise between speed and accuracy. We compare several numerical methods to identify optimal approaches to various problems.

© 2020 American Meteorological Society. For information regarding reuse of this content and general copyright information, consult the AMS Copyright Policy (www.ametsoc.org/PUBSReuseLicenses).

Corresponding author: Zhiyu Liu, zyliu@xmu.edu.cn

Abstract

We explore numerical methods for the stability analysis of stratified, parallel shear flows considering the effects of small-scale turbulence represented by eddy viscosity and diffusivity. The result is an extension of the classical Taylor–Goldstein problem applicable to oceanic and atmospheric flows. Solutions with imaginary frequency describe shear and convective instabilities, whereas those with real frequency represent internal gravity waves. Application to large observational datasets can involve considerable computation and therefore requires a compromise between speed and accuracy. We compare several numerical methods to identify optimal approaches to various problems.

© 2020 American Meteorological Society. For information regarding reuse of this content and general copyright information, consult the AMS Copyright Policy (www.ametsoc.org/PUBSReuseLicenses).

Corresponding author: Zhiyu Liu, zyliu@xmu.edu.cn

1. Introduction

The Taylor–Goldstein (T-G) equation describes the stability of a Boussinesq stratified shear flow under inviscid and nondiffusive conditions (Taylor 1931; Goldstein 1931; Liu 2010; Smyth and Carpenter 2019). It is a second-order ordinary differential equation whose solutions exhibit singularity at critical levels (where the speed of the mean current matches the phase velocity). The singular behavior arises from the neglect of viscosity, diffusion and nonlinearity in the equations of motion (Maslowe 1986), and makes the T-G equation a challenge to solve numerically. Several well-known theorems, such as the Rayleigh inflection point criterion (Rayleigh 1880), Fjørtoft’s condition (Fjørtoft 1950), the Miles–Howard theorem (Miles 1961; Howard 1961), and Howard’s semicircle theorem (Howard 1961), allow us to predict certain aspects of instability without solving the T-G equation, but the information they give is far from complete. One alternative is to use a numerical shooting method together with asymptotic matching to cross singularities (Hazel 1972; Smyth and Peltier 1989; Rees and Monahan 2014). Another is to retain the viscous and diffusive effects. Liu et al. (2012) extended the T-G equation to include vertical and horizontal eddy coefficients of viscosity and diffusivity, allowing those coefficients to vary with height. The resulting viscous T-G (vT-G) equation set (described below) is useful for modeling naturally occurring flows. It is nonsingular, but it is higher order than the T-G equation.

The focus of this paper is numerical methods for the vT-G equations, specifically matrix-based methods. Matrix methods are slower than shooting methods for a given accuracy but are useful in practice because they do not rely on an initial guess. We will compare several commonly used methods to seek the most efficient way to get a solution with a prescribed level of accuracy.

2. The viscous Taylor–Goldstein problem

For a small-amplitude, normal mode disturbance with horizontal wave vector k evolving on a horizontal background flow Uh = {u(z), υ(z)}, mode evolution is determined solely by the component of the background flow parallel to the wave vector:
U=kUhk,
where k=kk is the wave vector magnitude. Therefore, without loss of generality, we consider the two-dimensional problem that the parallel shear flow U(z) is disturbed by the vertical velocity perturbation w′ and the buoyancy perturbation b′. The buoyancy is defined as b = g(ρ0ρ)/ρ0, where g is the acceleration due to gravity, and ρ0 is a characteristic value of the density ρ. We decompose the density as ρ=ρ0+ρ¯(z)+ρ(x,y,z,t), and the buoyancy becomes b = B(z) + b′, where B=gρ¯/ρ0 and b′ = −′/ρ0 (see appendix E). The perturbations can be expressed as the normal mode
w=[w^(z)eσt+ιkx]r;b=[b^(z)eσt+ιkx]r,
where w^ and b^ are complex vertical structure functions of vertical velocity and buoyancy, respectively, σ = σr + ισι is the complex growth rate, subscripts r and i indicate the real and imaginary parts, ι=1 and x is the horizontal coordinate parallel to the wave vector. We include the effects of viscosity and diffusivity, which may either be molecular in origin or result from turbulence on spatial scales much smaller than the wave scale k−1. Following Liu et al. (2012), the viscosity and diffusivity have separate horizontal (Ah, Kh) and vertical (Aυ, Kυ) parts, and are allowed to vary in the vertical. The linearized normal-mode equations are then
(σ+ιkU)2w^ιkd2Udz2w^=Tww^k2b^,
(σ+ιkU)b^+dBdzw^=Tbb^,
with viscous and diffusive operators
Tw=d2dz2(Aυd2dz2)k2ddz[(Ah+Aυ)ddz]+k4Ah,
Tb=ddz(Kυddz)k2Kh.
The Boussinesq approximation has been made to neglect the effect of variation of density except in the buoyancy. In the inviscid, nondiffusive limit Ah = Kh = Aυ = Kυ = 0, the vT-G equations [Eqs. (1) and (2)] become the conventional T-G equation.
The vT-G equations [Eqs. (1)(4)] can be restructured as a generalized differential eigenvalue problem:
σ[200I]A˜[w^b^]=[ιkU2+ιkd2Udz2+Twk2dBdzιkU+Tb]B˜[w^b^],
where 0 is the zero matrix, I is the identity matrix, and
2=d2/dz2k2
is the Laplacian in normal-mode form and A˜ and B˜ are matrix differential operators.

Specification of the problem is completed by the imposition of boundary conditions at the upper and lower boundaries, which may in principle be at infinity. Each boundary is assumed to be impermeable (w^=0), either rigid (dw^/dz=0) or frictionless (d2w^/dz2=0) and either with constant buoyancy (b^=0) or insulating (db^/dz=0).

3. Numerical methods

The problem specified by (5) and the boundary conditions is to find (complex) eigenvalues σ for given profiles of U(z), B(z), Aυ(z), Ah(z), Kυ(z), Kh(z), and wavenumber k. We begin by defining grid points zi (i = 1, …, N), which may or may not be evenly spaced (appendix A). We then define derivative matrices D˜(K) such that the Kth derivative of a discretized function fi = f(zi) is represented by
dKfdzK|z=zi=DijKfj.
The differential eigenvalue problem (5) now becomes the generalized eigenvalue problem
σA˜x=B˜x,
where A˜ and B˜ are 2N × 2N matrices and the eigenvector x is the concatenation of the elements of the discretized structure functions w^i and b^i. This algebraic problem is solvable using standard numerical routines, but we need first to specify the derivative matrices D˜(K) that appear in A˜ and B˜.

Numerical methods for determining D˜(K) can be classified into the local and global categories. For the local methods, the derivative at the grid point zi involves only a few neighboring function values f(zj). We can then calculate Dij(K) by applying Taylor’s expansion of f or by differentiating a local polynomial interpolant at zi (appendix B). The result is a sparse matrix with bandwidth J. The larger J is, the higher the order of D˜(K) is.

In global methods, computing the derivative at any point involves all the N nodes in the domain. Here, Dij(K) can be derived by differentiating a high-order orthogonal polynomial such as the Chebyshev polynomial (appendix C) or integrating a trigonometric series (appendix D). As a result, D˜(K) is a full matrix. This increases the CPU time and storage requirements but, in compensation, the orthogonal high-order polynomials give higher accuracy for a given N. Details of the computation of the differentiation matrices are given in the appendixes.

It is important to recognize that higher-order finite-difference methods are designed to be more accurate in the limit Δ → 0, where Δ is the grid spacing defined in appendix A. In practice, we make Δ as small as we can with the available resources, but often we are interested in marginally resolved flow features, for example, a layer of strong shear that extends over just a few data points. In this case, there is no guarantee that a higher-order method will be more accurate. This failure of higher-order methods to improve accuracy has been noted previously, for example, by Putrevu and Svendsen (1992).

In some applications, our aim is to approximate the solution of the differential eigenvalue problem as accurately as possible, while in others we try to attain acceptable accuracy while minimizing processing time and memory. Therefore, we will compare methods based on two criteria:

  • How quickly does the error of the growth rate (or phase speed) go to zero as N → ∞?
  • What is the smallest N needed to achieve a predetermined accuracy, for example, a relative error of 1% in the growth rate?
We will address these questions for a set of test problems including both simple, idealized models of parallel flow and in situ oceanographic measurements.

4. Shear instabilities in idealized model flows

Our first goal in solving the vT-G equations is to identify unstable normal modes, or instabilities. We will begin with a profile that is often used in modeling geophysical flows, the hyperbolic tangent shear layer.

a. Case 1: A homogeneous, inviscid shear layer

In the homogeneous, inviscid limit the vT-G equation reduces to the Rayleigh equation (Rayleigh 1880; Smyth and Carpenter 2019). We consider a hyperbolic tangent shear profile U = tanh(z) with boundary conditions w^=0 at z = ±H/2, where H is the domain height, chosen to be 10. Further boundary conditions are not needed since Tw and Tb drop out of Eqs. (5). For each wavenumber k, a matrix-based method (local or global; see appendixes BD) using N grid points delivers 2N eigenmodes. We are concerned only with the fastest growing of these eigenmodes, that is, σFGM.

The growth rate is purely real, and is a maximum when k = 0.46. As a ground truth for testing the various numerical methods, we use the Fourier–Galerkin method (appendix C) with high resolution N = 801 to find the corresponding growth rate σ0 = 0.184 561 95. This is used as a ground truth, or “target value” to define the relative error, |σσ0|/σ0, for each of the other methods tested.

Figure 1 shows the relative error in the growth rate for five methods: the second-, fourth-, and sixth-order finite-difference methods (labeled FD2, FD4 and FD6, respectively) and the Fourier and Chebyshev methods. The number of grid points N ranges from 11 to 265. Not surprisingly, all methods become more accurate as N is increased. The error in the finite-difference methods decreases according to the order of the method, giving very accurate results at high N. At low N, however, the difference vanishes. To achieve 1% accuracy in the growth rate requires N = 39, 21, and 19 with FD2, FD4, and FD6, respectively. The global methods become extremely accurate at large N, but do not perform as well at small N (the Chebyshev method especially). The standard of 1% accuracy requires N = 29 and 19 with the Chebyshev and Fourier methods, respectively. An investigator desiring <1% error in the growth rate with high efficiency might do well to choose FD6 or the Fourier method. However, FD4 is simpler while giving nearly the same accuracy.

Fig. 1.
Fig. 1.

Relative error in the growth rate σ for case 1 with different numerical methods as shown in the legend.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

We now show that clustering the grid points in regions of high shear using the methods described in appendix A can improve accuracy significantly, especially when the resolution is coarse (Fig. 2). In general, the clustered grid delivers greatly improved accuracy for all orders of finite-difference methods. The difference is particularly striking at low N, where the 1% standard is achieved even for the lowest-order method FD2c, where “c” denotes clustering (not to be confused with the phase speed of internal waves in section 6) and at the lowest resolution tested (N = 11).

Fig. 2.
Fig. 2.

Relative error in the growth rate for case 1 using finite-difference methods of different order on uniform and nonuniform grids.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

For each of the computations shown in Fig. 2 that used clustered grids, an optimal value was chosen for the clustering parameter a (see appendix A). This was done by maximizing an improvement index ϒ, which compares the accuracy achieved with a particular clustered grid with that using a uniform grid:
ϒ(a,N)=1|σFDcσ0σFDσ0|,
where σFD is the growth rate computed using a particular finite-difference method with uniform grids and σFDc is the value obtained using clustered grids.

To illustrate the method, we examine the dependence of ϒ on a at N = 113 (Fig. 3a). Using method FD2c, accuracy improves steadily as a is increased, reaching a maximum at a = 0.85. We identify this as the optimal value for FD2c. With method FD4c, the increase is faster and the maximum improvement is found at a = 0.60. With method FD6c, maximum improvement is also found at a = 0.60, but for higher values of a, the rate of improvement decreases approaching zero as the clustering becomes extreme.

Fig. 3.
Fig. 3.

(a) Improvement index ϒ [defined in Eq. (8)] vs the clustering parameter a at N = 113. The black pentagrams highlight the optimal values. (b) Optimal value of a vs N. The dashed lines indicate the convergence value for FD2c, FD4c, and FD6c, which are 0.85, 0.60, and 0.60, respectively.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

We next examine the optimal value of a for a range of N (Fig. 3b) using second-, fourth-, and sixth-order methods. It is found that the optimal value of a for FD2c is constant; for FD4c and FD6c, the optimal value of a increases when N is small. These results are important because the advantage of the clustered grid method is greatest for coarsely resolved features.

While the above results might suggest using larger values of a, one should recall that setting a too large can degrade accuracy (Fig. 3a). Conservatism is especially well justified when analyzing observational data, where one may not know a priori the flow structures that the code will encounter. On that basis, we tentatively choose the lower values a = 0.85 for FD2c, and a = 0.60 for FD4c and FD6c, as in Fig. 2.

We can go one step further and use eigenfunction to test the accuracy of different numerical methods. As we do to the growth rate, the relative error of vertical velocity eigenfunction can be defined as
Ψ(N)=||w^||w^|0|w^|0|¯,
where |w^| is the magnitude of the vertical velocity eigenfunction, |w^|0 is the target eigenfunction corresponding to σ0, and the overline indicates vertical average. As shown in Figs. 4b and 4c, we normalize the solutions by scaling the maximum magnitude of the vertical velocity eigenfunction to unity. The eigenfunction is symmetric about z = 0, having peaks of equal magnitude on the upper and lower edges of the shear layer. Figure 4d shows the relative error Ψ for the FD methods, the FDc methods, and the Fourier and Chebyshev methods. The FDc methods achieve higher accuracy than the FD methods and global methods, indicating that the clustered grids work for eigenfunction. The Chebyshev method performs better than the Fourier method. This is because the collocation points of the Chebyshev method is symmetric about z = 0, well suitable for this case. We also note that the clustering strength needed to resolve the eigenfunction is smaller than that needed to resolve the growth rate. At N = 11, FD4c method with a = 0.40 can reproduce the eigenfunction (dashed line in Fig. 4c).
Fig. 4.
Fig. 4.

Eigenfunction of the fastest-growing mode for case 1. (a) Background velocity profile for reference. (b) Real and imaginary parts of eigenfunction w^. (c) Eigenfunction magnitudes for target and the FD4c method with N = 11. (d) Relative error in the eigenfunction with different numerical methods as shown in the legend.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

b. Case 2: A stably stratified, inviscid, nondiffusive shear layer

We turn now to an inviscid, nondiffusive, stably stratified fluid for which the parallel shear flow problem reduces to the Taylor–Goldstein equation (Taylor 1931; Goldstein 1931; Smyth and Carpenter 2019). Different numerical methods were tested with a simple case of a shear layer in homogeneous fluid in the previous section. Earth’s oceans and atmosphere, however, tend to be density stratified. It is thus critical to make sure these methods also work well for stratified shear flows.

As an example, we consider the hyperbolic tangent model for the stably stratified shear layer:
U(z)=tanh(z);B(z)=Ribtanh(z),
where the constant Rib is the bulk Richardson number characterizing the strength of the stratification relative to the shear. Differentiating B(z), we have the squared buoyancy frequency
Bz(z)=Ribsech2(z).
In this case, we set Rib = 0.15 and assume that w^=0 and b^=0 at z = ±H/2 and H = 10. The target growth rate σ0 is smaller than that in case 1 (Fig. 5), meaning that shear flow is stabilized by stratification.
Fig. 5.
Fig. 5.

Relative error in the growth rate σ for case 2 with the FDc, Fourier, and Chebyshev methods. As in Fig. 2, but with Rib = 0.15.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

We now repeat the calculations for which results were shown in Figs. 13. In this case the FDc methods are always more accurate than the FD methods. We therefore neglect the latter and compare the different order FDc methods with the Fourier and Chebyshev methods in Fig. 5. Except at high N, FDc methods achieve higher accuracy than the Fourier and Chebyshev methods, with the FD4c method performing best. The optimal values of a are similar to those found in the unstratified case, though not exactly the same (Fig. 5, legend). Once again, high-order FDc methods work best with smaller a.

c. Case 3: A homogeneous, stratified shear layer with variable eddy viscosity and diffusivity

Suppose that the shear layer has experienced instability events in the past and therefore has some residual turbulence represented by the eddy coefficients Aυ, Ah, Kυ, and Kh. We model this scenario as
U(z)=tanh(z),B=0,Aυ(z)=Ah(z)=Kυ(z)=Kh(z)=sech2(z)/Re,
where the constant Re is the Reynolds number. The eddy coefficients are assumed to be independent of horizontal direction. The turbulent Prandtl number is unity (Kυ = Aυ, Kh = Ah). We set Re = 10 and do the same analyses as in previous cases. Boundary conditions are again w^=w^zz=b^=0 at z = ±H/2 with H = 10. Use of the normal-mode formalism in viscous, diffusive fluid with arbitrary profiles U(z) and B(z) implies the assumption that the instability grows on a fast time scale in contrast with the slow diffusion of the mean profiles, the so-called frozen flow approximation. This generally requires that Re be sufficiently large (Smyth and Carpenter 2019). Here, however, we work with smaller Re to provide a rigorous test of the numerical approximations used.

Figure 6 shows the results. Again, the target growth rate is smaller than that in case 1. This reveals another stabilizing mechanism: shear instability damped by eddy viscosity and diffusion. The clustered finite-difference methods give better accuracy than the global methods at low N. At high N, the global methods converge rapidly, with the Fourier method outperforming the Chebyshev.

Fig. 6.
Fig. 6.

Relative error in the growth rate σ for case 3 using the FDc, Fourier, and Chebyshev methods. As in Fig. 2, but with Re = 10.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

d. Case 4: Plane Poiseuille flow in homogeneous, viscous fluid

Previous cases have employed frictionless boundaries, with d2w^/dz2=0. We turn now to plane Poiseuille flow, which consists of a parabolic velocity profile between two stationary plates
U(z)=4z(1z).
The fluid is assumed to be homogeneous (B = 0) and Aυ = Ah = 1/Re. We impose rigid boundary conditions: w^=dw^/dz=0 at z = 0 and z = 1.

The Chebyshev method with resolution N = 101 is used to compute the growth rate as a function of k and Re (Fig. 7). For Re > 105, the maximum growth rate increases with decreasing Re, that is, with increasing viscosity. This is the Tollmien–Schlichting instability (Schlichting and Gersten 2016), an example of a mode that is destabilized by viscosity. The growth rate maximum is found at Re = 105 and k = 1.55. Figure 8 shows relative errors of the growth rate at the Reynolds number Re = 105. In this case, both the FDc and Chebyshev methods cluster the grid points in the boundary layers. When resolution is coarse, the strongly clustered FD methods (a ≥ 0.9) achieve higher accuracy than the Chebyshev method. The FD6c method performs better than the others. At large N, the Chebyshev method converges rapidly. (The Fourier method is omitted because it cannot represent the rigid boundary conditions in the form used here).

Fig. 7.
Fig. 7.

Growth rate vs wavenumber and Reynolds number for case 4: plane Poiseuille flow with uniform viscosity.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

Fig. 8.
Fig. 8.

Relative errors of the growth rate for case 4 with Re = 105 and k = 1.55 (black dot in Fig. 7).

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

To summarize, the numerical methods tested in this paper (see appendixes) compute the growth rate of idealized models of shear instability with varying degrees of accuracy. The accuracy of the finite-difference methods depends on the order of the approximation. When resolution is coarse, clustering the grid in regions of strong shear can confer even higher accuracy than the global Fourier and Chebyshev methods. Most often, higher-order FD methods work best with less clustering (i.e., lower a). At high N, the Fourier and Chebyshev methods converge most rapidly. Before we make a final assessment of all these methods, tests will be carried out with an observed geophysical flows.

5. Shear instabilities in observed oceanic flows

We now demonstrate the application of these methods to observed geophysical flows. Observed flow profiles are considerably more complicated than the idealized models discussed above (e.g., Sun et al. 1998; Liu 2010; Smyth et al. 2011; Liu et al. 2012; Smyth et al. 2013). In what follows, we consider two cases of increasing complexity.

a. Case 5: Clyde Sea, observed profiles with single shear maximum

Figure 9 shows the profiles observed at a mooring station (55°21′N, 5°4′W) in the Clyde Sea at 2000 LT 29 June 2002 (see Liu 2010). The zonal and meridional velocity components were obtained from a moored acoustic Doppler current profiler (ADCP). Because data below 3.6 m (measured from the bottom) are unreliable due to instrumental constraints, we extrapolate the velocity using cubic splines, assuming U = V = 0 at the bottom. The profiles of the squared buoyancy frequency N2 and diffusivity Kυ were obtained from a free-fall yo-yo (FLY) microstructure profiler. The diffusivity Kυ was estimated from the turbulent kinetic energy dissipation rate ε via
Kυ=ΓεN2,
where ε can be directly estimated from FLY’s shear probes signal, and Γ is the flux coefficient, commonly approximated by the constant 0.2 (Gregg et al. 2018). As in case 3, the turbulent coefficients are assumed to be isotropic in the horizontal direction with turbulent Prandtl number unity: Aυ(z) = Ah(z) = Kυ(z) = Kh(z).
Fig. 9.
Fig. 9.

Background profiles observed at a mooring station (55°21′N, 5°4′W) in the Clyde Sea at 2000 LT 29 Jun 2002 (case 5). (a) Zonal (u) and meridional (υ) velocity components. Circles indicate the original data and the dashed lines show the extrapolated values. (b) Squared shear S2 = (du/dz)2 + (/dz)2 and fourfold squared buoyancy frequency 4Bz. The black dots indicate measurement depths where the gradient Richardson number Bz/S2 is below 0.25. (c) Turbulent viscosity/diffusivity. Horizontal dot-dashed lines show the lowest extent of the measurements. Values below this depth are extrapolated as described in the text. All panels are plotted vs height above the seabed.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

Note that the shear profile has five local maxima (excluding boundaries). Only two of these have Ri < 1/4, z = 16 m and z = 8 m. Eddy viscosity is strong at the latter, likely damping shear instability. We therefore anticipate a single dominant mode with critical level near z = 16 m.

To deal with the veering background flow Uh = {u(z), υ(z)}, we recall that an instability is affected only by the component of the mean flow parallel to its own wave vector k (section 2). Accordingly, we define the angle θ as the direction of the wave vector, measured counterclockwise from due west, and loop over θ = [−90°, 90°]. For each θ, the velocity profile appearing in the vT-G equations is
U(z,θ)=ucosθ+υsinθ.
We also loop over the wavelength λ = 2π/k = [1, 100] m and ultimately find the direction and wavenumber where the growth rate of the FGM is maximum (Fig. 10, black dot).
Fig. 10.
Fig. 10.

Growth rate σ on the θλ space for case 5. Here, θ is the wave vector direction and λ is the wavelength. For each k, growth rate is calculated using the Fourier method with high resolution with N = 801. The black dot indicates the fastest-growing mode. The title shows the maximum value of σ and the corresponding wavenumbers.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

To obtain a target value for evaluating different numerical methods, we use the Fourier method with very high resolution, N = 801, and thus obtain the following values for the FGM: θ0 = −54°, λ0 = 30.880 m (k0 = 2π/λ0 = 0.2035 m−1), and σ0 = (6.295 821 + 4.879 614ι) × 10−3 s−1. The critical level is located at 15.8 m, within the single maximum shear layer.

Figure 11 shows the comparison between the FD methods and the global methods (i.e., the Fourier and Chebyshev methods). At low N, no difference is visible between the Fourier and FD methods. The Fourier and FD6 method have higher accuracy than the others at large N. The Chebyshev method performs worst, even compared with FD2. This is because the Chebyshev method clusters the grid points near the boundaries, which is inefficient for this case.

Fig. 11.
Fig. 11.

Relative error in the growth rate σ for the FD, Fourier, and Chebyshev methods applied to case 5.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

We cluster the grid points in the single shear layer and compare the accuracy of the FDc methods of different orders with the FD method on a uniform grid. The FDc method achieves higher accuracy than the FD method (Fig. 12), indicating that the clustered grids work for observed flows. At large N, FD6c with a = 0.30 performs the best.

Fig. 12.
Fig. 12.

Relative error in the growth rate σ for the FD and FDc methods of different order applied to case 5. The value of σ is computed by Eq. (7) with targeted θ and λ shown in Fig. 10.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

b. Case 6: Clyde Sea, observed profiles with multiple shear maxima

Observed profiles are often more complex than the one shown above, for example, Fig. 13. Conditions for shear instability are evident at several depths; that is, shear magnitude reaches a local maximum (red curve in Fig. 13b), Ri < 1/4 (black dots), and turbulent coefficients are not too large (Fig. 13c). In this case the stability analysis at each (k, θ) may deliver two or more unstable modes with critical levels close to one of the shear maxima shown in Fig. 13b. We describe a method for dealing with this additional complexity. At each (k, θ), rather than retain only the fastest growing of the 2N eigenmodes, we collect all modes having positive growth rates. After scanning the kθ plane, we are typically left with several thousand modes.

Fig. 13.
Fig. 13.

Case 6: Background profiles observed at a mooring station (55°21′N, 5°4′W) in the Clyde Sea at 0300 LT 30 Jun 2002. (a) Zonal (u) and meridional (υ) velocities. (b) Squared shear S2, fourfold squared buoyancy frequency 4Bz, and the gradient Richardson number, which is below a quarter. (c) Turbulent viscosity and diffusivity. (d) Histogram of the critical level having positive growth rates. The red and blue triangles show all mode families that are found. The horizontal dash–dotted lines in (a)–(c) show the high-shear layers induced by extrapolated velocity. The dashed lines in (b) represent the critical-level depth of mode families found in (d).

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

Following Smyth et al. (2013), we compute the critical level for each mode and plot a histogram of the results (Fig. 13d). For the case analyzed here, the histogram reveals eight peaks, each of which corresponds roughly to one of the shear maxima shown Fig. 13b. Local minima of the histogram (blue triangles in Fig. 13d) conveniently delineate the set of modes corresponding to each shear maximum. We call these sets mode families. Each mode family has its own fastest-growing mode (e.g., pentagrams in Fig. 14a) and critical level (Fig. 14c). The depth of the critical level for each family is approximately independent of wavelength. Eight depths are found and shown by horizontal lines on Fig. 14c. The shallowest critical level, located at z = 49 m, is denoted as mode 1. Successive mode families with critical levels at z = 45, 31, 23, 19, 12, 7, and 1 m are denoted as modes 2–8, respectively. These mode families represent distinct physical processes (Sun et al. 1998). For example, the uppermost mode family may represent shear at the base of the surface mixed layer, while others might represent breaking depths of the internal wave field. The growth rates of these mode families are shown on Fig. 14a. Three mode families stand out are mode 1, mode 5 and mode 6. The growth rates of their FGMs are 39.31, 39.76, and 34.21 h−1, respectively, so their amplitudes grow by a factor e = 2.718 in about 2 min. The corresponding wavelength are 7.78, 12.04, and 25.43 m, about 7 times the thickness of their shear layer, that is, 1, 2, and 4 m.

Fig. 14.
Fig. 14.

(a) Growth rates, (b) wave vector direction, and (c) critical-level depths vs wavelength for the eight mode families for case 6. Pentagrams show the fastest-growing mode of three main mode families.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

Figure 15 shows the eigenfunctions of the three dominant modes. The solutions were normalized by scaling the maximum magnitude to unity. The vertical structure of eigenfunctions have significant magnitude at their critical-level depth, while the magnitude decreases to zero away from these layers.

Fig. 15.
Fig. 15.

Eigenfunctions of modes 1, 5, and 6 for case 6. (a) Vertical velocity eigenfunction. (b) Vertical velocity eigenfunction magnitudes. (c) Buoyancy eigenfunction. (d) Buoyancy eigenfunction magnitudes. The maximum magnitude of the vertical velocity and buoyancy of each mode is normalized to unity.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

We use mode 6 to test the accuracy of different numerical methods in computing the growth rate of fastest-growing mode σ, the wavelength λ, the wave vector direction θ, and the critical-level height zc. All methods converge to the same values (blue arrows in Fig. 16). At large N, the FD4c method performs as well as the Fourier–Galerkin method and even better than the Chebyshev method. At low N, FD4c achieves the highest accuracy.

Fig. 16.
Fig. 16.

Numerical methods’ ability to catch the characteristic parameter of mode family 6 for case 6. (a) Growth rate of the fastest-growing mode σ vs number of grid points N. (b) Corresponding wavelength λ vs N. (c) Corresponding wave vector direction θ vs N. (d) Critical level zc vs N. The blue arrows and values on the right-hand edge of each plot indicate the convergency values of σ, λ, θ, and zc.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

6. Internal gravity waves in inviscid, nondiffusive fluid

Internal gravity waves arise from the same Eqs. (1) and (2) that describe instabilities. The phase speed of internal gravity waves is c = ισ/k = cr + ιcι, where σ is the eigenvalue of Eq. (5). Here, we look for the stable wave solutions (cι = 0) and test the abilities of various numerical methods to approximate the phase speed cr in the long-wave (or hydrostatic) limit k → 0.

We consider a viscous stratified fluid with stratification given by (11) as in case 3 but with Rib = 1 and no background flow, U = 0. Eddy coefficients are uniform and equal: Aυ = Kυ = Ah = Kh = 1/Re with Re = 1010.

Figure 17 shows the relative error of phase speed. The accuracy of high-order finite-difference methods and global methods is high. Unlike the behavior in Fig. 1, the Fourier method works very well at low N. To achieve 1% accuracy, only 12 grid points are required. The FD4, FD6, and Chebyshev methods have similar accuracy at low N. These methods all outperform FD2, which requires N > 80 to achieve 1% accuracy.

Fig. 17.
Fig. 17.

Relative error in the internal gravity wave speed c. The target speed c0 is defined using the Fourier–Galerkin method with N = 801. For other methods with smaller N, c is computed from Eq. (5) with Eq. (11), k = 10−6, U = 0, Re = 1010, Pr = 1, and Rib = 1.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

The optimal value of a (Fig. 18b) is generally smaller than the values computed for the homogeneous shear layer (case 1; Fig. 2). The phase speed of internal waves does not seem to require highly clustered grid points; in fact, the FD6 method gives better results with no clustering except when the resolution is very coarse (Fig. 18b; compare green and yellow diamonds). We understand this by recalling that, for shear instability, a high value of a ensures high resolution around the critical level, where the instability is most likely to occur. The neutral modes found here are not singular and are therefore less tightly localized than the instabilities discussed previously. The Fourier method (black curve on Fig. 17) provides reliably accurate solutions.

Fig. 18.
Fig. 18.

(a) Relative error in the internal gravity wave speed c for the FD and FDc methods of different order. (b) Relative error in the internal gravity wave speed c for the FDc, Fourier, and Chebyshev methods.

Citation: Journal of Atmospheric and Oceanic Technology 37, 5; 10.1175/JTECH-D-19-0155.1

7. Summary

The conventional Taylor–Goldstein equation is extended to include effects of turbulence represented by the eddy viscosity and diffusivity. The resulting “viscous T-G” (vT-G) equation, together with appropriate boundary conditions, is a linear eigenvalue problem that can be solved using matrix-based methods. We have tested the most commonly used matrix methods including the second-, fourth-, and sixth-order finite-difference methods, the Chebyshev-collocation method, and the Fourier–Galerkin method. The accuracy of the finite-difference method is greatly improved by using adaptive grid spacing.

We have tested these methods using both idealized models and observational data. At high resolution, the global methods (i.e., the Fourier–Galerkin and Chebyshev-collocation methods) converge most rapidly. At coarse resolution, however, the finite-difference methods with optimal grid spacing can achieve higher accuracy than the global methods. The optimal value of clustering strength depends on the order of the methods. High-order finite-difference methods usually need only slight clustering. Overall, we recommend the FD4c method with a = 0.6 or the FD6c method with a = 0.4 for sheared flows. If shear is judged to be unimportant, the Fourier–Galerkin method is a reliable alternative.

Acknowledgments

This work was supported by the National Natural Science Foundation of China (41622601, 91858201, and 41721005), the National Key R&D Program of China (2016YFC1401404), and the U.S. National Science Foundation (OCE-1537000). The project has benefited from discussions with Shuwen Tan and Larry Pratt.

Data availability statement: The codes developed in this study are available on request from W.D.S (bill.smyth@oregonstate.edu) or Z.L. (zyliu@xmu.edu.cn).

APPENDIX A

Creation of an Efficient Clustered Grid

Efficient solution of Eqs. (1)(4) requires an efficient means of discretization; that is, grid spacing can vary with z such that the spacing is fine in regions where the solution is expected to vary most rapidly. Since instability tends to be focused in high-shear layers, it is natural to seek for a discretization with clustering in these regions.

We begin with a set of points spaced evenly between the boundaries zB and zT:
zi=zB+(i1)Δ,wherei=1,2,,N
and
Δ=zTzBN1.
Now suppose, for example, that we want to concentrate resolution in parts of the profile where the shear is strong. We therefore define the absolute shear
si=|Ui+1Ui|zi+1zi,fori=1,2,,N1
and a transformed version
ζi=ln(si/smin)ln(smax/smin).
The latter variable approaches 0 and 1 when the absolute shear is at its minimum and maximum values, smin and smax, respectively. We now define the new grid increment
ηi=zTzBk=1N1(1aζk)(1aζi),i=1,2,,N1,
where the stretching parameter a is an adjustable constant such that 0 ≤ a < 1. If a = 0, ηi = Δ; that is, the original uniform grid is recovered. As a → 1, the clustering becomes extreme. The new grid points are
Z1=zB;Zj=zB+i=1j1ηi;j=2,,N.

APPENDIX B

The Finite-Difference Method

The most commonly used local method is the finite-difference (FD) method, since it is well suited to problems in complex geometries and boundary conditions. On regular grids (a = 0), the FD method is simple. The (i, j)th component of the derivative matrix, Di,j(K), is derived using Taylor series expansions and tabulated (e.g., Abramowitz and Stegun 1964; Bickley 1941). However, it becomes difficult to construct the differencing formula using Taylor’s expansion on irregular grids, especially for high-degree and high-order derivatives. Instead, we use polynomial interpolation, which is suitable for calculating derivative matrices of any degree with any order of accuracy on an arbitrary grid. For barycentric Lagrange interpolation (Klein and Berrut 2012; Berrut and Klein 2014), we expand the function to be differentiated, f(Z), as
f(Zi)=j=j1j2βjZiZjf(Zj)j=j1j2βjZiZj,i=1,2,,N,
where j1 and j2 are identify neighboring grid points around the derivative point i. For example, the fourth-order central finite-difference scheme for first derivatives involves the grid points from j1 = i − 2 to j2 = i + 2. The stencil width is J = j2j1 + 1 (5, in this case). When J < N, Eq. (B1) is a local method, whereas it is a global method when J = N. The values βj=[ij(ZjZi)]1 are called the barycentric weights. The Kth derivative of f(Z) is then given by
f(K)(Zi)=j=j1j2Di,j(K)f(Zj),i=1,2,,N,
where the differentiation matrix D˜(K) has components
Di,j(1)={βjβi1ZiZj,ijm=1miNDi,m(1),i=j,Di,j(K)={KZiZj[βjβiDi,i(K1)Di,j(K1)],ijm=1miNDi,m(K),i=j,K2.
Boundary conditions are expressed via a matrix C˜ and a vector b such that
C˜x=b,
where x is the vector of eigenfunctions as defined in section 3. If the total number of boundary conditions is Nbc, then C˜ is an Nbc × 2N matrix with each row specifying one boundary condition. Similarly, b is an Nbc × 1 column vector. For example, if the boundary condition requires that the first element of x vanish (a homogeneous Dirichlet condition), then the top row of C˜ is [1, 0, 0, …] and the top value of b is 0. If the boundary condition involves derivatives, then C˜ will include elements of the appropriate derivative matrix.
Now, we decompose x into xk, the part of x that we will keep, and xr, the part that we will remove. The decomposition is chosen so that the boundary conditions become
[Ck˜00Cr˜][xkxr]=b,
Solving Eq. (B4), xr can be expressed as a function of xk:
xr=Cr˜1Ck˜G˜xk+Cr˜1H˜b.
The matrix H˜ allows for possible nonhomogeneous boundary conditions. In the present applications the boundary conditions are homogeneous (b = 0) and Eq. (B5) is simply
xr=G˜xk.
The matrix G˜ is called the “give-back” matrix, since it gives back the removed degrees of freedom.
The eigenvalue Eq. (7) can likewise be separated into two parts:
σ[Akk˜Akr˜Ark˜Arr˜][xkxr]=[Akk˜Akr˜Ark˜Arr˜][xkxr].
We are only interested in xk, since xr can be recovered using Eq. (B6). Beginning with the upper part of Eq. (B7),
σ(Akk˜xk+Akr˜xr)=Bkk˜xk+Bkr˜xr,
we substitute Eq. (B6), obtaining
σ(Akk˜+Akr˜G˜)A˜xk=(Bkk˜+Bkr˜G˜)B˜xk,
where A˜ and B˜ are matrices modified to account for the boundary conditions. The generalized eigenvalue to be solved is then
σA˜k=B˜xk.
After σ and xk are obtained from Eq. (B8), we can recover xr using Eq. (B6), and finally assemble the eigenvector x.

APPENDIX C

The Chebyshev-Collocation Method

Polynomial (including the Chebyshev polynomials) interpolation on equally spaced points is known to suffer from the Runge phenomenon (Fornberg and Zuev 2007). The best way to overcome this problem is to use irregular distributed interpolation points, such as the most common and simplest one, the Chebyshev–Gauss–Lobatto points,
ci=cos(i1N1π),i=1,,N,
which is the extrema of Chebyshev polynomials Ti(c) = cos[i cos−1(c)]. We can visualize these points as the projections on [−1, 1] of equispaced points zi on the upper half of the unit circle (see Fig. 5.1 of Trefethen 2000). They are clustered at boundaries and should be very effective to analyze the boundary layer instability. Substituting Eq. (C1) into Eq. (B3), we get the Chebyshev derivative matrix
Ci,j(1)={bjbi(1)i+jcicj,ijm=1miDi,m(1),i=j,Ci,j(K)={Kcicj[bj(1)i+jbiDi,i(K1)Di,j(K1)],ijm=1miDi,m(K),i=j,K2,
where bj = 1/2 if j = 1 or N, and bj = 1 otherwise. The Chebyshev points and matrices are defined on [−1, 1]; they can be extended to [ZB, ZT] by using Zi = ZB + [(ZTZB)/2](ci + 1) and D(K) = C(K)/[(ZTZB)/2]K.

We find that the collocation method is nothing other than the barycentric Lagrange interpolation based on the Chebyshev collocation points. The boundary conditions can be incorporated using the same approach discussed in the last section.

APPENDIX D

The Fourier–Galerkin Method

Here we describe a Fourier–Galerkin method in which the solution is expanded in terms of sine functions:
Fn(Z)=2HsinnπHZ.
Then
w^(Z)=n=1NwnFn(Z),b^(Z)=n=1NbnFn(Z).
Here, Fn(Z) automatically satisfies the frictionless boundary conditions x^=x^=0 at Z = 0 and Z = H. This choice of basis functions is natural for impermeable, frictionless, constant-buoyancy boundaries, and may be adapted for insulating boundaries by expanding b^ in terms of cosines rather than sines. But the method is not well-suited for rigid boundaries.
The orthogonality of Fn(Z) is expressed by
0HFm(Z)Fn(Z)dZ=δm,n,
where δm,n is the N × N identity matrix. Substituting Eq. (D1) into Eqs. (1) and (2) gives
(σ+ikU)n=1Nwn2FnikUn=1NwnFn=Twn=1NwnFnk˜2n=1NbnFn,
(σ+ikU)n=1NbnFn+Bn=1NwnFn=Tbn=1NbnFn,
where primes indicate differentiation with respect to Z. Using the fact that Fn=(nπ/H)2Fn, the Laplacian ∇2Fn becomes DnFn, where
Dn=(nπH)2k˜2.
The viscous terms TwFn and TbFn become
TwFn=d2AυdZ2[(nπH)2]Fn+2dAυdZ[(nπH)3]2HcosnπHZGn+Aυ(nπH)4Fnk˜2d(Ah+Aυ)dZ(nπH)2HcosnπHZGnk˜2(Ah+Aυ)[(nπH)2]Fn+k˜4AhFn,Tb=dKυdZ(nπH)2HcosnπHZGn+Kυ[(nπH)2]Fnk˜2KhFn
Now multiply Eqs. (D3) and (D4) by Fm and integrate, remembering Eq. (D2):
σn=1NwnDn0HFmFndZ=δm,n=ikn=1NwnDn0HFmUFndZ+ikn=1Nwn0HFmUFndZk2n=1Nbn0HFmFndZ=δm,n+n=1Nwn[(nπH)2]0HFmAυFndZ+2n=1Nwn[(nπH)3]0HFmAυGndZ+n=1Nwn(nπH)40HFmAυFndZk2n=1NwnnπH0HFm(Ah+Aυ)GndZk2n=1Nwn[(nπH)2]0HFm(Ah+Aυ)FndZ+k4n=1Nwn0HFmAhFndZ
σn=1Nbn0HFmFndZ=δm,n=ikn=1Nbn0HFmUFndZn=1Nwn0HFmBFndZ+n=1NbnnπH0HFmKυGndZ+n=1Nbn[(nπH)2]0HFmKυFndZk˜2n=1Nbn0HFmKhFndZ
The summation on the left-hand sides of Eqs. (D5) and (D6) can be done explicitly, resulting in wmDm and bm, respectively. Then Eqs. (D5) and (D6) now become the algebraic eigenvalue problem;
σ[wmbm]=[B11k˜21Dm0HFmBFndZB22][wmbm],
B11=ikDnDm0HFmUFndZ+ik1Dm0HFmUFndZ(nπ/H)2Dm0HFmAυFndZ2(nπ/H)3Dm0HFmAυGndZ+(nπ/H)4Dm0HFmAυFndZk˜2(nπ/H)Dm0HFm(Ah+Aυ)GndZ+k˜2(nπ/H)2Dm0HFm(Ah+Aυ)FndZ+k˜4Dm0HFmAhFndZ,
B22=ik0HFmUFndZ+nπH0HFmKυGndZ(nπH)20HFmKυFndZk˜20HFmKhFndZ.
The eigenvalue is the growth rate σ as usual, but the eigenvector is now composed of the coefficients wn and bn in the expansion (D1).

APPENDIX E

List of Symbols

k

Wave vector

k

Wave vector magnitude

U

Background flow parallel to the wave vector

Bz

Squared buoyancy frequency

ρ

Density

ρ0

Characteristic value of density

ρ¯

Mean density

ρ

Density perturbation

b

Buoyancy

b

Buoyancy perturbation

w

Vertical velocity perturbation

w^

Complex vertical structure function of vertical velocity

b^

Complex vertical structure function of buoyancy

σ

Exponential growth rate of instability

Rib

Bulk Richardson number

Re

Reynolds number

REFERENCES

  • Abramowitz, M., and I. A. Stegun, 1964: Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. Vol. 55. U.S. Government Printing Office, 1046 pp.

    • Crossref
    • Export Citation
  • Berrut, J.-P., and G. Klein, 2014: Recent advances in linear barycentric rational interpolation. J. Comput. Appl. Math., 259, 95107, https://doi.org/10.1016/j.cam.2013.03.044.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Bickley, W., 1941: Formulae for numerical differentiation. Math. Gaz., 25, 1927, https://doi.org/10.1017/S002555720007008X.

  • Fjørtoft, R., 1950: Application of integral theorems in deriving criteria of stability for laminar flows and for the baroclinic circular vortex. Geofys. Publ., 17 (6), 152.

    • Search Google Scholar
    • Export Citation
  • Fornberg, B., and J. Zuev, 2007: The Runge phenomenon and spatially variable shape parameters in RBF interpolation. Comput. Math. Appl., 54, 379398, https://doi.org/10.1016/j.camwa.2007.01.028.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Goldstein, S., 1931: On the stability of superposed streams of fluids of different densities. Proc. Roy. Soc. London, 132A, 524548, https://doi.org/10.1098/rspa.1931.0116.

    • Search Google Scholar
    • Export Citation
  • Gregg, M., E. D’Asaro, J. Riley, and E. Kunze, 2018: Mixing efficiency in the ocean. Annu. Rev. Mar. Sci., 10, 443473, https://doi.org/10.1146/annurev-marine-121916-063643.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Hazel, P., 1972: Numerical studies of the stability of inviscid stratified shear flows. J. Fluid Mech., 51, 3961, https://doi.org/10.1017/S0022112072001065.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Howard, L. N., 1961: Note on a paper of John W. Miles. J. Fluid Mech., 10, 509512, https://doi.org/10.1017/S0022112061000317.

  • Klein, G., and J.-P. Berrut, 2012: Linear rational finite differences from derivatives of barycentric rational interpolants. SIAM J. Numer. Anal., 50, 643656, https://doi.org/10.1137/110827156.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Liu, Z., 2010: Instability of baroclinic tidal flow in a stratified fjord. J. Phys. Oceanogr., 40, 139154, https://doi.org/10.1175/2009JPO4154.1.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Liu, Z., S. A. Thorpe, and W. D. Smyth, 2012: Instability and hydraulics of turbulent stratified shear flows. J. Fluid Mech., 695, 235256, https://doi.org/10.1017/jfm.2012.13.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Maslowe, S. A., 1986: Critical layers in shear flows. Annu. Rev. Fluid Mech., 18, 405432, https://doi.org/10.1146/annurev.fl.18.010186.002201.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Miles, J. W., 1961: On the stability of heterogeneous shear flows. J. Fluid Mech., 10, 496508, https://doi.org/10.1017/S0022112061000305.

  • Putrevu, U., and I. A. Svendsen, 1992: Shear instability of longshore currents: A numerical study. J. Geophys. Res., 97, 72837303, https://doi.org/10.1029/91JC02988.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Rayleigh, L., 1880: On the stability or instability of certain fluid motions. Scientific Papers, Vol. 3, Cambridge University Press, 594–596.

  • Rees, T., and A. Monahan, 2014: A general numerical method for analyzing the linear stability of stratified parallel shear flows. J. Atmos. Oceanic Technol., 31, 27952808, https://doi.org/10.1175/JTECH-D-14-00034.1.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Schlichting, H., and K. Gersten, 2016: Boundary-Layer Theory. Springer, 805 pp.

  • Smyth, W. D., and W. R. Peltier, 1989: The transition between Kelvin–Helmholtz and Holmboe instability: An investigation of the overreflection hypothesis. J. Atmos. Sci., 46, 36983720, https://doi.org/10.1175/1520-0469(1989)046<3698:TTBKAH>2.0.CO;2.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Smyth, W. D., and J. R. Carpenter, 2019: Instability in Geophysical Flows. Cambridge University Press, 338 pp.

    • Crossref
    • Export Citation
  • Smyth, W. D., J. N. Moum, and J. D. Nash, 2011: Narrowband oscillations in the upper equatorial ocean. Part II: Properties of shear instabilities. J. Phys. Oceanogr., 41, 412428, https://doi.org/10.1175/2010JPO4451.1.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Smyth, W. D., J. N. Moum, L. Li, and S. A. Thorpe, 2013: Diurnal shear instability, the descent of the surface shear layer, and the deep cycle of equatorial turbulence. J. Phys. Oceanogr., 43, 24322455, https://doi.org/10.1175/JPO-D-13-089.1.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Sun, C., W. Smyth, and J. Moum, 1998: Dynamic instability of stratified shear flow in the upper equatorial Pacific. J. Geophys. Res., 103, 10 32310 337, https://doi.org/10.1029/98JC00191.

    • Crossref
    • Search Google Scholar
    • Export Citation
  • Taylor, G. I., 1931: Effect of variation in density on the stability of superposed streams of fluid. Proc. Roy. Soc. London, 132A, 499523, https://doi.org/10.1098/rspa.1931.0115.

    • Search Google Scholar
    • Export Citation
  • Trefethen, L. N., 2000: Spectral Methods in MATLAB. Society for Industrial and Applied Mathematics, 165 pp.

    • Crossref
    • Export Citation
Save