Accurate determination of stability characteristics of spatially modulated shear layers

Abstract We present a method for accurately determining the stability characteristics of spatially modulated shear layers. The algorithm can handle arbitrary commensurate states, which are not accessible to classical direct-numerical-simulation-based approaches. It uses spectral discretization of the field equations to handle field modulations and the spectrally accurate immersed boundary conditions method to handle the geometry modulations. The algorithm can deal with pattern interaction effects driven by modulations of different physical origins. Various tests demonstrate that the algorithm delivers spectral accuracy for eigenvalues and eigenfunctions. The algorithm can be easily extended to analyse many sources and patterns of modulation with minimal commitment to the user's time.


Introduction
Flows encountered in nature are exposed to spatial modulations, e.g.roughness represents topography modulations, and temperature patterns represent thermal modulations.Both effects can be used for intentional flow actuation, which, if properly designed, can give the flow new, practically relevant features.It is known that specific grooves lead to a reduction of friction losses in laminar (Mohammadi & Floryan 2013) and turbulent (Walsh 1983;Chen et al. 2016) flows and lead to energy-efficient, low-Reynolds-number chaotic stirring (Gepner & Floryan 2020).It is also known that heating patterns (Hossain, Floryan & Floryan 2012;Floryan & Floryan 2015;Hossain & Floryan 2015), as well as transpiration patterns (Jiao & Floryan 2021a,b), reduce frictional losses in laminar flows.A combination .Wavelength λ x of a disturbed flow system as a function of disturbance wavenumber δ.Red circles and blue triangles provide wavelengths of the complete system modulated with wavenumbers α = 1 and α = 1.1, respectively.Vertical dotted lines identify two possible incommensurate states where the system is aperiodic.
of groove and heating patterns may significantly reduce or increase losses depending on the relative position of both patterns (Hossain & Floryan 2020).Their proper combination may activate the pattern interaction effect (Floryan & Inasawa 2021), generating thermal drift (Abtahi & Floryan 2017;Inasawa, Hara & Floryan 2021).It is further known that selective vibration patterns reduce pressure losses while others increase such losses while increasing flow mixing (Floryan & Haq 2022;Haq & Floryan 2023).
The transition of spatially modulated flows to secondary states restricts the effectiveness of modulations when drag reduction is of interest.This transition may be desired when mixing intensification is of interest.Linear stability theory can determine secondary states' onset conditions (bifurcation points).The current literature shows that flow transitions in complex geometries are captured using direct numerical simulations (DNS), but the limitations of such a strategy are not acknowledged.While the computational cost of simulations is known to be significant, the fundamental limitation lies elsewhere.Natural transition starts with the growth of disturbances, but answering the stability question requires analysis of all possible disturbances.Suppose that the spatial distribution of flow modulations is characterized by wavenumber α and the spatial distribution of flow disturbances is characterized by wavenumber δ.The properties of the complete flow depend on the ratio of these wavenumbers.Integer-valued ratios describe simple commensurate states with either subharmonic or superharmonic properties and can be handled using DNS.Non-integer-valued but rational ratios may lead to more complex commensurate states where a slight change of this ratio results in an order-of-magnitude change in the overall system wavelength, as illustrated for a simple two-wavenumber system in figure 1. Commensurate states form a countable set.Irrational ratios lead to aperiodic systems, forming an uncountable set (the product of an irrational and rational number is irrational).
Variations of flow patterns for a simple case of a shear layer modulated by a spanwise temperature pattern with α = 1 and with different disturbance wavenumbers are illustrated in figure 2. The spanwise wavelength of the flow system involves three sets of primary rolls and one set of secondary rolls on the left, and four sets of primary rolls and one set of secondary rolls on the right.Details of this problem, including the notation, are explained later.
Direct numerical simulation can handle only a restrictive class of commensurate systems (Blancher, Le Guer & El Omari 2015;Gepner & Floryan 2016, 2023) as the size of the computational box is limited by the available memory.Continuous change of the disturbance wavenumber is not possible as it results in very large variations of the computational domain, with the stability results being a function of the size of the computational box (Blancher et al. 2015;Gepner & Floryan 2016, 2023).Re-gridding required by changes in the box length represents another significant difficulty due to labour cost.Irrational wavenumber ratios lead to aperiodic incommensurate states, which require an infinite computational box; such states are not accessible to numerical computations due to the inherent truncation error.One may conclude that DNS is suitable for a detailed exploration of particular cases, as the computational cost can be justified; however, it cannot address the stability question in general and is unsuitable for exploring the entire parameter space required for identifying the most effective modulations from either the drag reduction or mixing intensification points of view.
Identifying the most effective modulations requires systematic analysis, which can be accomplished using a process that starts with identifying stationary states, then determining their stability properties, and culminates with establishing saturation states and their domains of attraction.The most promising configurations can then be studied in detail using DNS.This strategy relies on the availability of an accurate stability algorithm that bypasses the limitations of DNS described above.
Stability analysis requires a formulation capable of dealing with various commensurate systems and an accurate numerical method to solve the disturbance equations.The stability of unmodulated shear layers led to the Orr-Sommerfeld equation, whose spectrally accurate solution was given by Orszag (1971).The formulation of the stability problem, when modulations do not change geometry, was given by Floryan (1997), who represented disturbance quantities as waves with amplitudes modulated by base flow variations.This formulation avoids the need to use large computational boxes and frees stability results from their dependence on the size of the computational box associated with the use of DNS.Cabal, Szumbarski & Floryan (2002) implemented this concept in an algorithm that handles modulations associated with surface topographies.This algorithm relied on domain transformation, mapping a complex channel geometry into a smooth slot and using spectral discretization.It is cumbersome to use as it involves very complex field equations.The present work aims to describe a spectrally accurate algorithm that is flexible enough to accurately and efficiently handle a large class of geometric and physical modulations and provide comparison cases that can be used to verify implementations of this algorithm by others, similar to Orszag (1971).The algorithm uses Fourier expansions in the streamwise and spanwise directions and Chebyshev expansions in the transverse direction coupled with the immersed boundary conditions (IBC) method to handle modulations created by surface topographies.
As the number of possible spatial modulations is uncountable, we present our algorithm in the context of a shear layer modulated by a combination of surface grooves and heating patterns.The latter represents actuations not affecting geometry and are generally simple to implement, and the former represents geometry modulations whose implementation represents a challenge.The generalization of this algorithm to other modulations should not pose a problem as, in all cases, disturbances can be represented as travelling waves with spatially modulated amplitudes.We present detailed convergence studies for selected test problems to provide reliable and accurate comparison data.Special versions of this algorithm were used in the past (Floryan 2002;Hossain & Floryan 2013;Moradi & Floryan 2014;Mohammadi, Moradi & Floryan 2015;Moradi & Floryan 2019), but the underlying concepts are yet to be adequately exposed.
The analysis of the effects of complex topographies requires accurate geometry modelling, as eigenvalues show high sensitivity to minor geometry modifications.Six approaches for handling geometry have been used in the literature.When the groove size is small compared with the overall flow scale, one may argue that it can be accounted for by employing an adequate boundary condition imposed on a smooth surface approximating the actual one (the equivalent surface concept).The implementation details of this concept vary widely (Nye 1969;Sarkar & Prosperetti 1996;Kamrin, Bazant & Stone 2010) but can be reduced to a slip boundary condition with the slip parameter adjusted based on numerical experiments (Rothstein 2010).This concept is unsuitable for stability analysis due to the truncation of flow physics near the corrugated wall.
The second concept takes advantage of small groove amplitude and relies on the boundary conditions transfer procedure, which leads to linearization of the boundary conditions about the mean wall position.Such linearization truncates flow physics as even minor grooves activate nonlinear effects.Including higher-order terms in the transfer procedure (Kamrin et al. 2010) does not resolve this problem (Cabal, Szumbarski & Floryan 2001).The third method of treating surface topography relies on analytic mappings, which transfer a complex flow geometry into a geometrically regular computational domain.Such mapping leads to a complex form of the field equations whose solution is computationally expensive (Cabal et al. 2002).The fourth concept relies on numerically constructed grids.The available grid generators are only second-order accurate (Geuzaine & Remacle 2009) -sufficient for work with typical finite-volume discretizations (Moukalled, Mangani & Darwish 2015) but insufficient for stability problems.Spectral elements bypass this difficulty, but matching neighbouring elements becomes challenging when deformed geometries are considered (Karniadakis & Sherwin 2013;Cantwell et al. 2015).Accurate grid generation methods providing near-spectral accuracy are available (Floryan 1986;Floryan & Zemach 1987, 1993) but are cumbersome.The shortcoming of all the above techniques is laborious grid generation whenever a new groove geometry is considered, especially when carrying out grid convergence studies to verify the results.The cost of grid generation limits the use of these methods when an analysis of a large number of geometries is required but makes them very useful when an in-depth analysis of a small number of geometries is needed.
The fifth method relies on the fictitious boundaries concept, whose origins refer to techniques developed to solve moving boundary problems using fixed grids (Floryan & Rasmussen 1989).Its recent implementations are described in Peskin (1982Peskin ( , 2002)).These methods rely on low-order spatial discretization and local fictitious forces to enforce the no-slip and no-penetration conditions, resulting in truncation of flow physics, which makes them unsuitable for stability analysis.The sixth method combines spectral discretization with the IBC concept.Spectral methods provide the high spatial accuracy required for stability analysis, but their use is limited to regular geometries due to the involvement of global basis functions.This limitation is overcome by the IBC concept (Szumbarski & Floryan 1999), which relies on the spectrally accurate construction of boundary constraints enforcing flow boundary conditions.The programming effort associated with changing the domain geometry is reduced to the specification of Fourier coefficients describing the groove shape.This method has been extended to moving boundary problems (Husain & Floryan 2010), and its applicability has been expanded using the over-constrained formulation (Husain, Szumbarski & Floryan 2009).The algorithm presented in the paper takes advantage of the IBC method.
The presentation of the stability algorithm and demonstration of its accuracy, efficiency and flexibility are organized into seven parts.Section 2 describes a convenient model problem to focus the presentation of the algorithm.Section 3 briefly discusses the determination of stationary states, the first step in the overall analysis.The linear stability analysis is presented in § 4, with § 4.1 describing the modal equations, § 4.2 discussing the discretization of the boundary conditions and § 4.3 describing the complete discretized system.Section 5 briefly discusses the numerical solution to the eigenvalue problem and tracing procedures.The accuracy testing and demonstration of spectral convergence are described in § 6. Section 7 presents an example of an application problem.Section 8 gives a summary of the main conclusions.

Problem formulation
The model problem involves flow between two parallel plates extending to ±∞ in the x and z directions.Distributed heating and surface grooves spatially modulate this flow.We limit this presentation to modulations that are the spanwise x-coordinate functions.The formulation can be easily extended to modulations being functions of the streamwise z coordinate -its details are not presented due to their length.The conduit is oriented in a way where the gravity g works in the negative y-direction (figure 3).The fluid is assumed to be incompressible with the density ρ variations modelled using the Boussinesq approximation; it has thermal conductivity k, specific heat c, thermal diffusivity κ = k/ρc, kinematic viscosity ν, dynamic viscosity μ and thermal expansion coefficient β.The non-dimensional equations of motion are where half of the channel height h is used as length scale, velocity vector where the subscripts L and U refer to the lower and upper plates, respectively, and y L (x) and y U (x) describe groove geometry.
The above system is closed by specifying constraints either in the form of mean pressure gradients in the x and z directions, that is, or in the form of the mean flow rates in the x and z directions, that is, In the absence of grooves and heating, the velocity and pressure fields of the reference flow have the form (2.3e-g) where the Reynolds number is defined as Re = W max h/ν = W max /U v and W max denotes the maximum of the z-velocity component.In the computations, reference flow with a specific Re is selected, and its modified state is determined.
Fourier expansions of the form (2.4a) describe the surface topographies.In the above, Y L (x) and Y U (x) are the shape functions describing plates' topographies satisfying conditions B L and B U are the peak-to-bottom groove amplitudes at the lower and upper plates, respectively, H (n)  L and H (n)  U are the coefficients of the Fourier expansions describing the shape of grooves at the lower and upper plates, respectively, N G is the number of Fourier modes required to describe the geometry, α is the modulation wavenumber and Ω G stands for the phase shift between the upper and lower groove systems.
The plates' temperatures are expressed as Fourier expansions of the form where Θ L (x) and Θ U (x) are the shape functions describing temperature distributions at the lower and upper plates, respectively, satisfying conditions L and θ (n)  U are the coefficients of the Fourier expansions describing the temperature profile at the lower and upper plates, respectively, N L is the number of Fourier modes required to describe the form of heating, Ra uni = |g|βh 3 θ uni /(κν) is the uniform Rayleigh number measuring the intensity of the uniform component of heating, Ra P,L = |g|βh 3 θ LP /(κν) is the lower periodic Rayleigh number measuring the intensity of the lower periodic heating, Ra P,U = |g|βh 3 θ UP /(κν) is the upper periodic Rayleigh number measuring the intensity of the upper periodic heating, θ LP and θ UP are the differences between the maximum and minimum of the lower and upper periodic temperature components, Ω T,L stands for the phase shift between the lower groove and the lower temperature distribution and Ω T,U stands for the phase shift between the lower groove and the upper-temperature distribution.We focus on systems with perfectly tuned heating and groove modulations; these modulations are described by the same wavenumber α.
The stability problem represents an initial-value problem that can be solved using DNS for any initial disturbance velocity and temperature fields set.The Fourier-Chebyshev expansions combined with IBC method provide the required high-accuracy discretization capable of handling complex geometry (Panday & Floryan 2020, 2021).The spectral element method described in Cantwell et al. (2015) represents an alternative, but its existing implementations provide only a low-order temporal discretization.The DNS requires the specification of a computational box containing an integer number of modulation wavelengths and an integer number of disturbance wavelengths.Such a box may have to be very long.Its size limits possible investigations to a few combinations of groove and heating wavelengths (Blancher et al. 2015;Gepner & Floryan 2016, 2023) and prevents analysis of arbitrary disturbances.Here, we pursue a strategy that avoids these difficulties.We start with determining stationary states and follow up with their stability analysis to determine onset conditions for secondary states.
The following section briefly discusses the algorithm required for determining stationary states.This algorithm has been described elsewhere (Panday & Floryan 2020, 2021), so the presentation is limited to the basic concepts required to describe the stability algorithm.

Determination of stationary states
Stationary states are described by the stationary version of (2.1) and (2.2).It is helpful to restate these equations for clarity of the presentation: where subscript B denotes stationary quantities.One needs to add either the pressure gradient constraint ℘ x or the flow rate constraint Q x for the x direction, and either the pressure constraint ℘ z or the flow rate constraint Q z for the z direction.Most of the computations have been carried out with ℘ x = 0 and ℘ z = −2Re, where the Reynolds number is defined as Re = (w B ) max h/ν.
We use spectrally accurate spatial discretization capable of reducing the discretization error to machine accuracy.This discretization relies on Fourier expansions in the z-streamwise and x-spanwise directions and Chebyshev expansions in the y-transverse direction.The algebraic equations are constructed using the Galerkin projection method.The irregularity of the flow domain is handled using the spectrally accurate IBC method, with flow boundary conditions replaced by constraints implemented using the tau method.Details of the algorithm are given in Panday & Floryan (2020).
For simplicity of presentation of the stability algorithm, we express velocity components, pressure and temperature of stationary states in the following form: We have also defined the vorticity vector as and write its components as Fourier expansions of the form (3.5)

Linear stability analysis
The stability analysis begins with the governing equations expressed in terms of the vorticity transport, energy and continuity equations in the following form: Unsteady three-dimensional disturbances are superposed on the stationary flow in the form where subscript D denotes disturbance quantities.The flow quantities (4.2) are substituted into (4.1), the mean parts are subtracted and the equations are linearized, yielding the linear disturbance equations of the form The homogeneous boundary conditions of the form VD (x, y, z, t) = 0, θ D (x, y, z, t) = 0 at y = y L (x) and y = y U (x) (4.4a,b) complete the formulation.The solution of (4.3) can be written as a travelling wave with modulated amplitude, i.e.
[ VD , ωD where δ and μ are the real wavenumbers in the x and z directions, respectively, representing components of the disturbance wavevector, σ = σ r + iσ i is the complex frequency with σ i describing the rate of growth of disturbances and σ r describing their frequency and c.c. stands for the complex conjugate.Functions ḠD (x, y), ΩD (x, y) and κ D (x, y) are the x-periodic amplitude functions accounting for the groove and heating-induced modulations.Substituting (4.5) into (4.3)leads to partial differential equations for the amplitude functions.Since these functions are x-periodic, they can be expressed in terms of the Fourier expansions of the form A combination of (4.5) and (4.6) provides the final expressions for VD , ωD and θ D of the form The above formulation provides means for analysis of the effects of continuous variations of the disturbance wavenumbers δ and μ for a specific modulation wavenumber α, i.e. requires a computational box of the same size as the box used to determine the stationary state.Substitution of (4.7) into (4.3)leads to (2N D + 1) ordinary differential equations (ODEs) for the unknown modal functions for each partial differential equation in the above system.Separation of Fourier modes and extensive rearrangements provide an explicit form of these ODEs expressed in terms of (4.9) One needs to extract boundary conditions for different Fourier modes.This process is complex due to the irregularity of the flow domain, which provides coupling between different modes.We provide a detailed explanation in § 4.2.
In the limit of no modulations, the stationary state is reduced to mode zero of w B and θ B .The disturbance wavenumber δ in the x direction is taken as α, and the system is reduced after rearranging indices t m = (m + 1)α = Jα to the following form: where k 2 j = (Jα) 2 + μ 2 and |J| = 0, 1, 2, 3, . . ., (2N D + 1).Equation

Discretization of the modal equations
Determination of the amplitude functions requires a numerical solution of a system of ODEs described in the previous section.The modal functions are to be represented in terms of Chebyshev expansions.Our preference for the standard definition of the Chebyshev polynomials requires a preliminary mapping of the solution domain y , where y t and y b identify locations of extremities of the upper and lower walls, respectively.The reader may note that this step is not required when boundary modulations are not present.After transformation, the locations of the walls are specified as It is convenient to cast them in a shorter form for simplicity of the presentation, i.e.
Equation (4.8) expressed in terms of ŷ assumes the following form: (4.12b) where all operators appearing in (4.12) are defined in Appendix B. System (4.12) has variable coefficients involving stationary state -in the first step of the numerical solution, these coefficients are represented as Chebyshev expansions of the form where and G n w,r are known.In the second step, the unknown modal functions are expressed in terms of the Chebyshev expansions of the form where and G m k,θ are unknown and are to be determined.Substitution of (4.13) and (4.14) into (4.12) and application of the Galerkin projection method result, after a rather lengthy algebra, in a system of algebraic equations for these coefficients of the following form: where all operators appearing in (4.15) are defined in Appendix C.

Discretization of boundary conditions
The discretization of boundary conditions without geometry modulations leads to a standard form of boundary conditions for each modal function.Modulations create coupling between the modal functions -this coupling is different from the coupling provided by the modulations of the field equations discussed previously.The form of these conditions is presented below.
Thermal, no-slip and no-penetration boundary conditions (4.4) at the lower wall are restated as To be consistent with the modal equations, they must be expressed using the vertical velocity and vorticity components.Their form is given below: Substitution of the Chebyshev expansion (4.14) into (4.17)results in The above boundary relations involve values of Chebyshev polynomials and their derivatives at the grooved wall.These values represent periodic functions of the x coordinate and, thus, can be expressed in terms of Fourier expansions as follows: (4.19a,b) Appendix D explains the determination of coefficients w L and d L .Substitution of (4.19) into (4.18),extraction of Fourier modes and retention of the first N D modes result in the boundary relations of the form where truncation |m − p| ≤ N D is needed to maintain consistency with the modal equations.Increasing the number of retained boundary relations is possible as it improves spatial accuracy but leads to over-constrained formulation (Husain et al. 2009).A similar process leads to boundary relations on the upper wall of the form Relations (4.20) and (4.21) provide intermodal coupling associated with the grooves.

The linear algebraic system
We include boundary relations in the system (4.15) using the Tau method (Canuto et al. 1992), i.e. equations corresponding to the highest-order Chebyshev polynomials in each of (4.15) are replaced with the boundary relations (4.20) and (4.21).The linear system used for computations has a simple form: where Λ represents the coefficient matrix and x identifies the vector of unknowns.The structure of the coefficient matrix is illustrated in figure 4(a), where the large blocks identified by green lines correspond to different sets of unknowns (i.e.v, η, θ) -the off-diagonal blocks provide coupling between these unknowns.The structure of a single block for v, displayed in figure 4(b), illustrates couplings between Fourier modes with the diagonal subblocks corresponding to a specific modal function and the off-diagonal subblocks providing couplings between the modes.Rows with green shading identify positions of boundary relations that provide additional intermodal coupling.

Method of solution
A homogeneous system (4.22) has a non-trivial solution only for certain combinations of parameters that are interrelated through a dispersion relation of the form (5.1) All but two real quantities can be selected arbitrarily.Determining these two quantities requires finding zeros of (5.1).The explicit form of (5.1) is not given.The dispersion relation can be posed in various ways for computational purposes.The first form involves posing the system as an algebraic eigenvalue problem for σ in the form where E denotes the eigenvector and A and B are the coefficient matrices.The σ -spectrum can be computed using a general eigenvalue solver (Moler 2004).This process can be computationally expensive, and the computed spectrum may suffer from accuracy problems as our stability problem leads to large algebraic systems.The cost can be reduced by evaluating only a spectrum segment using the Arnoldi method (Saad 2003).All these methods are suitable for locating eigenvalues of interest but unsuitable for their tracing through parameter space.
Local solutions are more computationally efficient and accurate but typically produce just one eigenvalue (Moler 2004).The first method used in this study, the inverse iterations method (Demmel 1997), is suitable for tracing complex frequencies.One starts with an initial approximation for the eigenpair (E p , σ p ) = (E (0) , σ 0 ) and improve it iteratively.The iteration process uses the following relation: (5.3) which starts with b = 0 and determines the next approximation for the eigenpair as (5.4) where the asterisk denotes the complex conjugate transpose.If σ p is the eigenvalue closest to σ 0 , then E (b) converges to E p .The initial approximation E (0) must be consistent with boundary conditions.The Newton-Raphson method posed either in terms of one complex variable or in terms of two real variables offers various alternatives.Search for zeros of the determinant of Λ is one of them.This method is ineffective as the determinant varies by several orders of magnitude as a function of the unknown eigenvalue, which leads to numerical difficulties.The alternative approach involves converting the homogeneous problem (4.22) into an inhomogeneous one.To do so, one replaces a homogeneous boundary condition with an inhomogeneous condition, making the system inhomogeneous and easy to solve.The omitted homogeneous boundary condition provides a test verifying if the correct eigenvalue has been selected.This process involves a search for zero of the omitted boundary condition.A simple example of this process in the case of a smooth surface consists of replacing the homogeneous boundary condition for Dv (1) = 0 at one of the walls with an inhomogeneous condition D 2 v (1) = 1, which, at the same time, imposes the normalization condition.In general, Dv (1) is not zero, so one must implement the Newton-Raphson search process to find eigenvalues that bring this condition to zero.Any boundary relation can be used as the test condition.A good initial guess is required to achieve convergence.

Testing of the algorithm
The main feature of the algorithm is its high (spectral) accuracy, ability to handle arbitrary temperature and groove patterns very efficiently and ability to handle arbitrary disturbance wavenumbers for any modulation wavenumber.The stationary states were determined using the algorithm described in Panday & Floryan (2020).In the tests, the stationary solutions were determined with machine accuracy to eliminate any numerical error in the determinations of these solutions, which may affect the accuracy of stability results.All the tests reported here have been carried out with zero-pressure-gradient constraints in the x direction.The surface and thermal patterns were of the form The tests dealt with (i) two-dimensional disturbances (δ = 0) and (ii) three-dimensional disturbances (δ / = 0, μ / = 0).The algorithm reproduced results for special limiting cases available in the literature (Rayleigh 1916;Orszag 1971;Schmid & Henningson 2001;Hossain & Floryan 2013;Moradi & Floryan 2014, 2019;Mohammadi et al. 2015).
We provide detailed testing and demonstration of the accuracy of evaluating stability characteristics for flows through a slot formed by grooved walls exposed to periodic heating.The typical spectrum is presented in figure 5, with its width depending on the number of Fourier modes (N D ) used in the computation.There is one unstable eigenvalue for these conditions (σ r + iσ i ) = (458.6385,7.6468), which connects to the Squire spectrum in the limit of no modulations.
The accuracy of the determination of the unstable eigenvalue depends on the number of Fourier modes and Chebyshev polynomials used in the computations.In this testing, the stationary state was determined with machine accuracy, so its accuracy does not affect the stability results.We define error σ i in the determination of the eigenvalue as where σ i stands for the computed imaginary part of the eigenvalue and σ i,ref is its actual value.Since the actual eigenvalue is not known, σ i,ref has been determined with machine accuracy, which, for the conditions in this test, required the use of N D = 25 Fourier modes and N T = 80 Chebyshev polynomials.Figure 6 illustrates variations of σ i as a function of the number of Fourier modes N D used in the computations.These tests used N T = 80 Chebyshev polynomials to reduce this part of discretization error to the machine level.Results for two-dimensional travelling waves show an exponential decrease of the error as the number of Fourier modes increases, demonstrating the spectral accuracy of the algorithm (figure 6a).The absolute value of the error increases with an increase in the heating intensity; however, the character of its exponential decrease is not affected.A similar exponential reduction of error can be observed for the three-dimensional disturbances in figure 6(b).These results indicate that a near machine accuracy can be achieved using N D = 15 Fourier modes.
Results displayed in figure 7 illustrate variations of σ i as a function of the number N T of Chebyshev polynomials used in the computations.These computations used N D = 20 Fourier modes to reduce the error associated with this part of discretization to the machine level.The results demonstrate an exponential decrease in the error as the number of Chebyshev polynomials increases.They also illustrate the need to use more Chebyshev polynomials in the case of three-dimensional waves to achieve the same absolute accuracy as in the case of two-dimensional waves.In most cases, 40 Chebyshev polynomials were sufficient to achieve machine accuracy.
The IBC method raises the question of how well the homogeneous boundary conditions are enforced at the grooved walls.Since the expected values of the disturbance velocity components and the disturbance temperature are zero, these quantities evaluated at the boundaries represent the absolute errors.They vary in an oscillatory manner along the wall, as illustrated in figure 8.The relative position of the groove and heating patterns determines the location of the maximum error, but the absolute value of the error is never higher than 10 −10 .To quantify the boundary error and its variations as a function of the number of Fourier modes, we measured this error using the norm defined as BE = max(q)| y L , (6.3) where q is the flow quantity of interest.Eigenfunctions used in (6.3) were normalized by bringing their Euclidean norm defined as to unity.Here E is an eigenvector that includes each disturbance quantity appearing in (6.3) with length 3N T (2N D + 1).Results displayed in figure 9 demonstrate that BE decreases exponentially with N D .The convergence rate varies between different disturbance quantities, but all have exponential forms.
Another way to demonstrate the spectral convergence of the algorithm is to determine variations of the Chebyshev norm defined as where q stands for the modal function of choice.Figure 10 illustrates variations of this norm with an increase of the mode number m for two-dimensional and three-dimensional disturbances.These results confirm the exponential reduction of the Chebyshev norm as the mode number increases for all the quantities.All the tests reported in this section validate the spectral accuracy of the algorithm.The algorithm has a significant advantage in efficiently handling variations of geometry and heating patterns compared with the grid-based approaches.Its gridless nature makes it suitable for a parametric study involving the analysis of any parameter that defines geometric and heating patterns.Mesh construction and grid independence studies required by analyses using the conventional grid methods are very labour-and time-expensive.
Tables 1 and 2 provide numerical values illustrating the convergence of the test eigenvalue determined using different numbers of Chebyshev polynomials and Fourier modes.The comparison dataset uses a form similar to that of Orszag (1971), which others can use for verification of the accuracy of their results.

Example of an application problem
This section discusses an application problem selected to illustrate the capabilities of the proposed algorithm.This problem cannot be convincingly analysed using the DNS-type methodology.
Consider isothermal pressure-gradient-driven flow in a channel modified by longitudinal grooves.This flow is subject to a new type of instability, which, for simplicity, we refer to as Floryan's instability (Mohammadi et al. 2015).The presence of longitudinal grooves creates spanwise gradients of the streamwise velocity, which activate inflection-point-type inviscid instability.The critical Reynolds number can be as low as O(10) if grooves with large enough amplitudes are used (Gepner & Floryan 2020).The instability creates waves with phase speed near the maximum flow velocity, leading to laminar chaos in the saturation state (Gepner & Floryan 2020).Use of grooves with amplitude B L = 0.1 results in a critical Reynolds number of about 2600 (see figure 11a).If one adds heating with amplitude Ra P,L = 700 and wavenumber matching the groove wavenumber, and places this heating in such a manner so that hot spots overlap with the groove peaks, e.g.Ω T,L = 0, the critical Reynolds number is reduced to about 375 (see figure 11b).Table 3. Spanwise extent W of the computational domain required for the use of the DNS approach for the heating wavenumber α = 1 and selected disturbance wavenumbers δ.
It is thus possible to achieve low critical Re with much smaller groove amplitudes.The use of heating patterns is attractive as heating can be turned on and off as required, and its implementation is likely more economically effective as the creation of special conduit geometries is avoided.Figure 12(a) displays the spectrum for Re = 400, which shows the presence of a single unstable eigenvalue.Figure 12(b) illustrates variations in the amplification rate σ i as a function of the streamwise wavenumber δ, which is essential for determining δ giving the largest amplification, this step being required in a stability analysis.Table 3 gives spanwise size W of the computational domain that needs to be used for DNS to reproduce some of these results -this table illustrates difficulties associated with using DNS.

Summary
An algorithm suitable for analysing the stability of spatially modulated shear layers has been proposed and described in the context of modulations induced by surface topography and modulations created by heating patterns.The former represents geometry modulations, while the latter represents field modulations.The algorithm can be easily extended to other forms of modulations.Spatial modulation problems are characterized by the formation of commensurate and incommensurate states arising out of the need to analyse all possible disturbances, and these states are not accessible to classical DNS-based approaches.The proposed algorithm bypasses this problem by treating disturbances as modulated waves and focusing on determining the amplitude functions.This determination relies on spatial discretization based on Fourier expansions in the streamwise and spanwise directions and Chebyshev expansions in the wall-normal direction.The Galerkin projection method has been used to develop the linear system of algebraic equations for the expansion coefficients.The homogeneous boundary conditions to be imposed along the corrugated walls have been replaced by constraints (the IBC method) included in the complete system of linear equations using the Tau concept.
The resulting eigenvalue problem was solved using standard methods.Numerous tests demonstrated that the algorithm provides spectral accuracy.Detailed comparison tables for selected test cases have been provided, and the eigenvalue accuracy has been demonstrated.An example of a physical problem was presented to illustrate the power and effectiveness of the proposed method.The proposed algorithm is gridless and requires minimal user time to adapt to new geometries of the bounding walls and new heating patterns.It bypasses the need for cumbersome grid convergence studies to verify grid-based methods' accuracy.The number of Fourier modes and Chebyshev polynomials used in the computations sets the absolute accuracy.
Figure1.Wavelength λ x of a disturbed flow system as a function of disturbance wavenumber δ.Red circles and blue triangles provide wavelengths of the complete system modulated with wavenumbers α = 1 and α = 1.1, respectively.Vertical dotted lines identify two possible incommensurate states where the system is aperiodic.

Figure 2 .
Figure 2. (a,b) Primary rolls for Ra P,L = |ḡ|βh 3 θ LP /(κν) = 1000, Re = (w B ) max h/ν = 2000 when the shear layer flowing in the z direction is subject to the x modulations of the lower wall temperature with wavenumber α = 1.These plots extend over one flow wavelength in the x direction.Colours illustrate the z-velocity component, while the solid black lines illustrate the vector lines in the (x, y) plane.(c,d) Instantaneous iso-surfaces of the disturbance z-velocity component w D over one flow wavelength in the x direction.Iso-surfaces shown correspond to (c) w D = (2.23,−2.23) and (d) w D = (1.8,−1.8).The z component of the disturbance wavevector is equal to 1 in both panels; the spanwise component is 2 3 in (c) and 1 2 in (d).Red arrows show the locations of hot spots at the lower wall.

Figure 3 .
Figure 3. Schematic diagram of the flow system.Red and blue colours identify hot and cold sections of the walls.
.8c) where all operators used in the above expressions are defined in Appendix A. The right-hand sides provide modulation-imposed coupling between different modes.The coupling terms contain indices m − n with the relevant terms truncated for |m − n| ≥ N D .The boundary conditions can be written asN D m=−N D [g m u , g m v , g m w , g mθ ] e i mαx = 0 at y = y L (x) and y = y U (x).

v
(4.10a) is the Orr-Sommerfeld operator with thermal coupling term −Pr −1 k 2 is the coupling term with the Orr-Sommerfeld operator, and (4.10c) is the energy equation with Df 0 θ g J v providing coupling with the Orr-Sommerfeld operator.

Figure 4 .
Figure 4. (a) Structure of the coefficient matrix Λ for N D = 2 and N T = 10.Green lines identify off-diagonal blocks providing coupling between different unknowns.(b) Structure of a single block with green shading identifying entries corresponding to boundary relations.Black symbols mark the non-zero elements.

Figure 5 .
Figure 5. (a) Spectrum for flow in a channel with longitudinal grooves exposed to spanwise periodic heating with α = 1, δ = 0.8, μ = 0.5, Ra P,L = 500, Ω T,L = π/2, B L = 0.1, B U = 0, Re = 1000.Here N D = 10 Fourier modes and N T = 120 Chebyshev polynomials were used in the test.The leading mode is identified with a square box.(b) Variations of σ i of the leading mode as a function of Ra P,L for grooved surfaces with B L = 0.2 (black colour) with Ra P,L decreasing to zero and then as a function of B L for isothermal surface (blue colour) with B L decreasing to zero.

Figure 9 .
Figure 9. Variations of the boundary errors as functions of the number N D of Fourier modes used in the computations for α = 1, B L = 0.07, Re = 1000, Ra P,L = 100, μ = 0.4 and (a) δ = 0 and (b) δ = 0.4.All results were obtained with N T = 80 Chebyshev polynomials.

M
and the number of Chebyshev polynomials N T used in the computations for an isothermal system with Ra pL = 0, B L =
Figure 12.(a) Spectrum for flow in a grooved channel exposed to periodic heating for α = 1, Ra P,L = 700, Re = 400, Ω T,L = 0, B L = 0.1, B U = 0 and δ = 1, μ = 1 determined using N D = 10 Fourier modes and N T = 120 Chebyshev polynomials.(b) Variation of the amplification rate σ i as a function of δ for μ = 1 with other conditions as in (a).

=
iμΓ Df n u − it m−n Γ Df n w + inα f n w Γ D − inαΓ Df n w , v Γ 2 D2 − μt m f n u Γ D + (n 2 α 2 − μ 2 )f n w Γ D), −n t m f n u − it m f n v Γ D + μt m−n f n w ), r T j , T r DT k − iμΓ G n u,r T j , DT r T k + it m−n Γ G n w,r T j , DT r T k − inαΓ G n w,r T j , T r DT k + inαΓ G n w,r T j , DT r T k + t m−n μΓ 2 k 2 m−n G n v,r T j , T r D2 T k + it m−n μt l Γ k 2 m−n G n u,r T j , T r DT k − it m−n n 2 α 2 Γ T j , T r DT k + it m−n μ 2 Γ T j , T r DT k , (C7)

Table 1 .
Variations of the leading eigenvalue σ as a function of the number of Fourier modes N

Table 2 .
Variations of the leading eigenvalue σ as a function of the number of Fourier modes N M and the number of Chebyshev polynomials N T used in the computations for a non-isothermal system with Re = 1000, Ra pL = 500, B L