1 Introduction

Dynamics and flow of magnetic nanoparticles (MNPs) suspended in non-magnetic viscous carrier fluids (ferrofluids) have been studied intensively over the last decades (Socoliuc et al. 2022; Felicia et al. 2016; Ilg and Odenbach 2008; Rosensweig 1985). These studies have almost exclusively focused on spatially homogeneous solvents. In many applications, however, one is interested in the flow through composite materials. Prominent examples are the transport through sand or other granular matter (Sahimi 2011). On a coarse-grained level, transport phenomena through such materials can be described via a porous medium approach (Sahimi 2011; Plessis and Masliyah 1991). Similarly, the porous medium approach is also frequently used in biomedical applications to describe transport through biological tissues and cancerous cells (see e.g. Khaled and Vafai 2003; Tucci et al. 2021; Al Sariri and Penta 2022; Mosharaf-Dehkordi 2019 and references therein).

Although MNPs find more and more promising biomedical and technical applications (Socoliuc et al. 2022; Colombo et al. 2012; Felicia et al. 2016), to date, only a handful of studies address the flow properties of MNPs through porous media. One of the experimental studies on ferrofluid flow through sands and sediments observed a strong dependence on external magnetic fields (Borglin et al. 2000). Similarly, experiments on the internal convection of ferrofluids flowing through a capillary tube filled with porous media showed that external fields could significantly enhance the thermal conductivity (Shafii and Keshavarz 2018). Also, the efficiency of ferrofluids for oil displacements in a sand-filled pipe was investigated experimentally and compared to finite-element simulations (Dou et al. 2022).

Fluid dynamic simulation of ferrofluids has also been performed to investigate their use as displacing fluid in fractured porous media (Huang et al. 2017). Other finite-element or finite-volume simulations have addressed some particular flow (Huang et al. 2021; Guerroudj et al. 2023) and heat transfer (Abbas et al. 2021) properties of ferrofluid flow through porous media. A porous medium approach was also used in finite-volume simulations of magnetic drug targeting of MNPs, coupling channel flow to adjacent tumor region via the permeable endothelium layer (Ne’mati et al. 2017). These simulation studies relied on highly simplified constitutive models, typically neglecting internal rotations and corresponding non-equilibrium magnetization components.

In addition to classical fluid dynamics simulations such as finite-volume and finite-element methods, the Lattice Boltzmann scheme has been successfully used to describe flow through porous media (Dardis and McCloskey 1998). In these simulations, explicit scatterers for fluid motion are placed at fixed locations within the simulation cell. Using this method, ferrofluid permeation into a randomly structured porous medium has been simulated and shown to be sensitive to an applied magnetic field (Hadavand et al. 2013). As an alternative simulation approach, an extension of the highly versatile multi-particle collision dynamics method (MPC) (Malevanets and Kapral 1999) to transport in porous media has been proposed in Ref. Matyka (2017) for non-magnetic fluids. In the latter, the effect of porous media on fluid transport is simply modeled as local damping, leading to very efficient simulation methods. Note that the Lattice Boltzmann methods put forward in Refs. Dardis and McCloskey (1998), Hadavand et al. (2013) resolve the detailed fluid dynamics in the vicinity of individual grain boundaries. On the other hand, the MPC modeling proposed in Ref. Matyka (2017) is suitable for a more coarse-grained level of description where the porous medium can be considered to be locally homogeneous.

Here, we use similar ideas to simulate ferrofluid flow through porous media via a MPC method that is coupled to Brownian dynamic simulations of the MNP dynamics to model their internal rotations. In the absence of porous media, this approach was proposed and validated in Ref. Ilg (2022), showing the correct incorporation of a reliable constitutive model for dilute ferrofluids. We here show how this model can be extended via friction forces to model ferrofluid flow through porous media. In the absence of an external magnetic field, we reproduce the Darcy–Brinkman velocity profile and clarify the interpretation of and relationship between the model parameters. Simulations of driven flow through planar channels show that flow properties can be manipulated by external magnetic fields. In particular, we observe an effective permeability that increases with increasing field strength before reaching a limiting value. Using kinetic theories of ferrofluids, we provide a theoretical expression of this magneto-permeability effect in close analogy with the magneto-viscous effect. Finally, we study driven flow through planar channels where only the channel walls are covered with a layer of porous material, with no porous medium present in the center region of the channel.

2 Modeling

2.1 Continuum Level

Darcy’s law predicts the flow velocity \({\textbf{v}}\) through a porous medium when a pressure gradient \(\varvec{\nabla }p\) is applied as Sahimi (2011)

$$\begin{aligned} {\textbf{v}}= - \frac{1}{\eta }{\textbf{K}}\cdot \varvec{\nabla }p, \end{aligned}$$
(1)

where \(\eta\) is the dynamic viscosity of the fluid. The empirical proportionality coefficient \({\textbf{K}}\) is known as permeability of the porous medium. For isotropic porous media \({\textbf{K}}=K\textbf{I}\), with \(\textbf{I}\) the identity matrix, so that \({\textbf{v}}= -(K/\eta )\varvec{\nabla }p\). In a finite domain, the Darcy–Brinkmann model provides a better description than Darcy’s law (Khaled and Vafai 2003). This model can be formulated as the stationary Navier–Stokes equation supplemented with an additional damping term proportional to an empirical parameter \(\alpha\),

$$\begin{aligned} \nu \nabla ^2 {\textbf{v}}- \alpha {\textbf{v}}= \frac{1}{\rho }\varvec{\nabla }p. \end{aligned}$$
(2)

The density and kinematic viscosity of the fluid are denoted by \(\rho\) and \(\nu =\eta /\rho\), respectively. The phenomenological parameter \(\alpha\) governs the strength of the damping term and is related to the permeability coefficient by \(\alpha =\nu /K\). We here consider Reynolds numbers that are small enough so that the Forchheimer correction (Khaled and Vafai 2003) is irrelevant.

For spatially homogeneous porosity, i.e., a position-independent \(\alpha\), the exact solution of Eq. (2) for one-dimensional channel flow \({\textbf{v}}({\textbf{r}})=v(y)\textbf{e}_x\) reads (Dardis and McCloskey 1998)

$$\begin{aligned} v(y) = c \left( 1 - \frac{\cosh (r[y-L/2])}{\cosh (rL/2)} \right) , \end{aligned}$$
(3)

where L denotes the width of the channel and no-slip boundary conditions on the channel walls have been assumed. The parameters appearing in the flow profile Eq. (3) are given by \(c=-(\alpha \rho )^{-1}\frac{\textrm{d}p}{\textrm{d}x}\) and

$$\begin{aligned} r^2 = \alpha / \nu . \end{aligned}$$
(4)

From Eq. (4) and the above relation \(\alpha =\nu /K\), we find that the permeability can also be expressed as \(K=1/r^2\). These relations will be useful for later analysis.

Note that for weak damping, we recover the usual Poiseuille profile from Eq (3), \(v(y)=-(2\nu \rho )^{-1}\frac{\textrm{d}p}{\textrm{d}x}y(L-y) + {{{\mathcal {O}}}}(r^2)\). Conversely, increasing \(r\) leads to stronger and stronger deviations from the parabolic velocity profile.

The amount of fluid transported per unit time through a cross-section of the channel (known as volumetric flow rate in the three-dimensional case) is obtained from \(\dot{{\mathcal {V}}}=\int _0^Lv_x(y)\textrm{d}y\). For the velocity profile (3), we obtain \(\dot{{\mathcal {V}}}=cL[1-\tanh (L^*)/L^*]\) with reduced channel width \(L^*=rL/2\). As expected, the flow rate is proportional to the applied pressure gradient. For \(L^*\gg 1\) we find \(\dot{{\mathcal {V}}}\approx c[L-2/r]\) corresponding to a plug flow, whereas for \(L^*\ll 1\) we recover the equivalent of the Hagen–Poiseuille law for two-dimensional channels, \(\dot{{\mathcal {V}}}\approx - (\textrm{d}p/\textrm{d}x) L^3/[12\rho \nu ] ( 1 + {{{\mathcal {O}}}}((L^*)^2) )\).

2.2 Mesoscopic Level: Particle-based Model

Over the past decades, several particle-based methods for simulating fluid flow have been explored (see e.g., Noguchi et al. 2007 and references therein). Contrary to more traditional fluid dynamics simulations, these mesoscopic methods are very flexible, straightforward to implement, and naturally include thermal fluctuations. In the present study, we employ one of these methods known as multi-particle collision dynamics (MPC) (Malevanets and Kapral 1999). One of the advantages of the MPC method is that viscoelastic fluids can be modeled rather straightforwardly (Gompper et al. 2009). In particular, we have already proposed and successfully tested an MPC implementation of ferrofluid flow using a reliable constitutive model (Ilg 2022). To make the paper self-contained, we provide a short description of the standard MPC method, before specifying the extension to porous media.

Within the MPC method, the fluid is represented by a collection of N identical particles, each with mass m. If \({\textbf{r}}_i\) and \({\textbf{v}}_i\) denote the position and velocity of particle i, \(i=1,\ldots ,N\), particle dynamics is split into a streaming and a collision step. In the streaming step, particles are advanced for a time \(\Delta t\) as

$$\begin{aligned} {\textbf{r}}_i(t+\Delta t)&= {\textbf{r}}_i(t) + {\textbf{v}}_i(t)\Delta t + \frac{\Delta t^2}{2m}{\textbf{f}}_i(t) \end{aligned}$$
(5)
$$\begin{aligned} {\textbf{v}}_i'(t)&= {\textbf{v}}_i(t) + \frac{\Delta t}{m}{\textbf{f}}_i(t) , \end{aligned}$$
(6)

where \({\textbf{f}}_i(t)\) is the total force acting on particle i at time t. While Eqs. (5),(6) are formally identical to those used in molecular dynamics simulations, the crucial idea of MPC as a mesoscopic method is to include in \({\textbf{f}}_i\) only external and body forces and to disregard inter-particle interactions in the streaming step. Instead, inter-particle interactions are accounted for via momentum exchange in the collision step. In this collision step, all particles i residing at time t in the same collision cell \(C_i\) are updated simultaneously as

$$\begin{aligned} {\textbf{v}}_i(t+\Delta t) = {\textbf{V}}_{C_i}(t) + \beta _{\textrm{th}}{\textbf{R}}\cdot [{\textbf{v}}_i'(t) - {\textbf{V}}_{C_i}(t)]. \end{aligned}$$
(7)

In Eq (7), \({\textbf{V}}_{C_i}(t)\) denotes the center of mass velocity of the collision cell \(C_i\) and \({\textbf{R}}={\textbf{R}}(\gamma )\) a matrix describing rotations around a randomly chosen axis by an angle \(\pm \gamma\). Equation (7) models the effect of collisions among particles as rotations of their relative velocities. A local thermostat is present in Eq. (7) and described by the factor \(\beta _{\textrm{th}}=\sqrt{T/T_{C_i}}\), where \(T_{C_i}\) is the instantaneous kinetic temperature of the collision cell \(C_i\) and T a prescribed bath temperature. We use a two-dimensional square grid, so the collision cells are squares of side length a. Using a spatially fixed grid of collision cells violates Galilean invariance. Therefore, we follow common practice (Ihle and Kroll 2001) and in each step shift the grid of collision cells by a vector with independent random components in \([-a/2,a/2]\).

Besides the time step \(\Delta t\) which determines the mean-free path \(\lambda =\Delta t \sqrt{k_{\textrm{B}}T/m}\), the mean number of particles per collision cell Q is the other crucial parameter in the MPC model (Malevanets and Kapral 1999; Noguchi and Gompper 2008). Due to the importance of angular momentum conservation, we here follow our earlier work (Ilg 2022) and implement the angular momentum-conserving algorithm (denoted as MPC-DR in Ref. Noguchi and Gompper 2008), where the rotation angle \(\gamma\) is not a free parameter but chosen as

$$\begin{aligned} \cos \gamma = \frac{1-R^2}{1+R^2}, \end{aligned}$$
(8)

where \(R=A_1/A_2\) with angular \(A_1=\sum _{j\in C_j}[{\textbf{r}}_j\times {\tilde{{\textbf{v}}}}_j]_z\) and projected \(A_2=\sum _{j\in C_j}{\textbf{r}}_j\cdot {\tilde{{\textbf{v}}}}_j\) relative velocities before collision, \({\tilde{{\textbf{v}}}}_j={\textbf{v}}'_j-{\textbf{V}}_{C_j}\).

The simplified collision rules between particles (7) do not resolve individual collisions, but ensure local conservation laws are obeyed. Therefore, the MPC method is numerically very efficient and hence can simulate hydrodynamic behavior on time and length scales larger than \(\Delta t\) and a (Malevanets and Kapral 1999; Noguchi et al. 2007).

In the form described so far, the MPC method has been successfully applied to various flow problems for viscous and viscoelastic fluids (Gompper et al. 2009), including ferrofluids (Ilg 2022). In order to describe flow through porous media, however, we need to introduce the effect the porous medium exerts on the fluid via inelastic collisions. Here, we follow the ideas put forward in Ref. (Dardis and McCloskey 1998) that on a mesoscopic level, the interaction of the fluid with the porous medium can be described as a local damping of the fluid velocity. Within the MPC method, this approach can be implemented straightforwardly as an additional friction force acting on the particles (Matyka 2017),

$$\begin{aligned} {\textbf{f}}^{\textrm{fric}}_i(t) = - \xi ({\textbf{r}}_i(t)){\textbf{v}}_i(t), \end{aligned}$$
(9)

where \(\xi ({\textbf{r}})\) is a (possibly position-dependent) friction coefficient. For \(\xi =0\) we recover the original MPC model, whereas \(\xi >0\) describes velocity damping due to porous media. For the case of pressure-drive flow that we consider in the following, the force on particle i can be written as \({\textbf{f}}_i={\textbf{f}}_i^{\textrm{fric}} + {\textbf{f}}^\textrm{ext}\), where the external force due to an applied pressure gradient is \({\textbf{f}}^{\textrm{ext}}=-\rho ^{-1}\varvec{\nabla }p\).

Eqs (5) – (9) describe the MPC model of non-magnetic fluid flow through porous media. This model has essentially been proposed in Ref Matyka (2017), where instead of adding the friction force (9), particle velocities are rescaled by a factor \((1-\xi \Delta t/m)\).

2.3 Hybrid MPC–BD Model for FF Flow

For magnetic fluids, the stationary momentum balance equation (2) must be supplemented by additional Kelvin–Helmholtz forces (Rosensweig 1985),

$$\begin{aligned} \rho {\textbf{f}}_{{\textbf{M}}} = ({\textbf{M}}\cdot \varvec{\nabla }){\textbf{H}}+ \frac{1}{2}\varvec{\nabla }\times ({\textbf{M}}\times {\textbf{H}}), \end{aligned}$$
(10)

where \({\textbf{H}}\) and \({\textbf{M}}\) denote the magnetic field and the magnetization, respectively. We assume the fluid to be non-conducting; therefore, we must also satisfy the magnetostatic Maxwell equations

$$\begin{aligned} \varvec{\nabla }\times {\textbf{H}}= \textbf{0}, \quad \varvec{\nabla }\cdot \textbf{B} = 0, \end{aligned}$$
(11)

where \(\textbf{B}=\mu _{0}({\textbf{H}}+{\textbf{M}})\) denotes the magnetic induction and \(\mu _0\) the permeability of free space. For a thorough description of ferrofluid hydrodynamics see e.g., Ref. Rosensweig (1985).

To evaluate the force density (10), one needs to employ a model to calculate the field- and flow-dependent magnetization \({\textbf{M}}\). Unfortunately, even after 50 years of research, there is no commonly agreed magnetization equation available in the literature (see e.g., Leschhorn and Lücke 2006; Fang, 2022 and references therein). Therefore, we here consider dilute conditions where there is less controversy and adopt the classical kinetic model of Martsenyuk et al. (1974) that has been studied frequently since (Ilg et al. 2002; Soto-Aquino et al. 2011; Ilg and Odenbach 2008).

To make the paper self-contained, we briefly present the MPC implementation of this model proposed in Ref. Ilg (2022). Further details can be found in the original reference. In this model, one considers the rotational dynamics of an individual MNP within the rigid-dipole approximation under the influence of external magnetic fields and flow. From the balance of magnetic, flow, and random torques, one finds that the orientation of the magnetic moment of particle i evolves to first order in the time step \(\Delta t_{\textrm{B}}\) by

$$\begin{aligned} {\textbf{u}}_i(t+\Delta t_{\textrm{B}}) = \frac{{\textbf{u}}_i(t)+\Delta \varvec{\omega }_i\times {\textbf{u}}_i(t)}{\Vert {\textbf{u}}_i(t)+\Delta \varvec{\omega }_i\times {\textbf{u}}_i(t)\Vert } \end{aligned}$$
(12)

with

$$\begin{aligned} \Delta \varvec{\omega }_i = \left[ \tau _{\textrm{B}}\varvec{\Omega }_{C_i} + \frac{1}{2} {\textbf{u}}_i\times {\textbf{h}}_{C_i} \right] \frac{\Delta t_{\textrm{B}}}{\tau _{\textrm{B}}} + \frac{1}{\sqrt{\tau _{\textrm{B}}}}\Delta {\textbf{W}}_i, \end{aligned}$$
(13)

where \(\varvec{\Omega }_{C_i}\) and \({\textbf{h}}_{C_i}\) are one half the local vorticity of the flow and the dimensionless magnetic field, respectively, both evaluated at the center of collision cell \(C_i\). The Brownian relaxation time of a MNP is denoted by \(\tau _{\textrm{B}}\) and \(\Delta {\textbf{W}}_i\) are independent, three-dimensional Wiener increments over a time interval \(\Delta t_{\textrm{B}}\). In the simulations presented here, we use a weak second order stochastic Heun scheme, where Eqs. (12) and (13) serve as predictor step.

With the magnitude of the magnetic moment \(\mu\) of a single MNP, the instantaneous local magnetization in collision cell \(C_i\) can be calculated as

$$\begin{aligned} {\textbf{M}}_{C_i}(t)=\frac{n\mu }{N_{C_i}(t)}\sum _{j\in C_i}{\textbf{u}}_j(t), \end{aligned}$$
(14)

where \(N_{C_i}(t)\) is the number of MPC particles in collision cell \(C_i\) at time t and n denotes the number density of MNPs. We calculate the magnetization \({\textbf{M}}\) in all collision cells according to Eq. (14) and use kernel-smoothing methods to find a discretization of the magnetization field \({\textbf{M}}({\textbf{r}};t)\). From the discretized magnetization field, we calculate spatial gradients via finite-difference approximations and are thus able to evaluate the Kelvin–Helmholtz force density (10) within each collision cell. Further details on the method are given in Ref. Ilg (2022).

Note that we do not explicitly include the effect of the porous medium on the rotational motion of the MNPs. While it is plausible that inelastic collisions of fluid and MNPs with obstacles lead to an effective damping of the translational motion, their effect on rotations is less obvious, especially since we later consider rotational motion of MNPs on time scales long compare to fluid motion (by choosing \(\tau _{\textrm{B}}\gg \Delta t\)). One possibility would be to model this effect as an additional rotational friction. In this case, all results presented below still hold when adjusting \(\tau _{\textrm{B}}\) correspondingly for given \(\xi\). Due to the uncertainties associated with such modeling, we chose to consider \(\tau _{\textrm{B}}\) constant in this initial study.

3 Non-magnetic Fluid Flow Through Porous Media

All numerical results and parameter values presented below are reported in dimensionless form, with the particle mass m and the linear size of the collision cell a as basic units, together with the reference thermal energy \(k_{\textrm{B}}T_{\textrm{ref}}\). Consequently, the units for time are \(t_{\textrm{ref}}=a\sqrt{m/k_{\textrm{B}}T_{\textrm{ref}}}\) and the units for the diffusion coefficient and kinematic viscosity are \(D_{\textrm{ref}}=a\sqrt{k_{\textrm{B}}T_{\textrm{ref}}/m}\).

First, we consider non-magnetic fluids, i.e., the MPC particles experience no other external forces except friction forces (9) and external pressure gradients, \({\textbf{f}}_i = {\textbf{f}}_i^{\textrm{fric}} + {\textbf{f}}^{\textrm{ext}}\).

3.1 Self-diffusion in Unbounded Domain, No External Forcing

To study self-diffusion under equilibrium conditions, no pressure gradient is applied, \({\textbf{f}}^{\textrm{ext}}=0\). Furthermore, to study self-diffusion in an unbounded domain, we consider in this section a periodic system without any walls present. Under these conditions and for the two-dimensional angular momentum-conserving collision model adopted here, the diffusion coefficient was calculated using molecular chaos assumption (Noguchi and Gompper 2008) as

$$\begin{aligned} D = \frac{k_{\textrm{B}}T\Delta t}{m} \left( \frac{1}{s_{\textrm{K}}} - \frac{1}{2} \right) , \end{aligned}$$
(15)

with \(s_{\textrm{K}}= 1 - \frac{3}{2Q} + e^{-Q}(3/Q+1-Q/2)/2\). Figure 1a shows the diffusion coefficient as a function of the average number of MPC particles per collision cell Q for two selected temperatures.

We perform MPC simulations for a two-dimensional periodic system of size \(30\times 30\) and different values for Q. From the particle mean-square displacement, \(\langle [{\textbf{r}}_i(t)-{\textbf{r}}_i(0)]^2 \rangle =4Dt\), we extract the diffusion coefficient D from a least-square fit and verified that the X- and Y-components of the displacement agree with each other within numerical accuracy. Figure 1a shows that Eq. (15) provides a good representation of the numerical results, even though some quantitative discrepancies can clearly be discerned for small up to moderate values of Q. For this model, similar deviations from the theoretical predictions have been reported in Ref. Noguchi and Gompper (2008) and attributed to the limitations of the molecular chaos assumption.

Equation (15) has been derived for a standard MPC fluid. We are not aware of a corresponding result for an MPC fluid in a porous material. Heuristically, we can describe the effect of local damping in the MPC scheme for porous materials by an effective time step \(\delta t\) in the free-streaming step (Matyka 2017), \(\delta t = (1-\xi \Delta t/m)\Delta t\). We assume that the reasoning presented in Ref. (Noguchi and Gompper 2008) leading to Eq. (15) remains otherwise unaltered. In particular, we assume that collisions occur sufficiently fast so that they are not affected by local friction effects. Thus, we suggest an approximation to the MPC diffusion coefficient for spatially homogeneous porous media as

$$\begin{aligned} D_\xi = \frac{k_{\textrm{B}}T\Delta t(1-\xi \Delta t/m)}{m} \left( \frac{1}{s_{\textrm{K}}} - \frac{1}{2} \right) \end{aligned}$$
(16)

with the same expression for \(s_{\textrm{K}}\) as given after Eq. (15). Figure 1b shows the variation of the effective diffusion coefficient with increasing value of the friction coefficient \(\xi\). The agreement of the numerical results with Eq. (16) is satisfactory. In particular, we find that the effective diffusion coefficient decreases approximately linear with increasing \(\xi\) as predicted by Eq. (16).

Fig. 1
figure 1

a Diffusion coefficient D vs Q for regular MPC fluid (\(\xi =0\)). Top and bottom correspond to temperatures \(T=0.5\) and \(T=0.1\), respectively. The dashed lines are the theoretical result Eq. (15). b Diffusion coefficient for MPC fluid in porous medium versus friction coefficient \(\xi\) for \(Q=50\), \(\Delta t =1\) , and \(T=0.1\). The dashed line corresponds to Eq. (16)

3.2 Channel Flow

In the following, we consider the pressure-driven channel flow of a fluid through a porous medium. Within the MPC model, an applied pressure gradient \(\textrm{d}p/\textrm{d}x\) in flow direction is realized by the external force \({\textbf{f}}^{\textrm{ext}}=f^{\textrm{ext}}\textbf{e}_x\) acting on every particle, where \(f^{\textrm{ext}}=-\rho ^{-1}\textrm{d}p/\textrm{d}x\).

To determine suitable values for \(f^{\textrm{ext}}\), we calculate the flow rate \(\dot{{\mathcal {V}}}\) by numerical integration over the flow profile and verify that this quantity varies linearly with \(f^{\textrm{ext}}\) in the parameter regime studied here. We consider a planar channel of widths \(L=32\) and 64 and length 50. From Fig. 2 we find \(\dot{{\mathcal {V}}}/f^{\textrm{ext}}\) approaches a limiting value with decreasing \(f^{\textrm{ext}}\). Within statistical uncertainties, we find the same limiting value for \(f^{\textrm{ext}}\lesssim 10^{-3}\). Therefore, we will use in the following \(f^{\textrm{ext}}=10^{-3}\) unless stated otherwise.

Fig. 2
figure 2

The flow rate divided by the strength of the driving force, \(\dot{{\mathcal {V}}}/f^{\textrm{ext}}\), is shown versus \(f^{\textrm{ext}}\) on a semi-logarithmic scale. Symbols denote simulation results obtained for parameters \(T=0.1\), \(\Delta t=0.2\), \(Q=100\) , and \(\xi =0.005\). Dashed line indicates the limiting value for weak driving forces

Having chosen a suitable value for \(f^{\textrm{ext}}\), we perform a series of MPC simulations for different values of the friction coefficient \(\xi\) and analyze the resulting velocity profiles. For all conditions investigated, we find that the numerical velocity profiles are well-described by the analytical profile for the Darcy–Brinkman model, Eq. (3). Fitting the numerical profiles to Eq. (3), we extract two fit parameters, c and \(r\), from which the model parameters can be determined as follows. First, as shown in Sec. 2.1, c is related to the damping parameter \(\alpha\) in the Darcy–Brinkman equation (2) by \(\alpha =f^{\textrm{ext}}/c\). Next, the permeability K is directly linked to the parameter \(r\) by \(K=1/r^2\). Finally, the kinematic viscosity is given by \(\nu =\alpha /r^2.\)

Figure 3 shows the extracted damping parameter \(\alpha\) and permeability K over a wide range of values for the friction coefficient \(\xi\) in the MPC model. Within numerical accuracy, we find that the Darcy–Brinkman damping parameter \(\alpha\) is equal to the friction coefficient \(\xi\) used in the MPC model. Therefore, the newly introduced friction coefficient in the MPC model can be identified with the more familiar damping parameter in the Darcy–Brinkman approach. For a derivation of this result at least for inviscid fluids, see Appendix A. From Fig. 3b, we find that the permeability K decreases with increasing \(\xi\). Except at very small values of \(\xi\), we find that the decrease can be described as \(K\sim 1/\xi\) to a very good approximation. It is interesting to note that the relations \(\alpha =\xi\) and \(K=k_0\xi ^{-1}\) also hold for a corresponding Lattice Boltzmann implementation of flow through porous media (Dardis and McCloskey 1998), where the density of scatterers plays the role of \(\xi\).

For small values of \(\xi\), large uncertainties in model parameters extracted from fits to Eq. (3) are found. In this regime, the velocity profiles are close to parabolic, leading to ambiguities in the two-parameter fit to Eq. (3).

Fig. 3
figure 3

a The damping parameter \(\alpha\) in the Darcy–Brinkman equation (2) extracted from fits to the velocity profile is shown versus the friction coefficient \(\xi\) in the MPC model for non-magnetic fluids. Note that a double-logarithmic scale is used. Open black squares and filled blue circles correspond to \(\Delta t = 1.0\) and 0.2, respectively. The dashed line indicates the relation \(\alpha =\xi\). b Permeability parameter K versus MPC friction coefficient \(\xi\) on a double-logarithmic scale. The same model parameters have been chosen and the same symbols are used as in (a). Dashed lines shows the power-law relation \(K=k_0\xi ^{-\kappa }\) with exponent \(\kappa \approx 0.99\) and prefactor \(k_0\approx 0.13\) for \(\Delta t =1.0\) and \(\kappa \approx 1.02\) and \(k_0\approx 0.30\) for \(\Delta t = 0.2\)

As a consistency test, we plot in Fig. 4a the parameter \(r\) governing the velocity profile (3) parametrically versus the damping parameter \(\alpha\) that we determined for different values of the friction coefficient. In agreement with Eq. (4), we find from our simulations \(r\sim \alpha ^{1/2}\). Note that this relation was also confirmed in Lattice Boltzmann simulations (Dardis and McCloskey 1998), while an earlier MPC implementation (Matyka 2017) recovered this relation only over a rather limited interval of \(\xi\).

From the relations \(\alpha =\xi\) and \(K=k_0\xi ^{-1}\) extracted from Fig. 3, we conclude that the kinematic viscosity \(\nu =\alpha K\) (see Sec. 2.1) is given by \(\nu = k_0\), independent of the friction coefficient. In the absence of porous media, we have already established the value of the kinematic viscosity \(\nu =0.114\pm 0.001\) for \(\Delta t=1.0\) in Ref. Ilg (2022). Since the current model reduces for \(\xi =0\) to a pure MPC fluid, we have performed some simulations for \(\xi =0\) and fitted the resulting velocity to a parabolic profile expected for Poiseuille flow. Thereby, we confirm the value of \(\nu\) obtained earlier for the current choice of parameters and \(\Delta t =1.0\) and find in addition \(\nu =0.320\pm 0.001\) for \(\Delta t=0.2\).

In Fig. 4b, we show the kinematic viscosity \(\nu\) obtained from fits to the velocity profile (3) via the relation \(\nu =\alpha /r^2\) in Sec. 2.1. From Fig. 4b, we indeed find that \(\nu\) is independent of the friction coefficient within statistical uncertainties, consistent with our conclusions above. Therefore, we can identify \(\nu\) with the kinematic fluid viscosity in the absence of a porous medium.

Fig. 4
figure 4

a The parameter \(r\) is shown parametrically versus \(\alpha\) for different friction coefficients and non-magnetic fluids. The same color coding is used as in Fig. 3. Dashed lines are power-law fits \(r\sim \alpha ^b\) with exponents \(b\approx 0.49\) and 0.50 for \(\Delta t=1.0\) and 0.2, respectively. b The kinematic viscosity \(\nu\) extracted from fits to the velocity profile (3) versus the friction coefficient \(\xi\) in the MPC model. The same color coding is used as in Fig. 3. The dashed lines indicate the kinematic viscosity determined in the absence of a porous medium (\(\xi =0\))

4 Ferrofluid Fluid Flow Through Porous Media

In this section, we consider ferrofluid flow for the same conditions as studied in Sec. 3.2, i.e., the steady-state flow through planar channels filled with porous media. As before, we assume spatially homogeneous porous materials so that the friction coefficient \(\xi\) in the MPC method, Eq. (9) is constant, independent of the position throughout the channel. Here, we employ the hybrid MPC-BD model of fluctuating ferrohydrodynamics and include the Kelvin–Helmholtz force into the momentum balance as described in Sec. 2.3.

Assuming that the rotational relaxation of MNPs is slow compared to fluid motion, we choose \(\tau _{\textrm{B}}=100\) and set \(\Delta t_{\textrm{B}}=\Delta t\).

Fig. 5
figure 5

The velocity profiles \(v_x(y)\) across the channel are shown for ferrofluid flow through a porous medium with \(h=0\) (open squares) and \(h=5\) (filled circles) for \(\Delta t =0.2\), \(n^*=0.005\). Top curves correspond to \(\xi =0.01\), bottom ones to \(\xi =0.02\). Dashed lines show fits to the profile (3) in the Darcy–Brinkman model

Figure 5 shows velocity profiles obtained from MPC-BD simulations for selected parameter values of \(\Delta t =0.2\), \(n^*=0.005\), using \(\xi =0.01\) and \(\xi =0.02\). As found earlier, with increasing friction \(\xi\), the flow velocity is reduced and deviates more strongly from the parabolic Poiseuille profile found in the absence of porous media. In addition, we observe that the external magnetic field also influences the flow profile. In particular, we find that increasing the magnetic field leads to a reduction of the overall velocity, corresponding to an increase in the effective viscosity of the fluid. This so-called magneto-viscous effect is well-known for magnetic nanoparticles suspended in viscous solvents (Ilg and Odenbach 2008).

Here, we analyze this phenomenon quantitatively for the flow through porous media. To this end, we fit the velocity profiles that we obtain numerically from the MPC-BD simulations to the profile (3) resulting from the Darcy–Brinkman model. For all parameter values investigated, we find that Eq. (3) provides an accurate description of our numerical results. Therefore, we can proceed with our analysis of the fitted coefficients c and \(r\). First, we extract the damping parameter \(\alpha\) from the amplitude c of the profile (3) via the relation \(\alpha =f^{\textrm{ext}}/c\) found in Sec. 2.1, where \(f^{\textrm{ext}}=-\rho ^{-1}\textrm{d}p/\textrm{d}x\).

Fig. 6
figure 6

a The effective damping parameter \(\alpha\) in the Darcy–Brinkman equation (2) extracted from fits to the velocity profile is shown versus the applied magnetic field strength h. The same model parameters are chosen as in Fig. 5 with \(\xi =0.01\) (lower) and \(\xi =0.02\) (upper). b Effective permeability parameter \(K_{\textrm{eff}}\) versus magnetic field strength h. The same model parameters have been chosen, and the same symbols are used as in (a). Dashed lines show the theoretical result (18) explained below

From Fig. 6a, we find that the effective damping parameter \(\alpha\) for ferrofluid flow is independent of the magnetic field strength and still given by the MPC friction coefficient \(\xi\) as in the non-magnetic/field-free case. Thus, within statistical uncertainty, the friction coefficient \(\xi\) in the MPC model is equal to the damping parameter \(\alpha\) in the Darcy–Brinkman model (2) also in the magnetic case. In Fig. 6b, we show the effective permeability \(K_{\textrm{eff}}\) obtained from the parameter \(r\) in the fitted velocity profile (3) versus the magnetic field strength h for different values of the friction coefficient \(\xi\). We observe that \(K_{\textrm{eff}}\) increases with increasing field strength, reaching a limiting value for large h.

Fig. 7
figure 7

a The relative change of the effective viscosity, \(\Delta \nu _{\textrm{eff}}(h)/\nu (0)\), versus the applied magnetic field strength h. The model parameters are chosen as in Fig. 6. Dashed line shows a fit to Eq. (17). b The permeability K scaled with the friction coefficient \(\xi\) is shown versus the effective viscosity \(\nu _{\textrm{eff}}\) for the same data as in panel (a) and in Fig. 6b. The dashed line shows the relation \(\xi K = \nu _{\textrm{eff}}\)

In order to explain this finding, we use Eq. (4) to define the effective viscosity \(\nu _{\textrm{eff}}\) and evaluate this quantity with the values for the damping parameter \(\alpha\) and the fit parameter \(r\) that we have determined. In Fig. 7a, we show the viscosity change \(\Delta \nu _\textrm{eff}(h)=\nu _{\textrm{eff}}(h)-\nu (0)\), scaled with the viscosity \(\nu (0)\) at zero field. We verified that \(\nu (0)\) agrees with the viscosity \(\nu\) obtained in Sec. 3.2 for non-magnetic fluids with otherwise identical model parameters. From Fig. 7a, we find that the relative viscosity change does not depend on the value of the friction coefficient \(\xi\). Furthermore, the increase of \(\Delta \nu _{\textrm{eff}}(h)/\nu (0)\) is well-described by the classical result for ferrofluids (Martsenyuk et al. 1974),

$$\begin{aligned} \frac{\Delta \nu _{\textrm{eff}}(h)}{\nu (0)} = \frac{3}{2}\phi \frac{h L^2(h)}{h-L(h)}, \end{aligned}$$
(17)

where \(L(h)=\coth (h)-h^{-1}\) denotes the Langevin function and \(\phi\) the magnetic volume fraction. Therefore, the magneto-viscous effect can be seen in porous media in very much the same manner as in viscous solvent.

It should be mentioned that the model of Martsenyuk et al. (1974) employed here can be justified only for dilute ferrofluids. Therefore, in future applications, smaller values for the number density n should be chosen with corresponding smaller viscosity changes. Here, we have chosen larger values of n to better illustrate the field-dependent effects captured by the simulation method.

Having rationalized the effective viscosity, we replot in Fig. 7b the effective permeability \(K_{\textrm{eff}}\) from Fig. 6b not versus the magnetic field h but versus \(\nu _{\textrm{eff}}(h)\). Multiplying \(K_{\textrm{eff}}\) with the friction coefficient \(\xi\), all data fall nicely on the diagonal, showing that the effective permeability of ferrofluid flow through porous media is given by \(K_{\textrm{eff}}(\xi ,h) = \nu _\textrm{eff}(h)/\xi\), which is well approximated by

$$\begin{aligned} K_{\textrm{eff}}(\xi ,h) = \frac{\nu }{\xi }\left[ 1 + \frac{3}{2}\phi \frac{h L^2(h)}{h-L(h)}\right] , \end{aligned}$$
(18)

with \(\nu\) the kinematic viscosity in the absence of magnetic fields. In the absence of a magnetic field, we recover \(K=K_\textrm{eff}(\alpha ,h=0)\), where we made use of the equality \(\xi =\alpha\). For increasing magnetic field strength h, we find that the effective permeability \(K_{\textrm{eff}}\) increases monotonically to approach an asymptotic value for \(h\gg 1\). In analogy to the well-known magneto-viscous effect, one might speak of a corresponding “magneto-permeability effect” in ferrofluid flow through porous media. From Fig. 6b, we observe that the magneto-permeability effect for the present model is well-described by Eq. (18).

We close this section by considering the most important dimensionless groups determining the nature of fluid flow. First, the Reynolds number is defined as \(\textrm{Re}=UL/\nu\), where U is a characteristic flow velocity and L the channel width. For the present choice of parameters \(U\approx 0.1\) for \(L=64\) (see Fig. 5), so that we find typical Reynolds numbers \(\textrm{Re}\approx 20\), well in the laminar regime. Next, the Schmidt number \(\textrm{Sc}=\nu /D\) is a measure for the importance of viscous versus molecular diffusion. For \(Q=100\gg 1\), we find \(D\approx T\Delta t/2\approx 0.01\) so that \(\textrm{Sc}\approx 30\), indicating that we are indeed operating in the relevant regime for fluids, where collisions dominate over kinetic transport. Finally, the Mach number is defined as \(\textrm{Ma}=U/c_{\textrm{s}}\), where \(c_\textrm{s}=\sqrt{5k_{\textrm{B}}T/3\,m}\) denotes the speed of sound. In our case, we find typically \(\textrm{Ma}\approx 0.25\). It is well-known that particle-based methods like MPC do not strictly obey the incompressibility condition. The smaller the Mach number, the better incompressibility is restored. Finally, for viscoelastic fluids like ferrofluids, the Weissenberg number \(\textrm{Wi}=\tau _{\textrm{B}}U/L\) gives the ratio of viscous to elastic forces. Here, we typically find \(\textrm{Wi}\approx 0.2\) and therefore the simulations are performed in the Newtonian regime.

5 Flow Through Channels with Walls Covered by Porous Media

In this section, we consider again driven flow through a parallel channel. This time, however, the porous medium is only present within a layer of width \(\ell _{\textrm{p}}\) on both walls, whereas the fluid is unperturbed in the center.

Within the MPC scheme described in Sec. 2.2, this situation can be implemented conveniently by a position-dependent friction coefficient \(\xi ({\textbf{r}})\) in Eq. (9). The porous layers are described by setting \(\xi ({\textbf{r}})=\xi\) for \(y\le \ell _{\textrm{p}}\) or \(y\ge L-\ell _{\textrm{p}}\) and \(\xi =0\) in the center, \(\ell _{\textrm{p}}< y < L-\ell _{\textrm{p}}\).

Fig. 8
figure 8

Flow profile in a parallel channel where walls is covered with a porous layer, indicated by the gray-shaded regions. Black and blue symbols correspond to \(h=0\) and \(h=5\), respectively. In panels a and b, the width of the porous layer is \(\ell _{\textrm{p}}= 0.2 L\) and 0.3L, respectively. The model parameters are chosen as \(T^*=0.1\), \(\Delta t=0.2\), \(Q=100\), \(\xi =0.02\), \(f^{\textrm{ext}}=0.0002\). The dot-dashed lines indicate the estimated value for \(\ell _{\textrm{p}}\) based on Eq. (20), and dashed lines show the corresponding simplified profile (19)

Figure 8 shows typical simulation results of the velocity profile obtained in such a situation. From Fig. 8, we observe a smooth transition between a parabolic Poiseuille profile in the center and a more flat Darcy–Brinkman profile in the porous layers. These observations are in qualitative agreement with earlier simulations (Matyka 2017). In the center region, the magnetic field increases the effective viscosity, therefore slowing down the flow. In the porous region, however, the magnetic field is found to have a much smaller effect on the flow.

In a simplified description, we can approximate the velocity as constant, \(v=v_0\), within the porous layers of width \(\ell _{\textrm{p}}\), and a parabolic profile in the center of the channel. Insisting on a continuous velocity profile at the interface between the two at \(y=\ell _{\textrm{p}}\) and \(y=L-\ell _{\textrm{p}}\), we arrive at

$$\begin{aligned} v_x(y) \approx \left\{ \begin{array}{ll} v_0 &{} \textrm{for}\ y<\ell _{\textrm{p}}\ \textrm{or}\ y>L-\ell _{\textrm{p}}\\ v_0 + u[y(L-y) - \ell _{\textrm{p}}(L-\ell _{\textrm{p}}) ]&{}\textrm{for}\ \ell _{\textrm{p}}\le y \le L-\ell _{\textrm{p}}\end{array}\right. \end{aligned}$$
(19)

with L the channel width. The quantity u can be expressed in terms of the maximum velocity \(v_{\textrm{max}}\) in the channel center as \(u=(v_{\textrm{max}}-v_0)/[(L/2)^2-\ell _{\textrm{p}}(L-\ell _{\textrm{p}})]\). The flow rate \(\dot{{\mathcal {V}}}=\int _0^Lv_x(y)\textrm{d}y\) for the flow profile (19) can be calculated as

$$\begin{aligned} \dot{{\mathcal {V}}} = \frac{1}{3}(2v_{\textrm{max}}+v_0)L - \frac{4}{3}(v_{\textrm{max}}-v_0)\ell _{\textrm{p}}. \end{aligned}$$
(20)

For constant \(v_0<v_{\textrm{max}}\), increasing the width \(\ell _{\textrm{p}}\) of the porous layer leads to a proportional decrease in the flow rate.

In view of possible applications, it might be useful to be able to estimate the thickness of the porous layer \(\ell _{\textrm{p}}\) without the need to determine the detailed flow profile. We assume one can measure the total flow rate \(\dot{{\mathcal {V}}}\) and the centerline velocity \(v_{\textrm{max}}\). In our simulations, we obtain \(v_{\textrm{max}}\) from fitting a parabola to the flow profile in the center region. Furthermore, we approximate the velocity within the porous layer by Darcy’s law (1), \(v_0 = -(K/\eta )\textrm{d}p/\textrm{d}x = f^{\textrm{ext}}/\xi\). Knowing the channel width L, we can then determine the thickness of the porous layer within the simple model (19) by solving Eq. (20) for \(\ell _{\textrm{p}}\).

Vertical dot-dashed lines in Fig. 8 indicate the value of \(\ell _{\textrm{p}}\) obtained in this way, while dashed lines show the corresponding approximate profile (19). Note that changing the magnetic field strength alters the flow profile, but the estimate for \(\ell _{\textrm{p}}\) remains unchanged within numerical accuracy. From Fig. 8, it is apparent that Darcy’s law captures the mean velocity, but approximating the flow as constant within the porous layer is a rather crude approximation. Consequently, the layer thickness is underestimated by around 15–30% within the parameter range investigated. In spite of this inaccuracy, such a simple estimate might be a useful first step in determining the thickness of porous layers.

6 Conclusions

In this communication, we propose an extension of the hybrid MPC-BD scheme developed in Ref. Ilg (2022) to describe fluctuating ferrohydrodynamics in porous media by additional friction forces. We performed numerous computer simulations and validated the model and its implementation in several ways and over a considerable range of parameters. In particular, we verified that the newly introduced friction coefficient is identical to the damping parameter in the Darcy–Brinkman model. Using an Irving–Kirkwood approach, we argue that this identity is expected, at least on large enough scales where hydrodynamics emerges from the MPC model. We also verified the expected dependence of the permeability on the friction coefficient. Therefore, the current MPC model can serve as an alternative to the Lattice Boltzmann implementation proposed in Ref. Dardis and McCloskey (1998) for the non-magnetic case. We mention that our implementation of the MPC method for non-magnetic fluids improves on an earlier approach (Matyka 2017), which suffered from a number of misconceptions concerning model parameters.

In the present work, we benefit from the flexibility of the MPC approach and couple the stochastic rotational motion of MNPs to the MPC scheme for flow through porous media. From simulations of channel flows, we find a “magneto-permeability effect” in porous media, i.e., the field-dependent change of the effective permeability. This effect is analog to the traditional magneto-viscous effect in ferrofluids (Ilg and Odenbach 2008) and can be described theoretically in the same manner.

As an application of the method, we consider the flow through a planar channel with walls covered by a layer of porous material. In this situation, a parabolic velocity profile develops in the center of the channel, as is well-known for Poiseuille flow of viscous fluids. On approaching the porous layers, the parabolic profile gives way to the more plug-like flow, which is typically observed in porous materials. We propose a simple method to estimate the thickness of the porous layer, based only on the total flow rate and the centerline velocity. Such rough estimates might be useful in a number of practical applications.

The present study can be extended in various ways. First, the extension to fully three-dimensional flows and more complicated geometries is straightforward, thanks to the flexibility of the MPC method. These extensions, together with a generalized model to describe non-dilute ferrofluids, have already been explored for flow in non-porous media (Ilg 2022). From a more conceptual point of view, future studies are needed to investigate the role of porous media on the rotational motion of nanoparticles. Once these effects are better understood, they can then be included within the present hybrid MPC-BD scheme. A further extension of the present work could be the investigation of strongly heterogeneous, e.g., fractured porous media and to revisit earlier studies (Huang et al. 2021) with a more reliable constitutive model. The current approach is also well-suited to be incorporated within multi-scale simulation schemes (Boccardo et al. 2020; Al Sariri and Penta 2022), which are needed e.g., to study the highly interesting phenomenon of colloidal deposition in porous media (Bizmark et al. 2020; Gerber et al. 2020).