Intense reynolds-stress events in turbulent ducts

The aim of the present work is to investigate the role of intense Reynolds shear-stress events in the generation of the secondary flow in turbulent ducts. We consider the connected regions of flow where the product of the instantaneous fluctuations of two velocity components is higher than a threshold based on the long-time turbulence statistics, in the spirit of the three-dimensional quadrant analysis proposed by Lozano-Durán et al. (J. Fluid Mech., vol. 694, 2012, pp. 100–130). We examine both the geometrical properties of these structures and their contribution to the mean in-plane velocity components, and we perfom a comparison with turbulent channel flow at similar Reynolds number. The contribution to a certain mean quantity is defined as the ensemble average over the detected coherent structures, weighted with their own occupied volume fraction. In the core region of the duct, the contribution of intense events to the wall-normal component of the mean velocity is in very good agreement with that in the channel, despite the presence of the secondary flow in the former. Additionally, the shapes of the three-dimensional objects do not differ significantly in both flows. In the corner region of the duct, the proximity of the walls affects both the geometrical properties of the coherent structures and the contribution to the mean component of the vertical velocity. However, such contribution is less relevant than that of the complementary portion of the flow not included in such objects. Our results show that strong Reynolds shear-stress events are affected by the presence of a corner but, despite the important role of these structures in the dynamics of wall-bounded turbulent flows, their contribution to the secondary flow is relatively low, both in the core and in the corner.


Introduction
Turbulent flows through ducts with square and rectangular crosssections exhibit secondary flow of Prandtl's second kind (Prandtl, 1926), which consists of non-vanishing values of the mean cross-stream velocity components. The secondary flows of first and second kinds differ as to the latter is only present in turbulent flows and it typically has a lower intensity, which amounts to few percentage points of the stream-wise mean velocity. This phenomenon has a multiscale nature, which is apparent in its scaling properties. In fact, in the square duct, the mean cross-stream velocity components in the proximity of the corner collapse for different Reynolds numbers if the velocity is expressed in outer units and the distance from the wall in inner units. However, in the proximity of the centre, the velocity profiles collapse when velocity and wall-distance are expressed in outer units (Gavrilakis, 1992;Pirozzoli et al., 2018). In rectangular ducts, the asymmetric development of the boundary layers attached to sides of different lengths leads to a more complex scenario, and the scaling of the near-corner pattern is not obvious .
Several studies have investigated the origin of the secondary flow of Prandtl's second kind. Einstein and Li (1958) applied the Reynolds decomposition to the equation of the mean stream-wise vorticity. They pointed out that the presence of the secondary flow is connected to the in-plane derivatives of the Reynolds-stress terms that only include the cross-stream velocity components. Huser and Biringen (1993) performed direct numerical simulations (DNS) at average friction Reynolds numbers up to Re * τ = 300, defined as Re * τ = hu * τ /h, where h is the half height of the duct, ν is the kinematic viscosity and u * τ the friction velocity computed using the streamwise pressure gradient dP/dx, i.e. u * τ = ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅ ̅ − (h/2)(dP/dx) √ and employed a generalized quadrant analysis to quantify the contribution of intense Reynolds-stress events to the Reynolds-stress components (Wallace et al., 1972;Willmarth and Lu, 1972). They stated that "the mean secondary flow […] can be explained by the preferred location of an ejection structure near the corner and the interaction between bursts from the two intersecting walls". Pinelli et al. (2010) performed DNS for several Reynolds numbers in the range of Re * τ = 80 − 225 to investigate the relation between secondary flow and near-wall structures. They observed that the presence of two perpendicular walls determines a preferential location of a high-speed streak at a distance of 50 + from the corner, unveiling a connection between buffer-layers structures and the scaling properties of the mean streamwise vorticity. Note that the superscript (⋯) + denotes here viscous units defined via the viscous length l * = ν/u * τ . More recently, Modesti et al. (2018), using data at Reynolds numbers up to Re * τ = 1,000, employed a generalized form of the FIK identity (Fukagata et al., 2002) to study the role of the secondary flow and performed a numerical experiment, consisting of the artificial suppression of the secondary flow. They confirmed the intuitive hypothesis that the role of the secondary flow is to compensate for the momentum deficit in the proximity of the corner, and they observed that suppressing the secondary flow actually results in a poorer agreement with the canonical log law of the velocity profiles. Lastly, Gavrilakis (2019) performed DNS in the range Re * τ = 157 − 861, carefully assessing the Reynolds number dependence of the secondary flow. He pointed out that the secondary flow is not fully developed up to Re * τ ≈ 300. Furthermore, because of the presence of an inflectional point in the mean streamwise velocity, he observed that an instability mechanism plays a role in generating vortices in the corner region of the duct.
The present paper aims at characterising coherent structures in turbulent flows through duct with square and rectangular cross-section at two different Reynolds numbers, namely Re τ = 180 and Re τ = 360.
Note that Re τ = hu τ /ν, where u τ = ̅̅̅̅̅̅̅̅̅̅ τ w /ρ √ is computed using the wallshear stress at the centre-plane, τ w , and fluid density, ρ. The duct dataset is part of that presented by Vinuesa et al. (2018), who performed DNSs of rectangular ducts with aspect ratio in the range AR = 1-14. We defined the structures as intense Reynolds-stress events in the spirit of the quadrant analysis, following the same procedure already employed by Lozano-Durán et al. (2012) in the study of turbulent channel flow. We focus on the geometrical properties of the structures and on their fractional contributions to the mean velocity profiles, to provide additional information on the effects of the perpendicular walls on turbulence and the relation between these structures and the secondary flow. The paper is organised as follows: in Section 2 we describe the numerical simulation, the properties of the mean fields and the structureidentification technique; in Sections 3 and 4 we examine the geometrical properties and the fractional contribution to the secondary flow of the structures, respectively; finally, in Section 5 we present our conclusions.

Methodology
In this section, we describe the data-set examined in the present work, we summarize the properties of the mean flow in square and rectangular duct, and we present the structure-detection procedure.

Numerical database
In this study, we consider turbulent flows through a square duct and a rectangular duct with an aspect ratio AR = 3 (defined as AR = l a /l b , where l a and l b are the lengths of the horizontal and the vertical sides, respectively), and friction Reynolds numbers at the centre-plane of Re τ = 180 and 360. We employed an additional data-set of turbulent channel flow at same Re τ for comparison. For both channel and duct, we employ a reference system where x, y and z correspond to the streamwise, vertical and spanwise directions, respectively. The three components of the instantaneous velocity in these directions are u, v and w, while their mean values are U, V and W.
The simulations were carried out using the numerical code Nek5000 developed by Fisher et al. (2008). In these simulations, the domain is divided into "spectral elements", and the solution is expressed in terms of a nodal base of Legendre polynomials defined on Gauss-Lobatto-Legendre (GLL) quadrature points within each element. Polynomials of the 11 th order are used in this case. The spatial derivatives of the incompressible Navier-Stokes equation are discretized following the P N − P N− 2 formulation by Patera (1984), while the time derivatives are discretized using a backward scheme for the viscous term and an extrapolation scheme for the non-linear terms. Both schemes for the time derivative are of the third order. The domain length for the duct simulations is 25 h.
The channel-flow simulations are performed by integrating the incompressible Navier-Stokes equations in the form of evolution equations for the wall-normal vorticity and for the Laplacian of the wallnormal velocity, as in Ref. Kim et al. (1987). The spatial discretization is dealiased Fourier in the two wall-parallel directions and Chebychev polynomials in y. Time stepping is performed with the third-order semiimplicit Runge-Kutta as in Ref. Moser et al. (1999). Both channels have computational domains in the streamwise and spanwise directions large enough to ensure that the largest structures of the flow are reasonably well represented. The domain size for the channel simulations is 12πh × 2h × 4πh. Fig. 1 shows the mean of the vertical and spanwise components of the velocity, V and W respectively, for the square and the rectangular duct. Here the bulk velocity and the half width of the duct h are employed to scale the velocity components and the spatial coordinates, respectively, and the origin of the reference frame is located at the bottom left corner with respect to the main flow direction. In order to identify the region of the flow for which it is meaningful to compare the different cases, we examine in detail the Reynolds-number and geometry effects on the secondary flow. We focus on the position of local extrema of the mean cross-stream components of the velocity in the bottom-left quadrant of the duct. In the square duct, the coordinates of the first maximum (y + ≃ 77; z + = 11) and of the first minimum (y + = 50; z + = 50) of V scale in inner units (x, y and z are the streamwise, wall-normal and spanwise coordinates). The fact that the secondary flow is still evolving in this range of Reynolds numbers is manifested in the position of the second maximum of V, which does not scale either in inner or in outer units. Furthermore, a third maximum arises at Re τ = 360 at the centreplane, which is not present at Re τ = 180. In the rectangular duct the secondary flow extends through the domain in the horizontal direction and Reynolds-number and geometry effects are clearly distinguishable, although the geometry has also an impact on the scaling properties of the secondary flow. In fact, the corner circulation is confined closer to the wall when the Reynolds number increases, as in the square duct, but the location of the extrema of V and W does not scale in inner units in the rectangular duct. For instance, the location of the first maximum of V is (y + = 71; z + = 11) for Re τ = 180, but (y + = 90; z + = 13) for Re τ = 360. In addition, in the rectangular duct V and W become qualitatively different. The maximum of V associated with the core circulation is located at a distance from the vertical wall which is larger than the width of the square duct and other local maxima appear while approaching the vertical centre-plane. However, V is positive almost always in the core region, and therefore the flow moves on average from the wall to the horizontal centre-plane. On the other hand, W in the rectangular duct exhibits a change of sign along the horizontal centre-plane, followed by a (negative) local minimum, and it approaches again 0 at the centre of the duct (y = 1; z = 3) from a negative value. Therefore, along the horizontal axis the flow moves from the wall toward the centre up to a certain distance from the vertical wall, but in the opposite direction at farther distance. Note that in the square duct V (or W) is always positive along the centre-plane and gradually decreases to become 0 at the centre (y = 1; z = 1). It is also interesting to observe that the position of the change of sign (y = 1; z ≃ 0.5) and of the local minimum (y = 1; z ≃ 1.1) do not depend on the Reynolds number, despite the fact that the evolution that W exhibits from Re τ = 180 to Re τ = 360 in the spanwise portion of the domain with z < 0.5 is similar to that in the corresponding half of the domain in the square duct.
Since the structure analysis is performed as a post-processing step, it is key to examine a large enough number of flow fields to reduce the statistical uncertainty. In particular, turbulent ducts exhibit a slow convergence because of the secondary flow (Vinuesa et al., 2016;Vidal et al., 2017) and require hundreds of fields for the results to be meaningful (a convergence assessment to quantify the statistical uncertainty of our results is provided in the appendix). The data-set considered in the present study is summarized in Table 1.

Structure identification and percolation analysis
The coherent structures examined in the present paper are defined as connected regions of the domain where a specific condition is fulfilled. In particular, we study intense Reynolds-stress events, with the procedure introduced by Lozano- Durán et al. (2012) for channel flow, who extended the classic quadrant analysis Wallace et al. (1972) to three dimensions. These authors defined as "structures" the regions of the domain where: Table 1 Simulation parameters for the considered cases. The resolution is indicated in terms of the maximum and minimum grid spacing in inner units. The bulk Reynolds number is defined as Re b = hU b /ν, where h is the half-height of the duct, U b is the bulk velocity and ν is the kinematic viscosity. Note that "N.P." is number of grid points, and "N.F." number of fields used in the analysis.
In this expression, u and v are the fluctuations of the spanwise and vertical velocity components, respectively, u rms and v rms are the corresponding root-mean-squares, and H uv is a numerical value (called "hyperbolic hole"). In the duct, the scaling term of the threshold, u rms v rms , is a two-dimensional field, which has its highest values in the proximity of the vertical walls.
The percolation analysis quantifies the effects of varying the threshold H uv (Fig. 2, right). For small values of H uv , few very large structures occupy most the domain, and the ratio between the probability for a single grid point to belong to the largest structures (denoted by P max ), and the probability of belonging to any structures (denoted by P all ), is P max /P all ≈ 1. As H uv increases, the identified coherent structures start to break into smaller ones and, at a certain value of H uv , P max /P all suddenly decreases (percolation crisis). A further increase of H uv will eventually lead to a modest increase of P max /P all , when only a few, small and very intense events still satisfy condition (1). The differences in the percolation diagrams are probably due in part to the geometry of the domain and in part to structural differences in the turbulence fluctuations but we do not investigate these effects in the present work. We focus on results obtained for H uv = 2, a value close to the percolation crisis for all the cases, which guarantees to isolate the intense events in the domain. For this value of H uv , the portion of the volume occupied by the structures is ≈ 7% of the total volume for all the cases. Due to the presence of the vertical walls, we also consider turbulent structures defined as regions of the domain where: |uw| > H uw u rms w rms . (2) Note that uw events are exactly equivalent to uv in the square duct. The percolation analysis for uw in the rectangular duct gives very similar results to that for uv, and it is not shown.

Geometrical properties of the coherent structures
In turbulent channel flow, Lozano-Durán et al. (2012) found that it is possible to identify three different families of uv structures, which we will denote as follows: wall-attached objects (WA), whose centre of mass is located in a near-wall region below y + ≈ 20; detached objects (D), located far from the wall; and tall wall-attached (TWA), which extend from the region near the wall up to the core of the channel, sometimes being connected with both walls. Note that the centre of mass of the structures is defined as: where N is the number of connected grid points in the structure, V i the volume corresponding to each grid point, x = (x i ,y i ,z i )is the position of the point and V is the total volume of the structure. In the duct, the presence of vertical walls leads to a more complex scenario. We classify uv structures in the duct into seven different families making a distinction between objects attached to one wall or two perpendicular walls. The boundaries of the classification regions are illustrated in Fig. 3 (bottom left) for the square duct at Re τ = 180. The classification is based on the location of centre of mass of the structures (y cm , z cm ), and on the points belonging to the structure which are closer to the walls, denoted y min and z min for the horizontal and the vertical walls, respectively. The families under study in the duct are defined as follows: detached structures (D) are entirely located far from the walls (y + min > 20 and z + min > 20); wall-attached structures (WA) have the centre of mass in the regions near horizontal walls (y + cm < 20); sideattached structures (SA) have the centre of mass in the regions near the vertical walls (z + cm < 20); tall-wall attached structures (TWA) have the centre of mass far from the horizontal walls but are partly contained in the corresponding near-wall region (y + min < 20); tall-side attached structures (TSA) are analogous to TWA for the vertical wall (z + min < 20); corner attached structures (CA) have the centre of mass in the near corner region (y + cm < 20 and z + cm < 20) and tall-corner attached structures (TCA), which are partially embedded in both a near-vertical wall and a near-horizontal wall (y + min < 20 and z + min < 20), but have the centre of mass far from the walls. Note that the TCA structures do not necessary enter in the near-corner region, but are usually long and complex objects with some branches entering the near-wall regions of two adjacent perpendicular walls.
In a preliminary study (Atzori et al., 2018), we compared the geometrical properties of the structures at three different spanwise locations and they employed the optimal value of H uv which maximises the number of detected structures. We concluded that the WA and SA structures in the duct exhibit features similar to those of the WA structures in the channel. On the other hand, D objects closer to the vertical walls in the duct tend to be narrower than D objects in the channel, and the same is true for TWA structures closer to the vertical walls. It has also been observed that, in the duct, if TWA objects are considered together with TCA, they have similar geometrical properties as those of the tall wall-attached objects (TWA) in the channel; note however that certain TWA structures in the channel are wider than the spanwise size of the duct.
In the present work, we focus on two different spanwise regions of duct, which are defined taking into account the scaling properties of the secondary motion: region A extends from the vertical wall to the location of the minimum of V (z + < 50), and here the velocity profiles scale if the wall-normal vertical is expressed in inner units; region B, on the other hand, comprises the region where the core-circulation is dominant (z > 0.6), as illustrated in Fig. 3 (bottom right). The structures are assigned to region A or B based on the position of their centre of mass and those which are located neither in A nor B are discarded. Note that the same definitions for regions A and B are employed in the rectangular duct. Fig. 4 illustrates contours of the joint-probability density function (JPDF) of y min and y max of uv events for all cases (denoted f(y min ,y max )). In region B of the duct, f(y min , y max ) is in good agreement with that of the channel for both Reynolds numbers and aspect ratios. As already pointed out by Lozano-Durán et al. (2012), it is possible to recognize the existence of the D, WA and TWA families. The first family is represented by the diagonal bands of f(y min , y max ) parallel to the line (y min = y max ), and correspond to objects identified from above the near-wall region up to the core of the domain, which have an extension in the vertical direction which is roughly independent on the wall distance. The WA family corresponds to the events close to the origin of the axis. The TWA family corresponds to the structures whose y min is below y + ≈ 20 and y max is much higher. In some instances, y max is even higher than the halfchannel height, a fact that illustrates the existence of very large objects which extend through most of the domain in the vertical direction. Interestingly, in region A of the duct, which does not have an equivalent in the channel, f(y min , y max ) is qualitatively different than that in region B and the channel. In fact, very large TWA uv are virtually absent in region A, illustrating the impact of the vertical wall that prevents the occurrences of large ejections and sweeps in the proximity of the corner. Note that, in this region, detached uv also play the role of spanwise fluctuations in respect of the boundary layer attached to the vertical wall, and their extension in the y direction scales in inner-units.
Although coherent structures exhibit a rather complex shape, several studies showed that their bounding box typically follows common patterns and scaling laws which are characteristic of wall-bounded turbulent flows. For instance, Hwang and Sung employed the size of the bounding box to characterize structures of velocity fluctuations in turbulent boundary layers (Hwang and Sung, 2018) and pipe flows (Hwang Fig. 4. JPDF of the minimum and maximum distance of the identified objects to the horizontal walls in (left) region B of the duct and in the channel (right) region A of the duct. The contours represent 95% of the sampled objects. Dark and light colour for Re τ = 360 and Re τ = 180, respectively. Blue for the channel, green for the square duct and red for the rectangular duct. The grey lines on the right are the same contours for channel flow shown on the left, reported as reference. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) and Sung, 2019). Lozano-Durán et al. (2012) reported that, in turbulent channel flow, the proportionality relation between the lengths in the three directions of TWA ejections (denoted by Δ x , Δ y and Δ z ) is approximately: As previously discussed for square duct and channel at Re 180 (Atzori et al., 2018), the presence of the corner modifies both the structure shape and size. In Fig. 5, we illustrate the probability density function (PDF) of the length in the streamwise direction of detached (D) and large attached structures (TWA and TCA) in the channel at Re 360 and the two spanwise regions of the rectangular duct at the same Reynolds number. Structures in region B of the duct have lengths which are in good agreement with those in the channel, whereas those in region A are shorter. In the channel and region B of the duct, it is possible to observe very long objects, with Δ + x as high as many times the domain height, for both detached (D) and large wall attached objects. In region A of the duct, very long wall-attached objects are rarer and, interestingly, there are no detached objects longer than the domain height.
To investigate how the presence of the corner modifies the structure shape, we consider the PDF of the ratio between the lengths in the streamwise and the vertical direction for different families, denoted f(Δx/Δy), and its mean value, denoted 〈Δx/Δy〉. Fig. 6 illustrates f(Δx/ Δy) for wall-attached (WA) and corner-attached (CA) structures. The shape of WA structures is in good agreement for all the cases, and in particular for channel and duct flows. Their average vertical aspect ratio is approximately 〈Δ x /Δ y 〉 ≈ 7 at Re τ = 180, and 〈Δ x /Δ y 〉 ≈ 6 at Re τ = 360, showing the close relation with Reynolds-stress events and nearwall streaks. Effects of the corner on near-wall structures are immediately apparent examining the CA family in the duct, which does not have  an equivalent in the channel. The PDF f(Δx/Δy) for CA structures is modified by the presence of very elongated objects, which, despite being relatively rare, lead to an appreciably higher 〈Δ x /Δ y 〉. Furthermore, Reynolds-number effects are more evident for the CA family, as the vertical average aspect ratio is 〈Δ x /Δ y 〉 ≈ 14 at Re τ = 180 and 〈Δ x /Δ y 〉 ≈ 8 at Re τ = 360. Similarly, D structures have the same 〈Δ x /Δ y 〉 ≈ 1.5 in the channel and the region B of the duct, but 〈Δ x /Δ y 〉 ≈ 2.5 in region A (the PDF is not shown). The fact that the secondary flow is still nonnegligible along the centre-plane of both the square and the rectangular ducts suggests examining the shape for the large objects in the domain, which belong to the TWA and TCA families. The PDF of their vertical aspect ratio is illustrated in Fig. 7, separately for region A and region B in the duct. Despite the secondary flow, f(〈Δ x /Δ y 〉) of TWA structures in region B of the duct and the channel are in very good agreement. Furthermore, their dependence on the Reynolds number is quite low, since 〈Δ x /Δ y 〉 ≈ 3 at both Re τ = 180 and 360. These results are also compatible with those reported by Lozano-Durán et al. (2012) for channel flow at much higher Reynolds numbers. Differences between channel and duct arise for TWA structures in region A and considering the TCA family, which does not have an equivalent in channel flows. The PDF of Δ x /Δ y of TWA structures in region A of both square and rectangular ducts show that they are more elongated than in channel flows. In particular, their average vertical aspect ratio is 〈Δ x /Δ y 〉 ≈ 4 at both Reynolds numbers. TWA structures in region A of the duct are more similar to the objects belonging to the TCA family, which have 〈Δ x /Δ y 〉 ≈ 4 and ≈ 4.5 at Re τ = 180 and 360, respectively. Note that comparing structures in different regions in the duct requires to take into account the fact that they have different sizes. We examined the aspect ratio Δ x / Delta y as a function of the streamwise length, Δ x (not shown here), and we found that longer structure tends to be also more elongated, irrespective of their location, and that structures in the corner region of the duct are more elongated than those of similar length in the channel and the central region.
We also performed a similar analysis examining the PDFs of the ratio between streamwise and spanwise lengths of the structures, f(Δ x /Δ z ) (the PDFs are not shown in the paper). For all the families of uv events, Δ z is on average the shortest length, and the same qualitative observations valid for the average Δ x /Δ y also held for Δ x /Δ z , in most cases. In particular, WA and TWA structures in region B of the duct are similar to the same objects in the channel. The first family exhibits 〈Δ z /Δ x 〉 ≈ 6 and ≈ 5 for Re τ = 180 and 360, respectively, while the latter has 〈Δ z /Δ x 〉 ≈ 4 at both Reynolds numbers. A very similar effect on the spanwise aspect ratio is also observed for D objects, for which 〈Δ x 〉/〈Δ z 〉 ≈ 2 in the channel and in region B of the duct and 〈Δ x 〉/〈Δ z 〉 ≈ 3 in region A of the duct.
The average aspect ratios for the different families considered in this section are summarized in Table 2, and the average bounding boxes for detached and tall-wall-attached structures are illustrated in Fig. 8. In this figure, the horizontal and vertical axes are the aspect ratios in the horizontal and vertical directions, respectively, so that the bisector of the Cartesian plane represents objects with the same size in both crossstream directions. The corner proximity modifies the shape of the different structures in different ways. Detached structures, which are enclosed in almost cubic bounding boxes in the channel and region B of the duct, become more elongated in the streamwise direction. On the other hand, tall-wall-attached structures, which are already proportionally wider than detached ones, become even wider.
It is important to note that the average aspect ratios only provide a general indication of the structures scaling properties. Nevertheless, this analysis unveils measurable differences between intense Reynolds-stress events in the proximity of the corner of the duct, where the secondary flow originates, and the same type of structures in the core region of the duct and the channel. It is also interesting to note that, for all the quantities considered so far, square and rectangular ducts are remarkably similar.

Table 2
Mean aspect ratios of corner-attached (CA), wall-attached (WA), detached (D), tall wall-attached (TWA), and tall corner-attached (TCA) structures, for the channel and regions A and B in the duct. The structure lengths in the streamwise, vertical and spanwise direction are denoted by Δ x , Δ y and Δ z , respectively. For the duct, the results for square and rectangular ducts are apparent only to the second or the third digits. Note that structures with the same geometrical properties are grouped in the table.

Fractional contributions to the secondary flow
In the present section, we investigate how intense events contribute to the mean velocity in the duct and the channel. We consider fractional contributions, which are defined for certain structures as volume averages over the volume occupied by the structures, weighted with the probability of structures to be detected. The fractional contribution from a certain intense event XX to a mean quantity Ξ is denoted by Ξ > XX . For instance, V > uv is the fractional contribution to the vertical component of the velocity from intense uv, which for a single field of the duct is computed as: where i, j and k are the indices for the streamwise, vertical and spanwise directions, respectively, N x is the number of grid points in the streamwise direction, p(i, j, k) is 1 if |uv(i, j, k)| > H uv u rms v rms (j, k) and 0 otherwise, and ṽ is the value of the instantaneous vertical component of the velocity. According to this definition, fractional contributions are additive, in the sense that the sum of the average over the sampled and the non-sampled portions of the domain corresponds to the average over the entire domain. Note that the quadrant analysis is traditionally employed to evaluate contributions to the Reynolds stress. However, in the duct, the mean momentum budgets include both uv and uw, and, under another perspective, the mean streamwise vorticity equation includes vw, v 2 and w 2 . Thus, it is not trivial to determine which coherent structures are more relevant to explain the flow dynamics. Nevertheless, the quadrant analysis still identifies the region of the flow where the most intense velocity fluctuations occur. The rationale of the present approach is not to assess how these structures contribute to balance the averaged equations, but rather to investigate their connection with the mean flow directly. We firstly consider the fractional contribution to the vertical component of the velocity in the channel and at the vertical centre-plane of the duct from intense uv events, denoted by V > uv (Fig. 9). It is possible to appreciate the differences in the mean secondary flow for the various cases at this location, which are due to both aspect-ratio and Reynoldsnumber effects for Re τ = 180. In the core of the channel, V > uv reflects the predominance of "ejections" the among intense events, a result which was already reported at higher Re τ by Lozano-Durán et al. (2012). Note that ejections, in the context of the quadrant analysis, are regions of the flows where the velocity fluctuations in the streamwise and vertical directions are negative and positive, respectively. To the contrary, regions where the velocity fluctuations are positive in the streamwise direction and negative in the vertical direction are called "sweeps". From the value of 0 at the wall, V > uv initially decreases reaching a minimum at y + ≃ 9 before increasing farther from the wall, and it changes sign at y + ≃ 15. For y + > 15, it further increases reaching an almost constant value at y + ≃ 50, before decreasing again above y ≃ 0.60 to become 0 along the horizontal centre-plane. The first change of sign of V > uv coincides with the transition between the viscous wall region, where the most intense fluctuations are the consequence of sweeps that occur farther from the wall, and the logarithmic region, where ejection events with respect to the closer wall are predominant (this trend does not depend on the choice of H uv ). Closer to the horizontal centre-plane of the channel, the largest ejection events from the opposite wall start to have Fig. 9. Vertical profile of (symbols) fractional contribution from intense uv events (H uv = 2) to the vertical component of the velocity V > uv , compared with the (solid lines) average of the same component, V. Channel in blue; square and rectangular duct at the vertical centre-plane in green and red, respectively. Light and dark colors are for Re τ = 180 and Re τ = 360, respectively. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) an influence, eventually reaching a balance at y/h = 1, where V > uv is zero, as implied by the symmetry of the flow.
Despite the differences in the secondary flow, for all the cases considered here there is a good agreement between V > uv in channel and duct. It is interesting to observe that such similarity is not affected by the differences in the relative intensity of the contribution to V > uv with respect to the mean V. In fact, in the square duct at Re τ = 360, for which the centre-plane is the location of a local maximum and the secondary flow is expected to scale in outer units, V is higher than V > uv up to y/h ≈ 0.7. In the square duct at Re τ = 180, the secondary flow is less intense and V > uv is, coincidentally, in good agreement with V between y + > 15 and y/h < 0.3. In the rectangular duct, where the vertical centre-plane is farther from the vertical wall and the secondary flow is relatively weak, V is almost always lower than V > uv . As opposed to what happens at the vertical centre-plane, V > uv in the duct significantly differs from that in the channel in the near-corner region, where the secondary flow scales if the wall-normal distance is expressed in viscous units. Fig. 10 shows V > uv and V in the duct at the location of the minimum of V,z ≈ 51. The contribution in the channel is reported as well as a reference. At this location, V is negative, therefore its sign is opposite to that of V > uv in the channel. However, above the near-wall region and below the corner bisector, i.e. for 15 < y + < 50, the square duct exhibits intense ejections which are relevant enough to have V > uv positive. Furthermore, in a relatively small region up to y + ≃ 25, including the near-wall region where intense sweeps are prevalent, V > uv is in good agreement between channel and duct. Note that V in the square duct scales well up to y + ≈ 100. Despite the fact that the behavior of V and of V > uv as functions of the wall-normal distance are qualitatively different, the effect of the geometry in the rectangular duct is quite similar for both of them. In fact, in the square duct V > uv scales if the wall-normal distance is expressed in inner units as V does, and the agreement of V > uv between Re τ = 180 and Re τ = 360 is better for the square duct than for the channel. In the rectangular duct, V > uv does not scale, as it happens for V, and the locations of the local extrema for both V > uv and V move farther from the horizontal wall as the Reynolds number increases.
Closer to the vertical wall, V changes sign again, and it exhibits a local maximum at a distance from the vertical wall of z + ≈ 11. The mean V and the corresponding fractional contribution V > uv on this profile are shown in Fig. 11. This maximum is located quite far from the horizontal wall (approximately y + ≈ 71 in the square duct). The contribution V > uv still scales over the wall-normal distance up to y + ≈ 50 in the square duct, and it has no obvious relation with the same quantity in the channel. This result is perhaps not surprising, because of the presence of Fig. 10. Vertical profiles of the fractional contribution V > uv (H uv = 2) in the channel and at the location of local V minimum closer to corner in square and rectangular duct compared with the average V. Colors and symbols as in Fig. 9. The vertical dashed line in black illustrates the wall-distance where the vertical profile encounters the corner bisect.or (y + = 50). (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) Fig. 11. Vertical profiles of the fractional contribution V > uv (H uv = 2) in the channel and at the location of local maximum closer to corner in square and rectangular duct compared with the average, V. Colors and symbols as in Fig. 9. The vertical dashed line in black illustrates the wall-distance where the vertical profile encounters the corner bisect.or (y + = 11). (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) the vertical wall, but it is worth noting that there is no agreement with V > uv for the channel even in below the wall-bisector, y + < 11. In this region, V > uv is very small, which is a consequence of the fact that intense events are almost absent. Farther from the wall and above the corner bisector, V > uv in the duct increases and it exhibits a maximum at a wallnormal distance similar to that of the maximum in V, but it always remains lower than in the channel and significantly lower than the mean V. Above y + > 100, which is the region of the domain where intense uv are spanwise fluctuations in respect to the vertical wall, the contribution decreases, becoming again close to zero.
To better characterize the contribution V > uv , we also examine its dependence on the distance from the vertical wall on the horizontal profiles at y + = 50 and y + = 20 ( Fig. 12 and Fig. 13, respectively). On both horizontal profiles, the behaviour of V > uv follows a common pattern, with small differences between all the cases. In the profile at y + ≈ 50, it is possible to identify three different regimes in terms of the distance from the vertical wall. In the near-corner region, where V scales in inner units, V > uv also scales in inner units, although the positions of the local extrema do not match with those of V. In particular, the first local maximum and local minimum of V > uv are closer to the vertical wall than the corresponding maximum and minimum of V. Interestingly, this "displacement" of the extrema is smaller for the profile at the shorter distance from the wall of y + ≈ 20, a fact that underlines the connection between secondary flow and high-and low-speed streaks in the nearcorner region of the domain. However, despite this relation with V, the absolute value of V > uv remains relatively small. In the profile at y + ≈ 50, farther from the vertical wall, it is possible to identify an intermediate region where V > uv does not scale in inner units but it approaches the value of V > uv (y + = 50) in the channel at the same Reynolds number. In this intermediate spanwise region, the trend of V > uv vaguely resembles that of V, in the sense that for the range of z + where V is increasing (or decreasing) it is possible to identify a corresponding range of z + , at lower distance from the vertical wall, where V > uv is also increasing (or decreasing). In particular, for both square and rectangular ducts at Re τ = 180, after V reaches the minimum at z + ≈ 50 + it increases up to a local maximum, which is higher than V > uv in the channel, and it decreases again for higher z + . The contribution V > uv has a similar trend, including a region where V > uv in the duct is higher than V > uv in the channel, but, as in the near-corner region, the local extrema have different positions. Even farther from the wall it is possible to identify a third spanwise region, for which V > uv at y + = 50 approaches asymptotically the value of V > uv for the same wall-normal distance in the channel. The extension of this region is very small for the square duct at Re τ = 180, for which it is limited at z + > 160, and for the rectangular duct at the same Reynolds number is observed at a distance from the vertical wall higher than the half-height of the duct (z + ≃ 220). In this asymptotic region V < uv is almost constant and it does not show any correlation with the secondary flow, despite the fact that the amplitudes of V < uv and V change with z + and they differ in the various cases. For instance, in the square duct at Re τ = 360 the contribution V > uv remains constant for z + > 200, i.e. the region where V monotonically increases from ≈ 0 to a value higher than that of V > uv approaching the vertical center-plane.
The presence of a spanwise region where V > uv in the duct is the same as in channel is also apparent on the horizontal profile at y + ≈ 20 for the data at Re τ = 360. In square duct at Re τ = 180, V > uv (y + = 20) seems to reach a uniform value close to 0 for z + > 150, instead of the value of V > uv (y + = 20) in the channel. Such a discrepancy corresponds to the miss-match that is possible to observe between the V > uv (y) profiles at the centre-plane in the near-wall region (Fig. 9), and it is perhaps related with the fact that secondary flow is still developing at this Reynolds number. In the rectangular duct at Re τ = 180, the horizontal profile V > uv (y + = 20) exhibits a quite complex behaviour, but it also eventually reaches the same value as in channel flow. Because intense uv events are relatively rare in this region of the domain, and because the agreement between V > uv is better for the rectangular duct are Re τ = 360, we did not further investigate this phenomenon.
In the square duct the two cross-stream components of the velocity are identical, together with the relative contributions, e.g. V > uw and W > uw . On the other hand, as we have previously discussed, V and W are qualitatively different in the rectangular duct, due to the change of sign of W in the core region in the latter. Fig. 14 shows, for both Reynolds numbers, the contributions to the horizontal component of the velocity from intense uw events, W > uw , and the contribution V > uv in channel flow for comparison. The profiles are reported as functions of the walldistance in outer units, i.e. the spanwise coordinate z for the rectangular duct (0 < z < 3) and for the square duct (0 < z < 1) and the vertical coordinate for the channel (0 < y < 1). At this location it is possible to clearly distinguish between geometry and Reynolds-number effects on W. On the one hand, the secondary motion is more intense for Re τ = 360 than for Re τ = 180, which is due to the fact that in the latter the core circulation is not present. On the other hand, for both Reynolds numbers, the maximum of W is lower in the rectangular duct, W changes sign at a similar distance from the vertical wall for both rectangular ducts (z ≃ 0.5) and it exhibits a minimum at a distance from the vertical wall higher than the half-height of the duct (z ≃ 1.1). However, both the Reynolds number and the geometry have a less significant impact on the contribution from the intense events W > uw . In fact, as observed for V > uv along the vertical centre-plane, W > uw does not follow the spanwise dependence of W and it is in good agreement in channel and ducts, despite the presence of the secondary flow in the latter. Furthermore, V > uv and W > uw are in relatively good agreement in the square and rectangular duct, despite the differences in their respective secondary-flow patterns. Such agreement holds up to a distance from the vertical wall which is almost the half-height of the duct, and it is better for higher Reynolds. In particular, W > uw exhibits for all the cases the change of sign at z + ≃ 15 and the same almost constant value of V > uv above z + ≃ 50 (W > uw is slightly lower in the rectangular duct than in the square duct, but these differences are within the statistical uncertainty). Furthermore, despite the fact that the vertical centre-plane in the rectangular duct is at a distance from the wall three times larger than for channel flow, W > uw decreases at a very similar distance from the wall of approximately z ≃ 0.6. The differences between W > uw in the rectangular duct with respect to W > uw (or V > uv ) in the square duct and V > uv in the channel are limited in how they approach 0 at z/h ≃ 0.6 at the centre-plane. In the rectangular duct, W > uw exhibits an inflection point and gradually reaches 0 farther from the wall. Interestingly, there is a qualitative difference between the two considered Reynolds numbers, which may be related to the still evolving structure of the secondary flow. In fact, at Re τ = 180 the contribution remains always positive, while at Re τ = 360 it becomes negative right after z = 1, reaching again 0 from below closer to the vertical centre plane. The distance from the wall and the spanwise evolution suggest that the process that gradually leads to W > uw in the region z > 1 in the rectangular duct is fundamentally different from that occurring for V > uv in channel and duct approaching the centre-plane. The results discussed in the present section are qualitatively valid for values of the threshold H uv higher than the critical one, at which the percolation crisis occurs. The effects of varying H uv in a wide range are described in the appendix.

Conclusions
In the present work we have studied the properties of coherent structures in turbulent square duct at moderate Reynolds numbers, with the aim of identifying the features of the instantaneous turbulent flow responsible for the secondary motion of Prandtl's second kind. The intense events are detected following the three-dimensional extension of the quadrant analysis introduced by Lozano-Durán et al. (2012), which studies the connected regions of the domain fulfilling a condition such as |uv| > H uv u rms v rms or |uw| > H uw u rms w rms . Based on the percolation analysis, we focused on the results obtained for H uv = 2 and H uw = 2, which is a value high enough to ensure that the most intense events are isolated.
We have performed a comparative analysis between duct and channel at similar Reynolds number considering two different points of view: the structure geometrical properties and their contributions to the cross-stream components of the mean velocity. Due to the multi-scale nature of the secondary motion, we have focused on two different spanwise regions of the domain in the duct. The corner region (region A in the text above, i.e. z + < 50) is defined to include the locations where the mean vertical component of the velocity V scales if it is expressed in outer units and the wall-normal distance is expressed in inner units. The core region (region B, i.e. z > 0.6) is defined to include the region where V scales in outer units, although we note, according to the recent findings by Gavrilakis (2019), that the topology of the secondary motion is still evolving at this range of Reynolds numbers. In the core region of the duct, Reynolds-stress intense events are similar to those in the channel. In particular, they exhibit similar aspect ratios in three directions, and their contribution to the mean in-plane components of the velocity is in good agreement in both flows, despite the existence of the secondary flow in the duct. In both the channel and the core region of the duct, wall-attached and tall-wall attached uv structures are present and the largest objects tend to reach the two opposite walls.
In the corner region of the duct, the geometrical properties of the structures are different than those in the core region, and intense events are on average shorter but more elongated in the streamwise direction than in the core region. In this region, the fractional contributions are less intense than in the channel or in the core region, and almost everywhere they are much intense than the mean velocity. Furthermore, in rectangular ducts the Reynolds-stress events do not yield a noticeable contribution to the core circulation towards the vertical walls, which is characteristic of that flow.
The effects of the corner on the geometrical properties of the intense Reynolds-stress events are in agreement with results already reported in the literature (Pinelli et al., 2010;Vidal et al., 2018;Uhlmann et al., 2007), and suggest that the secondary flow could be described in terms of instantaneous features of the turbulent flow. On the other hand, despite the important role of these structures in the dynamic of wallbounded turbulent flows, based on the present analysis it can be stated that their fractional contribution to the secondary flow is relatively low, both in the core and in the corner region.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgments
This study was funded by the Swedish Foundation for Strategic Research, project "In-Situ Big Data Analysis for Flow and Climate Simulations" (Ref. number BD15-0082) and by the Knut and Alice Wallenberg Foundation. The simulations were performed on resources provided by the Swedish National Infrastructure for Computing (SNIC).

Appendix A. Statistical convergence
In order to assess the statistical convergence, we consider the kinetic energy associated with the secondary flow integrated over the section of the duct (as in Ref. Vinuesa et al., 2018), denoted by K = (V 2 + W 2 )/2, and the PDF of the vertical aspect ratio, f(Δ x /Δ y ), of CA attached structures in the rectangular duct at Re τ = 180. The integrated K based on ensemble averaging over increasing number of fields is shown in Fig. 15 (left), in which it can be observed that this quantity differs by ≈ 4% and ≈ 1% with respect to the long-term statistics reported in Ref. Vinuesa et al., 2018 for the ducts at Re τ = 360 and Re τ = 180, respectively, when the entire data-set is considered. Fig. 15 (right) shows a comparison between the PDF of the vertical aspect ratio Δ x /Δ y for CA structures in the rectangular duct at Re τ = 180 for the entire data-set and half of it. Note as the CA structures in this case are the less numerous among all the families considered in the present work, due to the low Reynolds number and the fact that the vertical and spanwise directions are not equivalent. Nevertheless, the two PDFs are in excellent agreement.