1 Introduction

In recent decades, the finite element method, the finite volume method and the finite difference method (FDM) [11] have been facing some difficulties due to increasing requirements for simulating more and more complicated natural problems. In these methods based on meshes, the global meshing difficulties and a large number of re-meshes in successive computational steps lead to the complexity of the computer program. Meshless methods, as alternative numerical approaches have attracted much attention in the past decade. The main objective of the meshless methods is to get rid of, or at least alleviate the difficulty of, meshing and re-meshing the entire structure, by only adding or deleting nodes in the entire structure, instead. Meshless methods [12, 15, 51, 54] may also alleviate some other problems associated with the finite element method, such as locking, element distortion, and others [32, 62].

Some meshfree methods have been developed, such as smooth particle hydrodynamics (SPH) methods [23], diffuse element method (DEM) [44], element free Galerkin method (EFG) [7], reproducing kernel particle method (RKPM) [25, 3436, 38], hp- clouds [21], partition of unity method (PUM) [43], meshless local Petrov–Galerkin method (MLPG) [25], finite point method [45, 55] and so on.

The meshfree collocation strong form method, is a truly meshless method which is easy to implement and computationally efficient but in problems with Neumann boundary conditions is unstable and inaccurate. Moreover, the meshfree weak form methods are accurate and stable approaches that naturally dealt with the Neumann boundary conditions. In spite of this, employing the background cells for numerical integration makes the weak form method not totally meshfree and computationally expensive. Considering the above stated matters, Liu and Gu [39, 40] introduced the meshfree weak-strong form (MWS) method based on a combination of strong form and local Petrov–Galerkin weak form of Atluri [3]. The aim of the MSW method is to remove the quadrature cells as much as possible and still achieve an accurate and stable numerical procedure. The MWS method has been successfully developed and applied for the static and dynamic analysis of structures [16, 17, 26, 3941, 63]. The method uses the moving least square approximation [47] or radial point interpolation [17] to construct the shape functions for the collocation method and employs them for internal nodes and nodes on the essential boundaries while applies the meshless local Petrov–Galerkin method for nodes on natural boundary of the problem domain.

Magnetohydrodynamic (MHD) equation studies the interaction between the flow of an electrically conducting fluid and magnetic fields. Faraday first pointed out an interaction of sea flows with the earth as magnetic field (1832). In the beginning of the 20th century the first proposals for applying electromagnetic induction phenomenon in technical devices with electrically-conducting liquids and gases appeared. Systematic studies of magnetohydrodynamic (MHD) flows began in the 30s when the first exact solutions of MHD equations were obtained and experiments on liquid metal flows in MHD channels were performed by Hartmann and Lazarus [29]. The discovery of Alfvén waves finalized the establishment of magnetohydrodynamic as an individual science for which he received the Nobel Prize in Physics (1970) [1]. The study of flow of conducting fluids in the presence of magnetic fields has attracted owning to its applications in the evolution and dynamics of astrophysical objects, thermonuclear fusion, metallurgy and semiconductor crystal growth, etc.

The set of equations which describe MHD are a combination of the Navier–Stokes equations of fluid dynamics and Maxwell’s equations of electromagnetism. Due to this, the equations governing MHD are rather cumbersome and exact solutions are available only for simple geometry subject to simple boundary conditions [10, 20, 24, 28, 49]. Gupta and Singh [27] obtained exact solution for unsteady flows in some special cases. Hence, some numerical methods have been applied to give the approximate solution for the MHD flow problems. For numerical research on MHD flow, we can refer to works of Singh and Lal [52, 53] by finite element method for Hartmann numbers less than 10, Tezer–Sezgin and Köksal [56] by finite element method for moderate Hartmann numbers, Sheu and Lin [50] by finite difference method, Tezer–Sezgin and Bozkaya [59], Tezer-Sezgin [57], Tezer-Sezer and Aydin [58], and Hosseinzadeh et al. [30] by boundary element method [30] and dual reciprocity boundary element method, stablized finite element method by Salah et al. [46], Veradi et al. [60, 61] by element free Galerkin method, Shakeri and Dehghan [48] by a combination of finite volume and spectral element method, Dehghan and Mirzaei [13] by meshless local boundary integral equation method, Dehghan and Mirzaei [14] by meshless local Petrov–Galerkin method. Some other research works can be found in [8, 9, 42].

In the current paper, the meshfree weak-strong form method is applied to numerically solve the unsteady MHD flow with arbitrarily conducting walls. We consider pipes of rectangular and circular cross-sections to demonstrate the numerical method. For different Hartmann number and wall conductivity, the velocity and induced magnetic field have been computed at various time levels. In the current work, we employed the MLSRKP approximation to obtain the shape functions.

The reminder of this paper is structured as follows: In Sect. 2, the governing equations of the studied problem are presented. A brief discussion of the moving least reproducing kernel particle (MLSRKP) approximation is presented in Sect. 3. In Sect. 4, a time stepping method and numerical implementation of the method are demonstrated. Section 5 includes some test problems and comparisons to reveal the efficiency and accuracy of the proposed method. Finally, some concluding remarks are drawn in Sect. 6.

2 Governing equation

The set of equations which describe MHD are a combination of the Navier–Stokes equations of fluid dynamics and Maxwell’s equations of electromagnetism. For viscous and incompressible fluid, the governing equations in the flow region are [53, 61]

$$\begin{aligned}&\rho \frac{\partial V_{Z}}{\partial T} \!-\! K F(T) \!=\! \acute{\eta } \nabla ^{2}V_{Z} \!+\! \frac{B_{0}}{\mu _{0}}\left( \cos (\theta ) \frac{\partial B_{Z}}{\partial X} + \sin (\theta ) \frac{\partial B_{Z}}{\partial Y}\right) ,\nonumber \\ \end{aligned}$$
(2.1)
$$\begin{aligned}&\frac{\partial B_{Z}}{\partial T} = \frac{1}{\mu _{0}\sigma } \nabla ^{2}B_{Z} + B_{0}\left( \cos (\theta ) \frac{\partial V_{Z}}{\partial X} + \sin (\theta ) \frac{\partial V_{Z}}{\partial Y}\right) , \end{aligned}$$
(2.2)

where

\(\rho ,\,\acute{\eta },\,\sigma \) :

density, viscosity and conductivity of fluid,

\(\mu _{0}\) :

a constant \(=4\pi \times 10^{-7}\) in MKS, system,

\(T\) :

time variable,

\(\theta \) :

orientation of applied magnetic filed with X-axis,

\(B_{0}\) :

applied magnetic filed,

\(V_{Z}, B_{z}\) :

axial velocity and induced magnetic field,

\(-K F(T)\) :

pressure gradient,

\(\nabla ^{2}\) :

is the two-dimensional Laplacian operator.

The boundary conditions on \(V_{Z}\) and \(B_{Z}\) are

$$\begin{aligned} V_{Z} = 0, \quad \quad \frac{\partial B_{Z}}{\partial {N}} + \frac{\sigma }{\acute{\sigma }} \frac{B_{Z}}{\acute{h}} = 0, \end{aligned}$$
(2.3)

where \({N}\) is the outward normal to the boundary of the domain, \(\acute{\sigma }\) and \(\acute{h}\) are the wall conductance and the small wall thickness, respectively.

The initial conditions depend upon how the motion starts initially. If initially the fluid is rest and the motion starts by applying the constant pressure, then the initial conditions become

$$\begin{aligned} V_{Z}(X, Y, 0 ) = 0, \quad \quad B_{Z}(X, Y, 0 ) = 0. \end{aligned}$$
(2.4)

Considering the non–dimensional variables and parameters by

$$\begin{aligned}&V = \frac{V_{Z}}{V_{0}}, \quad \quad V_{0} = \frac{K a^{2}}{\acute{\eta }},\quad \quad B = \frac{B_{Z}}{V_{0} \mu _{0} \sqrt{\sigma \acute{\eta }}}, \\&x = \frac{X}{a},\quad y = \frac{Y}{a}, \quad \quad M^{2} = \frac{B_{0}^{2}a^{2}\sigma }{\acute{\eta }},\quad \quad \lambda = \frac{\sigma a }{\acute{\sigma }\acute{h}},\\&R = \frac{\rho a V_{0}}{\acute{\eta }},\quad \quad R_{m} = V_{0} a \mu _{0} \sigma , \quad \quad t = \frac{T V_{0}}{a}, \\&f(t) = F \left( \frac{aT}{V_{0}} \right) , \end{aligned}$$

where \(M, R\) and \(R_{m}\) are the Hartmann number, Reynolds number and magnetic Reynolds number, respectively. Then the governing equations are reduced to

$$\begin{aligned}&R \frac{\partial V}{\partial t } - f(t) = \nabla ^{2} V + M \left( \cos (\theta ) \frac{\partial B}{\partial x} + \sin (\theta ) \frac{\partial B}{\partial y} \right) , \nonumber \\ \end{aligned}$$
(2.5)
$$\begin{aligned}&R_{m} \frac{\partial B}{\partial t } = \nabla ^{2} B + M \left( \cos (\theta ) \frac{\partial V}{\partial x} + \sin (\theta ) \frac{\partial V}{\partial y} \right) , \end{aligned}$$
(2.6)

in \(\Omega \times [0,\infty )\) with boundary conditions

$$\begin{aligned}&V = 0, \quad \text {on}\,\, \partial \Omega , \end{aligned}$$
(2.7)
$$\begin{aligned}&\frac{\partial B }{{n}} + \lambda B = 0, \quad \text {on}\,\, \partial \Omega , \end{aligned}$$
(2.8)

and initial conditions

$$\begin{aligned} V(x, y, 0) = B(x, y, 0) = 0, \quad (x,y) \in \Omega , \end{aligned}$$
(2.9)

where \(\Omega \) represents the section of the pipe in the non–dimensional form with boundary \(\partial \Omega \).

In the limiting case of perfectly insulating \((\acute{\sigma }=0, \lambda \! =\! \infty )\) and conducting \((\acute{\sigma } = \infty , \lambda = 0)\) walls, the boundary conditions become \(V = B = 0\) and \(V = \frac{\partial B}{\partial {n}} = 0\), respectively [27].

3 Approximation in the MWS form method

The classical MWS form method employs the moving least square approximation and radial point interpolation method to approximate the unknown function. In the current work, we make the approximation by moving least square reproducing kernel particle (MLSRKP) [33, 37]. The MLSRKP was provided as a different version of the moving last square (MLS) approximation where the shape functions are generated by a MLS process. The interpolation of this kind contains a reproducing kernel (RK), which, as a generalization of the discrete case, establishes a continuous basis for a partition of unity and can reproduce any smooth function accurately in a global least square sense. Now we give an outline of this method.

Let \(u(x), x \in \mathbb R ^{d}\), be a sufficiently smooth function defined on a simply open set \(\Omega \subset \mathbb R ^{d} \) with a Lipschitz continuous boundary. For each \(x \in \overline{\Omega }\), we define

$$\begin{aligned} \mathcal B (x)=\left\{ y\in \Omega | \, \varphi \left( \frac{x-y}{\rho }\right) \ne 0\right\} \subseteq \Omega . \end{aligned}$$
(3.1)

Also, for a positive integer \(m\), the space of polynomials of degree \(\le m\) in \(\mathbb R ^{d}\) is defined as

$$\begin{aligned} \mathcal P _{m,d}=\text {span}\{(x-y)^{\alpha }\}_{\alpha :\,|\alpha |\le m}, \end{aligned}$$
(3.2)

and define \(u_{x}:\mathcal B (x)\rightarrow \mathbb R \) by

$$\begin{aligned} \forall y \in \mathcal B (x),\quad u_{x}(y)=u(y). \end{aligned}$$
(3.3)

The process of finding the global approximating function \(u^{G}:\Omega \rightarrow \mathbb R \) is that at each point \(\bar{x}\in \Omega \), by employing the concept of the inner product a local approximant \(L_{\bar{x}}u:\mathcal B (\bar{x})\rightarrow \mathbb R \) for function \(u_{\bar{x}}:\Omega \rightarrow \mathbb R \) is obtained. Then the global approximant is obtained as follows:

$$\begin{aligned} u^{G}(x):=\lim _{\bar{x} \rightarrow x}{(L_{\bar{x}}u)(x)},\quad \quad \forall x\in \overline{\Omega }. \end{aligned}$$
(3.4)

In the current contribution, for a fixed point \(\bar{x}\in \bar{\Omega }\), the local approximant is considered as follows:

$$\begin{aligned} u^{l}(x)\cong (Lu_{\bar{x}})(x)&:= \sum _{i=1}^{Q}{\psi _{i} \left( \frac{x-\bar{x}}{\rho }\right) d_{i}(\bar{x})}\nonumber \\&= {\Psi }\left( \frac{x-\bar{x}}{\rho }\right) \mathbf d (\bar{x}), \end{aligned}$$
(3.5)

where \(Q=\text {dim} \mathcal P _{m,d}=\left( \begin{array}{c} m+d \\ d\\ \end{array}\right) \) and

$$\begin{aligned}&\mathbf d ^{t}(y):=\{d_{1},d_{2},\ldots ,d_{Q}\}(y),\end{aligned}$$
(3.6)
$$\begin{aligned}&\Psi (y):=\{p_{1},p_{2},\ldots ,p_{Q}\},\end{aligned}$$
(3.7)
$$\begin{aligned}&p_{i}=\frac{(x-y)^{\alpha _{i}}}{\rho },\quad i=1,2,\ldots ,m. \end{aligned}$$
(3.8)

Since the polynomial series is finite, then we can define a residual \(r_{\rho }\)

$$\begin{aligned} r_{\rho }:=u^{l}(x)-{\Psi }\left( \frac{x-\bar{x}}{\rho }\right) \mathbf d (\bar{x}), \quad x\in \mathcal B (\bar{x}). \end{aligned}$$
(3.9)

Then a functional related to this residual is defined as

$$\begin{aligned} \mathcal J (\mathbf d (\bar{x}))=\int \limits _\mathcal{B (\bar{x})}{r_{\rho }^{2} (x,\bar{x})\omega _{\rho }(x-\bar{x})\,\mathrm d \mathcal B }, \end{aligned}$$
(3.10)

where \(\omega _{\rho }(x-\bar{x})=\omega (\frac{x-\bar{x}}{\rho })\). One can obtain the following equation by minimizing the quadratic form \(\mathcal J (\mathbf d (\bar{x}))\)

$$\begin{aligned} \int \limits _\mathcal{B (\bar{x})}{\Psi ^{t}\left( \frac{x-\bar{x}}{\rho }\right) (u^{l}(x)-{\Psi }\left( \frac{x-\bar{x}}{\rho }\right) \mathbf d (\bar{x})) \omega _{\rho }(x-\bar{x})\,\mathrm d \mathcal B }=0. \nonumber \\ \end{aligned}$$
(3.11)

When \(\text {supp}\{\omega _{\rho }(x-\bar{x})\}\subseteq \overline{\mathcal{B }}\), then the above integral can be extended over the whole domain

$$\begin{aligned} \int \limits _{\Omega _{x}}{\Psi ^{t}\left( \frac{x-\bar{x}}{\rho }\right) (u^{l}(x)-{\Psi } \left( \frac{x\!-\!\bar{x}}{\rho }\right) \mathbf d (\bar{x}))\omega _{\rho }(x\!-\!\bar{x}) \,\mathrm d \Omega _{x}}=0, \nonumber \\ \end{aligned}$$
(3.12)

which yields

$$\begin{aligned}&\left( \,\int \limits _{\Omega _{x}}{\Psi ^{t}\left( \frac{x-\bar{x}}{\rho }\right) \omega _{\rho } (x-\bar{x})\Psi \left( \frac{x-\bar{x}}{\rho }\right) \mathrm d \,\Omega _{x}}\right) \mathbf d (\bar{x})\nonumber \\&\quad = \int \limits _{\Omega _{x}}{\Psi ^{t}\left( \frac{x-\bar{x}}{\rho }\right) u(x)\omega _{\rho }(x-\bar{x})\mathrm d \,\Omega _{x}}. \end{aligned}$$
(3.13)

Now, if we define an \((Q)\)–by–\((Q)\) matrix \(\mathcal M (x)\) as follows:

$$\begin{aligned} \mathcal M (\bar{x}):=\int \limits _{\Omega _{x}}{\Psi ^{t}\left( \frac{x-\bar{x}}{\rho }\right) \omega _{\rho }(x-\bar{x})\Psi \left( \frac{x-\bar{x}}{\rho }\right) \mathrm d \, \Omega _{x}}, \nonumber \\ \end{aligned}$$
(3.14)

then the unknown vector \(\mathbf d (\bar{x})\) is determined as:

$$\begin{aligned} \mathbf d (\bar{x})=\mathcal M ^{-1}(\bar{x}) \int \limits _{\Omega _{x}}{\Psi ^{t}\left( \frac{x-\bar{x}}{\rho }\right) u(x) \omega _{\rho }(x-\bar{x})\mathrm d \,\Omega _{x}}. \nonumber \\ \end{aligned}$$
(3.15)

According to (3.5) and (3.15), we will have

$$\begin{aligned}&\forall x\in \mathcal B (\bar{x})\quad u^{l}(x)=(L_{\bar{x}}u)(x)=\Psi \left( \frac{x-\bar{x}}{\rho }\right) \mathbf d (\bar{x})\nonumber \\&\quad =\Psi \left( \frac{x-\bar{x}}{\rho }\right) \mathcal M ^{-1}(x)\int \limits _{\Omega _{y}} {\Psi ^{t}\left( \frac{y-\bar{x}}{\rho }\right) u(y)\omega _{\rho }(y-\bar{x}) \mathrm d \,\Omega _{y}}. \nonumber \\ \end{aligned}$$
(3.16)

So, according to relation (3.4), the global approximation function \(u^{G}:\Omega \rightarrow \mathbb R \) is obtained in the following form:

$$\begin{aligned}&\forall x\in \Omega \quad u^{G}(x)=(L_{x}u)(x)\nonumber \\&\quad =\Psi (0)\mathcal M ^{-1}(x)\int \limits _{\Omega }{\Psi ^{t}\left( \frac{y-{x}}{\rho }\right) u(y)\omega _{\rho }(y-{x})\mathrm d \,\Omega }. \nonumber \\ \end{aligned}$$
(3.17)

Now, we set

$$\begin{aligned} \mathcal C _{\rho }(x,x-y)=\Psi (0)\mathcal M ^{-1}(x)\Psi ^{t} \left( \frac{y-{x}}{\rho }\right) . \end{aligned}$$
(3.18)

Substituting (3.18) into (3.17), gives

$$\begin{aligned} \forall x\in \Omega \quad u^{G}(x)=\int \limits _{\Omega }\mathcal{C _{\rho } (x,x-y)u(y)\omega _{\rho }(y-{x})\mathrm d \,\Omega }. \nonumber \\ \end{aligned}$$
(3.19)

Let

$$\begin{aligned} \mathcal K _{\rho }(x,x-y)=\mathcal C _{\rho }(x,x-y)\omega _{\rho }(y-{x}), \end{aligned}$$
(3.20)

where the function \(\mathcal K _{\rho }\) is the so–called reproducing kernel function. Therefore, we will have

$$\begin{aligned} u(x):=\int \limits _{\Omega }\mathcal{K _{\rho }(x,x-y)u(y)\mathrm d \,\Omega }. \end{aligned}$$
(3.21)

In order to use (3.21) in the numerical approximation, the integral must be discretized. Let \(\{x_{i}\}_{i=1}^{NP}\), be an admissible particle distribution [37], then by employing the numerical quadrature, one can approximate (3.21) as follows:

$$\begin{aligned} u(x)&= \sum _{i=1}^{NP}{u(x_{i})\mathcal C ^{h}_{\rho }(x,x_{i}-x) \omega _{\rho }(x_{i}-x)\Delta V_{i}}\nonumber \\&= \sum _{i=1}^{NP}\mathcal{K _{\rho }^{h}(x,x_{i}-x)u_{i}\Delta V_{i}}, \end{aligned}$$
(3.22)

where \(\Delta V_{i}\) denotes the nodal domain associated with the \(i\)th particle and

$$\begin{aligned} \mathcal C _{\rho }^{h}(x,y-x)=\Psi (0)(\mathcal M ^{h})^{-1}(x) \Psi ^{t}\left( \frac{y-x}{\rho }\right) , \end{aligned}$$
(3.23)

and

$$\begin{aligned} \mathcal M ^{h}(x)=\sum _{i=1}^{NP}{\Psi \left( \frac{x_{i}-x}{\rho }\right) \omega _{\rho }(x_{i}-x)\Psi ^{t}\left( \frac{x_{i}-x}{\rho }\right) \Delta V_{i}}. \nonumber \\ \end{aligned}$$
(3.24)

Now, (3.21), can be written as

$$\begin{aligned} u(x)=\sum _{i=1}^{NP}\mathcal{N _{i}^{h}(\rho ,x,x_{i})u_{i}}, \end{aligned}$$
(3.25)

where

$$\begin{aligned} \mathcal N _{i}^{h}(\rho ,x,x_{i})&= \mathcal C _{\rho }^{h} (x,x_{i}-x)\omega _{\rho }(x_{i}-x)\Delta V_{i},\end{aligned}$$
(3.26)
$$\begin{aligned}&= \Psi (0)(\mathcal M ^{h})^{-1}(x)\Psi ^{t}\left( \frac{x_{i}-x}{\rho }\right) \omega _{\rho }(x_{i}-x)\Delta V_{i},\nonumber \\ \end{aligned}$$
(3.27)
$$\begin{aligned}&= \mathcal K _{\rho }^{h}(x,x_{i}-x)\Delta V_{i}. \end{aligned}$$
(3.28)

4 The MWS form method implementation

4.1 Time difference approximation

To obtain a fully discrete scheme, the time interval \((0,T_{0})\) has been divided into the \(N\) uniform subintervals by employing nodes \(0=t_{0}\le t_{1}\le \cdots \le t_{N}=T\), where \(t_{n}=n\,\Delta t\), then to deal with the time derivatives, the following difference approximations have been considered

$$\begin{aligned}&\frac{\partial V}{\partial t}(\mathbf x ,t)\simeq \frac{{V}^{n+1} (\mathbf x )-{V}^{n}(\mathbf x )}{\Delta t},\nonumber \\&\frac{\partial {B}}{\partial t}(\mathbf x ,t)\simeq \frac{{B}^{n+1} (\mathbf x )-{B}^{n}(\mathbf x )}{\Delta t},\nonumber \\&{{V}}(\mathbf x ,t)\simeq \frac{{V}^{n+1}(\mathbf x )+{V}^{n} (\mathbf x )}{2},\nonumber \\&{{B}}(\mathbf x ,t)\simeq \frac{{B}^{n+1}(\mathbf x )+{B}^{n} (\mathbf x )}{2}, \end{aligned}$$
(4.1)

where \({V}^{n}(\mathbf x )={V}(\mathbf x ,n\Delta t),\,{B}^{n}(\mathbf x )={B}(\mathbf x ,n\Delta t)\). So, Eqs. (2.5)–(2.6) become as given in the following

$$\begin{aligned}&\frac{R \beta }{2} V^{n+1} - \frac{1}{2}\nabla ^{2} V^{n+1} -\frac{M}{2} \left( \cos (\theta )\frac{\partial B^{n+1}}{\partial x}+\sin (\theta ) \frac{\partial B^{n+1}}{\partial y}\right) \nonumber \\&\quad = f^{n}+\frac{R\beta }{2} V^{n}+\frac{1}{2}\nabla ^{2} V^{n}+ \frac{M}{2} \left( \cos (\theta )\frac{\partial B^{n}}{\partial x}+\sin (\theta )\frac{\partial B^{n}}{\partial y}\right) ,\nonumber \\ \end{aligned}$$
(4.2)
$$\begin{aligned}&\frac{R_{m} \beta }{2} B^{n+1} - \frac{1}{2}\nabla ^{2} B^{n+1} -\frac{M}{2} \left( \cos (\theta )\frac{\partial V^{n+1}}{\partial x} +\sin (\theta )\frac{\partial V^{n+1}}{\partial y}\right) \nonumber \\&\quad = \frac{R\beta }{2} B^{n}+\frac{1}{2}\nabla ^{2} B^{n}+ \frac{M}{2} \left( \cos (\theta )\frac{\partial V^{n}}{\partial x}+\sin (\theta ) \frac{\partial V^{n}}{\partial y}\right) , \nonumber \\ \end{aligned}$$
(4.3)

where \(\beta = \frac{1}{\Delta t}\).

4.2 The strong form for internal nodes and nodes on essential boundary

Using strong form, the MWS form method yields a system of discretized equations for nodes inside the domain and on essential boundary. Approximating \(B^{n}\) and \(V^{n}\) as (3.25), substituting into Eqs. (4.2) and (4.3) and applying collocation method at each interior point \(\mathbf{x}_{j}\), lead to

$$\begin{aligned}&\frac{R \beta }{2} V_{j}^{n+1} - \frac{1}{2}\nabla ^{2} V_{j}^{n+1} -\frac{M}{2} \left( \cos (\theta )\frac{\partial B_{j}^{n+1}}{\partial x} +\sin (\theta )\frac{\partial B_{j}^{n+1}}{\partial y}\right) \nonumber \\&\quad \!=\! f_{j}^{n}\!+\!\frac{R\beta }{2} V_{j}^{n}\!+\!\frac{1}{2}\nabla ^{2} V_{j}^{n} + \frac{M}{2} \left( \cos (\theta )\frac{\partial B_{j}^{n}}{\partial x} +\sin (\theta )\frac{\partial B_{j}^{n}}{\partial y}\right) ,\nonumber \\ \end{aligned}$$
(4.4)
$$\begin{aligned}&\frac{R_{m} \beta }{2} B_{j}^{n+1} \!-\! \frac{1}{2}\nabla ^{2} B_{j}^{n+1}\! -\!\frac{M}{2} \left( \cos (\theta )\frac{\partial V_{j}^{n+1}}{\partial x}+\sin (\theta )\frac{\partial V_{j}^{n+1}}{\partial y}\right) \nonumber \\&\quad = \frac{R\beta }{2} B_{j}^{n}+\frac{1}{2}\nabla ^{2} B_{j}^{n}+ \frac{M}{2} \left( \cos (\theta )\frac{\partial V_{j}^{n}}{\partial x}+ \sin (\theta )\frac{\partial V_{j}^{n}}{\partial y}\right) ,\nonumber \\ \end{aligned}$$
(4.5)

where

$$\begin{aligned}&B_{j}^{k} = B(\mathbf{x}_{j}, k\Delta t )=\sum _{i=1}^{NP}\mathcal{N _{i}(\mathbf{x}_{j})\hat{B}_{i}^{n}} ,\\&V_{j}^{k} = V(\mathbf{x}_{j}, k\Delta t )=\sum _{i=1}^{NP}\mathcal{N _{i}(\mathbf{x}_{j})\hat{V}_{i}^{n}},\\&\frac{\partial B_{j}^{k}}{\partial x} = \sum _{i=1}^{NP}{\frac{\partial \mathcal N _{i}}{\partial x}(\mathbf{x}_{j}) \hat{B}_{i}^{k}},\quad \frac{\partial B_{j}^{k}}{\partial y} = \sum _{i=1}^{NP}{\frac{\partial \mathcal N _{i}}{\partial y}(\mathbf{x}_{j}) \hat{B}_{i}^{k}},\\&\nabla ^{2}B_{j}^{k} = \sum _{i=1}^{NP}{\left( \frac{\partial ^{2} \mathcal N _{i}}{\partial x^{2}}(\mathbf{x}_{j})+\frac{\partial ^{2} \mathcal N _{i}}{\partial y^2}(\mathbf{x}_{j})\right) \hat{B}_{i}^{k}}. \end{aligned}$$

Also, the boundary conditions (2.7) are imposed as follow

$$\begin{aligned} \sum _{i=1}^{NP}\mathcal{N _{i}(\mathbf{x}_{j})\hat{V}_{i}^{n+1}} = 0 , \quad \mathbf{x}_{j} \in \partial \Omega , \end{aligned}$$
(4.6)

also, in the case of \(\lambda =\infty \), the boundary condition (2.8) is imposed similar to (4.6).

4.3 The weak form for nodes on natural boundary condition

In MWS form method, the natural boundary condition is imposed using the local weak form method which is firstly introduced by Atluri and Zhu [3] in the MLPG method. Applying a weighted residual method over each quadrature cell, the MLPG method obtains a local weak form over local sub–domains \(\Omega _{s}\) which are small regions considered over each node in the global domain \(\Omega \) as can be seen in Fig. 1. Therefore, to impose the natural boundary condition (2.8), we consider the following local weak form of (4.2) and (4.3) at each node \(x_{i}\) on the natural boundary (2.8)

$$\begin{aligned}&\int \limits _{\Omega _{q}^{i}} \left[ \frac{R \beta }{2} V^{n+1} - \frac{1}{2}\nabla ^{2} V^{n+1} -\frac{M}{2} \left( \cos (\theta )\frac{\partial B^{n+1}}{\partial x}\right. \right. \nonumber \\&\quad \quad \left. \left. +\sin (\theta )\frac{\partial B^{n+1}}{\partial y}\right) \right] u^{*}(x) \,\mathrm d \Omega \nonumber \\&\quad = \int \limits _{\Omega _{q}^{i}}\left[ f^{n}+\frac{R\beta }{2} V^{n}+\frac{1}{2}\nabla ^{2} V^{n}+ \frac{M}{2} \left( \cos (\theta )\frac{\partial B^{n}}{\partial x}\right. \right. \nonumber \\&\quad \quad \left. \left. +\sin (\theta )\frac{\partial B^{n}}{\partial y}\right) \right] u^{*}(x)\,\mathrm d \Omega , \end{aligned}$$
(4.7)

and

$$\begin{aligned}&\int \limits _{\Omega _{q}^{i}} \left[ \frac{R_{m} \beta }{2} B^{n+1} - \frac{1}{2}\nabla ^{2} B^{n+1} -\frac{M}{2} \left( \cos (\theta )\frac{\partial V^{n+1}}{\partial x}\right. \right. \nonumber \\&\quad \left. \left. +\sin (\theta )\frac{\partial V^{n+1}}{\partial y}\right) \right] u^{*}(x) \,\mathrm d \Omega \nonumber \\&\int \limits _{\Omega _{q}^{i}} \left[ \frac{R\beta }{2} B^{n}\!+\!\frac{1}{2}\nabla ^{2} B^{n}\!+\! \frac{M}{2} \left( \cos (\theta )\frac{\partial V^{n}}{\partial x}+\sin (\theta )\frac{\partial V^{n}}{\partial y}\right) \right] \nonumber \\&\quad \times u^{*}(x) \,\mathrm d \Omega , \end{aligned}$$
(4.8)

where \(u^{*}(x)\) is a test function. Employing the divergence theorem and

$$\begin{aligned} \left[ \nabla ^{2}B \right] u^{*} = B_{,ll}u^{*} = \left[ B_{,l}u^{*}\right] _{,l} - B_{,l}u^{*}_{,l}, \end{aligned}$$
(4.9)

Equations (4.7) and (4.8) become as follow

$$\begin{aligned}&\frac{R \beta }{2}\int \limits _{\Omega _{q}^{i}}{ V^{n+1}u^{*}\,\mathrm d \Omega } - \frac{1}{2} \int \limits _{\partial \Omega _{q}^{i}}{V_{,l}^{n+1} n_{,l}u^{*}\,\mathrm d \Gamma } + \frac{1}{2} \int \limits _{\Omega _{q}^{i}} {V_{,l}^{n+1}n_{,l}u_{,l}^{*}\,\mathrm d \Omega }\nonumber \\&\quad \quad - \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial B^{n+1}}{\partial x}+\sin (\theta )\frac{\partial B^{n+1}}{\partial y}\right) u^{*}\, \mathrm d \Omega }, \nonumber \\&\quad = \int \limits _{\Omega _{q}^{i}}{f^{n}u^{*}\,\mathrm d \Omega }+\frac{R\beta }{2} \int \limits _{\Omega _{q}^{i}}{ V^{n}u^{*}\,\mathrm d \Omega } + \frac{1}{2} \int \limits _{\partial \Omega _{q}^{i}}{V_{,l}^{n}n_{,l}u^{*}\,\mathrm d \Gamma }\nonumber \\&\quad \quad - \frac{1}{2} \int \limits _{\Omega _{q}^{i}}{V_{,l}^{n}n_{,l}u_{,l}^{*}\, \mathrm d \Omega }+ \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial B^{n}}{\partial x}+\sin (\theta )\frac{\partial B^{n}}{\partial y}\right) u^{*}\,\mathrm d \Omega }, \nonumber \\ \end{aligned}$$
(4.10)

and

$$\begin{aligned}&\frac{R_{m} \beta }{2}\int \limits _{\Omega _{q}^{i}}{ B^{n+1}u^{*}\,\mathrm d \Omega } - \frac{1}{2} \int \limits _{\partial \Omega _{q}^{i}}{B_{,l}^{n+1}n_{,l}u^{*}\, \mathrm d \Gamma } + \frac{1}{2} \int \limits _{\Omega _{q}^{i}}{B_{,l}^{n+1}n_{,l}u_{,l}^{*}\, \mathrm d \Omega }\nonumber \\&\quad \quad - \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial V^{n+1}}{\partial x}+\sin (\theta )\frac{\partial V^{n+1}}{\partial y}\right) u^{*}\, \mathrm d \Omega }, \nonumber \\&\quad =\frac{R\beta }{2}\int \limits _{\Omega _{q}^{i}}{ B^{n}u^{*}\,\mathrm d \Omega } + \frac{1}{2} \int \limits _{\partial \Omega _{q}^{i}}{B_{,l}^{n}n_{,l}u^{*}\, \mathrm d \Gamma } - \frac{1}{2} \int \limits _{\Omega _{q}^{i}}{B_{,l}^{n}n_{,l}u_{,l}^{*}\, \mathrm d \Omega }\nonumber \\&\quad \quad + \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial V^{n}}{\partial x} +\sin (\theta )\frac{\partial V^{n}}{\partial y}\right) u^{*}\, \mathrm d \Omega },\nonumber \\ \end{aligned}$$
(4.11)
Fig. 1
figure 1

Local sub-domains and the global domain of the approximation

where \(\partial \Omega _{q}\) is the boundary of the local sub-domain \(\Omega _{q}\) and for the nodes on the boundary, as one can see in Fig. 1, we have \(\partial \Omega _{q}^{i} = \Gamma _{q}^{i} \bigcup \mathrm{L}\!\!\!\hbox {-} ^{i}_{q}\). In the MLPG5 method, the test function is taken as Heaviside step function

$$\begin{aligned} u^{*} = \left\{ \begin{array}{l@{\quad }l} 1, &{} x \in \Omega _{s},\\ 0, &{} x \notin \Omega _{s}, \end{array}\right. \end{aligned}$$
(4.12)

and then \(u^{*}_{,l} =0 \), therefore the local weak form (4.10) and (4.11) are changed into the following integral equations

$$\begin{aligned}&\frac{R \beta }{2}\int \limits _{\Omega _{q}^{i}}{ V^{n+1}\,\mathrm d \Omega } - \frac{1}{2} \int \limits _{\Gamma _{q}^{i}}{V_{,l}^{n+1}n_{l}\,\mathrm d \Gamma }- \frac{1}{2} \int \limits _{L_{q}^{i}}{V_{,l}^{n+1}n_{l}\,\mathrm d \Gamma }\nonumber \\&\quad \quad - \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial B^{n+1}}{\partial x}+ \sin (\theta )\frac{\partial B^{n+1}}{\partial y}\right) \,\mathrm d \Omega } \nonumber \\&\quad = \int \limits _{\Omega _{q}^{i}}{f^{n}\,\mathrm d \Omega }+\frac{R\beta }{2} \int \limits _{\Omega _{q}^{i}}{ V^{n}\,\mathrm d \Omega } + \frac{1}{2} \int \limits _{\Gamma _{q}^{i}}{V_{,l}^{n}n_{l}\,\mathrm d \Gamma }+ \frac{1}{2} \int \limits _{L_{q}^{i}}{V_{,l}^{n}n_{l}\,\mathrm d \Gamma }\nonumber \\&\quad \quad + \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial B^{n}}{\partial x} +\sin (\theta )\frac{\partial B^{n}}{\partial y}\right) \,\mathrm d \Omega }, \end{aligned}$$
(4.13)

and

$$\begin{aligned}&\frac{R_{m} \beta }{2}\int \limits _{\Omega _{q}^{i}}{ B^{n+1}\,\mathrm d \Omega } - \frac{1}{2} \int \limits _{\Gamma _{q}^{i}}{B_{,l}^{n+1}n_{l}\,\mathrm d \Gamma } - \frac{1}{2} \int \limits _{L_{q}^{i}}{B_{,l}^{n+1}n_{l}\,\mathrm d \Gamma }\nonumber \\&\quad \quad - \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial V^{n+1}}{\partial x} +\sin (\theta )\frac{\partial V^{n+1}}{\partial y}\right) \,\mathrm d \Omega }, \nonumber \\&\quad =\frac{R\beta }{2}\int \limits _{\Omega _{q}^{i}}{ B^{n}\,\mathrm d \Omega } + \frac{1}{2} \int \limits _{\Gamma _{q}^{i}}{B_{,l}^{n}n_{l}\,\mathrm d \Gamma }+ \frac{1}{2} \int \limits _{L_{q}^{i}}{B_{,l}^{n}n_{l}\,\mathrm d \Gamma } \nonumber \\&\quad \quad \quad + \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial V^{n}}{\partial x} +\sin (\theta )\frac{\partial V^{n}}{\partial y}\right) \,\mathrm d \Omega }. \end{aligned}$$
(4.14)

Imposing the natural boundary condition, Eq. (4.14) is transformed into

$$\begin{aligned}&\frac{R_{m} \beta }{2}\int \limits _{\Omega _{q}^{i}}{ B^{n+1}\,\mathrm d \Omega } + \frac{1}{2} \int \limits _{\Gamma _{q}^{i}}{\lambda B^{n+1}\,\mathrm d \Gamma } - \frac{1}{2} \int \limits _{L_{q}^{i}}{B_{,l}^{n+1}n_{l}\,\mathrm d \Gamma }\nonumber \\&\quad \quad - \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial V^{n+1}}{\partial x} +\sin (\theta )\frac{\partial V^{n+1}}{\partial y}\right) \,\mathrm d \Omega }, \nonumber \\&\quad =\frac{R\beta }{2}\int \limits _{\Omega _{q}^{i}}{ B^{n}\,\mathrm d \Omega } - \frac{1}{2} \int \limits _{\Gamma _{q}^{i}}{\lambda B^{n}\,\mathrm d \Gamma }+ \frac{1}{2} \int \limits _{L_{q}^{i}}{B_{,l}^{n}n_{l}\,\mathrm d \Gamma }\nonumber \\&\quad \quad + \frac{M}{2}\int \limits _{\Omega _{q}^{i}}{\left( \cos (\theta )\frac{\partial V^{n}}{\partial x} +\sin (\theta )\frac{\partial V^{n}}{\partial y}\right) \,\mathrm d \Omega }. \end{aligned}$$
(4.15)

To obtain a discretized system of equations for weak form, we approximate the unknown functions with MLSRKP approximation. Substituting the MLSRKP approximation into Eq. (4.15), yields

$$\begin{aligned}&\sum _{j=1}^{NP}{\left[ \frac{ 1}{2}K_{ij} + \frac{1}{2} S_{ij} - \frac{1}{2} H_{ij} \right] \hat{B}_{j}^{n+1}} - \frac{M}{2} \sum _{i=1}^{NP}{\left[ M_{ij} + N_{ij} \right] \hat{V}_{j}^{n+1}}\nonumber \\&\quad = \sum _{j=1}^{NP}{\left[ \frac{R \beta }{2}K_{ij} + \frac{1}{2} S_{ij} - \frac{1}{2} H_{ij} \right] \hat{B}_{j}^{n}} - \frac{M}{2} \sum _{i=1}^{NP}{\left[ M_{ij} + N_{ij} \right] \hat{V}_{j}^{n}}, \nonumber \\ \end{aligned}$$
(4.16)

where

$$\begin{aligned}&K_{ij} = \frac{R_{m} \beta }{2}\int \limits _{\Omega _{q}^{i}}\mathcal{N _{j}(x)\, \mathrm d \Omega },\quad S_{ij} = \lambda \int \limits _{\Gamma _{q}^{i}}{ \mathcal N _{j}(x)\, \mathrm d \Gamma },\nonumber \\&H_{ij} = \int \limits _{L_{q}^{i}}{ \frac{\partial \mathcal N _{j}}{\partial n}(x)\,\mathrm d \Gamma },\quad M_{ij} = \int \limits _{\Omega _{q}^{i}}{\cos (\theta )\frac{\partial \mathcal N _{j}}{\partial x}(x)\, \mathrm d \Omega },\nonumber \\&N_{ij} = \int \limits _{\Omega _{q}^{i}}{\sin (\theta ) \frac{\partial \mathcal N _{j}}{\partial y}(x)\,\mathrm d \Omega }. \end{aligned}$$
(4.17)

5 Numerical results

In the test problems, the quadratic basis (\(m=2\)) and Gaussian weight function are employed as:

$$\begin{aligned} w_{i}(\mathbf{x}) = \left\{ \begin{array}{c@{\quad }c} \frac{\exp [-(d_{i}/c_{i})^2]-\exp [-(r_{i}/c_{i})^2]]}{1-\exp [-(r_{i}/c_{i})^2]}, &{} 0 \le d_{i} \le r_{i},\\ 0, &{} d_{i} > r_{i}, \end{array}\right. \quad \end{aligned}$$
(5.1)

where \(d_{i} = \Vert \mathbf{x}-\mathbf{x}_{i}\Vert _{2}, c_{i}\) is a constant controlling the shape of the weight function \(w_{i}\) and \(r_{i}\) is the size of the support domain for node \(i\). Except in the case of circular cross-section, we illustrate our procedure by considering a square pipe \(|x| \le 1,\,\,|y|\le 1\). The calculation has been executed for different values of \(\theta , \, \lambda \) and \(M\). We have \(f(t)=1\) in the case of transient flow with constant pressure gradient. Also, we have taken \(R=R_{m}= 1\).

5.1 Test 1: pipes with non-conducting walls, \(\lambda = \infty \) and horizontal magnetic field, \(\theta =0\)

As time tends to infinity, the steady state solutions are taken which are founded in special cases. Shercliff [49] obtained the steady solution for the flow in pipes with non-conducting walls with an applied magnetic field parallel to one pair of sides. In this case, these solutions are used to check the accuracy of the results for certain values of Hartmann numbers.

The obtained numerical results by Meshless Local Petrov–Galerkin (MLPG) method [14], Finite Volume Element (FVE) method [48], Finite Volume Spectral Element (FVSE) method [48] and the new method, i.e., Meshfree Weak-Strong (MWS) form method are presented in Tables 1 and 2 for solving the MHD equations with Hartmann numbers \(M=5\) and \(20\), respectively. From these tables, one can see that the numerical solutions are in a good agreement with steady state solutions, as time increases. Also, a comparison between the present approach and classical MWS (CMWS) with MLS approximation has been provided in Table 3 at different times for \(M=20\).

Table 1 Comparison of velocity field of Shercliff’s problem at \(M=5\) using MLPG method [14] FVE method [48], FVSE method [48] and MWS method
Table 2 Comparison of velocity field of Shercliff’s problem at \(M=20\) using MLPG method [14] FVE method [48], FVSE method [48] and MWS method
Table 3 Numerical solution of velocity for some selected points at different times for non-conducting walls at different times for non-conducting walls and \(M=20\)

The behaviour of velocity and induced magnetic field along the \(x\)-axis, in \(y=0\) plane of the duct, for \(M=5\) and \(10\) are plotted in Figs. 2 and 3 at several time levels. It can be seen from the figures that the solutions \(V\) and \(B\) tend to steady state by increasing the times.

Fig. 2
figure 2

Velocity and induced magnetic field along the \(x\)-axes for \(M=5\) at different time levels

Fig. 3
figure 3

Velocity and induced magnetic field along the \(x\)-axes for \(M=10\) at different time levels

The contour plot of velocity and induced magnetic field for different Hartmann numbers \(M=30\) and \(40\) are depicted in Figs. 4 and 5, respectively. The plots reveal that the velocity is symmetric with respect to both \(x\)- and \(y\)-axes, but the induced magnetic field is not symmetric with respect to \(y\)- axes and therefore the contour lines change their direction in the left and right parts of pipes. Also, these figures show that the boundary layers develop as the Hartmann number increases in both velocity and induced magnetic field cases. Furthermore, the thickness of boundary layers becomes smaller by increasing the Hartmann number which is the well–known behaviour of MHD duct flow. Finally, in Fig. 13, we depict results for the case of irregular nodal distribution.

Fig. 4
figure 4

The contour plots of velocity (left) and induced magnetic field (right) for \(\lambda =\infty ,\,\,M=30 \) at \(t=0.05 \) with \(N=1681\)

Fig. 5
figure 5

The contour plots of velocity (left) and induced magnetic field (right) for \(\lambda =\infty ,\,\,M=40 \) at \(t=0.05 \) with \(N=1681\)

5.2 Test 2: ducts with arbitrary wall conductivity \(\lambda , 0\le \lambda < \infty \) and horizontal magnetic field, \(\theta = 0\)

First of all, we consider \(\lambda =0\) which is the case of MHD flow in a duct with prefect conducting walls of the duct. In Fig. 6, the contour plots of velocity and the induced magnetic field with \(M=20\) are depicted. From this figure, it can be observed that for high conducting wall case, the induced magnetic field contours are perpendicular to the walls.

Fig. 6
figure 6

The contour plots of velocity (left) and induced magnetic field (right) for \(\lambda =0,\,\,M=30 \) with \(N=441\)

Also, Figs. 7 and 8 are plotted to investigate the effect of wall conductivity, \(\lambda \) for both the velocity and induced magnetic field. The graphs along the \(x\)-axes tend to the case \(\lambda =\infty \) as \(\lambda \) increases.

Fig. 7
figure 7

Graph of velocity along the \(x\)-axes (\(y=0\)) for \(M=10,\,\theta =0\) and different values of \(\lambda \)

Fig. 8
figure 8

Graph of induced magnetic field along the \(x\)-axes (\(y=0\)) for \(M=10,\,\theta =0\) and different values of \(\lambda \)

5.3 Test 3: ducts under oblique magnetic field, \(\theta > 0\)

In this case, we consider the MHD equation that by using externally applied magnetic field, makes angle \(\theta \) with the \(x\)-axes. The contour plots for \(M=20, \lambda =\infty , \theta =\frac{\pi }{4},\, \text {and}\, \theta = \frac{\pi }{3}\) are graphed in Figs. 9 and 10, respectively. Figures 11 and 12 demonstrate the effect of different values of \(\theta \) along the \(x\)-axes for \(M=10,\, \lambda =\infty \). The graphs show that the induced magnetic field along the \(x\)-axes decreases when \(\theta \) increases from \(0\) to \(\frac{\pi }{2}\).

Fig. 9
figure 9

The contour plot of velocity (left) and induced magnetic field (right) for \(M=20,\,\,\lambda =\infty \) and \(\theta =\frac{\pi }{4}\)

Fig. 10
figure 10

The contour plot of velocity (left) and induced magnetic field (right) for \(M=20,\,\,\lambda =\infty \) and \(\theta =\frac{\pi }{3}\)

Fig. 11
figure 11

Plot of velocity along the \(x\)-axes (\(y=0\)) for \(M=10,\,\lambda =\infty \) and different values of \(\theta \)

Fig. 12
figure 12

Plot of induced magnetic field along the \(x\)-axes (\(y=0\)) for \(M=10,\,\lambda =\infty \) and different values of \(\theta \)

5.4 Test 4: ducts with \(M=0, \lambda , \theta =\text {arbitrary} \)

Finally, we consider MHD equation with \(M=0\). The exact solution of this case has been obtained by Singh and Lal [52]. Clearly, in this test problem, the velocity and induced magnetic field results are independent of \(\lambda \) and \(\theta \). The values of velocity at different time levels are compared with the exact solution in Table 4. The obtained results show the accuracy of the proposed method (Fig. 13).

Table 4 Comparison of velocity field of Shercliff’s problem at \(M=0\) using FVE method [48], FVSE method [48] and MWS method
Fig. 13
figure 13

Irregular nodal distribution and contour plots of the induced magnetic field for \(M=20\)

5.5 Test 5: circular pipes with insulating walls, \(\lambda = \infty \) and \(\theta = 0\)

As an example of an irregular cross section, we studied the case of a circular cross section, \(x^2+y^2 \le 1\). An arbitrary node distribution is considered which is one of the advantages of using meshfree methods. The numerical solution for flow on a circular pipes for Hartmann numbers \(M=20\) and 40, are presented in Figs. 14 and 15, respectively. It observes from the figures that the velocity and induced magnetic filed behave similar to rectangular ones. In Table 5, the numerical results of the velocity and induced magnetic fields are given at different times for \(M=5\), it can be seen that the numerical results are in a good agreement with the steady state solution as time increasing.

Fig. 14
figure 14

Contour plots of velocity (left) and induced magnetic field (right) for \(M=20\) at \(t=0.05\)

Fig. 15
figure 15

Contour plots of velocity (left) and induced magnetic field (right) for \(M=40\) at \(t=0.05\)

Table 5 Numerical solution of velocity for selected points at different times for circular pipes at \(M=5\)

6 Conclusion

In this work, the MWS form method is employed for solving the unsteady two dimensional magnetic hydrodynamic flow in rectangular and circular pipes. The MWS form method applied the moving least square approximation and radial point interpolation to construct the shape functions. But, since the MLSRKP scheme was given as a different version of the moving least square method, the MLSRKP approximation is used to approximate the unknown functions. Moreover, a time stepping method is applied to deal with the time derivatives. The numerical results are presented for MHD duct problems with various values of \(\theta \), orientation of applied magnetic field with \(x\)-axes, \(\lambda \), the wall conductivity and \(M\), the Hartmann number. The figures are depicted to simulate the effect of these parameters. The numerical results are compared with three other methods in the cases with steady state solutions. In these cases, comparisons reveal that the new method is accurate and agrees with the exact solutions.