1 Introduction

Recently, transfer of heat in fluid flow by a stretchable sheet has an extensive range of applications. Such applications comprise metallic plates cooling, plastic sheets drawing, glass fibers, production of paper, spinning of metals, coating of fibers and wires, processing of chemical equipments, processing of food stuff, exchangers and processing of food stuff. All the processes of coating require a smoothy and glossy surface in order to fulfill the requirements for transparency, appearance, strength and low fraction. Viscous fluid flow by a stretchable surface is examined by Crane [1] for the first time. Turkyilmazoglu [2] inspected exact solution for couple stress fluid flow over a continuously stretchable sheet. Flow over a permeable stretchable sheet with thermal radiations and variable viscosity is investigated by Mukhopadhyay [3]. Nanofluid flow by a porous stretchable sheet is studied by Sheikholeslami et al. [4]. Hayat et al. [5] analyzed magnetohydrodynamic stagnation point flow of Jeffrey fluid toward a heated stretchable surface. Abbas et al. [6] inspected transfer of heat in viscous fluid flow by a porous stretchable/shrinkable cylinder. MHD steady flow of third-grade fluid over a stretchable cylinder is presented by Hayat et al. [7]. Hayat et al. [8] considered the revised Fourier heat flux model in flow of Jeffrey liquid with variable characteristics of thermal conductivity. Autocatalysis in MHD flow of Casson material is studied by Khan et al. [9]. Irreversibility in nanomaterial flow of viscous liquid is scrutinized by Hayat et al. [10]. Hayat et al. [11] examined the combined aspects of nonlinear radiation and mixed convection. Analysis of stretched flow of Sisko liquid with chemical reaction is performed by Hayat et al. [12]. Aziz et al. [13] performed the numerical study of heat source and sink in the rotatory flow of nanofluid. Darcy–Forchheimer 3D flow of nanofluid with convective boundary condition and chemical reactions is analyzed by Hayat et al. [14].

In thermal physics the fact of heat transfer is reported as the passage of thermal energy from the hot bodies to the cold one. This aspect in fluid mechanics has gained a particular interest in engineering and industrial processes. Melting heat transport is introduced due to its relevance to some particular engineering problems such as magma solidification, melting of permafrost and preparations of semiconductor materials. At high heat flux for rapid cooling, ice slurries (a mixture of water and ice particles) could be utilized due to its high heat capacity because of its latent heat and direct contact heat transfer between heated surface and ice particles. Ice slurries can be used in order to regulate amorphous solids production, at low-temperature biomaterials and foods preservation, the properties of materials by thermal treatments such as quenching and in the emergency cooling system of nuclear reactors. Applications of melting heat transfer include oil extraction, silicon wafer process and thermal insulation, geothermal recovery. By placing ice slub in hot air stream the phenomenon of melting is studied by Robert [15]. Hayat et al. [16] inspected melting effect in flow of nanotubes by a variable thickness surface. Heat transfer via melting in micropolar fluid flow by a stretchable sheet is inquired by Yacob et al. [17]. Hayat et al. [18] explored heat transfer via melting in chemically reactive flow of nanotubes. An experiment for heat transfer via melting of the solid–liquid phase material paraffin added with nanoparticles in a vertically square enclosure is performed by Ho and Gao [19]. Das [20] inquired transfer of heat during the melting process of steady viscous fluid with MHD over a movable surface.

Magnetofluiddynamics is a field in which the motion of fluid (conducting electrically like liquid metals, salt water and plasmas) is analyzed. The word magnetohydrodynamics is the combination of three words. (1) Magneto means magnetic field, (2) hydro means water, and (3) dynamics is the movement of particles. In dynamic fluids flow, magnetic field induces current and produces forces on the fluid. Due to wide range of applications magnetohydrodynamics (MHD) is an important area of study for the scientists and engineers. MHD has been a subject of interest due to its significance in various fields arising from several natural phenomena like astrophysics, geophysics and many engineering processes such as confinement of plasma, liquid–metal cooling of nuclear reactors. There are huge applications of MHD technologies to the aerospace vehicles. One of these applications is to control the flow around reentry vehicles with MHD interactions. A shock wave is induced where the air pressure can exceed 10,000 k with high electrical conductivity. Then the magnetic field is applied externally, and the MHD interaction pushes the shock wave away from the vehicle and reduces the thermal flux on the wall. Hayat et al. [21] addressed the transfer of heat during melting in the flow of Burgers material over a stretching sheet. Irreversibility in MHD flow of viscous fluid by a rotating disk is elaborated by Rashidi et al. [22]. Mukhopadhyay [23] examined heat transfer in MHD flow over a stretchable sheet. Rashidi et al. [24] studied buoyancy, magnetic and thermal radiation effect in flow of nanofluid. Joule heating, partial slip and viscous dissipation effects on MHD nanofluid flow are explored by Hayat et al. [25]. Turkyilmazoglu [26] addressed the MHD flow of viscoelastic fluids by a stretchable/shrinkable sheet. Series solution for Falkner–Skan flow of MHD fluid is constructed by Abbasbandy and Hayat [27]. Free convective micropolar fluid flow is elaborated by Mishra et al. [28]. MHD nanofluid flow over a variable thickness surface is addressed by Hayat et al. [29]. Azeany et al. [30] analyzed the stagnation point flow bounded by a permeable stretchable surface. Khan et al. [31] presented viscous dissipative flow with chemical reactions. Thermo-hydrodynamic stability in water-based nanoliquid under the impact of transverse magnetic field is addressed by Wakif et al. [32]. Nanofluid flow of Powell-Eyring fluid due to a curved surface is considered by Hayat et al. [33]. Qayyum et al. [34] analyzed third-grade nanofluid flow over a variable thickness surface with convection. Non-uniform heat source/sink in flow of viscoelastic fluid with porous medium is done by Mishra et al. [35]. Chemical reactions with magnetic effects in flow of micropolar fluid are considered by Hayat et al. [36]. Joule heating in chemically reactive and radiative flow is elaborated by Shamshuddin et al. [37]. Bhukta et al. [38] examined mixed convective and dissipative flow with non-uniform heat source/sink. Non-Newtonian fluid over a permeable stretchable surface with exothermal reaction is analyzed by Eid et al. [39]. Baag et al. [40] analyzed buoyancy effects in MHD flow with heat source and sink.

The theme of present effort is to inspect heat transfer via melting in flow of MHD Oldroyd-B fluid, in the region of orthogonal stagnation point over a variable thicked surface. In addition, heat source/sink is also taken into account. Series solution via HAM (homotopy analysis method) [41,42,43,44,45,46,47,48,49,50,51,52,53,54,55] is constructed. Flow, temperature and local Nusselt number are explored graphically.

2 Mathematical formulation

We are interested in examining the stagnation point flow of an Oldroyd-B material toward a stretchable sheet of variable thickness. Melting heat transfer over sheet is considered. Sheet thickness is specified by \(y = B\left( {x + b} \right)^{{\tfrac{1 - n}{2} \, }}\). The effect of heat source/sink is also taken into account. We have considered that \(T_{\infty } > T_{n}\). A transverse applied magnetic field conducts the flow. In Cartesian coordinate system \(x\)-axis is assumed along the surface, while \(y\)-axis is normal to flow. Under boundary layer assumptions (\(o(x) = o(u) = o(1),\) \(o(y) = o(v) = o(\delta )\)) the conservation laws yield

$$\frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} = 0,$$
(1)
$$u\frac{\partial u}{\partial x} + v\frac{\partial u}{\partial y} + \lambda_{1} \left( {u^{2} \frac{{\partial^{2} u}}{{\partial x^{2} }} + v^{2} \frac{{\partial^{2} u}}{{\partial y^{2} }} + 2uv\frac{{\partial^{2} u}}{\partial x\partial y}} \right) = U_{e} \frac{{dU_{e} }}{dx} + \lambda_{1} \, U_{e}^{2} \frac{{d^{2} U_{e} }}{{dx^{2} }} + \upsilon \frac{{\partial^{2} u}}{{\partial y^{2} }} + \upsilon \lambda_{2} \left( {u\frac{{\partial^{3} u}}{{\partial x\partial y^{2} }} + v\frac{{\partial^{3} u}}{{\partial y^{3} }} - \frac{\partial u}{\partial x}\frac{{\partial^{2} u}}{{\partial y^{2} }} - \frac{\partial u}{\partial y}\frac{{\partial^{2} u}}{{\partial y^{2} }}} \right) - \frac{{\sigma B_{0}^{2} }}{\rho }\left( {u - U_{e} + \upsilon \lambda_{1} \frac{\partial u}{\partial y}} \right),$$
(2)
$$u\frac{\partial T}{\partial x}{ + }v\frac{\partial T}{\partial y} = \alpha \frac{{\partial^{2} T}}{{\partial y^{2} }}{ + }\frac{{Q_{0} \left( {T - T_{n} } \right)}}{{\rho c_{p} }},$$
(3)

with subjected boundary conditions

$$u = U_{w} \left( x \right) = U_{0} \left( {x + b} \right)^{n} ,\, \, v = 0,\, \, T = T_{n} , {\text{ at }}y = B\left( {x + b} \right)^{{\tfrac{1 - n}{2}}} ,$$
$$u \to U_{e} \left( x \right) = U_{\infty } \left( {x + b} \right)^{n} ,\,\;T \to T_{\infty } ,\,\;{\text{as }}y \to \infty .$$
(4)

Melting condition for heat transfer is

$$\left. {k\left( {\frac{\partial T}{\partial y}} \right)} \right|_{{y = B\left( {x + b} \right)^{{\tfrac{1 - n}{2} \, }} }} = \left. {\rho \left[ {\lambda + C_{s} (T_{n} - T_{0} )} \right]\,v(x,\,y)} \right|_{{y = B\left( {x + b} \right)^{{\tfrac{1 - n}{2} \, }} }} .$$
(5)

Transformations are defined as follows:

$$\begin{aligned} \eta = & y\sqrt {\frac{n + 1}{2}\frac{{U_{0} \left( {x + b} \right)^{n - 1} }}{\upsilon }} , { }\psi = \sqrt {\frac{2}{n + 1}\upsilon U_{0} \left( {x + b} \right)^{n + 1} } F\left( \eta \right),\, \, \varTheta \left( \eta \right) = \frac{{T - T_{n} }}{{T_{\infty } - T_{n} }},\, \\ u = & U_{0} \left( {x + b} \right)^{n} F^{\prime}\left( \eta \right),\, \, v = - \sqrt {\frac{n + 1}{2}\upsilon U_{0} \left( {x + b} \right)^{n - 1} } \left[ {F\left( \eta \right) + \eta F^{\prime}\left( \eta \right)\,\frac{n - 1}{n + 1}} \right]. \\ \end{aligned}$$
(6)

After the application of these transformations continuity equation is trivially satisfied, while Eqs. (2-4) yield

$$F^{\prime\prime\prime} + FF^{\prime\prime} - \frac{2n}{n + 1}F^{\prime 2} + \frac{2n}{n + 1}A^{2} - \frac{2}{n + 1}HF^{\prime} + \frac{2}{n + 1}HA + \beta_{1} (\left( {3n - 1} \right)\,FF^{\prime}F^{\prime\prime} - \frac{{2n\left( {n - 1} \right)}}{n + 1}F^{\prime 3} + \eta \frac{n - 1}{2}F^{\prime 2} F^{\prime\prime} - \frac{n + 1}{2}F^{2} F^{\prime\prime\prime} - \frac{{2n\left( {n - 1} \right)}}{n + 1}A^{3} + \eta \frac{n - 1}{n + 1}HF^{\prime}F^{\prime\prime} + HFF^{\prime\prime}) + \beta_{2} \left( {\frac{3n - 1}{2}F^{\prime \prime 2} - \frac{n + 1}{2}FF^{{\left( {iv} \right)}} + \left( {n - 1} \right)\,F^{\prime}F^{\prime\prime\prime}} \right) = 0,$$
(7)
$$\varTheta^{\prime\prime} + \mathop {\Pr }\limits \left( {F\varTheta^{\prime} + \frac{2}{n + 1}\delta \,\varTheta } \right) = 0.$$
(8)

The boundary conditions now become

$$F^{\prime}(\alpha ) = 1,\, \, \varTheta \left( 0 \right) = 0,\, \, M\varTheta^{\prime}\left( \alpha \right) + \mathop {\Pr }\limits \left[F\left( \alpha \right) + \frac{n - 1}{n + 1}\alpha \right] = 0{\text{ at }}\alpha = B\sqrt {\frac{n + 1}{2}\frac{{U_{0} }}{{\nu_{f} }}} ,$$
$$F^{\prime}(\infty ) \to A,\, \, \varTheta \left( \infty \right) \to 1,\,{\text{ as }}\alpha \to \infty .$$
(9)

These definitions are

$$\begin{aligned} M = & \frac{{C_{pf} \left( {T_{\infty } - T_{m} } \right)}}{{\lambda + C_{s} \left( {T_{m} - T_{0} } \right)}},\, \, \Pr = \frac{{\mu c_{p} }}{k},\, \, A = \frac{{U_{\infty } }}{{U_{0} }},\, \, H = \frac{{B_{0}^{2} \sigma }}{{\rho U_{o} }},\, \, \eta = \alpha = B\sqrt {\frac{n + 1}{2}\frac{{U_{0} }}{\upsilon }} ,\, \\ \beta_{1} = & \lambda_{1} U_{0} \left( {x + b} \right)^{n - 1} ,\, \, \beta_{2} = \lambda_{2} U_{0} \left( {x + b} \right)^{n - 1} ,\, \, \alpha = B\sqrt {\frac{n + 1}{2}\frac{{U_{0} }}{{\nu_{f} }}} {\text{ and }}\delta = \frac{{Q_{0} }}{{\rho c_{p} U_{o} }}. \\ \end{aligned}$$
(10)

Differentiation with respect to \(\eta\) is denoted by prime. We define \(F(\eta ) = f(\eta - \alpha ) = f(\zeta )\), and Eqs. (8)–(10) become

$$f^{\prime\prime\prime} + ff^{\prime\prime} - \frac{2n}{n + 1}f^{\prime 2} + \frac{2n}{n + 1}A^{2} - \frac{2}{n + 1}Hf^{\prime} + \frac{2}{n + 1}HA + \beta_{1} (\left( {3n - 1} \right)\,ff^{\prime}f^{\prime\prime} - \frac{{2n\left( {n - 1} \right)}}{n + 1}f^{\prime 3} + (\zeta + \alpha )\frac{n - 1}{2}f^{\prime 2} f^{\prime\prime} - \frac{n + 1}{2}f^{2} f^{\prime\prime\prime} - \frac{{2n\left( {n - 1} \right)}}{n + 1}A^{3} + (\zeta + \alpha )\frac{n - 1}{n + 1}Hf^{\prime}f^{\prime\prime} + Hff^{\prime\prime}) + \beta_{2} \left( {\frac{3n - 1}{2}f^{\prime \prime 2} - \frac{n + 1}{2}ff^{{\left( {iv} \right)}} + \left( {n - 1} \right)\,f^{\prime}f^{\prime\prime\prime}} \right) = 0,$$
(11)
$$\theta^{\prime\prime} + \mathop {\Pr }\limits \left( {f\theta^{\prime} + \frac{2}{n + 1}\delta \,\theta } \right) = 0,$$
(12)
$$f^{\prime}(0) = 1,\, \, \theta \left( 0 \right) = 0,\, \, M \, \theta^{\prime}\left( 0 \right) + \mathop {\Pr }\limits \left[f\left( 0 \right) + \frac{n - 1}{n + 1}\alpha \right] = 0,$$
$$f^{\prime}(\infty ) \to A,\, \, \theta \left( \infty \right) \to 1,\,{\text{ as }}\zeta \to \infty .$$
(13)

Local Nusselt number (\(Nu_{x}\)) is

$$Nu_{x} = \frac{{\left( {x + b} \right)\,q_{w} }}{{k(T_{\infty } - T_{n} )}},$$
$$q_{w} = - \kappa \left( {\frac{\partial T}{\partial y}} \right)_{{y = B\left( {x + b} \right)^{{\tfrac{1 - n}{2}}} }} .$$
(14)

Dimensionless local Nusselt numbers are reduced to

$$Nu_{x} Re_{x}^{ - 1/2} = - \sqrt {\frac{n + 1}{2}} \theta^{\prime}(0),$$
(15)

where local Reynolds number is \(Re_{x} = \tfrac{{U_{w} \left( {x + b} \right)}}{\upsilon }\).

2.1 Solutions via homotopy

Initial guesses along with auxiliary linear operators are

$$f_{0} \left( \zeta \right) = A\zeta + \left( {1 - A} \right)\,\left( {1 - \exp \left( { - \zeta } \right)} \right) - \frac{M}{\Pr } + \alpha \frac{n - 1}{n + 1},\,$$
$$\theta_{0} \left( \zeta \right) = 1 - \exp \left( { - \zeta } \right),$$
$${\mathbf{L}}_{f} \left( f \right) = \frac{{d^{3} f}}{{d\zeta^{3} }} - \frac{df}{d\zeta },\,$$
$${\mathbf{L}}_{\theta } \left( \theta \right) = \frac{{d^{2} \theta }}{{d\zeta^{2} }} - \theta .$$
(16)

Zeroth- and mth-order deformation problems are as follows.

2.2 Problem of zeroth order

$$\left( {1 - p} \right)\,{\mathbf{L}}_{f} [\hat{f}\left( { \, \zeta ;\,p \, } \right) - f_{0} \left( { \, \zeta \, } \right)\, ]= p\hbar_{f} {\mathbf{N}}_{f} [\hat{f}\left( { \, \zeta ;\,p \, } \right),\hat{\theta }\left( { \, \zeta ;\,p \, } \right)\, ],$$
(17)
$$\left( {1 - p} \right)\,{\mathbf{L}}_{\theta } [\hat{\theta }\left( { \, \zeta ;\,p \, } \right) - \theta_{0} \left( { \, \zeta \, } \right)\, ]= p\hbar_{\theta } {\mathbf{N}}_{\theta } [\hat{\theta }\left( { \, \zeta ;\,p \, } \right),\,\hat{f}\left( { \, \zeta ;\,p \, } \right)\, ],$$
(18)
$$\hat{f}^{{\prime }} (0;p) = 1,\quad \, \hat{f}^{{\prime }} (\infty ;\,p) \to A,\,$$
(19)
$$\hat{\theta}^{\prime} \left({0;p} \right) = - \frac{\Pr}{M}\left({\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{f} \left({0;p} \right) + \frac{m - 1}{m + 1}\alpha} \right),\quad \hat{\theta}\left({\infty;p} \right) \to 1.$$
(20)
$$N_{f} \left[{\hat{f}\left({\zeta,\,p} \right)} \right] = \frac{{\partial^{3} \hat{f}\left({\zeta;\,p} \right)}}{{\partial \zeta^{3}}} + \overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{f} \left({\zeta;\,p} \right)\,\frac{{\partial^{2} \hat{f}\left({\zeta;\,p} \right)}}{{\partial \zeta^{2}}} - \frac{2n}{n + 1}\left({\frac{{\partial \hat{f}\left({\zeta;\,p} \right)}}{\partial \zeta}} \right)^{2} + \frac{2n}{n + 1}A^{2} \, - \frac{2}{n + 1}H\frac{{\partial \hat{f}\left({\zeta;\,p} \right)}}{\partial \zeta} + \beta_{1} (\left({3n - 1} \right)\,\hat{f}\left({\zeta;\,p} \right)\,\frac{{\partial \hat{f}\left({\zeta;\,p} \right)}}{\partial \zeta}\frac{{\partial^{2} \hat{f}\left({\zeta;\,p} \right)}}{{\partial \zeta^{2}}} - \frac{{2n\left({n - 1} \right)}}{n + 1}\left({\frac{{\partial \hat{f}\left({\zeta;\,p} \right)}}{\partial \zeta}} \right)^{3} + \frac{2}{n + 1}HA + (\zeta + \alpha)\frac{n - 1}{2}\left({\frac{{\partial \hat{f}\left({\zeta;\,p} \right)}}{\partial \zeta}} \right)^{2} \frac{{\partial^{2} \hat{f}\left({\zeta;\,p} \right)}}{{\partial \zeta^{2}}} - \frac{n + 1}{2}\left({\hat{f}\left({\zeta;\,p} \right)} \right)^{2} \frac{{\partial^{3} \hat{f}\left({\zeta;\,p} \right)}}{{\partial \zeta^{3}}} - \frac{{2n\left({n - 1} \right)}}{n + 1}A^{3} + \left(\zeta + \alpha)\frac{n - 1}{n + 1}H\frac{{\partial \hat{f}\left({\zeta;\,p} \right)}}{\partial \zeta}\frac{{\partial^{2} \hat{f}\left({\zeta;\,p} \right)}}{{\partial \zeta^{2}}}H\hat{f}\left({\zeta;\,p} \right)\,\frac{{\partial \hat{f}\left({\zeta;\,p} \right)}}{{\partial \zeta^{2}}}\right) + \beta_{2} \left({\frac{3n - 1}{2}\left({\frac{{\partial^{2} \hat{f}\left({\zeta;\,p} \right)}}{{\partial \zeta^{2}}}} \right)^{2} - \frac{n + 1}{2}\hat{f}\left({\zeta;\,p} \right)\,\frac{{\partial^{4} \hat{f}\left({\zeta;\,p} \right)}}{\partial \zeta 4} + \left({n - 1} \right)\,\frac{{\partial \hat{f}\left({\zeta;\,p} \right)}}{\partial \zeta}\frac{{\partial^{3} \hat{f}\left({\zeta;\,p} \right)}}{{\partial \zeta^{3}}}} \right),$$
(21)
$${\mathbf{N}}_{\theta } \left[ {\hat{\theta }\left( {\zeta ;\,p} \right),\,\hat{f}\left( {\zeta ;\,p} \right)} \right] = \frac{{\partial^{2} \hat{\theta }(\zeta ,\,p)}}{{\partial \zeta^{2} }} + \mathop {\Pr }\limits \left( {\hat{f}\left( {\zeta ;\,p} \right)\,\frac{{\partial \hat{\theta }(\zeta ,\,p)}}{\partial \zeta } + \frac{2}{n + 1}\delta \,\hat{\theta }(\zeta ,\,p)} \right).$$
(22)

Here \(p \in [0,\,1]\) depicts embedding parameter.

2.3 Problem of mth order

$${\mathbf{L}}_{f} [f_{m} \left( { \, \zeta } \right) - \chi_{m} f_{m - 1} \left( \zeta \right)\, ]= \hbar_{f} {\mathbf{R}}_{m}^{f} \left( \zeta \right),$$
(23)
$${\mathbf{L}}_{\theta } [\theta_{m} \left( { \, \zeta } \right) - \chi_{m} \theta_{m - 1} \left( \zeta \right)\, ]= \hbar_{\theta } {\mathbf{R}}_{m}^{\theta } \left( \zeta \right),$$
(24)
$$f^{\prime}_{m} \left( 0 \right) = 0,\, \, \theta_{m} \left( 0 \right) = 0,\, \, \theta^{\prime}_{m} \left( 0 \right) = - \frac{\Pr }{M}f_{m} \left( 0 \right),$$
$$\,\,f^{\prime}_{m} \left( \infty \right) \to 0,\,\,\,\theta_{m} \left( \infty \right) \to 0.$$
(25)
$${\mathbf{R}}_{m}^{f} \left( \eta \right) = f_{m - 1}^{\prime \prime \prime } + \mathop \sum \limits_{k = 0}^{m - 1} \left( {f_{m - 1 - k} f_{k}^{\prime \prime } } \right) - \frac{2n}{n + 1}\mathop \sum \limits_{k = 0}^{m - 1} \left( {f_{m - 1 - k}^{\prime } f_{k}^{\prime } } \right) + \frac{2n}{n + 1}A^{2} \left( {1 - \chi_{m} } \right) - \frac{2}{n + 1}Hf_{m - 1}^{\prime } + \frac{2}{n + 1}HA\left( {1 - \chi_{m} } \right) + H\mathop \sum \limits_{k = 0}^{m - 1} (f_{k} f^{'}_{m - 1 - k} ) + \beta_{1} (\left( {3n - 1} \right)\,\mathop \sum \limits_{k = 0}^{m - 1} (f_{m - 1 - k} \mathop \sum \limits_{l = 0}^{k} \left( {f_{k - l}^{\prime } f_{l}^{\prime \prime } } \right) - \frac{{2n\left( {n - 1} \right)}}{n + 1}f_{m - 1 - k}^{\prime } \mathop \sum \limits_{l = 0}^{k} \left( {f_{k - l}^{\prime } f_{l}^{\prime } } \right) + (\zeta + \alpha )\frac{n - 1}{2}f^{\prime}\mathop \sum \limits_{l = 0}^{k} \left( {f_{k - l}^{\prime } f_{l}^{\prime \prime } } \right) + \beta_{1} (\left( {3n - 1} \right)\,\mathop \sum \limits_{k = 0}^{m - 1} (f_{m - 1 - k} \mathop \sum \limits_{l = 0}^{k} \left( {f_{k - l}^{\prime } f_{l}^{\prime \prime } } \right) - \frac{{2n\left( {n - 1} \right)}}{n + 1}f_{m - 1 - k}^{\prime } \mathop \sum \limits_{l = 0}^{k} \left( {f_{k - l}^{\prime } f_{l}^{\prime } } \right) + (\zeta + \alpha )\frac{n - 1}{2}f^{\prime}\mathop \sum \limits_{l = 0}^{k} \left( {f_{k - l}^{\prime } f_{l}^{\prime \prime } } \right) - \frac{n + 1}{2}f_{m - 1 - k} \mathop \sum \limits_{l = 0}^{k} \left( {f_{k - l} f_{l}^{\prime \prime \prime } } \right)) - \frac{{2n\left( {n - 1} \right)}}{n + 1}A^{3} \left( {1 - \chi_{m} } \right) + (\zeta + \alpha )\frac{n - 1}{n + 1}H\mathop \sum \limits_{k = 0}^{m - 1} \left( {f_{m - 1 - k}^{\prime } f_{k}^{\prime \prime } } \right)\, + H\mathop \sum \limits_{k = 0}^{m - 1} \left( {f_{m - 1 - k} f_{k}^{\prime \prime } } \right)) + \beta_{2} \left( {\frac{3n - 1}{2}\mathop \sum \limits_{k = 0}^{m - 1} \left( {f_{m - 1 - k}^{\prime \prime } f_{k}^{\prime \prime } } \right) - \frac{n + 1}{2}\mathop \sum \limits_{k = 0}^{m - 1} \left( {f_{m - 1 - k} f_{k}^{{\left( {iv} \right)}} } \right) + \left( {n - 1} \right)\,\mathop \sum \limits_{k = 0}^{m - 1} \left( {f_{m - 1 - k}^{\prime } f_{k}^{\prime \prime \prime } } \right)} \right),$$
(26)
$${\mathbf{R}}_{m}^{\theta } \left( \eta \right) = \theta_{m - 1}^{\prime \prime } + \mathop {\Pr }\limits \left( {\mathop \sum \limits_{k = 0}^{m - 1} \left( {f_{m - 1 - k} \theta_{k}^{\prime } } \right) + \frac{2}{n + 1}\delta \,\theta_{m - 1} } \right),$$
(27)
$$\chi_{m} = \left\{ {\begin{array}{*{20}c} {0,\, \, m \le 1} \\ {1,\, \, m > 1.} \\ \end{array} } \right.$$
(28)

As we vary p from 0 to 1, \(\hat{f}\left( {\zeta ;\,p} \right)\) and \(\hat{\theta }\left( {\zeta ;\,p} \right)\) vary from the initial solutions \(f_{0} \left( \zeta \right)\) and \(\theta_{0} (\zeta )\) to the final solutions \(f\left( \zeta \right)\) and \(\theta (\zeta )\), respectively. Thus,

$$\hat{f}\left( { \, \zeta ;\,0 \, } \right) = f_{0} \left( \zeta \right),\, \, \hat{f}\left( {\zeta ;\,1} \right) = f\left( { \, \zeta \, } \right),$$
(29)
$$\hat{\theta }\left( {\zeta ;\,0} \right) = \theta_{0} \left( \zeta \right),\, \, \hat{\theta }\left( {\zeta ;\,1} \right) = \theta \left( \zeta \right).$$
(30)

By means of Taylor series expansion we have

$$\hat{f}\left( {\zeta ;\,p} \right) = f_{0} \left( \zeta \right) + \mathop \sum \limits_{m = 1}^{\infty } f_{m} \left( \zeta \right)\,p^{m} ,\, \, f_{m} \left( \zeta \right) = \left. {\frac{1}{m!}\frac{{\partial^{m} \hat{f}\left( { \, \zeta ;\,p \, } \right)}}{{\partial p^{m} }}} \right|_{p = 0} ,$$
(31)
$$\hat{\theta }\left( {\zeta ;\,p} \right) = \theta_{0} \left( \zeta \right) + \mathop \sum \limits_{m = 1}^{\infty } \theta_{m} \left( \zeta \right)\,p^{m} ,\, \, \theta_{m} \left( \zeta \right) = \left. {\frac{1}{m!}\frac{{\partial^{m} \hat{\theta }\left( {\zeta ;\,p} \right)}}{{\partial p^{m} }}} \right|_{p = 0} .$$
(32)

Also

$$f\left( \zeta \right) = f_{0} \left( \eta \right) + \mathop \sum \limits_{m = 1}^{\infty } f_{m} \left( \zeta \right),$$
(33)
$$\theta \left( \eta \right) = \theta_{0} \left( \zeta \right) + \mathop \sum \limits_{m = 1}^{\infty } \theta_{m} \left( \zeta \right).$$
(34)

The general solutions \(f_{m}\) and \(\theta_{m}\) are

$$f_{m} \left( \zeta \right) = f_{m}^{*} \left( \zeta \right) + A_{1} + A_{2} e^{\zeta } + A_{3} e^{ - \zeta } ,$$
(35)
$$\theta_{m} \left( \zeta \right) = \theta_{m}^{*} \left( \zeta \right) + A_{4} e^{\zeta } + A_{5} e^{ - \zeta } ,$$
(36)

where \(f_{m}^{*}\) and \(\theta_{m}^{\prime * }\) depict special solutions and Ai\((i = 1,\,2, \ldots ,\,5)\) represent arbitrary constants. Thus, we have

$$A_{1} = \frac{M}{\Pr }\left( {A_{5} - \theta_{m}^{\prime * } \left( 0 \right)} \right) - A_{3} - f_{m}^{*} \left( 0 \right),\, \, A_{2} = A_{4} = 0,\, \, A_{3} = f_{m}^{*'} \left( 0 \right)\, , { }A_{5} = - \theta_{m}^{ * } \left( 0 \right).$$
(37)

2.4 Convergence analysis

For \(\hbar_{f}\) and \(\hbar_{\theta } ,\) \(\hbar\)-curves are displayed in Figs. 1 and 2. The acceptable ranges of \(\hbar_{f}\) and \(\hbar_{\theta }\) are \(- 1.45 \le \hbar_{f} \le - 1.1\) and \(- 1.3 \le \hbar_{\theta } \le - 0.68\).

Fig. 1
figure 1

Sketch for \(\hbar_{f}\)

Fig. 2
figure 2

Sketch for \(\hbar_{\theta }\)

3 Discussion

This section intends to study the influences of different pertinent variables on flow and temperature. The effect of M on flow is portrayed in Fig. 3. Clearly, both velocity and associated penetration depth are enhanced for higher M. It is due to enhancement of convective flow from heated flow in direction of cold melting surface. Hence, fluid velocity intensifies. Figure 4 displays the outcome of A on velocity. Interestingly, the velocity enhances for both A > 1 and A < 1. The penetration depth has reverse behavior for higher A > 1 and A < 1. No boundary layer exists when A = 1. Figure 5 shows the impact of \(\alpha\) on velocity. Increment in velocity is found out for larger \(\alpha\). Figure 6 shows the influence of \(\beta_{1}\) on the velocity profile. Here velocity decays for higher \(\beta_{1}\). Figure 7 shows the influence of H on velocity distribution. Interestingly, velocity and momentum layer thickness decrease for higher H. In fact, larger H is responsible for the increase in Lorentz force (resistive force). Hence, for higher H, velocity decreases. Velocity under the impact of \(\beta_{2}\) is labeled in Fig. 8. It is concluded that both flow and penetration depth intensify with an increase in \(\beta_{2}\). The effect of n on flow is drawn in Fig. 9. The parameter n has three important equities: controlling (1) shape of sheet, (2) motion of the fluid and (3) boundary layer behavior. State (shape) of the sheet highly depends on the parameter n such that surface is flat for \(n = 1\), enhancement of \(\alpha\) occurs for n < 1 which corresponds to outer convex-type shape of the sheet, and n > 1 corresponds to decrease in \(\alpha\) and inner convex-type shape of the sheet. Boundary layer behavior can also be determined by means of this parameter such that for \(n = 1\), we have \(f(0) = 0\), which represents that the sheet is impermeable. Similarly, for n > 1 and n < 1, we have \(f(0) > 1\) and \(f(0) < 1,\) which represent suction and blowing, respectively. For larger n (n > 1), there is an enlargement in fluid velocity, while for (n < 1) the decay in fluid velocity is observed. Figure 10 displays temperature against M. Here temperature decays when M increases. An increase in M leads to more flow toward melting surface from the heated fluid, which intensifies the fluid flow and temperature of the fluid decay. The impact of A on temperature is portrayed in Fig. 11. Intensification is observed in temperature for higher A. Also penetration depth corresponding to temperature decays for higher A. The effect of \(\alpha\) on temperature of the fluid is portrayed in Fig. 12. Temperature reduces for larger wall thickness parameter. Figure 13 shows variation in temperature of fluid for higher \(\delta\). It is found that temperature shows increasing behavior for \(\delta > 0\), while it decreases for \(\delta < 0\). Figure 14 shows the impact of n on the temperature of the fluid. It is found that the temperature of the fluid decays for larger n. Figure 15 shows variation in Pr with respect to temperature. Here temperature enhances for higher values of Pr. Further, thermal penetration depth decays with an increase in Pr. Nusselt number is inspected under the influence of M, A and Pr. Decay in Nusselt number is found for larger M, while it indicates the opposite behavior for higher A and Pr. Table 1 gives the nomenclature of involved variables, while Table 2 gives the numerical evaluation of Nusselt number. Furthermore, comparison of Nusselt number corresponding to various values of A with published works [56, 57] in past is given in Table 3. Here an excellent agreement is noticed (Fig. 16a, b).

Fig. 3
figure 3

Variations in \(f^{\prime}\) via M

Fig. 4
figure 4

Variations in \(f^{\prime}\) via A

Fig. 5
figure 5

Variations in \(f^{\prime}\) via \(\alpha\)

Fig. 6
figure 6

Variations in \(f^{\prime}\) via \(\beta_{1}\)

Fig. 7
figure 7

Variations in \(f^{\prime}\) via H

Fig. 8
figure 8

Variations in \(f^{\prime}\) via \(\beta_{2}\)

Fig. 9
figure 9

Variations in \(f^{\prime}\) via n

Fig. 10
figure 10

Variations in \(\theta\) via M

Fig. 11
figure 11

Variations in \(\theta\) via A

Fig. 12
figure 12

Variations in \(\theta\) via \(\alpha\)

Fig. 13
figure 13

Variations in \(\theta\) via \(\delta\)

Fig. 14
figure 14

Variations in \(\theta\) via n

Fig. 15
figure 15

Variations in \(\theta\) via Pr

Table 1 Nomenclature of involved parameters
Table 2 Numerical evaluation of Nusselt number for higher M, A and Pr when \(\delta = 0.1\), \(H = 0.1\), \(n = 0.5\) and \(\alpha = 0.6\)
Table 3 Comparison of Nusselt number with published works for various values of A when \(\Pr = 1 = n\), while all other parameters are zero
Fig. 16
figure 16

a Variations in \(Nu_{x}\) via M and A. b Variations in \(Nu_{x}\) via M and Pr

4 Concluding remarks

We disclosed the characteristics of MHD flow of a non-Newtonian (Oldroyd-B) fluid. Flow is considered over a stretchable sheet of variable thickness in region of stagnation point. Key points are as follows:

  • Velocity shows intensification with larger M, \(\alpha\) and \(\beta_{2}\), while it decays with an increase in H, n and \(\beta_{1}\).

  • Higher M, \(\delta > 0\) (heat source parameter) and Pr are responsible for the reduction in temperature, but the opposite behavior is found for larger n and \(\alpha\).

  • Rate of heat transfer or process of cooling can be intensified by using larger A and Pr, while it decays for higher M.