1 Introduction

Underground fluid flow in fractured and porous media exhibits a variety of hydromechanical phenomena, which have been intriguing the research community for several decades (Schmidt and Steeb 2019). Foam drainage equation is observed one of the most important partial differential equation which in everyday of activities, both natural and industrial. The study of foam drainage equation is a simple model which leads to the flow of liquid through channels and nodes between the bubbles. Consider the non-linear foam drainage equation with time-fractional derivative such as

$$ D_{t}^{\alpha } \Omega + \frac{\partial }{\partial x}\left( {\Omega^{2} - \frac{\sqrt \Omega }{2}\frac{\partial \Omega }{{\partial x}}} \right) = 0, $$
(1)

with initial condition

$$ \Omega (x,0) = f(x), $$
(2)

\(\Omega\) is the cross-section of a channel formed where three films meet which usually indicated as Plateau border, \(x\) denotes the scaled position and \(t\) be the time respectively. \(\alpha\) is fractal dimension and \(\frac{{\partial^{\alpha } }}{{\partial t^{\alpha } }}\) is He’s fractional derivative (He 2018, 2020a, b; Ain et al. 2020; Shen and He 2020).

Recent research in foams and emulsions has focused on three topics often treated individually but are, in fact, interdependent: drainage, coarsening, and rheology; see Fig. 1. For \(\alpha = 1\), Eq. (1) can be reduced to classical foam drainage equation which has wide applications in particular care of commodities such as creams, oil, lotions, scrubbing and clothes cleaning (Stone et al. 2002), chemical industries, mineral processing, and structural material sciences (Hilgenfeldt et al. 2001), aluminum metals (Schultz et al. 2000), thin porous layer (Koursari et al. 2019). During the manufacturing of foam, the substance is in the liquid state, and fluid can change round while the bubble arrangement remains relatively unchanged. Alam (2015) applied \(G^{\prime}/G\)-expansion method to obtain the exact solution of the foam drainage equation. Parand and Delkhosh (2018) used the collocation method to find the semi-analytical solution of the nonlinear foam drainage equation. Islam and Akbar (2018) used \(G^{\prime}/G\)- expansion method with the assistance of the fractional complex transformation to find the wave solution of the space–time fractional foam drainage equation. Various approaches have been established to identify the approximate and analytical solution of foam drainage equation such Adomian decomposition method (Helal and Mehanna 2007), reduced differential transform method (Gubes et al. 2015), homotopy analysis method (Singh et al. 2016), and Haar wavelets method (Arbabi et al. 2016). The main focus of the present work is to formulate the strategy being pursued and to obtain the numerical solution of the fractal foam drainage equation. We also aim to confirm that the two-scale method is powerful, efficient, and promising in handling scientific and engineering problems (Elias-Zuniga et al. 2021a, b, c, d; He 2020c; Wang 2021; Wang et al. 2019).

Fig. 1
figure 1

Schematic illustration of the interdependence of drainage, coarsening, and rheology of foams (Hilgenfeldt et al. 2001)

2 Basic idea of the homotopy perturbation method

To illustrate the basic concept of the homotopy perturbation method, consider the following non-linear functional equation (Li and Nadeem 2019; Nadeem and Li 2019),

$$ A(u) - f(r) = 0,\quad r \in \Omega ,{\kern 1pt} $$
(3)

with boundary conditions

$$ B\left( {u,\frac{\partial u}{{\partial n}}} \right) = 0,\quad r \in \Gamma , $$
(4)

where \(A\) is a general functional operator, \(B\) is a boundary operator, \(f(r)\) is a known analytic function, and \(\Gamma\) is the boundary of the domain \(\Omega\). The operator \(A\) can generally be divided into two operators, \(L\) and \(N\), where \(L\) is a linear and \(N\) being a nonlinear operator. Therefore, Eq. (3) can be written as follows

$$ L(u) + N(u) - f(r) = 0. $$
(5)

Using the homotopy technique, we construct a homotopy \(v(r,p):\Omega \times [0,1] \to {\mathbb{R}}\) that satisfies

$$ H(v,p) = (1 - p)[L(v) - L(u_{0} )] + p[L(v) - N(v) - f(r)], $$
(6)

or

$$ H(v,p) = L(v) - L(u_{0} ) + pL(u_{0} ) + p[N(v) - f(r)] = 0, $$
(7)

where \(p \in [0,1]\), is called homotopy parameter, and \(u_{0}\) is an initial approximation for the solution of Eq. (3), which satisfies the boundary conditions. According to HPM, we can use \(p\) as a small parameter and assume that the solution of Eq. (7) can be written as a power series in \(p\)

$$ v = v_{0} + pv_{1} + p^{2} v_{2} + \cdots .{\kern 1pt} $$
(8)

Considering \(p = 1\), the approximate solution of Eq. (3) will be obtained as follows

$$ u = \mathop {\lim }\limits_{p \to 1} v = v_{0} + v_{1} + v_{2} + v_{3} + \cdots .{\kern 1pt} $$
(9)

Additionally, some recent applications of HPM can be viewed in (He et al. 2020a, b; He and Dib 2020a, b; Skrzypacz et al. 2020; Anjum and He 2020; He and Jin 2020).

3 Fractional complex transform

During the modeling of a problem, the dimension and scale are extremely valuable things since the various scales and dimensions will lead to remarkable results and properties for the same configuration. A fractional complex transform is a scientific approach that converts a fractional differential equation into a fractal space in a continuous space and is defined as (He et al. 2012; Li and He 2010; Wang and Yao 2020)

$$ \Delta S = \frac{{\Delta t^{\alpha } }}{\Gamma (1 + \alpha )}, $$
(10)

where \(\Delta S\) is the smaller scale and \(\Delta t\) is the larger scale. On a smaller scale, the time-fractional foam drainage equation behaves discontinuously, especially at the peak of the solitary wave. On the other hand, the larger scale predicts a smooth solitary wave. The transformation is given in Eq. (10) is an approximate one to convert a fractal space on a small scale to a smooth space with a large scale. To under this, consider an example of a tree that stops growing at night, so when we use a scale of 24 h, it grows continuously, while when we measure it in 12 h, it becomes discontinuous. So, Eq. (10) is also called the two-scale transform (Ain and He 2019; He and Ji 2019; He and Ain 2020), which was geometrically studied using fractal theory. The results of any particular problem depend on the scale. For example, on an observable scale, the liquid is steady; accordingly, Newton’s laws can be executed, otherwise invalid in case of molecular scale. For example, on an observable scale, Newton’s law is effective only if the liquid is steady, otherwise, it is illegitimate. In other words, if the flow is independent of time, then Newton's law is valid while if the flow is dependent on time, then Newtons' law becomes invalid. So, the two-scale transform is to convert a fractal space on a small scale to an approximate smooth space on a larger scale. Some recent work on fractal calculus can be studied in Wang (2020a, b), Wang and Wang (2020a, b, 2021) andd Wang et al. (2021).

4 Analysis of the method

In this section, we obtain an analytical solution of Eq. (1). We first use the transformation

$$ \Omega (x,t) = u^{2} (x,t). $$
(11)

Thus, Eq. (1) becomes as

$$ \begin{aligned} & D_{t}^{\alpha } u^{2} + \frac{\partial }{\partial x}\left( {u^{4} - \frac{u}{2}.\frac{\partial }{\partial x}(u^{2} )} \right) = 0, \\ & D_{t}^{\alpha } u^{2} + \frac{\partial }{\partial x}\left( {u^{4} - u^{2} \frac{\partial u}{{\partial x}}} \right) = 0, \\ & 2uD_{t}^{\alpha } u + 4u^{3} \frac{\partial u}{{\partial x}} - 2u\frac{\partial u}{{\partial x}}.\frac{\partial u}{{\partial x}} - u^{2} \frac{{\partial^{2} u}}{{\partial x^{2} }} = 0, \\ \end{aligned} $$

which may also be written as

$$ D_{t}^{\alpha } u = \frac{1}{2}uu_{xx} - 2u^{2} u_{x} + u_{x}^{2} , $$
(12)

with initial condition

$$ u(x,0) = - \sqrt c \tanh (\sqrt c x), $$
(13)

where \(c\) is the velocity of the wavefront (Alquran 2014). The initial condition (13) is taken in such a way that it satisfies the problem to find a particular solution. Initially, we will apply the fractional complex transform to write it in its partner differential equation such as

$$ S = \frac{{t^{\alpha } }}{\Gamma (1 + \alpha )}. $$
(14)

So, Eq. (12) can be written as

$$ \frac{\partial u}{{\partial S}} + 2u^{2} \frac{\partial u}{{\partial x}} - \left( {\frac{\partial u}{{\partial x}}} \right)^{2} - \frac{1}{2}u\frac{{\partial^{2} u}}{{\partial x^{2} }}.{\kern 1pt} $$
(15)

The initial guess will be taken as \(u_{0} = - \sqrt c \tanh (\sqrt c x)\). The HPM together with He’s polynomials will be applied on Eq. (15) as follows

$$ \frac{{\partial u_{1} }}{\partial S} + 2u_{0}^{2} \frac{{\partial u_{0} }}{\partial x} - \left( {\frac{{\partial u_{0} }}{\partial x}} \right)^{2} - \frac{1}{2}u_{0} \frac{{\partial^{2} u_{0} }}{{\partial x^{2} }} = 0,\quad u_{1} (x,0) = 0 $$
$$ \frac{{\partial u_{2} }}{\partial S} + 2\left( {u_{0}^{2} \frac{{\partial u_{1} }}{\partial x} + 2u_{0} u_{1} \frac{{\partial u_{0} }}{\partial x}} \right) - 2\frac{{\partial u_{0} }}{\partial x}\frac{{\partial u_{1} }}{\partial x} - \frac{1}{2}\left( {u_{0} \frac{{\partial^{2} u_{1} }}{{\partial x^{2} }} + u_{1} \frac{{\partial^{2} u_{0} }}{{\partial x^{2} }}} \right) = 0,\quad u_{2} (x,0) = 0 $$
$$ \begin{aligned} & \frac{{\partial u_{3} }}{\partial S} + 2\left( {u_{0}^{2} \frac{{\partial u_{2} }}{\partial x} + 2u_{0} u_{1} \frac{{\partial u_{1} }}{\partial x} + (u_{1}^{2} + 2u_{0} u_{2} )\frac{{\partial u_{0} }}{\partial x}} \right) - \left( {\left( {\frac{{\partial u_{1} }}{\partial x}} \right)^{2} + 2\frac{{\partial u_{0} }}{\partial x}\frac{{\partial u_{2} }}{\partial x}} \right) \\ & \quad - \frac{1}{2}\left( {u_{0} \frac{{\partial^{2} u_{2} }}{{\partial x^{2} }} + u_{1} \frac{{\partial^{2} u_{1} }}{{\partial x^{2} }} + u_{2} \frac{{\partial^{2} u_{0} }}{{\partial x^{2} }}} \right) = 0,\quad u_{3} (x,0) = 0 \\ \end{aligned} $$
$$ \begin{aligned} & \frac{{\partial u_{4} }}{\partial S} + 2\left( {u_{0}^{2} \frac{{\partial u_{3} }}{\partial x} + 2u_{0} u_{1} \frac{{\partial u_{2} }}{\partial x} + (u_{1}^{2} + 2u_{0} u_{2} )\frac{{\partial u_{1} }}{\partial x} + (2u_{1} u_{2} + 2u_{0} u_{3} )\frac{{\partial u_{0} }}{\partial x}} \right) \\ & \quad - \left( {2\frac{{\partial u_{1} }}{\partial x}\frac{{\partial u_{2} }}{\partial x} + 2\frac{{\partial u_{0} }}{\partial x}\frac{{\partial u_{3} }}{\partial x}} \right) - \frac{1}{2}\left( {u_{0} \frac{{\partial^{2} u_{3} }}{{\partial x^{2} }} + u_{1} \frac{{\partial^{2} u_{2} }}{{\partial x^{2} }} + u_{2} \frac{{\partial^{2} u_{1} }}{{\partial x^{2} }} + u_{3} \frac{{\partial^{2} u_{0} }}{{\partial x^{2} }}} \right) = 0,\quad u_{4} (x,0) = 0 \\ \end{aligned} $$

Proceeding in the same way, we can obtain the high-order approximations.

$$ u_{0} (x,S) = - \sqrt c \tanh (\sqrt c x), $$
$$ \begin{array}{*{20}l} {u_{1} (x,S)} \hfill & { = c^{2} {\text{sech}}^{2} (\sqrt c x)S,} \hfill \\ \end{array} $$
$$ \begin{array}{*{20}l} {u_{2} (x,S)} \hfill & { = c^{\frac{7}{2}} {\text{sech}}^{2} (\sqrt c x)\tanh (\sqrt c x)S^{2} ,} \hfill \\ \end{array} $$
$$ \begin{array}{*{20}l} {u_{3} (x,S)} \hfill & { = - \frac{1}{12}c^{4} ( - 1 - 13c + 10c\cosh (2\sqrt c x) - ( - 1 + c)\cosh (4\sqrt c x))\,{\text{sech}}^{6} (\sqrt c x)S^{3} ,} \hfill \\ \end{array} $$
$$ \begin{aligned} u_{4} (x,S) & = - \frac{1}{96}c^{\frac{11}{2}} \left( { - 46 - 582c + ( - 41 + 289c)\cosh (2\sqrt c x) + 6(1 + c)\cosh (4\sqrt c x)} \right. \\ & \quad \left. { + \cosh (6\sqrt c x) - c\cosh (6\sqrt c x)} \right){\text{sech}}^{8} (\sqrt c x)\tanh (\sqrt c x)S^{4} , \\ \end{aligned} $$

the rest of the components can also be found in the same manner. Thus, the approximate solution according to HPM has the following form

$$ u(x,t) = - \sqrt c \tanh (\sqrt c x) + c^{2} {\text{sech}}^{2} (\sqrt c x)S + c^{\frac{7}{2}} {\text{sech}}^{2} (\sqrt c x)\tanh (\sqrt c x)S^{2} . $$

Thus, by using Eq. (14), we get

$$ u(x,t) = - \sqrt c \tanh (\sqrt c x) + c^{2} {\text{sech}}^{2} (\sqrt c x)\left[ {\frac{{t^{\alpha } }}{\Gamma (1 + \alpha )}} \right] + c^{\frac{7}{2}} {\text{sech}}^{2} (\sqrt c x)\tanh (\sqrt c x)\left[ {\frac{{t^{\alpha } }}{\Gamma (1 + \alpha )}} \right]^{2} . $$

This series leads to the exact solution for Eq. (1) when \(\alpha = 1.\)

$$ \Omega (x,t) = - \sqrt c \tanh \sqrt c (x - ct).\quad x \le ct $$
(16)

Using the Mathematica package 11.0.1, we illustrate the graphical representations and physical behaviors of the fractal foam drainage equation. For case \(\alpha = 1\), we compare the obtained results of the approximate solution of Eq. (1) and the exact solution of Eq. (16), which is depicted in Figs. 2 and 3. From Fig. 2, it is obvious that when α = 1, the solution is nearly identical to the exact solution. The solution graphs have declared that the obtained results are almost identical and confirm worthy contact with the exact solution, which aids us to understand the nature of the fractal foam drainage equation. Moreover, Fig. 4 shows the error distribution of the approximate solution and the exact solution which helps us to capture the behavior of the obtained solution. Some recent developments in fractal vibration models can be studied from somewhere else (Chun-Hui et al. 2021a, b; He et al. 2021a, He et al. 2021b).

Fig. 2
figure 2

Approximate solution of \(u(x,t)\) for \(\alpha = 1\)

Fig. 3
figure 3

Exact solution of \(u(x,t)\) for \(\alpha = 1.\)

Fig. 4
figure 4

Error distribution of \(u(x,t)\) for different values of \(\alpha .\)

5 Conclusion

In this paper, we suggested a hybrid scheme such as fractional complex transform is coupled with HPM to obtain the analytic solution of the nonlinear time-fractional foam drainage equation, which is a simple model of the flow of liquid through channels and nodes between the bubbles. The fractional complex transform performed a simple and excellent approach to convert a fractional differential equation into its differential partner which is suitable for the development of the two-scale method. This method is applied directly without any discretization, linearization, and small parameter assumptions, which in actual ruins the physical nature of the problems. The results show that the proposed method is very efficient and powerful. The graphical representation shows that the solution procedure is simple and might be found in wide applications of engineering. The procedure reveals that the semi-inverse method is highly efficient and powerful, and can be generalized to other nonlinear evolution equations with fractal derivatives in future applications.