1 Introduction

Molecular dynamics (MD) is a useful numerical tool for probing microscopic phenomena and non-equilibrium dynamics in merging nano- and microfluidic technologies. MD can capture macroscopic hydrodynamics, or even operate as an ab initio tool for continuum-based solutions in which it provides the microscopic constitutive or boundary information (Koplik and Banavar 1995; Okumura and Heyes 2004; Todd 2001). However, its demand for massive computational power as system size and simulation time scale upwards prohibits simulations (even run on modern processing clusters) much above the nanoscale. So there has been a recent methodological drive to optimise the use of MD by coupling smaller domain sizes to computationally cheaper continuum solutions, creating a hybrid model for a given flow geometry (see Mohamed and Mohamad 2010 for a comprehensive review).

In this study, we propose such a hybrid method for simulating flows in networks of micro/nanochannels, for which Navier–Stokes solutions are inaccurate (because the smallest important scale of the network geometry means the use of conventional boundary conditions and constitutive models are invalid) and Molecular Dynamics is too computationally expensive (because of the largest scale of the network geometry). Many applications fall into this class of multiscale network flow. For example, lab-on-a-chip devices for health diagnostics (Jiang et al. 2011); flows through nanopipe membranes for sea-water desalination (Mattia and Gogotsi 2008), or air-purification (Mantzalis et al. 2011); and miniaturised heat exchangers for cooling electronic circuits (Yarin et al. 2009).

Hybrid molecular-continuum techniques developed so far for dense fluids can be grouped as follows: (a) domain-decomposition methods (O’Connell and Thompson 1995; Hadjiconstantinou and Patera 1997; Wagner et al. 2002; Delgado-Buscalioni and Coveney 2003; Nie and Robbins 2004) and (b) heterogeneous multiscaling (Ren and E 2005; Yasuda and Yamamoto 2008; E et al. 2009; Asproulis et al. 2012). Domain decomposition (DD) is a methodology suitable for flows next to bounding surfaces or interfaces. The DD method applies an MD solver to the boundary/interface, coupled to a continuum solver by matching hydrodynamic flux or state properties solely in an overlapping region (see Fig. 1a, b). DD methods have some serious disadvantages in certain classes of flow (Hadjiconstantinou 2005). For example, a major disadvantage for solving the kind of micro/nano-network problems in this paper is that the majority of the flow can be considered ‘near-wall’, as shown in Fig. 1b for a generic flow geometry: the MD component needs to be applied along the entire length of the channel walls to capture the slip and near-wall atomistic effects. As a consequence, this restricts the channel lengths and heights that can be modelled practically by DD. The coupling method may also not work properly if the viscosity selected in the continuum grid does not match exactly to that derived from the fluid in the MD sub-domains (Delgado-Buscalioni and Coveney 2003).

Fig. 1
figure 1

Schematic of different types of hybrid methods applied to a a generic internal-flow problem, b the domain-decomposition method (DD), e.g. (O’Connell and Thompson 1995), c the heterogeneous multiscale method (HMM), e.g. (Ren and E 2005), and d the internal-flow multiscale method (IMM) (Borg et al. 2013)

The heterogeneous multiscale method, known as HMM (E et al. 2003), is more appropriate for simulating multiscale fluidic network systems (see Fig. 1c). In HMM, a continuum macro-model is regarded as applicable in the whole domain and defined everywhere (although no assumptions regarding constitutive models or boundary conditions are made); unlike domain decomposition, there is no distinct macro/micro-partitioning involved. Small micro-elements are introduced into the multiscale technique by dispersing them only on nodes of the continuum computational grid, with the sole objective being to provide the microscopic information and physics that the macro-model does not incorporate. For a flow in a channel or pipe, for example, MD micro-elements are placed on the surface and in the fluid region, as illustrated in Fig. 1c. Non-equilibrium MD (NEMD) simulations are carried out using the local continuum strain rate as a constraint, and from which only the necessary information is measured and supplied to the macro-model to close the continuum governing equations. The shear stress measured in micro-boxes located in the bulk of the fluid replaces any form of constitutive relation or requirement for transport coefficients, while wall micro-elements measure accurate slip velocity and shear stress, replacing any need for phenomenological slip boundary conditions (Ren and E 2005).

The main disadvantage of HMM is that it is not suitable for modelling very narrow parts of a fluidic channel system, since micro-elements can then be forced to overlap (as seen in Fig. 1c), which is less efficient and less accurate than full MD. In the cases presented in this paper, the channel heights are of the same order as the sizes of individual micro-elements, which are typically constrained by a minimum dimension in MD (e.g. ∼3 nm for simple Lennard–Jones fluids). A reasonably fine macro-grid is also required for a good approximation of the hydrodynamic variables in the transverse directions (e.g. the velocity profile). While the number of grid points and sizes of micro-elements, in Fig. 1c, are drawn for clarity of illustration; they are, in fact, greater in number, proportionally much larger in size and therefore considerably overlap.

In this study, we build on our recent method called the internal-flow multiscale method (IMM) (Borg et al. 2013) (see Fig. 1d). The IMM is a hybrid method tailored to studying flows in high-aspect-ratio channels. The exploitable multiscale feature of this type of flow configuration is the existence of length-scale separation between hydrodynamic processes occurring along the direction of flow (characterised, say, by the length of the channel), and molecular processes occurring on scales transverse to the flow direction (characterised, for example, by the channel height). As such, in this method every micro-element covers the entire cross section of the channel/tube, enabling the use of simple parallel-wall MD simulations. As a result, the method does not suffer from non-periodicity requirements as in DD; the common periodic boundary condition in this case can be applied in every direction.

In the IMM coupling method, micro-elements do not communicate directly with each other. Instead, they interact indirectly via constraints applied by the local macroscopic component of the simulation. From the macroscopic perspective, the conservation of mass and momentum is a perfectly adequate description for channel flows. No constitutive behaviour or slip is required in the continuum formulation because this is provided (indirectly) by the micro-elements. The IMM algorithm consists of a series of iterations, which involve a two-way exchange of information between macro- and micro-constituents until convergence is obtained. It first imposes individual pressure gradients to every micro-element using common uniform ‘gravity’-type forcing techniques. Mass fluxes in these micro-simulations are then measured and, following a continuity constraint, a corrected set of pressure gradients are computed for the next iteration.

While the IMM method presented in Borg et al. (2013) is capable of capturing variations in pressure and velocity within a channel of high aspect ratio, it is not accurate in ‘junction’ components, where abrupt changes in channel geometries occur and no obvious scale separation exists. For example, a reservoir inlet/exit junction cannot make use of micro-resolution using the parallel-wall micro-elements of Borg et al. (2013). Even if the micro-resolution is increased in junction regions, micro-elements will be forced to overlap and thus will be far more computationally costly and less accurate than a full MD approach.

In this study, we propose a method for simulating multiscale fluidic networks by coupling an IMM-type (Borg et al. 2013) approach for high-aspect-ratio channels with full MD simulations of the connecting junction components. Figure 2 provides an illustration of this concept. As such, the scope of the current method is more general than IMM (Borg et al. 2013) alone and will enable the study of realistic fluidic systems for NEMS/MEMS applications.

We maintain the same flow assumptions as in Borg et al. (2013), i.e. low speed, isothermal, incompressible, steady flows. In this adaptation of the hybrid methodology, and for increased generality, the macro-to-micro-constraint procedure is modified so that individual pressure drops across junction and channel components can be applied (rather than pressure gradients as in IMM). The micro-to-macro-constraint remains similar to IMM and consists of measuring mass fluxes through disconnected micro-elements, and subsequently readjusting the applied pressure drops to conserve overall mass flux. In this hybrid approach, the computational saving is obtained only from long scale-separated channel sections that are replaced by shorter, but hydrodynamically equivalent, periodic channels. There is no computational advantage from simulating junction components, except that smaller MD simulations in the hybrid approach can converge far quicker to steady state than they would in the larger full MD system, since coupling is performed with steady-state continuum conservation equations.

The paper is set out as follows. We first describe the general multiscale method in Sect. 2, followed by testing and validation on flows through simple nanochannel networks in Sect. 3.

2 The hybrid method

A nanofluidics network typically consists of a number of different components, in two categories: junctions and channels. Some examples of junctions include kinks, bends, localised channel defects, mixers, and pumping chambers, bifurcation channel connectors (T- and Y-shapes). Our hybrid algorithm models each junction and channel using MD sub-domains (hereon referred to as micro-elements) that are disconnected from each other in the streamwise direction. Each micro-element covers the entire height of the channel and includes a molecular description of both the bounding wall and liquid. In this way, micro-elements provide an accurate prediction of the local mass flux and pressure loss caused by wall–liquid and liquid–liquid molecular interactions.

Junctions typically do not exhibit exploitable length-scale separation, i.e. there is no obvious way in which a multiscale approach can be used to reduce the computational burden of simulating the junction region using MD. However, in NEMS/MEMS devices, the channel/tube components will tend to be much longer in their length (or some other scale that characterises their geometry in the streamwise direction) than the characteristic scale of their cross section. Therefore, computational savings can be made by applying a multiscale approach to these long channel components that connect the junctions. The fluid properties in the streamwise direction of nanoscale channels are either uniform or only gradually varying. It is therefore very reasonable, in terms of accuracy, if these long channels are modelled by shorter periodic MD elements, as demonstrated in Borg et al. (2013). Note, despite the fact that a form of scale separation exists in these nano/microchannel elements, there is not likely to be Navier–Stokes behaviour (Travis et al. 1997), nor is this assumed in the method.

Figure 2a illustrates a simple nanofluidics network configuration in which inlet and outlet reservoirs are set at different pressures. The pressure drop \(\Updelta p = p_{\rm in} - p_{\rm out}\) generates a flow through the long channels and the junction of its midpoint, where p in is the inlet pressure and p out is the pressure at the outlet. The junction in the middle could represent any sort of nanoflow device or a local defect in the material, for example.

Fig. 2
figure 2

Schematic of a a simple nanofluidics serial network connected between two reservoirs, b the segmented network into channels and junctions, and c the multiscale decomposition simplified into separate MD sub-domains

The network is decomposed into channel and junction components as shown in Fig. 2b. Note that each junction incorporates also an extra channel section of reasonable length so that local entrance/exit effects are contained within the junction simulation. First we will describe the method for coupling the disconnected MD micro-elements shown in Fig. 2b, then we will describe how scale separation can be exploited in the channel elements to make this a multiscale method (Fig. 2c).

2.1 Coupling methodology

Mass conservation is the foundation of the coupling approach. In steady state, and for the serial-type network shown in Fig. 2, we require that the mass flow through each micro-element to be equal (and thus equal to the mean):

$$ \dot{m}_i = \frac{1}{\Uppi}\sum\limits_{j=1}^{\Uppi} \dot{m}_j =\overline{\dot{m}}, \quad{\rm for}\; i = 1,\ldots, \Uppi, $$
(1)

where \(\dot{m}_i\) denotes the mass flow rate in the ith of \(\Uppi\) micro-elements, and \(\overline{\dot{m}}\) is the mean mass flux across all the elements. Note that, in non-periodic junctions of a network, molecules must therefore be created/deleted at the inlet/outlet at the same rate. At the beginning of the coupling procedure, the mass flow rates in each micro-element are unequal, and only approach a solution to Eq. (1) after the iterative scheme described below is performed; the mass flux common to all micro-elements \(\overline{\dot{m}}\) in Eq. (1) is thus an output of the converged coupled simulation.

In this paper, for simplicity, we restrict our attention to incompressible isothermal flow through the network. Given this, a constant density and temperature are specified. The total pressure difference \(\Updelta p\) between the first and last element of the network, which is specified by the problem (i.e. an input to the coupled simulation), is related to pressure drops across all micro-elements by:

$$ \Updelta p= \sum\limits_{i=1}^{\Uppi} {\Updelta p}_i, $$
(2)

where \({\Updelta p}_i\) is the pressure drop over the ith micro-element.

2.2 Numerical scheme

The coupling we propose is an iterative scheme to enforce the mass flow rate and pressure-difference constraints, Eqs. (1) and (2), respectively. The simulation is stopped once all micro-elements converge to a single value of mass flux (given a predefined convergence criterion), from Eq. (1). Given the reasonable assumption that, in the steady state, \(\dot{m}_i\) varies monotonically with \({\Updelta p}_i,\) a straightforward iteration scheme towards a common mass flow rate in each of the micro-elements is provided by:

$$ \Updelta {p_i}^{l+1}=\Updelta {p_i}^{l}+ \gamma_i\left( \overline{\dot{m}}^{ l+1}-\dot{m}_i^l \right), $$
(3)

where l is the iteration index, and γ i is a relaxation coefficient for each micro-element. Inspection of Eq. (3) reveals that as the mass flow rate in each micro-element converges to the mean (and Eq. 1 is satisfied), the pressure drop in each micro-element will cease to be updated. The mean mass flux \(\overline{\dot{m}}\) is implicitly defined, i.e. it is evaluated at the updated iteration index l + 1. This means that Eq. (3) represents \(\Uppi\) equations with \(\Uppi+1\) unknowns. The missing equation is provided by the pressure-difference constraint, Eq. (2). The system of linear equations given by Eqs. (2) and (3) can thus be solved using LU decomposition or similar.

What must be determined at each iteration, before the system of equations can be solved, are the individual relaxation coefficients γ i for each micro-element. We base these on approximating a linear relationship between \({\Updelta p}_i\) and \(\dot{m}_i{:}\)

$$ \gamma_i = \frac{{\Updelta p_i}^l}{\dot{m}_i ^l}. $$
(4)

Note, the accuracy of this approximation does not affect the converged solution, but the speed of convergence. Equation (3) can therefore be reduced to a simpler form:

$$ \Updelta {p_i}^{l+1}=\Updelta {p_i}^{l} \left(\frac{\overline{\dot{m}}^{ l+1}}{\dot{m}_i^l}\right). $$
(5)

The channel components of the network are typically long narrow geometries (e.g. a carbon nanotube). Given that entrance and exit effects are contained within the junction components (as described above), the flow in these channels can be approximated accurately by short periodic channel micro-elements with the same pressure gradient applied. For example, if a full-scale channel is L i in length, with a pressure drop of \(\Updelta p_i,\) then this can be approximated by a periodic channel of the same dimensions except that its new length L i is equal to L i /g i with a pressure drop \(\Updelta p_i'\) equal to \(\Updelta p_i/g_i\) (see Fig. 2c). The dimensionless factor g i represents the speed-up for treating this component as a shorter micro-element—and is referred to here as the numerical gearing of the multiscale component.

This multiscale approach for the efficient simulation of channel elements is of the form of IMM presented in Borg et al. (2013). More general high-aspect-ratio geometries, as opposed to ones with constant cross section can be considered in this full network model, as illustrated in the example of Fig. 2.

2.3 Algorithm

We now describe our iterative hybrid algorithm applied to multiscale serial network configurations:

  1. 1.

    The initial condition at iteration l = 0 starts with an estimated value of pressure difference on each element: \(\Updelta p_i=L_i \Updelta p/L,\) where L i is the streamwise length of the ith micro-element, and L is the total length of the configuration, inlet to outlet.

  2. 2.

    Run all micro-element MD simulations at their applied pressure differences, \(\Updelta p_i,\) until steady state. At steady state, measure the mass fluxes, \(\dot{m}_i^{l},\) in all micro-elements.

  3. 3.

    New iteration, l + 1.

  4. 4.

    Solve the system of Eqs. (2) and (5), to obtain a corrected pressure difference, \(\Updelta p_i^{l+1},\) and a closer estimate of mass flux, \(\overline{\dot{m}}^{l+1}.\)

  5. 5.

    Repeat from 2 until a convergence criterion is met:

    $$ \zeta^{l+1}_i < \zeta^{\rm{tol}},\quad {\rm with}\; \zeta^{l+1}_i = \frac{| \ \overline{\dot{m}}^{l+1}- \dot{m}_i^{l} \ |}{ \overline{\dot{m}}^{l+1}}, $$
    (6)

    where \(\zeta^{\rm{tol}}\) is a predetermined tolerance used for all micro-elements.

2.4 Molecular dynamics

Junction and channel micro-elements are solved by non-equilibrium molecular dynamics simulations (NEMD) (Rapaport 2004; Allen 1987), with pressure-difference constraints to allow implementation of the numerical scheme described above. We run MD simulations using the mdFoam solver (Macpherson and Reese 2008; Borg et al. 2010), which has been developed in OpenFOAM, an open-source set of C++ libraries for fluid dynamics simulations (OpenFOAM: http://www.openfoam.org). To demonstrate the validity of our multiscale method, we simulate only simple spherically symmetric monatomic particles (hereon referred to as ‘molecules’) that interact through pair-wise potentials. The method is applicable to more general and realistic molecular models, however. The external geometry of the channel or junction is described by rigid wall molecules that are kept fixed in space and time. The non-equilibrium motion of liquid molecules is implemented using Newton’s equations of motion with added external forcing, \({\bf f}^{\rm ext}{:} \)

$$ \frac{\rm d}{{\rm d}t}{\mathbf{r}}_k = {\mathbf{v}}_k, $$
(7)
$$ m_k\frac{\rm d}{{\rm d}t}{\mathbf{v}}_k = {\bf f}^{\prime}_k + {\bf f}^{\rm ext}, $$
(8)

where k is a molecule in the system and \(\mathbf{r}_k = (x_k, y_k, z_k)\) is its time-instantaneous position in a fixed Cartesian co-ordinate reference system. Each molecule has a mass, m k and a velocity, \(\mathbf{v}_k = (u_k, v_k, w_k). \) The total intermolecular force on each molecule, \({\bf f}^{\prime}_k = - \sum\nolimits_j \nabla U(r_{kj}), \) is determined from neighbouring molecules j, where U(r kj ) is the pair potential and \(r_{kj} = |\mathbf{r}_k - \mathbf{r}_j|\) is the pair-molecule separation. The Lennard–Jones (LJ) 6–12 potential, widely used to model simple liquids, is used here in our MD simulations:

$$ U_{12-6}(r_{kj}) = \left\{\begin{array}{ll} 4 \epsilon \left[ \frac{\sigma}{r_{kj}}^{12} - \frac{\sigma}{r_{kj}} ^{6}\right] & {\rm if}\; r_{kj} < r_{\rm c} \\ 0 & {\rm if}\; r_{kj} \geq r_{\rm c}, \end{array}\right. $$
(9)

where σ and \(\epsilon\) are the length and energy characteristics of the potential, and r c is the cut-off separation. The σ and \(\epsilon\) properties for the liquid–liquid and wall–liquid interactions are taken from Thompson and Troian (1997), with the intention to generate slip at the solid–liquid interface. The values for these are, σ l-l  = 3.4 × 10−10 m, \(\epsilon_{l-l}=1.65678\times 10^{-21}\) J and σ w-l  = 2.55 × 10−10 m, \(\epsilon_{w-l}=0.33\times 10^{-21}\) J. The solid mass density is ρ w  = 6.809 × 103 kg/m3, and the liquid mass density is ρ l  = 1.437 × 103 kg/m3, where the mass of one wall or liquid molecule is 6.6904 × 10−26 kg.

All MD simulations are three-dimensional, with periodic boundary conditions applied in the x-(streamwise) and z-directions. In some cases, periodicity is also applied in the y-direction, for example, the reservoir component in Fig. 3. The cases are all set up with no gradients of properties in the z-direction, so the thickness (6.9 nm) in the z-direction has been chosen mainly to generate sufficient data for averaging.

Fig. 3
figure 3

Schematic of the network inlet and outlet reservoirs combined into one MD micro-element (see also Fig. 2). This illustration highlights the forcing due to the pressure drop \(\Updelta p\) imposed by the application of a Gaussian forcing F x in an external region (\(\mathcal{R}\)), and a counter force F * x applied in the channel section marked by \(\mathcal{R}^*\) that emulates the pressure drop \(\Updelta p_m\) from the central network components shown in Fig. 2. Black solid lines are walls, and black dashed lines are cyclic boundary conditions

The external forcing \({\bf f}^{\rm ext}\) in Eq. (8) is used to impose a pressure difference, as described later for network components and junctions. The heat generated indirectly by this forcing is removed to enforce a thermally homogeneous system. To do this, we activate the unbiased velocity-rescaling Berendsen thermostat (Berendsen et al. 1984) which operates on the thermal velocities, and as a result minimises the impact on the streaming velocity. The thermostat is implemented using localised bins distributed everywhere in the domain, where each bin is set at a target temperature of T = 292.8 K using a time-constant τ T  = 21.61 fs.

A flux measurement plane is placed at the midpoint of each micro-element to measure the net mass flow rate \(\dot{m}_i\) (kg/s). Over a long averaging time \(\Updelta t_{\rm av},\) the mass of the total number of molecules that cross the flux-plane in the x-direction are counted as positive, and those which cross in the opposite direction are counted as negative:

$$ \langle \dot{m}_i \rangle = \frac{1}{\Updelta t_{\rm av}}\displaystyle \sum_k^{\delta N} m_k \, {\rm sgn}({\bf v}_k \cdot {\hat{\mathbf{n}}_x}), $$
(10)

where \(\hat{\mathbf{n}}_x\) is the x-direction unit vector perpendicular to the flux-plane, and δN is the total number of molecules that cross the plane during the time period \(t \rightarrow t + \Updelta t_{\rm av}. \) The direction of crossing is obtained by the signum function, sgn(x).

In the next sections, we describe the method for applying pressure drops across different types of network components. The most convenient and common way of emulating a pressure gradient in simple MD channels is to apply a uniform ‘gravity’-type body force to all liquid molecules in the channel (Koplik et al. 1988; Travis et al. 1997; Travis and Gubbins 2000; Xi-Jun Fan Nhan Phan-Thien and Diao 2002), accompanied by periodicity in the flow direction. However, when the geometry is non-uniform in its cross section, the pressure gradient will vary; as such, a uniform body forcing is no longer hydrodynamically equivalent to the flow generated by an imposed pressure difference over the same geometry. For this reason, in the work of Zhu et al. (2002, 2004) modelling flow through carbon nanotubes, a step forcing is applied in cross-sectionally uniform regions only, thus creating a known pressure drop over non-uniform regions of the geometry. A similar approach is adopted here, except we use a Gaussian distributed forcing to maintain a spatially smooth imposition of momentum to the MD fluid. This local forcing is applied only in the inlet and outlet regions of the micro-element and so it allows the pressure difference across the element to be imposed, no matter whether the internal middle section is a straight channel or of some other complex shape. The method also maintains the simplicity of applying periodic boundary conditions in all our simulations. The limitation of this method is that it requires symmetry of the component between the inlet and outlet sections of the micro-element. For more complex components (e.g. Y-connectors), there is the option of enforcing pressure drops through non-periodic boundary conditions (NPBCs), such as setting inlet and outlet regions of the channel at different pressures or using fluxes to control incoming/outgoing particles. For example, see Brooks III and Karplus (1983), Sun and Ebner (1992), Delgado-Buscalioni and Coveney (2003), Werder et al. (2005), Borg et al. (2010) and Nicholls et al. (2012).

2.5 Reservoir component

The decomposition of the network seen earlier in Fig. 2c presents the inlet and outlet reservoirs as disconnected components. For convenience, we combine these reservoirs into a single MD micro-element (as shown in Fig. 3), as this enables periodic boundary conditions to be used in the streamwise direction.

Connecting the reservoirs in this way requires a method for controlling the entrance and exit pressure drops separately or collectively; the collective approach works better with the current setup. The overall pressure drop \(\Updelta p\) (which is set by the problem) is imposed through local forcing, applied solely in the external reservoir region \(\mathcal{R}. \) The effect of the central channels and junctions in the full network is then emulated by applying a negative pressure forcing \(\Updelta p_m\) given by

$$ \Updelta p_m = \displaystyle \sum_{i = 2}^{\Uppi - 1} \Updelta p_i, $$
(11)

at \(\mathcal{R}^*, \) in the mid-point of the channel. The inlet/outlet pressure drops are therefore implied by Eq. (2):

$$ \Updelta p_1 + \Updelta p_{\Uppi} = \Updelta p - \Updelta p_m. $$
(12)

2.6 Channel and junction components

As above, the pressure drop in channels and junctions is applied using local forcing at entrance/exit regions only, in conjunction with periodic boundary conditions applied in the x-direction; see Fig. 4a and b for channels and junctions, respectively.

The multiscale approach proposed here simulates a channel element of length L i by a shorter micro-channel element of length L i ′. Therefore, the pressure drop applied to the micro-element, \(\Updelta p_i',\) is a factor L i /L i ′ less then the pressure drop over the full channel it represents, i.e.

$$ \Updelta p_i' = \frac{\Updelta p_i} {g_i }, $$
(13)

where the factor is the numerical gearing, g i  = L i /L i ′.

2.7 Pressure-drop forcing

Central to the coupling method is the ability to prescribe pressure drops over the various MD components of the network. This is achieved by streamwise body forcing in localised regions of the domain, as illustrated in Figs. 3 and 4. The magnitude of this forcing is chosen such that it produces an equal and opposite momentum flux (within these localised areas) to that produced by the pressure difference we wish to induce, i.e.

$$ \Updelta p = \rho_{\rm n} \int\limits_{x_1}^{x_2} F_x\, {\rm d}x, $$
(14)

where x 1 and x 2 are the extents of the localised region,Footnote 1 ρ n is the number density and F x is the applied force field which is transferred to molecules through the term f ext in Eq. (8). Here we have assumed a constant cross-sectional area and number density between x 1 and x 2. While a ‘step’ force distribution could have been used (for example, see Zhu et al. 2002, 2004; Liang and Tsai 2012), we adopt a Gaussian form because it enables a smooth application of forcing on molecules over a short distance:

$$ F_x(x) = \left\{\begin{array}{ll} \overline{F} e^{(-x^{2}/2 \sigma_s^2)} & {\rm if}\; x_1 \leq x \leq x_2, \\ 0 & {\rm otherwise}, \end{array}\right. $$
(15)

where \(\overline{F}\) is the peak of the distribution and σ s is the standard deviation. Substitution of Eq. (15) into Eq. (14) gives:

$$ \begin{aligned} \Updelta p &= \rho_{\rm n} \int\limits_{x_1}^{x_2} F_x \,{\rm d}x,\\ &\approx \int\limits_{-\infty}^{\infty} \overline{F} e^{(-x^{2}/2 \sigma_{\rm s}^2)}\, {\rm d}x, \\ & = \rho_{\rm n} \overline{F} \sigma_{\rm s} \sqrt{2 \pi}, \end{aligned} $$
(16)

which can be rearranged in terms of the desired Gaussian forcing magnitude:

$$ \overline{F} = \frac{\Updelta p}{\rho_{\rm n} \sigma_{\rm s} \sqrt{2 \pi}}. $$
(17)

Note, the integral approximation in Eq. (16) is a very good one because the distance between x 1 and x 2 is set significantly larger than σ s making the integral from \(-\infty\) to x 1 and from x 2 to \(\infty, \) negligible.

Fig. 4
figure 4

Schematic of a the forcing applied to a periodic MD element channel due to a modified pressure drop \(\Updelta p_i'\) along a shortened length L i ′ = L i /g i , and b the forcing through an arbitrary MD junction element. Black solid lines are walls, and black dashed lines are cyclic boundary conditions

3 Results and discussion

Our hybrid algorithm is now tested on pressure-driven flows through simple network configurations, with scale separation exploited in the long connecting channels. A pressure difference of \(\Updelta p \approx\) 350 MPa is applied to all network cases. High pressure gradients are required in MD simulations of Poiseuille flows (Koplik et al. 1988; Travis et al. 1997) to obtain statistically measurable flow rates over thermal fluctuations. We validate the hybrid results by also solving each network as a whole using a full molecular dynamics description. The approach for applying the overall pressure difference \(\Updelta p\) in the full MD case is the same as that applied in the reservoir component (Sect. 2.5). We keep the test networks of moderate sizes, to be able to compare the hybrid results with the computationally expensive full MD simulations.

3.1 Simple channel network

The first test setup consists of two reservoirs with a relatively long inter-connecting nanochannel, as shown in Fig. 5a for the full molecular dynamics simulation. The hybrid setup for this network case is shown in Fig. 5b and c, and consists of two disconnected micro-elements, one representing the combined entrance/exit regions, and the other a short channel section that replaces the long nanochannel. The extent of the exit/entrance channel sections of the reservoirs micro-element has been chosen conservatively to be roughly twice the channel flow entrance length of laminar macroscopic flow theory. As will be shown later by inspection of the full MD results, this is a sufficient length to allow the channel flow to develop fully in the test cases we are considering; however, a longer and even more conservative entrance length could easily be used.

Fig. 5
figure 5

a Full MD setup of a simple network case that can be reduced to a hybrid network using two separate micro-elements: b MD simulation of the inlet and outlet junctions combined in one micro-element; c MD simulation of the interconnecting channel reduced to a shorter micro-element. Dimensions are in nanometers

Two different channel lengths are chosen for this demonstration: L = 95.2 nm and L = 217.6 nm, which are then both replaced in the hybrid simulation by a much shorter channel of length L′ = 13.6 nm. While there is no gearing possible in the reservoir components (i.e. no computational saving due to multiscaling), gearing in the middle channel component, calculated using g = L/L′, gives g = 7 and g = 16, respectively. The gearing of the channel component can also be computed from the ratio of molecules used in the full MD (the channel part only) and its corresponding channel micro-element, as shown in Table 1. The height of the middle channel for both cases is 4.08 nm, which is chosen to be small enough to generate non-continuum behaviour in the LJ fluid (e.g. layering and velocity slip) that could not be captured by a standard Navier–Stokes solution. This also makes the method computationally tractable, since a reasonable number of molecules are used for every micro-element, as well as for the full MD simulation. We set the hybrid algorithm with a tight convergence criterion, Eq. (6), of \(\zeta^{\mathrm{tol}} = 0.01. \)

Table 1 Multiscale gearing g for the channel component of the two simple network cases

In the full MD simulations, the overall pressure drop \(\Updelta p\) is first converted into an estimate of the forcing parameter \(\overline{F} = 9.21\) pN using Eq. (17). The Gaussian distributed force, Eq. (15), is then applied to molecules located in the constrained regions only, and the MD simulations are run until steady state. The steady state results for density \(\langle\rho_{n}\rangle\) and pressure drop \(\langle \Updelta p \rangle\) are measured in both simulations and recorded in Table 2. The measured pressure drop agrees within 0.6 % with the target pressure drop applied using the Gaussian forcing. This simple test verifies the Gaussian forcing method for applying pressure drops as described in Sect. 2.7.

Table 2 Percentage difference (error) \(\zeta\) calculated between measured and applied pressure drop using the Gaussian-forcing method described in Sect. 2.7

Mass flux results from the hybrid algorithm are presented in Figs. 6 and 7, with the convergence characteristics of the algorithm over consecutive iterations shown in Fig. 8. The results show that convergence in both networks is very quick, taking approximately 2–3 iterations. By running the hybrid simulation over more iterations, we verified that the coupling algorithm is numerically stable. This shows that the approximation of the relationship between mass flux and pressure drop, as defined in Eq. (4), works well. The stability of the algorithm depends, however, on allocating a reasonable averaging time per iteration to ensure the fluid relaxes to the imposed pressure drop, and also to decrease the uncertainty in the measured mass flux. We found for this case that 2 ns per iteration was sufficient.

Fig. 6
figure 6

Mass flux measurements in the hybrid simulations progressing with number of iterations (l) for the short channel case L = 95.2 nm. Comparisons are also made with a full MD simulation. The error bars for the micro-element mass flux measurements are smaller than the size of the symbols used

Fig. 7
figure 7

Mass flux measurements in the hybrid simulations progressing with number of iterations (l) for the long channel case L = 217.6 nm. Comparisons are also made with a full MD simulation. The error bars for the micro-element mass flux measurements are smaller than the size of the symbols used

Fig. 8
figure 8

Convergence of consecutive average mass fluxes at progressive iterations l for all three cases considered. See Eq. (6) for the definition of \(\zeta. \) The solid horizontal line is the chosen tolerance \(\zeta_{\rm{tol}} = 0.01\)

In Figs. 6 and 7, we additionally plot the mass flux that is measured from the full MD simulation; it shows very good quantitative agreement with the hybrid results. The converged values for mass flux are displayed in Table 3. The discrepancies in mass fluxes between hybrid and full MD predictions are small (∼4 %). The approximation of subsonic and low-speed flow characteristics should be valid in these simulations, as can be seen from the Reynolds number and Mach number measured from the average streaming velocity in the middle of the channel network: Re = 3.7, Ma = 0.058 for the short channel case, and Re = 1.8, Ma = 0.0286 for the long channel case. What is not safe, however, is the incompressibility assumption on which this hybrid model has been formulated. Our choice of test fluid (a Lennard–Jones potential for argon) has an isothermal compressibility of κ T ∼ 6 × 10−10 Pa−1 (Song et al. 1991) at the state being simulated, which is 1.5 times greater than water at room temperature (Kazi and Motakabbir 1990). Even if the chosen test fluid has a low isothermal compressibility value and low Mach number, significant flow compressibility can still occur in micro- and nanochannel geometries, as argued in Gad-El-Hak (2006).

Table 3 Converged mass fluxes compared with measurements from full MD simulations for both the short and long channel cases

To investigate the effect of compressibility in these simulations, we measured the centre-line density profiles and plot these in Fig. 9. The variation of density in the full MD profiles (maximum to minimum values) is quite large, ∼19 % for both network cases.Footnote 2 The relative percentage error in the density difference between full MD and hybrid elements, however, is <2 % for both networks.Footnote 3 Although small, this is likely to have a direct impact on our multiscale results, since the applied pressure drop over each micro-element is directly related to the applied body forces by fluid density (see Eq. 14).

Fig. 9
figure 9

Comparison of the density profiles measured at the channel centre-line between the multiscale simulation (with the addition of a compressible approximation) and the full MD simulation for a the short channel case and b the long channel case. (\(Cross\; symbol\)) is the target density in the mid-channel micro-element, computed using Eq. (18). Measurements are taken from an averaging time-interval of ∼4 ns for both hybrid and full-scale simulations, in uniform bins of 0.25 nm thickness

For the simulation of compressible flows, the state at the boundary (absolute pressure or density) needs to be set in addition to the overall pressure-difference constraint, otherwise the system is under-constrained. However, upon close examination of Fig. 9, it can be seen that the density at the inlet and outlet (the peak values) of the multiscale simulation are not the same as in the full-scale MD. This is a result of a slight asymmetry (in a rotational sense) in the density distribution through the full geometry. Therefore, to make a fairer comparison of the simulation methods, we must match the inlet/outlet density in the reservoir micro-elements to coincide with the corresponding density in the full MD simulation. This is equivalent to prescribing density boundary conditions to both simulations from the outset, but in a way that is computationally more convenient.

The channel micro-elements internal to the network require an additional constraint procedure to accommodate the variation of the density across the network system. For consistency and simplicity, here we choose a linear interpolation of density between the values measured at the entrance and exit channel parts of the reservoir micro-element, as per the definition of the geared pressure drop in Eq. (13). Thus, every micro-element (i) except the reservoir micro-element can be set an approximate target density a priori to the hybrid simulation, which is given by:

$$ \rho_i^{t} = \left(\frac{ \langle \rho_{\rm e} \rangle- \langle \rho_{\rm o} \rangle}{x_{\rm e}- x_{\rm o}}\right)(x_{i}-x_{\rm e}) + \langle \rho_{\rm e}\rangle, $$
(18)

where angle brackets denote MD measurements, subscripts ‘e’ and ‘o’ refer to the entrance and outlet regions respectively, and x i is the streamwise position of the ith micro-element. For example, x e = 12 nm and x o = 109 nm are the density-measurement locations for the small channel case (see Fig. 9a).

Following these density corrections, the hybrid simulations are then repeated until convergence. The matching of inlet/outlet boundary conditions with the full-scale simulation, and the inclusion of a simple density constraint step (18), creates major improvements to the results, reducing relative percentage errors for mass flux from 4 to ∼0.1 %. These results are plotted in Figs. 6 and 7. Despite observing significant compressibility (as described earlier) and non-linearities in streamwise pressure (∼3–4 %), we found that a linear density approximation was still good enough to obtain very high accuracy; Eq. (18) brought the density in the channel micro-element of the hybrid solutions within 0.04–0.09 % of the full-scale simulations for the small and long channel cases, respectively. These density values are marked by a cross in Fig. 9. For the rest of the analysis in this section only, we present results just from hybrid simulations that adopt this additional density constraint technique.

This method of accommodating compressibility within the method will lose accuracy in highly compressible flows and in cases where channels have non-uniform cross sections, i.e. when the pressure profile deviates substantially from a linear variation through the geometry. In these cases, a general compressible form of the IMM (Borg et al. 2013) will need to be developed. This will be the subject of future work.

Further validation of the multiscale method was made by plotting the streamwise pressure profiles in Fig. 10, and the cross-channel profiles for density and velocity in Figs. 11 and 12, respectively. Very good quantitative agreement with the full MD results is obtained, which includes the capture of pronounced non-continuum and non-equilibrium effects, i.e. molecular layering in the density profile, and slip in the velocity profile.

Fig. 10
figure 10

Comparison of the pressure profiles measured using the Irving–Kirkwood equation [Irving and Kirkwood 1950) in bins (e.g. see Okumura and Heyes 2004) at the channel centre-line between the multiscale simulation (with the addition of a compressible approximation) and the full MD simulation for a the short channel case and b the long channel case. Measurements are taken from an averaging time interval of ∼4 ns for both hybrid and full-scale simulations, in uniform bins of 0.25 nm thickness

Fig. 11
figure 11

Comparison of the density profiles measured in the channel height direction at the mid-point of the network between the multiscale simulation (with the addition of a compressible approximation) and the full MD simulation for a the short channel case and b the long channel case. Measurements are taken from an averaging time interval of ∼8 ns for the hybrid simulation (channel micro-element only) and ∼4 ns from the full-scale simulation, in uniform bins of 0.1 nm thickness

Fig. 12
figure 12

Comparison of the velocity profiles measured in the channel height direction at the mid-point of the network between the multiscale simulation (with the addition of a compressible approximation) and the full MD simulation for a the short channel case and b the long channel case. Measurements are taken from an averaging time interval of ∼8 ns for the hybrid simulation (channel micro-element only) and ∼4 ns from the full-scale simulation, in uniform bins of 0.1 nm thickness

As noted above, the choice of channel section length at the inlet and outlet of every component was taken to be two times bigger than the flow development length calculated from laminar macroscopic theory. To verify that this length is adequate (in our hybrid simulations, 6.8 nm), we compare in Fig. 13 velocity profiles Footnote 4 at various streamwise sections, starting from the inlet of the full MD network. Each streamwise profile is compared with a reference profile in the midpoint of the channel, where the flow can be assumed to be fully developed; the root mean square (RMS) of the deviation from the reference is plotted in Fig. 14a, and the slip velocity (normalised by the peak velocity at the centre-line) is plotted in Fig. 14b. Both figures show a development region which is 2–4 nm for both network examples, indicating that a channel section length of 6.8 nm is sufficient in these multiscale simulations.

Fig. 13
figure 13

Velocity profiles measured at different streamwise positions for a the short channel network case, and b the long channel network case. Streamwise x-directions are in (nm) and start relative from the entrance point of the channel

Fig. 14
figure 14

a Deviations of streamwise velocity profiles from fully developed, and b normalised slip velocities at different streamwise locations of the channel for both long and short cases. The horizontal arrow indicates the extent of the flow development region

The primary motivation for employing multiscaling is to obtain major computational savings over full molecular simulation. There is no easy way to predict computational savings a priori in these network simulations (although the gearing parameter g, shown in Table 1, can give an indication). This is because computational expense is dependent on both total molecules simulated and total time steps performed (i.e. total molecule timesteps). While the former is easy to compute beforehand, the latter depends on the convergence rate of the multiscale algorithm. A direct measurement of overall computational speed-up can be obtained after the simulations are run, from the ratio of executed clock times for full MD (τ F) and hybrid (τ H) simulations. To make a fair comparison, the computational time of each simulation is normalised by the assigned processing power. The hybrid simulation, for example, consisted of 1 processor per micro-element (i.e. 2 processors in total), while 24 processors decomposed the full MD cases. The speed-up computed by τ F/τ H is then 7.6 for the short channel network and 12 for the long channel network.

This is a very promising result for two reasons. First, the multiscale method is an order of magnitude quicker than full MD in these cases. Second, there is greater saving (as we might expect) for the longer channel because of higher scale separation, indicating that vast savings are likely if extended to the micrometer scale. In this calculation, the total problem run-time for the full MD cases was ∼10 ns, which allowed the solution to reach steady state, as well as enough time to average measurements within an acceptable standard error of the mean. The hybrid simulation is run for 2 ns per iteration until the solution converges (∼3 iterations).

3.2 Channel networks with local defects

The full capability of this hybrid methodology for incompressible flows can be demonstrated when it is applied to more complex systems, in particular, by introducing additional components that collectively influence the macro-flow. In this section, we show the effect of including an extra junction in the channel network.

The setup consists of the same long channel network (L = 217.6 nm) as before, but now it includes a “local defect” placed asymmetrically along the length of the channel, as shown in Fig. 15a. The hybrid setup of the individual micro-elements is shown in Fig. 15b–d. In a similar way to the previous two cases, inlet/outlet reservoirs are modelled together in one MD simulation, while two periodic channel micro-elements are now used to represent the two different channel lengths between the defect and reservoirs. The region of the wall defect is modelled as a junction-type micro-element as shown in Fig. 15d.

Fig. 15
figure 15

Multiscale setup of a simple channel network with a localised defect located asymmetric of the channel midpoint; a setup for the full MD simulation of the network (N F = 438,191 molecules); multiscale elements: b inlet/outlet reservoirs micro-element, c left channel micro-element, d right channel micro-element, and e micro-element with defect (N D = 24,816 molecules)

Even though the two-channel micro-elements C and D are of the same length, they each represent channel sections of different length owing to the asymmetry of the defect’s position. Two gearing parameters can thus be defined, as quantified in Table 4. However, we found that the pressure drops prescribed to both channel micro-elements are consistently identical at every iteration of the hybrid simulation, and since the density and channel height are also the same (under the incompressible assumption), we only need to simulate one of the two micro-elements. This further improves the computational speed up of the hybrid simulation.

Table 4 Multiscale gearing, g for the defect channel case

In Fig. 16, we show the mass flux results. Convergence, as shown in Fig. 8, is achieved in around 4 iterations. This is more than in the previous cases, but is not unexpected given the increased complexity of the system. A very close agreement is obtained between the hybrid and the full MD simulations, within ∼3 %. This could be further improved by modifying the algorithm to account for compressibility (as discussed above). In Fig. 16, the mass flux results from the previous network simulation with no defect are included.

Fig. 16
figure 16

Mass flux convergence for the defect channel network case. Comparisons are also made with full MD simulations with and without the defect

The computational saving measured for this hybrid simulation (τ F/τ H = 6.9) is less than the previous case (τ F/τ H = 12) without the defect, but is still very substantial. The reduction in speed-up arises from: (a) the extra micro-element required to model the defect in the multiscale model; and (b) the extra iteration required to converge the solution.

The introduction of micro-elements to model increasing network complexity is relatively straightforward. This makes our hybrid method highly attractive for modelling very large systems using smaller MD portions, in particular, when high end computational resources are not available to run full MD simulations. The micro-elements can easily be distributed to run in tandem if a small cluster of CPUs or GPUs are available, or sequentially if fewer computing resources are available. This is an important advantage of this hybrid method over a full MD simulation, because no matter how large the network is, supercomputing resources are not a requisite.

Note that the hybrid simulation will only be significantly quicker (compared to a full MD simulation) if either (a) length-scale separation exists in the channel components, since smaller micro-elements can then be utilised to describe the channel geometry, or (b) if a steady-state solution is required to a problem that has a very long ‘start-up’ time, for example, due to low flow rates through small constrictions.

4 Conclusions

In this study, we have presented a hybrid algorithm to solve multiscale fluid problems in simple channel networks by simulating important local microscopic phenomena that are integrated within a macroscopic description of the flow. Molecular dynamics is used for the micro-model, while the conservation of mass and momentum equations are used for the macro-model. An advantage of this multiscale approach is that there is no need to specify any constitutive or boundary information in the continuum solver. Properties such as shear stress/strain rate and boundary slip need not be computed per se, because they are accurately encapsulated within the microscopic model, i.e. from the choice of interaction potentials and the description of the bounding surface. We assumed incompressible, isothermal, low-speed, steady flows, as a basis for deriving the coupling algorithm. Macro-to-micro-coupling involved applying pressure drops across micro-elements, while micro-to-macro-coupling consisted of measuring the mass flux from the micro-elements and enforcing continuity in the network.

Gearing was introduced as a means to identify the level of scale separation and, similarly, to provide an indication of the level of computational savings. In these types of fluid problems, worthwhile computational saving is achieved only in channels with relatively long lengths. Our hybrid simulations of simple network configurations have been shown to converge very quickly (in 2–4 iterations, typically). Despite comparing very well with full MD results in terms of mass flux, we did observe small errors of the order of ∼4 %. We found that this was caused by a slight violation of the incompressibility assumption (∼2 % mismatch with the full MD result), which can be rectified by incorporating an extra constraint for density or pressure. This will form part of future development and application of the method.

Two promising advantages of our hybrid approach are: (a) simulation of much longer, more complex channel networks can be carried out with significant computational savings, provided there is a reasonable scale separation in long channel components, and (b) these simulations are not constrained by the availability of high performance computational resources. In fact, unlike a full MD simulation, each MD micro-element need not be run at the same time because there is no need to exchange micro/macro-information at every time step of the simulation.

The method presented in this paper is tailored for steady-state systems, but since the method converges quickly to an accurate solution in only a few iterations, it could also be applied to quasi-steady problems, as was suggested by Hadjiconstantinou and Patera (1997) and implemented by Hadjiconstantinou (1999), i.e. problems that exhibit high time-scale separation (Lockerby et al. 2013). In these types of multiscale problems, the macroscopic variables vary gradually in time and so the continuum time step that is required to capture the temporal variation of the mass flux in the network would be much larger than the MD time scale required to relax the solution to a quasi-steady state. Notable alterations to our method would need to be made if low time-scale separation problems are to be treated (E et al. 2009; Lockerby et al. 2013), because in our method, the micro-simulations are coupled to a steady-state continuum conservation rule.

Future work should include studying systems with non-isothermal and compressible constraints; analysing more complex network configurations (not only serial networks); treating non-symmetric MD micro-elements using NPBCs; studying unsteady/transient processes, such as mixing of chemical species; simulating flows through large filtration/desalination membranes; and applying the hybrid method to model more complex channel-wall and fluid materials.