If we assume that $l_{\rho} \approx l_{v}$ then
\begin{equation}
\frac{x}{l_{v}} \ll \frac{(1+\psi)}{l_{\rho}}.
\tag{24}
\end{equation}

In this case the linear approximation to $1/(\rho(r_A)|\Delta|_{r_A})$ is
\begin{equation}
\frac{1}{\rho(r_A)|\Delta|_{r_A}} = \frac{l_{\rho}}{\rho(r_A)\omega_k^2}(1-y+xJ).
\tag{25}
\end{equation}

Here $J$ is a factor which measures the relative importance of the non-uniformity of the flow to that of density and it is defined as
\begin{equation}
J = \frac{l_{\rho}}{l_v}.
\tag{26}
\end{equation}

With all terms approximated linearly, the approximation of the damping rate, $\gamma$, becomes
\begin{equation}
\gamma = -\frac{\pi}{8}\frac{l_{\rho}}{\rho(r_A)}\frac{(\rho_i-\rho_e)^2}{\rho_i-\rho_e}\,\omega_k
\left\{1 + x\left[-\frac{8\rho_i\rho_e}{(\rho_i-\rho_e)(\rho_i+\rho_e)} - \frac{2\rho_i}{\rho_i+\rho_e} + \frac{2v(r_A)}{v_i} + J\right]\right\}.
\tag{27}
\end{equation}

If we repeat the analysis for the backward wave we obtain the same expression with a change in the sign in front of $x$.

The final expression for the damping rates of the two waves (forward and backward propagating) using the sinusoidal profile of density and velocity reduces to
\begin{equation}
\gamma = -\frac{1}{4}\frac{l}{R}\frac{(\rho_i-\rho_e)}{(\rho_i+\rho_e)}\,\omega_k
\left\{1 \pm \frac{k v_i}{\omega_k}\left[-\frac{8\rho_i\rho_e}{(\rho_i-\rho_e)(\rho_i+\rho_e)} - \frac{\rho_i-\rho_e}{\rho_i+\rho_e} + \frac{(\rho_i+\rho_e)}{(\rho_i-\rho_e)}\frac{l}{l^*}\right]\right\}.
\tag{28}
\end{equation}

The $\pm$ sign corresponds to forward and backward propagating waves respectively. When the flow is zero, the second term inside the curly brackets vanishes and we recover the formula of the damping in the static equilibrium (see for example \cite{Ruderman_Roberts_2002}). In the non-static case since we have assumed that $l_{\rho} \approx l_v$ ($l \approx l^*$) the last two terms inside the square brackets are of the same order and we see that the imaginary part of the frequency linearly decreases with the flow for the forward propagating wave and increases for the backward wave. Using the linear approximation to the frequency (Eq.~(17)) and damping rate (Eq.~(28)) it is straight forward to calculate the damping per period. The results are represented in Fig.~\ref{fig:figure_3} (see dashed lines). We see that the analytical approximations agree very well with the full solution based on the calculation of $r_A$ and the evaluation of Eq.~(1) and Eq.~(8). Note that the dependence of the damping rate on the spatial variation of the flow across the loop boundary, $l^*$, is present in Eq.~(28). In Fig.~\ref{fig:figure_4} we have plotted the results using this expression (see dashed lines). Again, we find an excellent agreement between the two curves for both the forward and backward waves.

For the regime $l^* \ll l$ it is possible to derive useful information from the linear approximation. Using the assumption $l_v \ll l_{\rho}$ it is easy to see that the damping rate of the resonance inside the velocity layer (for both the forward and backward waves) is proportional to $l^*$, which means, as we have already anticipated in Sect.~3.1, that the contribution of this resonance to the total damping tends to zero (damping time tending to infinity) for a purely discontinuous velocity profile. This is the behaviour already found in Fig.~\ref{fig:figure_4} for the backward wave. Moreover, we can estimate the total damping of the two regular resonances of the forward wave (see Fig.~\ref{fig:figure_5}) by adding the individual damping rates. It turns out that the total damping rate for the forward wave is simply
\begin{equation}
\gamma = -\frac{1}{2}\frac{l}{R}\frac{(\rho_i-\rho_e)}{(\rho_i+\rho_e)}\,\omega_k
\left\{1 - \frac{k v_i}{\omega_k}\left[\frac{8\rho_i\rho_e}{(\rho_i-\rho_e)(\rho_i+\rho_e)} + \frac{\rho_i-\rho_e}{\rho_i+\rho_e}\right]\right\}.
\tag{29}
\end{equation}

This is the asymptotic value for the forward wave when $l^*$ tends to zero. Note that this is twice the damping rate of the situation with a very smooth velocity profile (see Eq.~(28) when $l^* \gg l$) indicating a more efficient attenuation (half damping time).

\subsection{3.3. Beyond the TTTB approximation: full resistive eigenvalue problem}

The results of the previous Sections are based on the TT approximation. It is known that without flows this approximation works very well even for thick layers. However it remains to be confirmed whether this assumption is still valid in the presence of flows. For this reason, we go beyond the TTTB approximation. In this case we solve the full problem numerically. We follow the approach of \cite{Terradas_2006}. To study the quasi-mode properties, the eigenvalue problem given by Eqs.~(1)--(5) in \cite{Terradas_2006}, plus the additional terms due to the flow, is solved. A time dependence of the form $e^{i\omega t}$ is assumed and the problem is solved numerically using a code based on finite elements. As boundary conditions we impose that the velocity components are zero for $r \rightarrow \infty$. In practice, the condition is applied at $r=r_{\max}$, and then it is necessary to check that the results do not depend on this parameter. On the other hand, at $r=0$ it is imposed that $\partial v_r/\partial r = 0$, i.e., we select the regular solution at the origin, while the rest of the variables are extrapolated. All the variables and the eigenfrequency are assumed to be complex numbers, since we are interested in resonantly damped modes. We include resistivity to avoid the singular behaviour of the ideal MHD equations at the resonances. The resistive eigenvalue problem is solved and we obtain the real and the imaginary part of the frequency which must be independent of the magnetic Reynolds number that we use in the computations (\cite{Poedts_Kerner_1991}).

The results of the calculations for $l^* \geq l$ are plotted in Fig.~\ref{fig:figure_3} (shown by dots). The agreement with the analytical calculations, using the TTTB approximation, is remarkable. The numerical curves almost overlap with the analytical ones. In Fig.~\ref{fig:figure_4} (shown by dots) we represent the damping per period as a function of $l^*$ and find the same behaviour as in the analytical expression. With these results we are even more confident about the method used in Sect.~3.1 and about the analytical expressions derived in Sect.~3.2.

For the regime $l^* \ll l$ the numerical method we are using fails since the thinner the layer (in density or velocity) the larger the Reynolds number required for the damping time to be independent of the dissipation. A method based on the application of the jump conditions at the resonance or resonances, used for example by \cite{Tirry_1998,Andries_2000,Andries_Goossens_2001}, is more appropriate but since this is not the main focus of this paper it will not be further investigated here.

\subsection{3.4. The standing wave problem}

The results presented in the previous sections correspond to two propagating waves, one propagating in the direction of the flow, $\omega_f$, and the other travelling in the opposite direction, $\omega_b$. In