1 Introduction

One of the key problems which mathematicians, physicists and numerical analyst come across during the solutions of flow problems of viscoelastic fluids is the higher order derivative term appearing in the governing equation when compared with the Navier–Stokes equations. In resulting equation the viscoelastic parameter appears as the coefficient of highest order derivative. Moreover, the order of the equation is reduced at the starting point of integration and in the limiting case when viscoelastic fluid tends to viscous fluid. This sort of singularity in the governing equation poses special challenges to mathematicians, physicists and numerical analysts. The boundary value problem of the stagnation point flow of Walter-B fluid with such singularity is already attempted by many researchers. For weakly viscoelastic fluids Beard and Walters [1] employed perturbation technique to investigate an analytic solution up to first order. The solution in [1] showed that velocity exceeds the mainstream velocity inside the boundary layer which is not realistic physically. Furthermore the velocity oscillates about free stream velocity outside the boundary layer. The classical stagnation point flow problem has attracted many researchers due to this overshoot in velocity inside the boundary layer. According to Frater [2] this overshoot is due to the approximate perturbation solution. The same boundary value problem is attempted by Serth [3]. In [3] orthogonal collocation method with Laguerre polynomials as trial functions is employed. A hybrid method based on the combination of finite difference method and the shooting method has been developed by Ariel [4]. Stagnation point flow of Walter-B fluid is analyzed in study [4]. The obtained solutions through hybrid method depict the same overshoot in velocity inside the boundary layer. In another paper Ariel [5] used the generalized Gear’s method to obtain a numerical solution of higher accuracy than that of hybrid method. It is important to mention that in all these studies the solutions possess a velocity overshoot inside the boundary layer.

The other two classical problems attempted in this paper are the Blasius and Sakiadis flows of Walter-B fluid. The transformed boundary value problems for these flows also possess the similar singularity at the starting point of calculation as discussed in detail for stagnation point flow. In a recent study by Tonekaboni et al. [6], the solutions of the three boundary layer flows of Walter-B fluid that includes stagnation point flow, Blasius flow and Sakiadis flow have been computed using predictor–corrector finite difference method. The results in [6] clearly show that the velocity overshoots in the case of stagnation point and Blasius flows and undershoots in Sakiadis flow. The velocity overshoot/undershoot inside the boundary layer is not physically realistic and it occurs due to the numerical scheme adopted for the solution of the relevant problems. This motivated us to develop a numerical algorithm which overcomes the difficulty of velocity overshoot appearing in studying the boundary layer flows of viscoelastic Walter-B fluid. Having such fact in mind we revisited the boundary value problems discussed in [6] by using a Legendre wavelet spectral collocation method for large domains [7].

The numerical techniques, based on spectral methods, are very powerful and efficient for solving the boundary value problems in all disciplines of science and engineering. For details readers are referred to the book by Boyd [8]. Particularly the applications of spectral methods for viscous fluids can be seen in the book by Canuto et al. [9]. The numerical results through spectral methods possess an exponential accuracy. Bhrawy [10] implemented the Jacobi pseudospectral approximation to nonlinear complex generalized Zakharov system. In another paper Bhrawy and Zaky [11] used spectral tau method for multi-term time–space fractional differential equation with Dirichlet boundary conditions. A highly accurate collocation method for 1 + 1 and 2 + 1 fractional percolation equations is attempted by Bhrawy [12]. Recently, Bhrawy and Abdelkawy [13] investigated the results for multi-dimensional fractional Schrodinger equations using spectral method. In a recent investigation Bhrawy et al. [14] presented a numerical technique based on Legendre polynomials for solving fractional KdV equation. Shifted fractional-order Jacobi orthogonal functions are used to solve system of fractional order differential equations by Bhrawy and Zaky [15]. In another paper Bhrawy and Zaky [16] discussed the solution for two-dimensional variable-order fractional nonlinear cable equation using spectral method. In the past two decades the wavelets have been used for the analysis of differential equations. For details the readers are referred to the articles Beylkin et al. [17], Chen and Hsiao [18], Razzaghi and Yousefi [19] and references therein. Islam et al. [20] solved the boundary layer flow problems with convection using Haar wavelet collocation method. Numerical solution for elliptic boundary value problems using wavelets collocation method is presented by Aziz [21].

The main objective of the present paper is to revisit the three boundary value problems discussed by Tonekaboni et al. [6] to resolve the anomalies associated with the fluid velocity for the non-Newtonian Walter-B fluid. Keeping this fact in mind in the present article we have implemented the Legendre wavelet spectral collocation method in combination with the shooting method [22] to discuss the stagnation point, Blasius and Sakiadis flows of viscoelastic Walter-B fluid. We have adopted the same concept of splitting the large domain into subintervals as implemented by Dizicheh [7]. We then combined the Legendre wavelets spectral collocation method with the shooting method to achieve the convergent solutions of the considered boundary layer flows. Through implementation of this algorithm we have successfully controlled the velocity overshoot/undershoot in the previous studies. The correctness, accuracy and convergence of the proposed algorithm is evident from the residual errors. The paper is organized as follows: Sect. 2 contains the problems statements for the stagnation point, Blasius and Sakiadis flows. The details of the implemented algorithm are presented in Sect. 3. Numerical results and discussion is included in Sect. 4 while Sect. 5 consists of concluding remarks.

2 Problems statements

Here the three boundary layer flows namely the stagnation point, Blasius and Sakiadis flows of Walter-B fluid discussed by Tonekaboni [6] are considered. We can refer the readers to study [6] for details of formulation about these three problems.

2.1 Stagnation point flow

The nondimensional problem for the stagnation point flow of Walter-B fluid is [6]:

$$f^{\prime \prime \prime } + ff^{\prime \prime } - f^{\prime 2} + 1 + K\left( {ff^{iv} - 2f^{\prime } f^{\prime \prime \prime } + f^{\prime \prime 2} } \right) = 0,$$
(1)
$$f(0) = 0,\quad f^{\prime } (0) = 0,\quad f^{\prime } (\infty ) = 1.$$
(2)

where f is the dimensionless velocity, \(\eta\) is the similarity variable and K is the Weissenberg number characterizing the viscoelasticity of fluid. As a first step we convert the boundary value problem (1) and (2) into system of initial value problems through shooting method [13]. Assuming

$$f^{\prime \prime } (0) = s$$
(3)

and differentiating Eqs. (1) and (2) with respect to s we get

$$g^{\prime \prime \prime } + gf^{\prime \prime } + fg^{\prime \prime } - 2f^{\prime } g^{\prime } + K\left( {gf^{iv} + fg^{iv} - 2f^{\prime } g^{\prime \prime \prime } - 2g^{\prime } f^{\prime \prime \prime } + 2f^{\prime \prime } g^{\prime \prime } } \right) = 0,$$
(4)
$$g(0) = 0,\quad g^{\prime } (0) = 0,\quad g^{\prime \prime } (0) = 1.$$
(5)

2.2 Blasius flow

Adopting the procedure of previous subsection, the Blasius flow of Walter-B fluid is governed by the following system of initial value problems:

$$f^{\prime \prime \prime } + \frac{1}{2}ff^{\prime \prime } + K\left( {ff^{iv} + 2f^{\prime } f^{\prime \prime \prime } - f^{\prime \prime 2} } \right) = 0,$$
(6)
$$f\left( 0 \right) = 0, \quad f^{\prime } \left( 0 \right) = 0,\quad f^{\prime \prime } \left( 0 \right) = s,\quad f^{\prime } \left( \infty \right) = 1,$$
(7)
$$g^{\prime \prime \prime } + \frac{1}{2}gf^{\prime \prime } + \frac{1}{2}fg^{\prime \prime } + K\left( {gf^{iv} + fg^{iv} + 2f^{\prime } g^{\prime \prime \prime } + 2g^{\prime } f^{\prime \prime \prime } - 2f^{\prime \prime } g^{\prime \prime } } \right) = 0,$$
(8)
$$g\left( 0 \right) = 0, \quad g^{\prime } \left( 0 \right) = 0,\quad g^{\prime \prime } \left( 0 \right) = 1.$$
(9)

2.3 Sakiadis flow

For Sakiadis flow of Walter-B fluid, the system of initial value problems takes the form

$$f^{\prime \prime \prime } + \frac{1}{2}ff^{\prime \prime } + K\left( {ff^{iv} + 2f^{\prime } f^{\prime \prime \prime } - f^{\prime \prime 2} } \right) = 0,$$
(10)
$$f\left( 0 \right) = 0,\quad f^{\prime } \left( 0 \right) = 1,\quad f^{\prime \prime } \left( 0 \right) = s,\quad f^{\prime } \left( \infty \right) = 0,$$
(11)
$$g^{\prime \prime \prime } + \frac{1}{2}gf^{\prime \prime } + \frac{1}{2}fg^{\prime \prime } + K\left( {gf^{iv} + fg^{iv} + 2f^{\prime } g^{\prime \prime \prime } + 2g^{\prime } f^{\prime \prime \prime } - 2f^{\prime \prime } g^{\prime \prime } } \right) = 0,$$
(12)
$$g\left( 0 \right) = 0, \quad g^{\prime } \left( 0 \right) = 0,\quad g^{\prime \prime } \left( 0 \right) = 1.$$
(13)

It is clear from the governing equations that a standard integration scheme like Runge–Kutta method does not work since the coefficient of the highest derivative terms vanishes at \(\eta = 0\) and \(K \to 0\). It is extremely difficult to get a solution of that problem numerically by any standard integration scheme. Ariel [4] applied the hybrid numerical method for solving the stagnation point flow of Walter-B fluid. In another paper Ariel [5] implemented the predictor–corrector method and obtained the similar results as presented in [4]. Tonekaboni et al. [6] adopted the method proposed in [5] to present numerical solutions of stagnation point, Blasius and Sakiadis flows. These numerical methods work well for weakly viscoelastic fluids i.e. when K is small. When K is moderate or large the velocity profiles in all the above cases overshoots inside the boundary layer. Having such fact in view, our intention in next section is to implement the Legendre wavelet spectral collocation method for the system of initial value problems given in the Sects. 2.12.3. The value of the missing condition i.e. s can be modified after each iterative solution using Newton’s method.

3 Method of solution

In this section, all the necessary details regarding the solution of stagnation point flow problem considering of Eqs. (1)–(5) are given using the Legendre wavelet spectral collocation method. First we briefly review the Legendre wavelets, Legendre polynomials and interpolation of any function by using Legendre wavelets.

3.1 Legendre wavelets and Legendre polynomials

For any continuous function \(\psi\) the definition of wavelets gives [7]

$$\psi_{a,b} \left( \eta \right) = \left| a \right|^{{ - \frac{1}{2}}} \psi \left( {\frac{\eta - b}{a}} \right), \quad a,b \in {\mathbb{R}},\;a \ne 0,$$
(14)

in which a and b are respectively called the scale and shift. The discrete wavelet transform is defined by

$$\psi_{m,n} \left( \eta \right) = a^{{ - \frac{m}{2}}} \psi \left( {a^{ - m} \eta - nb} \right),$$
(15)

in which \(a^{m}\) is scale and \(na^{m} b\) is shift for any \(m,n\text{ } \in {\mathbb{Z}}\). When \((\psi = \psi \left( {k,\eta_{\infty } ,n,m,\eta } \right)\) is derived from Legendre polynomial of order m, we consider \(\psi_{m,n} \left( \eta \right)\) as a family of discrete wavelets where

$$k = 1, 2, \ldots , \eta_{\infty } ,\quad n = 1, 2, \ldots , 2^{k - 1} \eta_{\infty } .$$
(16)

Therefore the Legendre wavelets on the interval \(\left[ {0,\left. T \right)} \right.\) are defined by

$$\psi_{n,m} \left( \eta \right) = \left\{ {\begin{array}{*{20}l} {\left( {m + \frac{1}{2}} \right)^{{\frac{1}{2}}} 2^{{\frac{k}{2}}} L_{m} \left( {2^{k} \eta - 2n + 1} \right), } \hfill & { \frac{n - 1}{{2^{k - 1} }} \le \eta < \frac{n}{{2^{k - 1} }}} \hfill \\ {0,} \hfill & { otherwise} \hfill \\ \end{array} ,} \right\} ,$$
(17)

in which \(L_{m} \left( \eta \right)\) is the mth-order Legendre polynomial. The Legendre–Gauss quadrature formula gives

$$\mathop \smallint \limits_{ - 1}^{1} F\left( x \right)dx \cong \mathop \sum \limits_{j = 0}^{M - 1} w_{j} F\left( {x_{j} } \right),$$
(18)

where \(x_{j} , w_{j} : j = 0,1, \ldots , M - 1\) are respectively the Legendre–Gauss collocation points and the corresponding weights. These collocation points are the roots of \(L_{m} \left( x \right)\) in the interval \(\left( { - 1,1} \right)\) which are arranged in ascending order. The weights are determined through the expression

$$w = \frac{2}{{\left( {1 - x_{j}^{2} } \right)\left( {L_{M}^{\prime } \left( {x_{j} } \right)} \right)^{2} }},\quad j = 0,1, \ldots , M - 1.$$
(19)

For any interval (a, b) the Legendre–Gauss quadrature formula takes the form

$$\begin{aligned} \mathop \int \limits_{a}^{b} F\left( x \right)dx & = \frac{b - a}{2}\mathop \int \limits_{ - 1}^{1} F\left( {\frac{{\left( {b - a} \right)x + a + b}}{2}} \right)dx \\ & \simeq \frac{b - a}{2}\mathop \sum \limits_{j = 0}^{M - 1} w_{j} F\left( {\frac{{\left( {b - a} \right)x_{j} + a + b}}{2}} \right) \\ & = \sum\limits_{j = 0}^{M - 1} {\overline{w}_{j} F\left( {\frac{{\left( {b - a} \right)x_{j} + a + b}}{2}} \right)} \\ \end{aligned}$$
(20)

with

$$\overline{w}_{j} = \frac{{\left( {b - a} \right)w_{j} }}{2}\quad j = 0, \ldots ,M - 1.$$
(21)

3.2 Interpolation by Legendre wavelets

Any function \(f \in L^{2} \left[ {0,\left. {\eta_{\infty } } \right)} \right.\) can be expanded in terms of the Legendre wavelets in the following form

$$f\left( \eta \right) = \sum\limits_{n = 1}^{\infty } {\sum\limits_{m = 0}^{\infty } {f_{nm} \psi_{n,m} \left( \eta \right)} } ,$$
(22)

where \(f_{n.m}\) are

$$f_{nm} = \int_{{\left( {n - 1/2^{k - 1} } \right)}}^{{n/2^{k - 1} }} {f\left( \eta \right)\psi_{n,m} \left( \eta \right)d\eta } \simeq \sum\limits_{j = 0}^{M - 1} {\overline{w}_{j} f\left( {x_{nj} } \right)\psi_{n,m} \left( {x_{nj} } \right)} ,$$
(23)

with

$$\overline{w}_{j} = \frac{{w_{j} }}{{2^{k} }}, \quad x_{nj} = \frac{{x_{j} }}{{2^{k} }} + \frac{2n - 1}{{2^{k} }},\quad j = 0, \ldots ,M - 1, \; n = 1, \ldots ,2^{k - 1} \eta_{\infty } .$$
(24)

If the series is truncated at \(M - 1\) and \(2^{k - 1} \eta_{\infty }\), we have from Eq. (22)

$$f\left( \eta \right) \simeq \sum\limits_{n = 1}^{{2^{k - 1} T}} {\sum\limits_{j = 0}^{M - 1} {I_{nj} \left( \eta \right)f\left( {x_{nj} } \right)} } ,$$
(25)

where \(I_{nj} \left( \eta \right)\) is defined by

$$I_{nj} \left( \eta \right) = \overline{w}_{j} \sum\limits_{n = 0}^{{2^{k - 1} T}} {\psi_{n,m} \left( {x_{nj} } \right)\psi_{n,m} \left( \eta \right), } \quad j = 0, \ldots ,M - 1, \; n = 1, \ldots ,2^{k - 1} \eta_{\infty } ,$$
(26)

together with \(I_{nj} \left( {x_{ni} } \right) = \delta_{ij}\).

3.3 Solution for the stagnation point flow

In this section we approximate the solution of the stagnation point flow governed by the initial value problems through Eqs. (1)–(5). In order to solve Eqs. (1)–(5) we divide the domain \(0 \le \eta < \eta_{\infty }\) into subintervals given by \(\left[ {\left( {n - 1} \right)/2^{k - 1} ,\left. {n/2^{k - 1} } \right)} \right.\) for \(n = 1, \ldots ,2^{k - 1} \eta_{\infty }\). Therefore,

$$\psi_{pj} \left( \eta \right) = 0\quad for\;any\;p \ne n \quad and\quad \eta \in \left[ {\left( {n - 1} \right)/2^{k - 1} ,\;\left. {n/2^{k - 1} } \right)} \right.$$
(27)

and hence the Legendre wavelet interpolation approximation to the functions \(f\left( \eta \right)\) and \(g\left( \eta \right)\) on the nth subinterval follows Eq. (26) and is given by

$$f\left( \eta \right) \simeq F_{n} \left( \eta \right) = \sum\limits_{p = 1}^{{2^{k - 1} T}} {\sum\limits_{j = 0}^{M - 1} {I_{pj} \left( \eta \right)f_{pj} } } = \sum\limits_{j = 0}^{M - 1} {I_{nj} \left( \eta \right)f_{nj} } , \quad for\; \eta \in \left[ { \frac{n - 1}{{2^{k - 1} }},\left. { \frac{n}{{2^{k - 1} }}} \right).} \right.$$
(28)

In a similar way we define that

$$g\left( \eta \right) \simeq G_{n} \left( \eta \right) = \sum\limits_{j = 0}^{M - 1} {I_{nj} \left( \eta \right)g_{nj} } ,$$
(29)
$$F_{n}^{(m)} \left( \eta \right) \simeq \sum\limits_{j = 0}^{M - 1} {I_{nj}^{(m)} \left( \eta \right)f_{nj} } ,\quad G_{n}^{(m)} \left( \eta \right) \simeq \sum\limits_{j = 0}^{M - 1} {I_{nj}^{(m)} \left( \eta \right)g_{nj} } ,$$
(30)

Applying the points \(\left\{ {\left. {x_{nj} } \right|n = 1, \ldots ,2^{k - 1} \eta_{\infty } , \quad j = 3, \ldots ,M - 1} \right\}\) into Eqs. (1) and (4) we get

$$F_{n}^{\prime \prime \prime } + F_{n} F_{n}^{\prime \prime } - F_{n}^{\prime 2} + 1 + K\left( {F_{n} F_{n}^{iv} - 2F_{n}^{\prime } F_{n}^{\prime \prime \prime } + F_{n}^{\prime \prime 2} } \right) = 0,$$
(31)
$$G_{n}^{\prime \prime \prime } + G_{n} F_{n}^{\prime \prime } + F_{n} G_{n}^{\prime \prime } - 2F_{n}^{\prime } G_{n}^{\prime } + K\left( {G_{n} F_{n}^{iv} + F_{n} G_{n}^{iv} - 2F_{n}^{\prime } G_{n}^{\prime \prime \prime } - 2G_{n}^{\prime } F_{n}^{\prime \prime \prime } + 2F_{n}^{\prime \prime } G_{n}^{\prime \prime } } \right) = 0,$$
(32)

where the initial conditions in the first subinterval are

$$F_{1} \left( 0 \right) = 0,\quad F_{1}^{\prime } \left( 0 \right) = 0,\quad F_{1}^{\prime \prime } \left( 0 \right) = s,\quad G_{1} \left( 0 \right) = 0,\quad G_{1}^{\prime } \left( 0 \right) = 0,\quad G_{1}^{\prime \prime } \left( 0 \right) = 1.$$
(33)

Substituting Eqs. (28)–(30) into Eqs. (31)–(33) we get the following nonlinear algebraic system of equations

$$\left[ {1 - 2K\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj}^{\prime } \left( {x_{nj} } \right)f_{nj} } } \right)} \right]\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj}^{\prime \prime \prime } \left( {x_{nj} } \right)f_{nj} } } \right) + 1 + \left[ {\sum\limits_{j = 0}^{M - 1} {\left\{ {I_{nj} \left( {x_{nj} } \right) + KI_{nj}^{\prime \prime } \left( {x_{nj} } \right)} \right\}f_{nj} } } \right]\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj}^{\prime \prime } \left( {x_{nj} } \right)f_{nj} } } \right) - \left( {\mathop \sum \limits_{j = 0}^{M - 1} I_{nj}^{\prime } \left( {x_{nj} } \right)f_{nj} } \right)^{2} + K\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj} \left( {x_{nj} } \right)f_{nj} } } \right)\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj}^{iv} \left( {x_{nj} } \right)f_{nj} } } \right) = 0$$
(34)
$$\left[ {1 - 2K\sum\limits_{j = 0}^{M - 1} {I_{nj}^{\prime } \left( {x_{nj} } \right)f_{nj} } } \right]\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj}^{\prime \prime \prime } \left( {x_{nj} } \right)g_{nj} } } \right) + \left[ {\sum\limits_{j = 0}^{M - 1} {\left\{ {I_{nj} \left( {x_{nj} } \right) + 2KI_{nj}^{\prime \prime } \left( {x_{nj} } \right)} \right\}f_{nj} } } \right]\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj}^{\prime \prime } \left( {x_{nj} } \right)g_{nj} } } \right) + \left[ {\sum\limits_{j = 0}^{M - 1} {\left\{ {I_{nj}^{\prime \prime } \left( {x_{nj} } \right) + KI_{nj}^{iv} \left( {x_{nj} } \right)} \right\}f_{nj} } } \right]\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj} \left( {x_{nj} } \right)g_{nj} } } \right) - 2\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj}^{\prime } \left( {x_{nj} } \right)g_{nj} } } \right)\left[ {\sum\limits_{j = 0}^{M - 1} {\left\{ {I_{nj}^{\prime } \left( {x_{nj} } \right) + KI_{nj}^{\prime \prime \prime } \left( {x_{nj} } \right)} \right\}f_{nj} } } \right] + K\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj} \left( {x_{nj} } \right)f_{nj} } } \right)\left( {\sum\limits_{j = 0}^{M - 1} {I_{nj}^{iv} \left( {x_{nj} } \right)g_{nj} } } \right) = 0$$
(35)
$$\sum\limits_{j = 0}^{M - 1} {I_{1j} \left( {x_{1j} } \right)f_{1j} = 0,} \quad \sum\limits_{j = 0}^{M - 1} {I_{1j}^{\prime } \left( {x_{1j} } \right)f_{1j} = 0, } \quad \sum\limits_{j = 0}^{M - 1} {I_{1j}^{\prime \prime } \left( {x_{1j} } \right)f_{1j} = s,}$$
(36)
$$\sum\limits_{j = 0}^{M - 1} {I_{1j} \left( {x_{1j} } \right)g_{1j} = 0, } \quad \sum\limits_{j = 0}^{M - 1} {I_{1j}^{\prime } \left( {x_{1j} } \right)g_{1j} = 0,} \quad \sum\limits_{j = 0}^{M - 1} {I_{1j}^{\prime \prime } \left( {x_{1j} } \right)g_{1j} = 1,}$$
(37)

Now the procedure proceeds as follows: We set \(n = 1\) and choose an approximate value for s. Then the algebraic system given in Eqs. (34)–(37) is solved for the coefficients \(f_{nj}\) and \(g_{nj}\) in the first subinterval \(\left[ { 0,\left. { 1/2^{k - 1} } \right)} \right.\). The analytical solution is then obtained in the first subinterval by using Eqs. (28) and (29). Through the solutions in the first subinterval the initial conditions for the second subinterval are evaluated and thus solutions for the second subinterval are computed. This process continues till the last interval. Then the value of s is corrected through a zero finding algorithm which leads to \(F_{{2^{k - 1} \eta_{\infty } }}^{\prime } \left( {\eta_{\infty } } \right) = 1.\) We choose M and k in such a way that the residual error is within an accuracy of \(10^{ - 6}\). The similar procedure is adopted for the solutions of the initial values problems for Blasius and Sakiadis flows.

4 Numerical results and discussion

The numerical procedure based on the Legendre wavelets spectral collocation method is implemented in symbolic computation software mathematica for finding an approximate solution of the stagnation point, Blasius and Sakiadis flows of Walter-B fluid. In the next subsections we respectively discuss the results of these three problems through graphs and tabular data.

4.1 Stagnation point flow

The key point in the solution of this problem is to obtain the numerical values of the missing condition i.e. \(s = f^{\prime \prime } \left( 0 \right)\). The numerical solutions for the stagnation point flow are evaluated by setting k = 4 and M = 7. The numerical values of the missing condition \(s = f^{\prime \prime } \left( 0 \right)\) are shown in Table 1 with the increasing viscoelastic parameter K. The numerical values obtained in the present case are smaller in magnitude when compared with the available results in the literature. Furthermore, in all previous studies no result is available beyond K = 0.3257864. This further ensure the efficiency of the proposed technique over the others for highly viscoelastic fluids.

Table 1 Numerical values of \(s = f^{''} \left( 0 \right)\) for the present and previously obtained results in case of stagnation point flow

In Figs. 1 and 2 the residual errors for \(K = 0.1\) and \(K = 0.3\) are presented. These Figs. depict that the residual errors can be measured to an accuracy of 10−6 and thus the approximate solutions presented are the solutions of the governing Eq. (1). The velocity profiles varying with the Weissenberg number are displayed in Fig. 3. It is evident from the velocity profiles that the velocity inside the boundary layer does not exceed the free stream velocity and also it does not oscillate about the free stream velocity. The results show that the velocity overshoot (predicted in the previous studies) is not observed here by the present numerical scheme. Hence these solutions are physically more realistic. The comparison of the present solutions with those of the Tonekaboni [6] solutions in the case of stagnation point flow for \(K = 0.3\) is shown in Fig. 4. It is evident from this Fig. that proposed algorithm provides a way to control the velocity overshoot for highly viscoelastic fluids.

Fig. 1
figure 1

Residual error for different \(\eta\) when \(K = 0.1\) in stagnation point flow

Fig. 2
figure 2

Residual error for different \(\eta\) when \(K = 0.3\) in stagnation point flow

Fig. 3
figure 3

Velocity profiles for different Weissenberg number \(K\) in stagnation point flow

Fig. 4
figure 4

Comparison of the present and Tonekaboni [6] solutions for \(K = 0.3\) in the case of stagnation point flow

4.2 Blasius flow

The numerical values for the missing condition \(s = f^{\prime \prime } \left( 0 \right)\) obtained by implementing the Legendre wavelet spectral collocation method for k = 3 and M = 7 are given in Table 2. The residual errors for two different values of the Weissenberg number are shown in Figs. 5 and 6. These Figs. elucidate that our obtained numerical solutions are correct within an accuracy of 10−8. The velocity profiles for the Blasius flow are plotted in Fig. 7. The plots show that the velocity decreases and the boundary layer thickness increases via larger Weissenberg number. Furthermore the overshoot in velocity predicted in [6] through the predictor corrector method does not appear in the present numerical scheme. Therefore the present results are more reliable physically. Figure 8 is made to illustrate the comparison between the present and Tonekaboni [6] solutions for Blasius flow when \(K = 1\). This Fig. elucidate that the present solutions does not show any overshoot in the velocity profile for strongly viscoelastic fluid as predicted by Tonekaboni [6].

Table 2 Numerical values of \(s = f^{\prime \prime } \left( 0 \right)\) for the present and previously obtained results in case of Blasius flow
Fig. 5
figure 5

Residual error for different \(\eta\) when \(K = 0.4\) in Blasius flow

Fig. 6
figure 6

Residual error for different \(\eta\) when \(K = 1.0\) in Blasius flow

Fig. 7
figure 7

Velocity profiles for different Weissenberg number \(K\) in Blasius flow

Fig. 8
figure 8

Comparison of the present and Tonekaboni [6] solutions for \(K = 1\) in the case of Blasius flow

4.3 Sakiadis flow

The numerical values of \(s = f^{\prime \prime } \left( 0 \right)\) for the two dimensional Sakiadis flow of Walter-B fluid are presented in Table 3 when \(k = 3\) and \(M = 7\). Residual error through Figs. 9 and 10 depict that the obtained numerical solutions are correct and accurate within an accuracy of 10−8. Figure 11 elucidates that both the velocity and boundary layer thickness decrease by increasing the Weissenberg number. The results presented for the same flow problem in [6] depicts a velocity undershoot. However, our numerical results do not show velocity profile going below the free stream velocity and therefore the results here are physically more realistic. To make a comparison among the present and Tonekaboni [6] solutions for Sakiadis flow when \(K = 0.6\) Fig. 12 is displayed. The results show that no undershoot in the velocity profile is present for the solutions using Legendre wavelet spectral collocation method for strongly viscoelastic fluids.

Table 3 Numerical values of \(s = f^{\prime \prime } \left( 0 \right)\) for the present and previously obtained results in case of Sakiadis flow
Fig. 9
figure 9

Residual error for different \(\eta\) when \(K = 0.6\) in Sakiadis flow

Fig. 10
figure 10

Residual error for different \(\eta\) when \(K = 0.8\) in Sakiadis flow

Fig. 11
figure 11

Velocity profiles for different Weissenberg number \(K\) in Sakiadis flow

Fig. 12
figure 12

Comparison of the present and Tonekaboni [6] solutions for \(K = 1\) in the case of Sakiadis flow

5 Conclusions

The two dimensional stagnation point flow, Blasius flow and Sakiadis flow of viscoelastic fluid are computed in this paper. The numerical solutions are obtained using Legendre wavelets spectral collocation method. The stable results for the velocity profiles are presented in all three cases for strong viscoelastic effects. The present algorithm provides a way to resolve the anomalies in the velocity profiles for large values of the viscoelastic parameter for Walter-B fluid. The overshoot in the velocity profiles of stagnation point and Blasius flows and undershoot in Sakiadis flow has been controlled through the present numerical scheme. Unlike the previous results, the graphical results here show that there are no oscillations of velocity about the free stream. The presented method is also an alternative to finite difference and shooting techniques. For singular nonlinear boundary value problems the shooting technique fails. The present method combines the features of shooting method Legendre wavelets to overcome this difficulty. The numerical procedure presented here is not limited to the present flow situation and can be applied to the other flow problems in non-Newtonian fluids.