1 Introduction

In shallow seas, bays, and tidal estuaries, the long-term mass transport is determined by the shallow sea circulation or estuary circulation, which is a quasi-steady motion after filtering the tidal signal. According to the way of filtering the tidal signal, this quasi-steady motion is also called the tide-induced Lagrangian residual current.

The idea of the Lagrangian mean is first used by Longuet-Higgins (1969) in large-scale circulation; he did not propose the concept of Lagrangian residual velocity (LRV) but used the mass transport velocity, which turned out to be the first order of the LRV (Feng et al. 1986a) under weakly nonlinear conditions. The LRV is first descriptively defined by Zimmerman (1979) as the net displacement of a water parcel after one or several tidal periods divided by the corresponding time.

The LRV is proved to be rational to describe the shallow sea circulation (Feng 1986; Feng et al. 1986b; Feng 1987) and can be applied in real conditions (Cheng and Casulli 1982; Cheng 1983; Feng 1998). So it has been used in many researches (Feng 1990; Ridderinkhof and Loder 1994; Delhez 1996; Loder et al. 1997; Feng et al. 2008; Muller et al. 2009; Jiang and Feng 2011, 2014a; Wang et al. 2013; Quan et al. 2014; Chen et al. 2017; Deng et al. 2017, 2019; Cui et al. 2019a).

Studies about the LRV are mainly analytical, numerical, or observational. The observational studies include observations in real seas (Quan 2014) and laboratory experiments (Wang et al. 2013; Chen et al. 2017). The numerical study is widely used in getting LRV because it can simulate complex conditions. Generally, a particle tracking module is applied to get the net displacement which is divided by the corresponding time elapsed to calculate the LRV according to its definition (Quan et al. 2014; Deng et al. 2017, 2019). In other studies, LRV can also be directly obtained by solving the governing equations of LRV numerically (Wang et al. 1993; Sun et al. 2000, 2001; Cui et al. 2019a). Analytical study is the basis of the numerical and observational studies and focuses on establishing governing equations and solving them analytically.

Based on the weakly nonlinear assumption, Jiang and Feng (2011) derived the depth-averaged equations of the first-order LRV systematically in a narrow bay and solved the equations analytically. The results indicated that the LRV has explicit physical meanings and is appropriate for describing the shallow sea circulation. But in the real tidal field, the water column does not move in unison like a rigid body; the LRV should be defined in 3D space strictly. So, Jiang and Feng (2014a) extended their work to the 3D case, in which they gave the 3D structure of the LRV in a narrow bay, and compared the influences of each component of the tidal body force on the depth-averaged and breadth-averaged LRV. It is necessary to point out that the tidal body force here is not an astronomical tide-generating force which conventionally means gravitational pull by celestial objects like the sun and moon, but the driving force of the governing equations of Lagrangian residual current through nonlinear coupling of the zeroth-order tidal current (see Feng 1987).

However, in terms of the eddy viscosity, analytical studies lag behind the numerical studies. In most analytical studies, the eddy viscosity coefficient was set as a constant, while in numerical studies parameterized or turbulent closure schemes were adopted. Early in 1977, Ianniello (1977) tried to use a vertically varying eddy viscosity coefficient in an idealized bay to study the LRV, but his work was limited to 2D space. In 1993, Feng and Lu (1993) proposed a homogeneous turbulent closure model for the Lagrangian residual current governing equations, but it has not been solved till today. At present no analytical solutions of the 3D LRV under varying eddy viscosity coefficient are reported, while the numerical studies indicated that both the magnitude and specific profile of the eddy viscosity coefficient have influences on the LRV (Winant 2008; Deng et al. 2017). The nonuniform eddy viscosity coefficient was also used in other studies on wind- and wave-induced currents such as in Jenkins (1987) and Lentz (1995). So the purpose of this paper is to give the analytical solution to the LRV and study its dynamics under vertically varying eddy viscosity.

To solve the LRV, the tidal current under the same conditions should be solved first. Chen et al. (2019) gave the analytical solution to the 3D tide in a narrow bay with vertically varying eddy viscosity coefficient and discussed the influences of the varying eddy viscosity coefficient to the tidal current. In the present paper, the eddy viscosity coefficient is chosen as same as that in Chen et al. (2019) which is a parabolic form in the vertical direction, and the LRV is solved analytically based on the zeroth-order solution of the linear tide in Chen et al. (2019).

The structure of this paper is as follows: the detailed procedure of solving the Lagrangian residual current equations is given in Section 2. In Section 3 the results of the total LRV and the LRV induced by two components of the tidal body force are discussed separately, and the contributing mechanisms are compared by changing the steepness of the topography. The conclusions are made in Section 4.

2 The solution to the Lagrangian residual current equations

In this study the analytical Lagrangian residual velocity is obtained in a rectangular model bay with the single frequency tide incoming from the open boundary. In this model, there are five basic characteristic values which are the spatial scale xc = λc, yc = B, and zc = hc; temporal scale ωc = 2π/T (T denotes the tidal period); and scale of tide amplitude ζc, with B representing the typical width of the bay, hc being the typical depth of the bay which is taken as the maximum water depth in this study, and \( {\lambda}_c=\sqrt{g{h}_c}T \) being the tidal wavelength. Based on the dimensionless method employed in Jiang and Feng (2014a) and B being one order smaller than λc, a narrow bay is adopted in this paper as that in Chen et al. (2019), with x = L being at the head of the bay and x = 0 being at the open boundary where the tidal signal is imposed and with y = 0 and y = 1 being the lateral boundaries. The surface of the still water is at z = 0 and z =  − h is the sea bottom. The vertical eddy viscosity coefficient is assumed to be time-independent.

2.1 The tide-induced Lagrangian residual current equations

A dimensionless parameter κ = ζc/hc is defined to denote the advective nonlinearity of the system. In this study, the weakly nonlinear condition is studied, i.e., O  (κ) < 1. δ = B/λc is the aspect ratio which is also a small parameter to reflect the narrowness of the bay in this study. Thus, the two-parameter perturbation method can be used in this study to get the tide-induced Lagrangian residual current equations. All the variables are expanded to different orders with respect to κ and δ. For example, the water elevation ζ is expanded in the form as follows:

$$ \zeta ={\zeta}_0+\kappa {\zeta}_1+{\delta}^2{\zeta}_0^{\hbox{'}}+\kappa {\delta}^2{\zeta}_1^{\hbox{'}}+\cdots $$

where ζ0, ζ1, \( {\zeta}_0^{\hbox{'}} \), and \( {\zeta}_1^{\hbox{'}} \) are the zeroth-order, first-order, δ2-order, and κδ2-order water elevations, respectively. It can be found by inserting the perturbation formula into the governing equations that ζ0 and ζ1 are independent of y because of the narrowness of the bay (Jiang and Feng 2014b); \( {\zeta}_0^{\hbox{'}} \) and \( {\zeta}_1^{\hbox{'}} \) are still functions of x, y, and t as ζ is. If the perturbed equations of different orders are examined, it can be found that the variables, such as ζ0, ζ1, \( {\zeta}_0^{\hbox{'}} \), and \( {\zeta}_1^{\hbox{'}} \), are periodic functions with period being T.

The derivation process of the tide-induced LRV equations can be found in Jiang and Feng (2014b) which did include the vertically varying eddy viscosity coefficient case by using the perturbation method, though they only gave solutions under constant eddy viscosity coefficient. In this paper only the nondimensional governing equations in a 3D narrow bay are listed as follows:

$$ \frac{\partial {u}_L}{\partial x}+\frac{\partial {v}_L}{\partial y}+\frac{\partial {w}_L}{\partial z}=0 $$
(1)
$$ 0=-\frac{\partial {\zeta}_E}{\partial x}+\beta \frac{\partial }{\partial z}\left(\upsilon \frac{\partial {u}_L}{\partial z}\right)+{\pi}_1 $$
(2)
$$ 0=-\frac{\partial {\zeta}_E^{\prime }}{\partial y}+\beta \frac{\partial }{\partial z}\left(\upsilon \frac{\partial {v}_L}{\partial z}\right)+{\pi}_2 $$
(3)

where uL, vL, and wL are the first-order LRV in x-, y-, and z-directions, ζE = < ζ1> and \( {\zeta}_E^{\prime }=\kern0.3em <{\zeta}_1^{\prime }> \) are the κ-order and κδ2-order of the residual water elevations; and \( <\cdot >=\frac{1}{nT}{\int}_{t_0}^{t_0+ nT}\cdot dt \) is the tidal-averaging operator, where n is the number of tidal cycles that are used for the average and t0 is the starting time of the average. In the present study the operator < > is always applied to periodic functions with period being T; n and t0 have no influence on the results. For convenience, n is set to 1 and t0 is set to 0. \( \beta ={\upsilon}_c/{\omega}_c{h}_c^2 \) represents the magnitude of the eddy viscosity coefficient. υc is the characteristic value of the vertical eddy viscosity coefficient. π = (π1  ,  π2) is called the tidal body force.

At the surface, z = 0

$$ {w}_L=0 $$
(4)
$$ \frac{\partial \left({u}_L,{v}_L\right)}{\partial z}=0 $$
(5)

At the bottom, z =  − h

$$ {u}_L={v}_L={w}_L=0 $$
(6)

At the fixed boundaries,

$$ {U}_L={\int}_{-h}^0{u}_L dz=0,\kern0.33em x=L $$
(7)
$$ {V}_L={\int}_{-h}^0{v}_L dz=0,\kern0.33em y=0,1 $$
(8)

The tidal body force π = (π1  ,  π2), the nonlinear coupling of the zeroth-order variables of the tidal system, is the driving force of the LRV. According to Cui et al. (2019a), they can be divided into two terms based on the different mechanisms behind them as follows:

$$ {\pi}_1={\pi}_{adv1}+{\pi}_{sto1}=-<{\mathbf{u}}_{\mathbf{0}}\cdot \nabla {u}_0>-\beta \frac{\partial }{\partial z}\left(\upsilon \frac{\partial <{\boldsymbol{\upxi}}_{\mathbf{0}}\cdot \nabla {u}_0>}{\partial z}\right) $$
(9)
$$ {\pi}_2={\pi}_{adv2}+{\pi}_{sto2}=-<{\mathbf{u}}_{\mathbf{0}}\cdot \nabla {v}_0>-\beta \frac{\partial }{\partial z}\left(\upsilon \frac{\partial <{\boldsymbol{\upxi}}_{\mathbf{0}}\cdot \nabla {v}_0>}{\partial z}\right) $$
(10)

where πadv = (πadv1  ,  πadv2) and πsto = (πsto1  ,  πsto2) represent the advection term and the Stokes’ drift stress term, respectively (Cui et al. 2019a). In (9) and (10), ξ0 is defined as

$$ {\boldsymbol{\upxi}}_{\mathbf{0}}=\left({\xi}_0,{\eta}_0,{\iota}_0\right)={\int}_{t_0}^t{\mathbf{u}}_{\mathbf{0}} dt,\kern0.66em t\in \left({t}_0,\kern0.33em {t}_0+ nT\right) $$

It is the tidal displacement of the water parcel (also see Jiang and Feng 2014a; Cui et al. 2019a), and u0 = (u0, v0, w0) is the zeroth-order tidal velocities obtained in Chen et al. (2019).

2.2 The analytical solutions

In order to get the analytical solution under a vertically varying eddy viscosity coefficient, two assumptions have to be made. The first one is that the water depth h should only vary in the y-direction, i.e., h = h(y). The second one is about the expression of v. According to Chen et al. (2019), the vertical eddy viscosity coefficient only varies in z-direction in a parabolic form (Fig. 1). The mathematical expression is as follows which is equivalent to Eq. (23) in Chen et al. (2019).

$$ v(z)=\left(R-1\right)\frac{{\left(z-{z}_m\right)}^2}{{\left(h+{z}_m\right)}^2}+1 $$
Fig. 1
figure 1

The profile of the nondimensional vertical eddy viscosity coefficient

It can be seen that the vertical eddy viscosity coefficient is determined by three nondimensional parameters: β, R, and zm. As an inverse oscillatory Reynolds number, which relates to a ratio of the frictional Stokes depth \( \sqrt{\upsilon_c/{\omega}_c} \) to water depth, \( \beta ={\upsilon}_c/{\omega}_c{h}_c^2 \) is also used in LRV study with the constant eddy viscosity (Jiang and Feng 2014a). It is found in Jiang and Feng (2014a) that β is important to the LRV; different β can even lead to reversed LRV distribution pattern. R and zm are two new parameters for the vertically varying eddy viscosity coefficient, and they codetermine the specific profile of the eddy viscosity coefficient, where R  (0 < R < 1) is the minimum value of the eddy viscosity coefficient near the bottom and zm is the location of the symmetry axis of the parabola. With this varying eddy viscosity coefficient, the nondimensional linear tidal equations in a narrow bay are solved analytically in Chen et al. (2019). Based on the tidal solutions, the present paper aims at giving the analytical solution to the 3D LRV governing equations under the same condition.

Integrate (2) from z to 0 using (5) to have

$$ 0=z\frac{\partial {\zeta}_E}{\partial x}-\beta \upsilon \frac{\partial {u}_L}{\partial z}+{\int}_z^0{\pi}_1\left(x,y,{z}_2\right)d{z}_2 $$
(11)

Integrate (11) from − h to z using (6) to yield

$$ {u}_L=\frac{1}{\beta}\frac{\partial {\zeta}_E}{\partial x}{\int}_{-h}^z\frac{z_1}{\upsilon}\kern0.33em d{z}_1+\frac{1}{\beta }{\int}_{-h}^z\frac{1}{\upsilon }{\int}_{z_1}^0{\pi}_1\left(x,y,{z}_2\right)\kern0.33em d{z}_2d{z}_1 $$
(12)

Then, the depth-integrated uL can be expressed as

$$ {U}_L={\int}_{-h}^0{u}_L dz=\frac{\prod_1}{\beta }+\frac{K}{\beta}\frac{\partial {\zeta}_E}{\partial x} $$
(13)

where

$$ {\prod}_1={\int}_{-h}^0{\int}_{-h}^z\frac{1}{\upsilon }{\int}_{z_1}^0{\pi}_1\left(x,y,{z}_2\right)d{z}_2d{z}_1 dz $$
(14)
$$ K(y)={\int}_{-h}^0{\int}_{-h}^z\frac{z_1}{\upsilon}\kern0.33em d{z}_1 dz $$
(15)

The same procedure applies to (3) to have

$$ {v}_L=\frac{1}{\beta}\frac{\partial {\zeta}_E^{\prime }}{\partial y}{\int}_{-h}^z\frac{z_1}{\upsilon}\kern0.33em d{z}_1+\frac{1}{\beta }{\int}_{-h}^z\frac{1}{\upsilon }{\int}_{z_1}^0{\pi}_2\left(x,y,{z}_2\right)\kern0.33em d{z}_2d{z}_1 $$
(16)

The depth-integrated vL is

$$ {V}_L={\int}_{-h}^0{v}_L\kern0.33em dz=\frac{\prod_2}{\beta }+\frac{K}{\beta}\frac{\partial {\zeta}_E^{\prime }}{\partial y} $$
(17)

where

$$ {\prod}_2={\int}_{-h}^0{\int}_{-h}^z\frac{1}{\upsilon }{\int}_{z_1}^0{\pi}_2\left(x,y,{z}_2\right)\kern0.33em d{z}_2d{z}_1 dz $$
(18)

Then, integrate (1) from − h to 0 by inserting the boundary conditions (4) and (6) to have

$$ \frac{\partial {U}_L}{\partial x}+\frac{\partial {V}_L}{\partial y}=0 $$
(19)

At the fixed boundary x = L, substitute (12) into (7) and integrate in y-direction from 0 to 1, to have

$$ \frac{\partial {\zeta}_E}{\partial x}=-\frac{\int_0^1{\prod}_1\left(L,y\right)\kern0.33em dy}{\int_0^1K\kern0.33em dy} $$
(20)

At the fixed boundary y = 0, substitute (16) into (8) to get

$$ \frac{\partial {\zeta}_E^{\prime }}{\partial y}=-\frac{\prod_2\left(x,0\right)}{K(0)} $$
(21)

At the fixed boundary y = 1, we have

$$ \frac{\partial {\zeta}_E^{\prime }}{\partial y}=-\frac{\prod_2\left(x,1\right)}{K(1)} $$
(22)

Substitute (13) and (17) into (19) to have

$$ \frac{\partial }{\partial y}\left(K\frac{\partial {\zeta}_E^{\prime }}{\partial y}\right)+K\frac{\partial^2{\zeta}_E}{\partial {x}^2}+\frac{\partial {\prod}_1}{\partial x}+\frac{\partial {\prod}_2}{\partial y}=0 $$
(23)

Integrate (23) along the breadth direction, noticing ζE being independent of y in Eq. (27) in Jiang and Feng (2014a) and the lateral boundary conditions (21) and (22) to yield

$$ \frac{\partial^2{\zeta}_E}{\partial {x}^2}=-\frac{\frac{\partial }{\partial x}{\int}_0^1{\prod}_1 dy}{\int_0^1K\kern0.33em dy} $$
(24)

Then, integrate (24) from L to x, using (20) to yield

$$ \frac{\partial {\zeta}_E}{\partial x}=-\frac{\int_0^1{\prod}_1 dy}{\int_0^1K\kern0.33em dy} $$
(25)

Substitute (25) into (23) and then integrate it from 0 to y, noticing the boundary condition (21), to have

$$ \frac{\partial {\zeta}_E^{\prime }}{\partial y}=\frac{1}{K}\left(-{\prod}_2+\frac{\int_0^yK\kern0.33em dy}{\int_0^1K\kern0.33em dy}{\int}_0^1\frac{\partial {\prod}_1}{\partial x} dy-{\int}_0^y\frac{\partial {\prod}_1}{\partial x} dy\right) $$
(26)

Then, according to (13) and (17), the depth-integrated LRV in x- and y-directions can be expressed as

$$ {U}_L=\frac{\prod_1}{\beta }-\frac{K}{\beta}\frac{\int_0^1{\prod}_1 dy}{\int_0^1K\kern0.33em dy} $$
(27)
$$ {V}_L=\frac{\int_0^yK\kern0.33em dy}{\beta {\int}_0^1K\kern0.33em dy}{\int}_0^1\frac{\partial {\prod}_1}{\partial x} dy-\frac{1}{\beta }{\int}_0^y\frac{\partial {\prod}_1}{\partial x} dy $$
(28)

Substitute (25) and (26) into (12) and (16); then, uL and vL are as follows:

$$ {u}_L=-\frac{1}{\beta}\left({\int}_{-h}^z\frac{z_1}{\upsilon }d{z}_1\frac{\int_0^1{\prod}_1 dy}{\int_0^1K\kern0.33em dy}-{\int}_{-h}^z\frac{1}{\upsilon }{\int}_{z_1}^0{\pi}_1\left(x,y,{z}_2\right)d{z}_2d{z}_1\right) $$
(29)
$$ {v}_L=\frac{1}{\beta K}{\int}_{-h}^z\frac{z_1}{\upsilon }d{z}_1\left(-{\prod}_2+\frac{\int_0^yK\kern0.33em dy}{\int_0^1K\kern0.33em dy}{\int}_0^1\frac{\partial {\prod}_1}{\partial x} dy-{\int}_0^y\frac{\partial {\prod}_1}{\partial x} dy\right)+\frac{1}{\beta }{\int}_{-h}^z\frac{1}{\upsilon }{\int}_{z_1}^0{\pi}_2\left(x,y,{z}_2\right)d{z}_2d{z}_1 $$
(30)

Furthermore, integrate (1) from z to 0 and consider the boundary condition (4) to have

$$ {\displaystyle \begin{array}{l}{w}_L={\int}_z^0\left(\frac{\partial {u}_L}{\partial x}+\frac{\partial {v}_L}{\partial y}\right)d{z}_1=\frac{1}{\beta }{\int}_z^0{\int}_{-h}^z\frac{1}{\upsilon }{\int}_{z_1}^0\frac{\partial {\pi}_1\left(x,y,{z}_2\right)}{\partial x}+\frac{\partial {\pi}_2\left(x,y,{z}_2\right)}{\partial y}d{z}_2d{z}_1 dz\\ {}\kern2.74em +\frac{1}{\beta {K}^2}\left(-\frac{h{h}_y^{\prime } Kz}{\upsilon \left(-h\right)}+{K}_y^{\prime }{\int}_z^0{\int}_{-h}^z\frac{z_1}{\upsilon }d{z}_1 dz\right)\left({\prod}_2-\frac{\int_0^y Kdy}{\int_0^1 Kdy}{\int}_0^1\frac{\partial {\prod}_1}{\partial x} dy+{\int}_0^y\frac{\partial {\prod}_1}{\partial x} dy\right)\\ {}\kern5.38em -\frac{1}{\beta K}{\int}_z^0{\int}_{-h}^z\frac{z_1}{\upsilon }d{z}_1\left(\frac{\partial {\prod}_1}{\partial x}+\frac{\partial {\prod}_2}{\partial y}\right)-\frac{h_y^{\prime }z}{\beta \upsilon \left(-h\right)}{\int}_{-h}^0{\pi}_2\left(x,y,{z}_2\right)d{z}_2 dz\end{array}} $$
(31)

By now, the 3D LRV (uL, vL, wL) under vertically varying eddy viscosity coefficient has been analytically solved and the results are exhibited in the following part by inserting the solutions of the zeroth-order tide from Chen et al. (2019).

3 Results and discussions

The results are presented in a bay with the nondimensional depth profile being

$$ h=1-\alpha {\left(2y-1\right)}^2 $$
(32)

The water depth only varies along the transverse direction, α can reflect the steepness of the topography, and initially it is taken as α = 0.99.

The length of the bay is set as a wavelength (L = 1) in this paper. Though the LRV pattern will change as the bay length changes, it is found that the pattern in a shorter bay seems to keep the corresponding part of the longer bay (Jiang and Feng 2011, 2014a, also in this study). For a bay with length L > 1, the pattern of LRV does not exhibit more features than that in bay with length L = 1. So here only L = 1 is chosen. Then, the solution of the 3D LRV is decided by three parameters: β, R, and zm. If β = 1, the eddy viscosity coefficient used in the present paper has the same magnitude as that in Jiang and Feng (2014a). The parameters deciding the specific profile of the eddy viscosity coefficient are initially taken as R = 0.4 and zm = − 0.4.

Details of the LRV are shown in Figs. 2 and 3. It is found that the result with varying profile differs a little from the constant eddy viscosity coefficient result. When a varying eddy viscosity coefficient is adopted, the 3D structure of the LRV (Fig. 2) is similar to that in Jiang and Feng (2014a). In all sections, the LRV flows inward through a core area located at the upper layer of the central deep part, while it flows out at the bottom and along the banks. Moreover, the core area reaches a deeper area when the section is closer to the head of the bay.

Fig. 2
figure 2

The LRV at four cross sections. α = 0.99, β = 1, R = 0.4, zm = − 0.4. x = 0 represents the entrance of the bay, and the axial velocity is inward in light area and outward in dark area

Fig. 3
figure 3

a The depth-averaged LRV. b The breadth-averaged LRV. x = 0 represents the entrance of the bay. α = 0.99, R = 0.4, zm = − 0.4, β = 1

The depth-averaged and breadth-averaged LRV also keep similar patterns to that under the constant eddy viscosity coefficient condition. As shown in Fig. 3, the depth-averaged LRV flows into the head through the central deep area and flows out along the banks. The breadth-averaged LRV consists of two parts: one small gyre near the head and one semi-gyre at the other part of the bay with the LRV flowing inward at the upper layer and outward at the lower layer.

3.1 The sensitivities of the LRV to the three nondimensional parameters

It has been pointed out that the varying eddy viscosity coefficient used in this paper is decided by three nondimensional parameters, β, R, and zm. To reveal their influences on the LRV, several experiments are conducted to diagnose the sensitivities of the LRV to the three parameters.

3.1.1 The influence of the magnitude of the eddy viscosity coefficient

With a given specific profile of the eddy viscosity coefficient (R = 0.4, zm = − 0.4), three different values of β are chosen to test the influence of the magnitude on the LRV. The results are shown in Figs. 4 and 5.

Fig. 4
figure 4

The LRV at four cross sections for three different β. α = 0.99, R = 0.4, zm = − 0.4. x = 0 represents the entrance of the bay, and the axial velocity is inward in light area and outward in dark area

Fig. 5
figure 5

The LRV for three different β. a Depth-averaged. b Breadth-averaged. x = 0 represents the entrance of the bay. α = 0.99, R = 0.4, zm = − 0.4

The 3D structure of the LRV changes a lot with different β. As shown in Fig. 4, the inflow occupies the upper part of the central deep area with a large β, and the core area reaches deeper near the head of the bay. As β decreases, the core area shortens and bifurcates. The outflow invades upward in the center and the inflow is divided into two branches when β is small; thus, the central area and the lower layer are occupied by the outflow.

The depth-averaged LRV is shown in Fig. 5a; when β is small, there are two pairs of symmetric gyres with the outflow existing in the center, and a weak outflow near each bank. As β increases, the outflows near the banks become stronger. The structure of the depth-averaged LRV becomes simpler when β is large, and in the whole bay the water flows in through the central deep area and flows out at the banks.

The breadth-averaged LRV is also sensitive to the parameter β (Fig. 5b). With a small β, the water flows inward at the upper layer and flows out at the lower layer. As β increases, the gyre moves toward the entrance and becomes a semi-gyre with a small gyre in the opposite sense appearing near the head when β is large.

3.1.2 The influence of the specific profile of the eddy viscosity coefficient

Now we focus on the influence of the specific profile of the eddy viscosity coefficient. The magnitude is taken as a constant (β = 0.5), and three groups of different values of R and zm are used to examine the structures of the LRV.

The result shows that with a decreasing R, the inflow remains at the central deep part but the occupation area is prolonged. When R is small enough, the inflow core area bifurcates from the head to the outer bay. While the increase of zm nearly has no influence except that the core area becomes a little wider, the figures are omitted here.

The depth-averaged LRV is insensitive to R and zm, the inflow always occupies the central deep area, and the outflow is at the banks. It is natural to get this result since in the depth-averaged hydrodynamic governing equations, the eddy viscosity terms are transformed to the difference of the surface and bottom stress due to the integration over the depth. So the specific profile of the eddy viscosity coefficient is not important to the depth-averaged LRV.

The general structure of the breadth-averaged LRV also remains almost the same with different R and zm, except that the gyre near the head extends toward the entrance a little with a decreasing R or an increasing zm (figures are omitted here). This result is in accordance with that in Ianniello (1977) when the breadth-averaged model was studied.

3.2 The LRV induced by each component of the tidal body force

Since the governing Eqs. (1)–(10) describe a linear system, each component of the tidal body force term in (9) and (10) can induce the LRV separately. The πadv-induced LRV can be obtained by replacing π in (2) and (3) with πadv = (πadv1  ,  πadv2), and we can get the πsto-induced LRV in the same way. The 3D structure and the depth-averaged and breadth-averaged structures of the total LRV and the LRV induced by each component are shown in Figs. 6 and 7, respectively. The depth profile in (32) is adopted and the steepness is taken as α = 0.9. The parameters of the vertical eddy viscosity coefficient are β = 1, R = 0.4, and zm = − 0.4.

Fig. 6
figure 6

The total LRV (first row) and the LRV induced by each component of the tidal body force in four cross sections. α = 0.9, R = 0.4, zm = − 0.4, β = 1

Fig. 7
figure 7

The total LRV (first row) and the LRV induced by each component. a depth-averaged; b breadth-averaged. α = 0.9, R = 0.4, zm = −0.4, β = 1

The 3D structures of the LRV induced by the tidal body force and the two components are exhibited in Fig. 6. It can be seen that the πsto-induced LRV is the dominant one, and both the magnitude and pattern of the πsto-induced LRV are similar to the total LRV, especially in the outer bay. From the second row in Fig. 6, we can see that the πadv-induced 3D LRV has a rather stable pattern that keeps a similar pattern in different sections in the bay with the inflow occupying the central deep area from the surface to the bottom. In some areas, the structure of the πadv-induced LRV is inconsistent with the total LRV. But because of its smaller magnitude, the πadv-induced LRV only has a minor influence on the total LRV. This result is consistent with that in Fig. 4 in Cui et al. (2019a).

The same results can also be seen in Fig. 7. The πsto-induced LRV dominates both the depth-averaged and breadth-averaged LRV. The πsto-induced depth or breadth-averaged LRV is greater in magnitude compared with the πadv-induced counterpart, but the πsto-induced depth or breadth-averaged LRV has a similar pattern with the total depth-averaged or breadth-averaged LRV, respectively. The πadv-induced depth-averaged LRV has a pattern that the inflow occupies the central area and the outflow locates at the banks, which is the same as the total LRV. The πadv-induced breadth-averaged LRV has a semi-gyre in Fig. 7b that the water flows inward at the upper layer and outward at the lower layer, which is simpler than the total LRV.

By changing the values of the parameters, the sensitivities of each component to the parameters that control the eddy viscosity are analyzed, the specific figures are omitted, and the results are summarized in Table 1. The 3D structure of the πadv-induced LRV is sensitive to parameter β; when β is small enough, there will appear a weak outflow. The structure is also sensitive to parameters R and zm. When R and zm become larger, the inflow in the central area becomes wider and shorter and it bifurcates obviously near the entrance. The πadv-induced depth-averaged LRV is only sensitive to β among the three parameters. And the πadv-induced breadth-averaged LRV has little sensitivity to all the three parameters.

Table 1 The sensitivities of the 3D, depth-averaged, and breadth-averaged Lagrangian residual current induced by each component of the tidal body force to parameters β, R, and zm

The πsto-induced 3D LRV is also very sensitive to β; different values of β may lead to a reversed pattern, while the structure is not sensitive to R and zm. The πsto-induced depth-averaged LRV (Fig. 7a) is sensitive to β, but insensitive to R and zm. The breadth-averaged LRV (Fig. 7b) contains two parts, and the gyre in the inner bay is sensitive to β, but is not sensitive to R and zm.

Thus, the sensitivities of the LRV induced by each component of the tidal body force to the parameters (β, R, and zm) shown in Table 1 can be concluded as follows. Parameter β that decides the magnitude of the eddy viscosity coefficient is the most important parameter to the LRV, and nearly all the structures of the 3D, depth-averaged, and breadth-averaged LRV are very sensitive to it. R, the minimum value of the eddy viscosity coefficient, has much weaker influences on LRV. πsto-induced depth-averaged LRV is not sensitive to it. Among the three parameters, the location of the symmetry axis zm only has a little influence except on the πadv-induced 3D LRV. So the magnitude of the eddy viscosity coefficient has a major influence on the LRV. With a fixed magnitude, the specific profile of the varying eddy viscosity coefficient affects the pattern of the total LRV mainly by affecting the πadv-induced LRV. While πadv-induced LRV contributes relatively small to the total LRV, so the profile of the eddy viscosity is not less important than the magnitude.

3.3 The effects of different steepness of the topography

The topography used in this paper only varies along the breadth direction, and the parameter α (0 < α < 1) in (32) can reflect the steepness of the topography. To explore the applicability of the contribution mechanism in Section 3.3, three values of steepness with α being 0.9, 0.6, and 0.3, respectively, are used to discuss the influence of the steepness on the LRV.

The 3D structures of the total LRV and the LRV induced by each component for three different α are shown in Fig. 8, and only the sections near the entrance are shown for brevity. The total LRV keeps a similar pattern that the water flows in through the upper part of the central deep area. As α decreases, the core area of the inflow becomes wider and shallower, and the magnitude reduces significantly.

Fig. 8
figure 8

The total LRV (first row) and the LRV induced by each component for three different α. The section is near the entrance of the bay. R = 0.4, zm = − 0.4, β = 1

The πadv-induced LRV is stable with different α, it enhances the total LRV except in the bottom part, but the magnitude is relatively small. For different α, both from the aspects of magnitude and the pattern, the πsto-induced LRV is highly similar to the total LRV; thus, it is the dominant one.

In conclusion, when α changes, the vertical structures of the total LRV, πadv-induced LRV, and πsto-induced LRV change accordingly. Specifically, their structure changes from lateral shear to vertical shear with the increase of α which is consistent with the result in Deng et al. (2019). Moreover, the πsto-induced LRV is similar to the total LRV and is always dominant with different α. Thus, the contribution mechanism of the 3D LRV does not change with different steepness.

When α = 0.9, the depth-averaged LRV is shown in Fig. 7a. Figures 9a and 10a are the results for α = 0.6 and α = 0.3, respectively. The total depth-averaged LRV has a similar pattern with different α, but the magnitude decreases with the decreasing α. The πadv-induced depth-averaged LRV has a stable pattern with different α and always enhances the total depth-averaged LRV, but the enhancement is small because of its small magnitude. The πsto term always enhances the total depth-averaged LRV, too. But as α decreases, its magnitude decreases sharply as well as the enhancement. Therefore, as for the contribution mechanism of the depth-averaged LRV, when α = 0.6, the conclusion is consistent with that for α = 0.9 and the πsto term has the main contribution to the total depth-averaged LRV. While α = 0.3, the LRV induced by the πsto term decreases a lot and the contributions are equal between the πadv and πsto terms.

Fig. 9
figure 9

The total LRV (first row) and the LRV induced by each component for α = 0.6. a Depth-averaged. b Breadth-averaged. R = 0.4, zm = − 0.4, β = 1

Fig. 10
figure 10

As in Fig. 9, but for α = 0.3

The results for the breadth-averaged LRV are shown in Figs. 7b, 9b, and 10b, respectively. The total breadth-averaged LRV changes with different α. There is a gyre near the head when α is relatively large. When α = 0.3, the gyre disappears, the pattern becomes simple, and the water flows inward in the upper layer and flows outward in the lower layer. The change of α also influences the magnitude of LRV, especially near the entrance.

The patterns of both πadv- and πsto-induced breadth-averaged LRV change little with different α, but the magnitude changes especially near the entrance. The πadv term mainly enhances the total LRV, but it has a weakening effect near the head when α is large. The πsto term shows the decisive effect on the total LRV with a large α, when α is small, and it weakens the total LRV near the head. Therefore, as for the contribution mechanism of the breadth-averaged LRV, when α = 0.6 and α = 0.9, the πsto term is the dominant one; when α = 0.3, the pattern of the total LRV changes and the πsto effect is weaker near the head, but it is still the main contributor from the aspect of magnitude.

In conclusion, as the steepness of the topography changes, the contribution mechanism of the 3D LRV is invariant and the πsto term is the dominant one. But the contribution mechanisms of the depth-averaged and breadth-averaged LRV have some changes when α varies, and a critical value is found through repeated experiments at around α = 0.35. With a sharp steepness (α > 0.35), the depth-averaged and breadth-averaged LRV are mainly decided by πsto term. But the contribution of πsto is no longer dominant with a gentle steepness (α < 0.35).

According to the setting of the model bay in this study, the Coriolis force is neglected naturally. But in many real cases, the bay width and bay length are of the same order, and the influence of the rotation on LRV cannot be ignored. In a 2D model bay, Quan et al. (2014) found that the Coriolis effect can influence LRV if the bay width has the same magnitude as bay length. In a wide idealized bay with a lateral topography, the Coriolis force on the residual circulation system can break symmetry along the central line of the deep channel, and the rotation effect from the tidal circulation system is weak (Cui et al. 2019a). In a wide idealized bay with a longitudinal topography, π1 and the rotation effect from the tidal circulation system codetermine the LRV (Cui et al. 2019b). Compared with the influence of topography on LRV, the magnitude of eddy viscosity mildly affects the magnitude and flow pattern of LRV (Cui et al. 2019b). With the rotation effect introduced in the residual current system, we can expect that topography becomes more important to LRV. This is a limitation of the present study.

4 Conclusion

In this paper the 3D LRV governing equations are solved analytically with vertically varying eddy viscosity coefficient. The eddy viscosity coefficient used in the present paper is time-independent and only varies along the vertical direction as a parabola. It is decided by three nondimensional parameters: β decides the magnitude, and R and zm together decide the specific profile where R is the minimum value and zm is the location of the symmetry axis. Among the three parameters, the LRV depends mostly on β, less on R, and least on zm. The structure of the LRV is mainly decided by the magnitude of the eddy viscosity coefficient.

The tidal body force is divided into advection term (πadv) and Stokes’ drift term (πsto), respectively. It is found that the total LRV is mainly determined by πsto term. The 3D, depth-averaged, and breadth-averaged LRV induced by each component are all sensitive to the magnitude of the eddy viscosity coefficient. With a fixed magnitude, the specific profile of the varying eddy viscosity coefficient affects the total LRV by affecting the πadv-induced LRV.

The scope of application of the above mechanisms is tested under different steepness of the topography. We can find that the structure of LRV changes from lateral shear to vertical shear with the increase of topographic steepness. The contribution mechanism of the 3D LRV is found invariant with steepness, and the πsto term always has a decisive effect. The contribution mechanisms of the depth-averaged and breadth-averaged LRV change with different steepness, and the critical value is found at around α = 0.35. πsto is the main contributor with steep topography, and the contribution effect is no longer obvious with a gentle topography.