Abstract
The modelling of electrokinetic flows is a critical aspect spanning many industrial applications and research fields. This has introduced great demand in flexible numerical solvers to describe these flows. The underlying phenomena are microscopic, non-linear, and often involving multiple domains. Therefore often model assumptions and several numerical approximations are introduced to simplify the solution. In this work we present a multi-domain multi-species electrokinetic flow model including complex interface and bulk reactions. After a dimensional analysis and an overview of some limiting regimes, we present a set of general-purpose finite-volume solvers, based on OpenFOAM® , capable of describing an arbitrary number of electrochemical species over multiple interacting (solid or fluid) domains (Icardi and Barnett in F Municchi spnpFoam, 2021. https://doi.org/10.5281/zenodo.4973896). We provide a verification of the computational approach for several cases involving electrokinetic flows, reactions between species, and complex geometries. We first present three one-dimensional verification test-cases, and then show the capability of the solver to tackle two- and three-dimensional electrically driven flows and ionic transport in random porous structures. The purpose of this work is to lay the foundation of a general-purpose open-source flexible modelling tool for problems in electrochemistry and electrokinetics at different scales.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Electrokinetic flows is a highly active topic of discussion branching over a multitude of scientific fields. Examples include chloride transport in reinforced concrete [13, 38], ion regulation in biological cells [20, 40], fuel cells [42] and electrochemical energy storage [23, 25]. As such, modelling these reactions has just as much importance as the flow they reside in.
Whilst used extensively in a wide range of physical settings by the research community, SPNP does come with its own caveats. For one, SPNP neglects any ion-ion interactions that may occur by assuming a dilute solution. This may not hold true for solutions with many ionic species [32]. Also, as SPNP is a continuum model, any steric effects are ignored. As such, many efforts have been made extending SPNP to be include other physical processes. To cover steric effects, free energy functionals using density functional theory (DFT) accounting for long-range Coulomb correlation and hard sphere (HS) interactions of ions [14, 21, 37] are formulated. Extensions to make Nernst-Planck more thermodynamically consistent under non-equilibrium thermodynamics [8, 18] have also been proposed. To model non-ideal solutions, [34] proposes an added term to the Nernst-Planck ionic flux considering varying chemical activities solved by the Debye-Hückel model.
Whilst these extensions do further the physical realism of the original SPNP model, this often exacerbates other challenges of SPNP. One of the foremost being the non-linear coupling between fields. For example, in [34] the Debye-Hückel model equates the chemical activity of a species to the solutions ionic strength. This in part creates explicit coupling between all ionic concentrations unlike in classic SPNP, resulting in more complex, often unviable, computational approaches.
The development of numerical solvers for such equations within general PDE and CFD toolboxes is something that has been discussed for decades.
Two common approaches can be taken to solve systems of coupled discretised equations. The first being the so-called block-coupled, with all equations solved at once in a large matrix. Whilst taking a large amount of memory, it upholds the coupling between fields and is numerically robust. The second is the segregated approach and consists in solving each equation separately and in sequence. Since this leads to a decoupling of the equations, appropriate iterative methods [27, 28] must be used to ensure coupling between fields. The advantages of a segregated approach are the lower memory requirements, easy preconditioning of the equations, and their multi-stage structure that allows a better control on the solution procedure. However, block-coupled approaches tend to scale better with the number of processors. When constructing our solvers to model electrokinetic flows, we chose a segregated iterative approach to couple the equations and the different domains.
This work presents a multi-region multi-species SPNP model and discusses its implementation in finite-volumes segregated solvers, built with the OpenFOAM® library and released open-source [11]. We present the mathematical model, including a dimensional analysis, and consider multiple solid and fluid regions, with general reaction and interface models.
Whilst other finite-volumes and finite-elements solvers have been developed [3, 19, 29, 39, 41], restrictions such as being designed for specific applications, single domains, dimensionality, absence of reactions, steady state or ignoring the fluid velocity are often made.
Another point of novelty also stems from a general non-linear reaction model, so that various reaction rate models such as Butler-Volmer [33] or the rate law [6] can be applied.
This work is organised in the following way. Within §2 we present the governing equations of Stokes-Poisson-Nernst-Planck and what fluid properties are assumed to gives accurate flow description. In §3 we perform dimensional analysis to understand the transport regimes possible and how this results in the often used electro-neutrality approximation. For §4 we outline what is required to capture reactions at a multi-region interface given different restriction on ion movement. In §5 the implementation of our solvers for single and multi-region is discussed, as well as the iterative algorithm performed when introducing our reactive conditions. To verify accuracy of our solvers and reactive conditions, we provide necessary numerical examples in §6, with concluding remarks given in §7.
2 Stokes-Poisson-Nernst-Planck model
Here we discuss the equations that make up Stokes-Poisson-Nernst-Planck, modelling the advective, diffusive and electrostatic forces of an ionic solution. As many real-world applications of electrochemistry involve interacting solids and fluids we consider a multi-domain scenario of a whole domain \(\Omega \) split, without loss of generality, into two sub-domains \(\Omega _{\text {f}}\), a fluid, and \(\Omega _{\text {s}}\), a solid, such that \(\Omega =\Omega _{\text {f}}\cup \Omega _{\text {s}}\), and with \(\Gamma \) being the solid–fluid interface and \(\partial \Omega =\partial \Omega _{\text {f}}\cup \partial \Omega _{\text {s}}\) the external boundaries. See Fig. 1 for a theoretical sketch of the domain \(\Omega \). More in general, in some applications and in our computational framework, we have allowed for an arbitrary number of solid and fluid regions, separated by different interfaces. We consider N ionic species, with concentrations and valencies \(c_i\) and \(z_i\) respectively, and \(i=1,...,N\). To describe the ionic transport we must define equations for the electric field \({\textbf {E}}\), ion concentrations \(c_i\) within \(\Omega \) and fluid velocity \({\textbf {u}}\) within \(\Omega _{\text {f}}\).
2.1 Stokes’ flow
Consider \(\Omega _{\text {f}}\), with velocity profile \({\textbf {u}}({\textbf {x}},t)\) governing the advective dynamics of the ions. Assume a negligible Reynolds numbers \(\text {Re}\) defined by the fluid density \(\rho _{\text {f}}\), characteristic velocity U, characteristic length scale L and dynamic viscosity \(\mu \):
such that viscous forces within \(\Omega _{\text {f}}\) outweigh the inertial. This common assumption in ionic transport [7, 15, 35] leads to linear Stokes flow. Furthermore we assume the fluid to be incompressible, i.e.,
where \(p=p({\textbf {x}},t)\), \(\rho _{\text {el}}=\rho _{\text {el}}({\textbf {x}},t)=F\sum \nolimits _{i=1}^{N}z_{i}c_{i}\) and \({\textbf {E}}\) are the static fluid pressure, electric charge density and electric field, respectively, and F is Faraday’s constant. Compared to the standard Stokes equation, we have the presence of the body force term \(\rho _{\text {el}}{} {\textbf {E}}\), describing the Coulomb forces acted on the fluid by the ions [15, 31]. We neglect any magnetic contribution by assuming our ions move slowly such that \({\textbf {E}}\) is irrotational, i.e. \(\varvec{\nabla }\times {\textbf {E}}={\textbf {0}}\). This body force term may be set to zero if the fluid is unaffected by \({\textbf {E}}\) or the fluid is approximated as electrically-neutral, \(\rho _{\text {el}}=0\). This will be further discussed in §3.
The first coupling term, between the variables \({\textbf {u}}\), \({\textbf {E}}\) and \(c_i\) appears here, showing one of the significant difficulties of describing electrokinetic flows. The coupling terms (particularly if non-linear) often add significant numerical difficulties. First of all, they make the velocity field time-dependent. Although by neglecting the time derivative we assume instantaneous relaxation to an equilibrium, and thereby a steady solution, by involving \(c_i({\textbf {x}},t)\) the relaxation becomes tied to the time scale of Nernst-Planck, which is order magnitudes different. For segregated approaches, the disparity of relaxation time scales between Stokes, Poisson and Nernst-Planck—leading to mixed parabolic-elliptic systems—can pose severe instability problems or slow convergence of the coupled system.
2.2 Poisson equation
To model the electric field \({\textbf {E}}\), neglecting magnetic forces, We may then write \({\textbf {E}}=-\varvec{\nabla }\phi \) and focus on the electric potential \(\phi =\phi ({\textbf {x}},t)\). Assume for each sub-domain their respective electric permittivity \(\varepsilon \) is spatially constant. From Maxwell’s equations we obtain Poisson’s electrostatic equation denoting variations in \(\phi \) by changes in the charge density \(\rho _{\text {el}}\),
where \(\varepsilon =\varepsilon _{\text {s}}\) in the solid and \(\varepsilon =\varepsilon _{\text {f}}\) in the fluid. Again we have direct coupling between our variables, here between \(c_i\) and \(\phi \), although this time the former appears linearly in the source term. Like for Stokes flow, this equation depends on time only through the source/coupling terms, in particular the time-dependent ionic concentration \(c_i({\textbf {x}},t)\).
2.3 Ionic transport
Assume the ionic fluid in \(\Omega _{\text {f}}\) is sufficiently dilute to ignore ion-ion interactions and diffusion is isotropic. Under these assumptions we may use the Nernst-Planck flux [10, 15, 22, 30] as
where denote R, T, \(D_{i,\text {f}}\) and \(D_{i,\text {s}}\) are, respectively, the ideal gas constant, absolute temperature and diffusion coefficient of species i in the fluid and in the solid. Taking Eq. (4) in conjunction with the continuity equation for mass conservation we arrive at the set of equations modelling transport of \(c_i\),
As mentioned, we assume a dilute solution to ignore ion-ion interactions. This may not hold true in some cases. Alternatively the Stefan-Maxwell equations [15, 16, 32] may be used in lieu of Nernst-Planck. In short, Stefan-Maxwell balances the driving forces exerted on a species with the frictional forces between species. This introduces cross diffusivities \(\mathcal {D}_{ij}\) describing the drag between species i and j due to these frictional forces [15]. The added complexity from such explicit coupling between species is difficult to describe, as the exact description of \(\mathcal {D}_{ij}\) is hard to determine [32]. Even in situations where the ionic fluid is bordering on dilute, it is common for Nernst-Planck to still be used [33] due to its simplicity.
To close the system of equations listed here, we must include conditions along the boundaries of \(\Omega _{\text {f}}\) and \(\Omega _{\text {s}}\). We briefly discuss some common choices below and their physical representation. We also require conditions at the interface \(\Gamma \) to describe interaction between sub-domains. This is discussed further below for \(c_i\) and \(\phi \) when considering reactions and (non-)conductive interfaces.
2.4 Boundary conditions
Below we list some relevant conditions for different physical situations often seen in electrokinetic problems:
-
Solid walls: Either a conductive or insulating wall. The no-penetration (\({\textbf {u}}\cdot {\textbf {n}}=0\), and zero normal stresses), where \({\textbf {n}}\) is the outward unit normal to the boundary, or no-slip condition (\({\textbf {u}}= {\textbf {0}}\)) may be used. Ions may not pass through the wall so their fluxes are zero (\({\textbf {j}}_i\cdot {\textbf {n}}=0\)). If conductive we impose a fixed normal current density \(I_\text {w}\) along the wall (\(\displaystyle {\textbf {i}}\cdot {\textbf {n}} = F\sum _i z_i{\textbf {j}}_i\cdot {\textbf {n}} = I_{\text {w}}\)) or fixed potential \(\phi _\text {w}\). If insulating (non-conductive) we may simply set \(I_\text {w}=0\).
-
Permeable membrane and reactive boundaries: For a membrane we may fix the flux of each species (\({\textbf {j}}_i\cdot {\textbf {n}}=j_{\text {m}}\)), non-zero for those capable of passing through, zero for who cannot. We will discuss the case of reactive boundaries later in §4.2.
-
Inlet/Outlet: Often used to model an in or outflow of fluid or ions. For a momentum driven inlet, pressure or flow velocity may be fixed (\({\textbf {u}}={\textbf {u}}_{\text {in}}\), \(p=p_{\text {in/out}}\)). For ions we may apply fixed fluxes (\({\textbf {j}}_i\cdot {\textbf {n}}=j_{\text {in/out}}\)), resulting in a fixed electric current (\(\displaystyle {\textbf {i}}\cdot {\textbf {n}} = I_{\text {in/out}}\)). More complicated is to determine suitable boundary conditions for the potential. Typically either a Dirichlet \(\phi =\phi _{\text {in/out}}\) or a Neumann condition can be imposed. The latter imposes the total electric current to be either equal to zero or a fixed value.
-
Periodicity: when dealing with large (quasi-)periodic (or homogeneous) structures, it is often impossible to solve for the entire domain of interest. In these cases, smaller representative unit cells can be solved with (quasi-)periodic external boundary conditions [5] are imposed. In these cases, an additional driving forces (as a bulk source term or a modification of the periodic BC) need to be added.
3 Dimensional analysis
When dealing with systems of coupled transport equations it is useful to perform a dimensional analysis to better understand the relationships between the different transport phenomena and identify the limiting regimes and possible approximations. We denote dimensionless variables with a hat symbol, e.g \({\hat{x}}\), and reference values with a bar unless stated otherwise. We use the reference values L, U, \({\bar{\phi }}\) and \({\bar{c}}_i\) for the length scale, velocity, electric potential and concentrations respectively. For pressure we take \({\bar{p}}=\frac{\mu U}{L}\) as this the appropriate form when under Stokes flow. For time, we take the diffusive timescale \({\bar{t}}=\frac{L^{2}}{D_{i}}\). With these choices and defining \({\bar{C}}=\displaystyle \frac{1}{2}\sum _{i=1}^{N}z_{i}^{2}\bar{c_i}\) as the reference total ionic strength, we obtain the dimensionless variables:
Substituting these dimensionless variables into Eqs. (1), (3) and (5) the dimensionless system of equations are
The underlying dimensionless numbers may be found by dividing all other terms by the reference values of one term. For Eqs. (7) to (9) we divide by \(\frac{D_{i}\bar{c_i}}{L^{2}}\), \(\frac{2{\bar{C}}F}{\varepsilon }\) and \(\frac{2{\bar{C}}\mu U}{2{\bar{C}}L^{2}}\) respectively, where recall \({\bar{C}}\) is the reference ionic strength needed to resolve the issue of not being able to factor out the reference concentrations \({\bar{c}}_i\). As such, the dimensionless equations become:
where we have defined four dimensionless numbers \(\mathcal {N}\), \(\text {Pe}\), \(\mathcal {L}\) and \(\mathcal {P}\). Note that whilst Eq. (7) had four terms, we only arrive at two numbers due to our choice of reference time. The same can be said with Eq. (12) and chosen reference pressure. The result, four numbers for the three equations with forms given in Eq. (13) as:
written in terms of the aforementioned reference values, where we denote e, \(k_{\text {B}}\) and \(N_{\text {A}}\) to be the elementary charge, Boltzmann’s constant and Avogadro’s number respectively. \(\mathcal {N}\) represents the ratio of electrostatic over diffusive forces, with \(\mathcal {N}\ll 1\) indicating diffusion is dominant. We also obtain the Péclet number \(\text {Pe}\), i.e., the ratio of advective over diffusive phenomena, and \(\mathcal {L}= \frac{\lambda _{\text {D}}}{L}\) the dimensionless Debye length, with the dimensional form \(\lambda _{\text {D}}\) defined as
approximating the distance at which a charge’s electrostatic effect persists. Typically \(\mathcal {L}\ll 1\), stating how the Debye length is much smaller than the reference length L. Finally we have \(\mathcal {P}\) denoting the ratio of viscous and electric forces upon our fluid. \(\lambda _{\text {D}}\) is also the approximate width of a common electrokinetic phenomena known as the electric double layer (EDL), see Fig. 2, that forms on boundaries. The EDL consists first of ions adsorbed at the boundary, known as the Stern layer, and another of free ions moved by electrical attraction and diffusive motion by the Stern layer, deemed the diffuse layer.
For sufficiently thin EDLs there is a common model reduction known as the electro-neutrality assumption, often employed in development of macroscopic models [17, 33, 35]. This reduction can in fact be determined through dimensional analysis and will be briefly discussed next.
3.1 Asymptotics and electro-neutrality
The electro-neutrality approximation states that for a sufficiently dilute electrolyte all charges of ionic species within the solution roughly cancel each other out, leaving the solution electrically neutral. Electro-neutrality for a solution containing N species is defined as
and is often used as model reduction when modelling ionic flows. Where Eq. (15) becomes invalid however is in the thin charged double layers, or EDL, mentioned above and often seen in real-world settings.
To get an understanding of where electro-neutrality comes from and how it relates to EDL formation, we perform an asymptotic analysis. Without any lack of generality, we limit here to a one-dimensional electrolyte and a binary electrolyte. In the numerical framework described above an arbitrary number of ionic species in three-dimensions can be considered. Let \(x \in \** \) where \(\** = [0,1]\) is a binary electrolyte solution with ionic concentrations \(c_1\) and \(c_2\) of opposing valencies. For now we omit any boundary conditions, only requiring those chosen result in a boundary layer formation near \(x=0\). To arrive at Eq. (15) we start by considering the asymptotics of the outer (bulk) layer away from \(x=0\). For simplicity we only consider the leading order terms.
Outer (bulk) layer To arrive at an asymptotic leading order solution in the bulk layer of \(\** \) we take the following expansions of \({\hat{u}}\), \({\hat{\phi }}\), \({\hat{p}}\), \(\hat{c_1}\) and \(\hat{c_2}\). These denote the fluid velocity, electric potential, pressure and ion concentrations respectively, all dimensionless. Expansions are taken in powers of \(\epsilon = \mathcal {L}^2\), the squared dimensionless Debye screening length since \(\epsilon \ll 1\), or, \(\lambda _{\text {D}} \ll L\):
Substituting these expansions into the transport Eqs. (10)–(12) for one-dimension, alongside the incompressibility condition, we arrive at
By considering only the leading order terms i.e., terms of \(\mathcal {O}(1)\), these equations reduce to,
Note how Eq. (252627) is the electro-neutrality approximation mentioned before, for a binary solution, and a direct consequence of the asymptotics. This implies said electro-neutrality is only accurate up to leading order. What’s more the electric body force of Stokes vanishes as a consequence of Eq. (252627). To close the system an equation for the leading order potential \(\phi ^{(0)}\) is required. This is possible by multiplying Eq. (24) by their respective valencies \(z_i\) and reference values \(\bar{c_i}\), summing over i, and utilizing Eq. (252627). Resulting in the equation,
which represents a steady equation for \(\phi ^{(0)}\). This can be interpreted as a modified Ohm’s law with new conductivity accounting for all contributions to the total current: advective, diffusive and electrical, from left to right.
Now that we have constructed the asymptotic solution, up to \(\mathcal {O}(1)\), for the outer (bulk) layer of \(\** \), we move on to determine the inner (boundary) layer asymptotics. As mentioned at the start, we state said inner layer formation is near \(x=0\) of \(\** \). Much like the outer layer, we make no case of boundary conditions, only that a boundary layer near \(x=0\) forms as a result of them.
Inner solution:
To construct a solution for the inner layer near \(x=0\) of \(\** \) we define the variable y to span the inner layer and be a ’fast’ variable counterpart to x, changing more rapidly,
By the definition of \(x\in \** \), y therefore has domain \([0,\infty )\), as \(y=0\) for \(x=0\) and \(y\rightarrow \infty \) for \(x\rightarrow 1\), since \(\epsilon \ll 1\). Such change of variable gives derivatives via chain rule as:
Substitution of the above derivatives into the original transport equations Eqs. (10)–(12) results in,
where all variables \({\hat{u}}\), \({\hat{p}}\), \({\hat{\phi }}\) and \(\hat{c_i}\) are in terms of y e.g., \(\hat{c_i} = \hat{c_i}(y,t)\). Just like the outer layer, we substitute the asymptotic expansions Eqs. (16)–(19) into the above equations to obtain,
Considering only the leading order terms of the four equations above we arrive at the following leading order set of equations for the inner layer:
Like the outer layer equations, to close the system we need another equation, this time for \(p^{(0)}\). Considering the \(\mathcal {O}(\epsilon ^{(1/2)})\) terms of Eq. (37) we can retrieve such an equation as
As mentioned earlier, when considering situations involving multiple sub-domains we must also have appropriate interface conditions. In many real applications of electrokinetic flows there are chemical reactions at interfaces between sub-domains, exchanging mass across the ionic species involved. In these cases, neglecting the EDL might lead to significant errors. In the next section we will consider such reactions occurring on our interface \(\Gamma \), formulating appropriate conditions to capture them whilst retaining mass conservation.
4 Multi-domain formulation and reactions
Here we formulate conditions to model heterogeneous reactions which are crucial for many electrochemical and electrokinetic problems. We write a general reaction rate that ensures total mass conservation and apply it to form reactive interface conditions, where we consider the scenarios of species that exist in the whole domain (unrestricted) or only in a specific sub-domain (restricted). We then discuss conditions on \(\phi \) when the interface is conductive or non-conductive.
4.1 Reaction model
Consider a general elementary reaction transferring mass between reactants \(i=J,...,K\) and products \(i=K+1,...,M\) with exchanged molar masses \(B_{i}\) and valencies \(z_i\). We denote \(\nu _i>0\) to be the stoichiometric coefficients determining the number of moles of species i is lost or gained and n the number of released (\(n<0\)) or absorbed (\(n>0\)) electrons, alongside the electron mass \(e^{-}\). The mass balance of the reaction reads:
To formulate Eq. (44) as conditions on \(\Gamma \) we first determine the rate \(r_i\) at which each species in our reaction is exchanging mass. More complex reactions involving several intermediate reactions can be decomposed into elementary steps, i.e a set of elementary reactions. Typically the overall reaction rate is then given by the rate of the slowest elementary reaction [6]. One option to determine the rate is the law of mass action, also known as the rate law [2, 6]. Given an ideal solution and reaction involving chemical species [j] with stoichiometric coefficients \(\nu _{j}\), at dynamic equilibrium
where the net reaction rate (density) \(r^\prime \) with units [mol/m\(^{2}\) s], is given by:
Here \(k_{\text {f}}\), \(k_{\text {r}}\) are the rate constants for the forward and reverse reaction and can be empirically modelled by the Arrhenius equation [6, 31]. Note that \(r^\prime \) is always positive, so we cannot simply take \(r_i=r^\prime \) as we must allow \(r_i< 0\) for reactant species. Instead, we define the coefficient \(\alpha _i\) as
and, multiplying by \(r^\prime \) and \(\nu _i\), we obtain:
For species not involved in the reaction we set \(r_i=0\). Assuming a closed reactive system, i.e no trace ion species, we can represent the mass conservation as the balance across reaction rates \(r_i\):
We weight by the molar masses \(m_i\) to convert from moles (a non-conserved quantity between species) to grams. We use the rate law as the example here as it is valid for many reactions [6]. It is also the more general form for the commonly used Butler-Volmer equation for faradaic reactions, which uses the energy dependence of \(k_{\text {f}}\) and \(k_{\text {r}}\) to give explicit electric potential dependency. It is important to notice that the units of measure of the reaction rate are [mol/s] for bulk reaction and [m mol/s] for surface reactions. Therefore, for the case of linear reactions, the reaction constants \(k_i\) can be either [1/s] or [m/s].
4.2 Interface conditions
The reaction models above can be applied in the bulk or on a interface. Here we apply them on \(\Gamma \) for \(\phi \) and \(c_i\) given conductive or non-conductive interface and surface reactions respectively. We employ general reaction rates \(r_i\) to balance the ionic fluxes \({\textbf {j}}_i\) through \(\Gamma \) with mass exchanged by the reaction. For \(\phi \) we use conservation of charge to find conditions on the current passing through \(\Gamma \) when acting conductively or non-conductively.
4.2.1 Interface conditions for ions concentration
Here we outline reactive conditions along \(\Gamma \) to model Eq. (44). We use a set of general, possibly non-linear, reaction rates \(r_i\) for \(i=J,\dots ,M\) of ion species involved in Eq. (44). We make no assumptions on the form of \(r_i\), other than making sure Eq. (50) holds true. For species not involved we simply take flux continuity. the results is jump conditions in ionic flux between \(\Omega _{\text {s}}\) and \(\Omega _{\text {f}}\), equal to their respective reaction rates \(r_i\):
Here we denote \(\big [{\textbf {j}}_i \cdot {\textbf {n}}\big ]_{\Gamma _{\text {f}}}\) to be the normal flux evaluated at \(\Gamma \) from \(\Omega _{\text {f}}\)’s side. Alongside this we assume continuity of concentrations to provide our second condition:
So, for all species involved in the reaction eq. (44) we have the difference in ionic flux from \(\Omega _{\text {s}}\) and \(\Omega _{\text {f}}\) to be the rate \(r_i\) of the respective species. In some scenarios one or more of the ion species may be restricted to reside in a single sub-domain of \(\Omega \). This can however be easily modelled by simply modifying the conditions of those restricted species, setting both \({\textbf {j}}_i\) and \(c_i\) to be zero in the inaccessible domains.
4.2.2 Interface conditions for the potential
We consider conditions for the electric potential \(\phi \) given two situations. Suppose our interface \(\Gamma \) is acting as a conductor such that we see a electric current flowing through. Assume we are under the most general case where all ion species are unrestricted. Conservation of charge and Ohm’s law then implies the change in current through \(\Gamma \) is proportional to the sum of changes in ionic fluxes:
Here we denote \(\sigma \) to be the electric conductivity which is discontinuous across the interface. Alongside this we assume continuity of the potential:
We see therefore that the conditions on the current are closely linked to the previous reactive conditions. As if no reaction occurs at \(\Gamma \), we simply have continuity of current due to ionic flux continuity. If a reaction is present, then eq. (51) tells us our jump in current is proportional to the sum of reaction rates \(r_i\) alongside their respective charge numbers \(z_i\).
If \(\Gamma \) is non-conductive instead we fix separately the current on each side of \(\Gamma \) and no longer impose continuity:
5 Numerical implementation
As we have mentioned our goal is to construct simple, effective numerical solvers to the Stoke-Poisson-Nernst-Planck (SPNP) model at the pore scale. To do so, we employ the computational fluid dynamics (CFD) package OpenFOAM® due to its open-source nature, large active community and robust handling of complex geometries. OpenFOAM® is a finite volume library for general unstructured mesh. Coupled equations are solved iteratively in a segregated/splitted approach, solving sequentially each discretised equation. This removes the explicit coupling between equations, as well as the need of linearising multi-linear terms (terms linear in each variable but where multiple variables appear) at the expense of having internal iterations. These would be unavoidable also if we adopted a monolithic approach due to the non-linearities of the model.
Two separate solvers have been implemented. The first, pnpFoam, models electrokinetic flow of a single ionic fluid, modelled by SPNP. The second, pnpMultiFoam, is more generalised, modelling a general set of ionic fluids and solids following SPNP and diffusion respectively. Furthermore we developed the numerical counterpart, named mappedChemicalKinetics, to the reactive conditions in §4.2.1 for the case of a binary reaction. In this section we will describe in detail the structure of the solvers and the corresponding boundary conditions.
5.1 Single- and multi-domain solvers
OpenFOAM® discretise each equation using a sparse matrix \({\textbf {M}}\) with entries relating to the cell centres of the mesh. For example, for the fluid momentum the discrete form reads:
where \([{\textbf {u}}]\) is the vector of unknown velocities at cell centres and \({\textbf {M}}\) the coefficient matrix scaling the effect of neighbouring cell velocities. Note the right hand terms are left as source terms and are computed explicitly and the gradients operators can be discretised with different schemes (details about the schemes will be presented in the results section). To solve for the pressure–velocity coupling we employ the PIMPLE algorithm with an extra term due to the electric body force. This works by decomposing \({\textbf {M}}\) into its diagonal, A, and off-diagonal, \({\textbf {H}}\), parts \({\textbf {M}}[{\textbf {u}}] = A{\textbf {u}} - {\textbf {H}}\). This leads to the velocity correction equation:
Interpolating \({\textbf {u}}\) to the cell faces and taking the dot product with cell face area vectors \({\textbf {S}}_{\text {f}}\) leads to the flux U correction equation,
where subscript \(\text {f}\) denotes values at cell faces. Discretising the incompressibility condition \(\varvec{\nabla }\cdot {\textbf {u}}=0\) gives \(\varvec{\nabla }\cdot U =0\) which when applied to the flux correction equation forms the pressure correction equation:
This is solved iteratively until convergence. In an external loop, momentum and pressure equations are coupled with the concentration and potential equations. When the mesh is highly skewed, or for complex discretisation schemes with implicit-explicit terms, additional iterations can be added for each single equation. The pseudo-code algorithm for our single ionic fluid solver pnpFoam is presented in Algorithm 1.
The same method is employed within the algorithm of pnpMultiFoam, our solver for ionic transport over a general set of ionic fluids and solids, where each region is solved separately, and an additional outer loop is added to ensure the coupling between regions. The algorithm is presented in Algorithm 2. Both solvers here are presented for the case of non-electroneutral solution. In case the electroneutrality is assumed, the algorithm is slightly modified to solve a modified potential equation Eq. (28) (with ionic conductivity instead of permittivity) and with the last species calculated to ensure electro-neutrality.
5.2 Boundary and interface conditions
To make use of the object orientation of OpenFOAM® , all conditions are first reformulate as effective Robin conditions. We consider here, as an example, the inhomogeneous Robin BC for a variable c with coefficients \(D^\star \), \(K^\star \) and \(F^\star \) along a boundary \(\Gamma \) with normal \({\textbf {n}}\):
In OpenFOAM® the boundary values \(c|_{\Gamma }\) and \(\varvec{\nabla }_{{\textbf {n}}}c|_{\Gamma }\) are approximated using the value of the cell centres with faces along \(\Gamma \):
Here \(c_{\text {c}}\) and \(c_{\text {f}}\) are the values of c at the cell centre and face respectively. The \(\alpha \)’s are the interpolation weights, and B is the inverse distance between the cell centre and the boundary. We can then rearrange Eq. (61) using Eqs. (62) and (63) to find the \(\alpha \) values that allow us to approximate Eq. (61) using the cell centres \(c_{\text {c}}\):
This forms the basis of the Robin BC implemented. Reformulating all other conditions into a form like Eq. (61) lets us reuse the same equations in Eq. (64) to approximate all other conditions.
The interface conditions are implemented as a derived class named mappedChemicalKinetics. If we consider here the limiting case of two reacting species \(c_{\text {s}}\) and \(c_{\text {f}}\), restricted to their respective sub-domains \(\Omega _{\text {s}}\) and \(\Omega _{\text {f}}\) respectively. Along the interface \(\Gamma \) connecting the two sub-domains is the reaction:
The general reactive conditions eq. (51) in this case reduces to the following condition along \(\Gamma \):
where we denote here \(\Gamma _{\text {s}}\) to be evaluation at the \(\Omega _{\text {s}}\) side of \(\Gamma \) and \({\textbf {n}}\) the unit normal of \(\Gamma \) facing into \(\Omega _{\text {f}}\). Note the reaction rate r is kept general and not necessarily linear. Equation 66 is solved iteratively using the Newton–Raphson method, linearised about the previous solution \({\textbf {c}}^{N} = (c_{\text {s}}^N \hspace{.5em} c_{\text {f}}^N)^\top \). Here the previous solution could be the solution at the previous time step (if an explicit time step** is chosen) or at the previous internal iteration (for fully implicit time step**). This allows us to rewrite Eq. (66) into two decoupled effective Robin conditions for \(c_{\text {s}}^{N+1}\) and \(c_{\text {f}}^{N+1}\) that we solve separately. The coupling between the two sides of the interface conditions (and therefore the two domains) is achieved through the internal iterations but, for stiff reactions, additional sub-loo** to update both boundary values whenever one of the two domains is solved for. In Algorithm 3 we detail the mappedChemicalKinetics pseudo-code to solve the effective Robin conditions. As both resulting effective Robin conditions are solved in the same manner we only write here solving of the condition for \(c_{\text {f}}\).
More details about the linearisation can be found in Appendix A. Alongside the reactive conditions we have also implemented a number of simpler conditions, such as the continuity of total fluxes, continuity of value or continuity of derivatives, often used within applications. Just as with the non-linear reactive condition, we rewrite all conditions into effective Robin conditions.
6 Numerical examples
Here we present four numerical examples of electrokinetic flows. To verify accuracy of results we compare with the spectral Matlab® toolbox Chebfun [9] with machine-precision accuracy. The first case verifies accuracy of the flow description given a single ion species using a pressure-driven infinite ion channel similar to [4]. Next we verify accuracy when considering multiple ion species. Afterwards we verify the implemented reactive interface conditions counterpart to §4.2.1. The final case displays the capabilities of our solver(s), simulating ionic transport within a randomised solid–fluid porous medium.
To show spatial convergence of OpenFOAM® results we use the following normalised \(L^2\) error point norm. We use here the dummy variables v and \(v_{\text {cref}}\) to denote OpenFOAM® and Chebfun results respectively as an example:
6.1 SPNP in an infinite channel
To verify pnpFoam and pnpMultiFoam for a single ion species take \(\Omega \), of length L, with two boundaries \(\Gamma _{\text {t}}\) and \(\Gamma _{\text {b}}\) denoting the top and bottom channel walls respectively. Take boundaries \(\Gamma _{\text {in}}\) and \(\Gamma _{\text {out}}\) denoting the inlet and outlet of fluid in \(\Omega \). To mathematically describe this channel as infinite in length we take periodic conditions on \(\Gamma _{\text {in}}\) and \(\Gamma _{\text {out}}\).
Take a monovalent ionic fluid, i.e a single ion species c with valency \(z=1\). Enforce a fixed external force \({\textbf {J}} =\bigg ({\begin{matrix} -\mu /H^2 \\ 0 \end{matrix}}\bigg )\) to induce transport across the channel length. To allow electro-migration of c between the two channel walls, fix \(\phi =0.1\) along \(\Gamma _{\text {t}}\) and \(\phi =0\) on \(\Gamma _{\text {b}}\). For c apply no-flux along \(\Gamma _{\text {t}}\) and \(\Gamma _{\text {b}}\), denoting \({\textbf {n}}\) to be the outward unit normal of either \(\Gamma _{\text {t}}\) or \(\Gamma _{\text {b}}\). We consider the channel at steady state and, by assuming L is sufficiently large, take all derivatives in x to be zero, i.e. \(\frac{\partial a}{\partial x}=0\) for \(a\in \{ {\textbf {u}}, \phi , c, p\}\). Just like Poiseuille flow we assume a uni-directional velocity, such that \({\textbf {u}}= \left( {\begin{matrix} u_1 \\ 0 \end{matrix}}\right) \). These assumptions in turn produce a one-dimensional reduce system of equations in y.
The SPNP system with a single ionic species in an infinite channel is considered with an added pressure-driven driving force \({\textbf {J}}\):
The complete system is solved in OpenFOAM® in a periodic channel, and compared with the equivalent one-dimensional model. By applying the assumptions of uni-directional flow and zero derivatives in x we obtain a one-dimensional reduced set of equations in y:
where we excluded the incompressibility condition as this is trivially satisfied.
To compare results between Chebfun and our single ionic fluid solver pnpFoam we the following dimensionless numbers, geometrical parameters and transport properties, according to Table 1.
When running pnpFoam we solve it in steady state and take a large number of PIMPLE corrector iterations to insure convergence of the coupled system. The mesh used in OpenFOAM® is up to \(N=420\) cells (100 in x, 320 in y). Comparison of results and the \(L^{2}\) error norm convergence are shown in fig. 4. We observe an accumulation of c along \(\Gamma _{\text {b}}\), causing a large pressure gradient to form. sThe velocity profile follows a parabolic arc, as expected, whilst we see a non-linear profile for \(\phi \). Overall we find good agreement, with linear order spatial convergence \(\mathcal {O}(N^{-1})\).
6.2 Multi-component ionic fluid
To verify pnpFoam and pnpMultiFoam for a multi-component fluid we take two species \(c_1\) and \(c_2\) with opposite valencies \(z_1=-z_2=1\) over the domain \(\Omega \in [0,L]\) where \(L=1\times 10^{-6}\). We set a zero-flux BC, i.e., \(j(c_{i})=0\) at \(x=0,L\) for both species and fix \(\phi =0.1\) at \(x=L\) and \(\phi =0\) at \(x=0\). We fix here a constant velocity \( {\textbf {u}}=0.001\) for simplicity and we by-pass the solution of the Stokes system (frozenFlow flag). Concentrations and potential are initially set to \(c_i=1\times 10^{-3}\) and \(\phi =0.05(1-\cos {\frac{\pi x}{L}})\).
We consider here the dimensionless number values in Table 2, indicating electrostatic forces dominate. From \(\mathcal {L}\) we find the Debye length as approximately \(\lambda _{\text {D}} ={308}{\hbox {nm}}\). Since we are fixing \({\textbf {u}}\) and neglecting Stokes we have \(\mathcal {P}=0\).
When running pnpFoam we use a time step \(\Delta t=10^{-7}\)s, end time \(t=1\times 10^{-5}\)s, third-order implicit time scheme (backward keyword) and a mesh of up to \(N=1000\) cells. Results and \(L^{2}\) norm convergence plots are depicted in Sect. 6.3 where we find good agreement of results and linear spatial convergence of all fields.
We see the ions are transported to the outer walls due to the high electric potential gradient. Most of the ions then accumulate within \(\lambda _{\text {D}}\) from the walls forming two overlap** EDLs. Non-linear behaviour between \(c_i\) and \(\phi \) is observed through the slight shift in \(\phi \)’s profile due to the clustering of ions at the walls.
6.3 Reactive interface
Here we verify the accuracy of mappedChemicalKinetics, the numerical counterpart to the conditions found in §4.2.1. Consider the domain \(\Omega =\Omega _{\text {s}}\cup \Omega _{\text {f}}=[-1,1]\) split into fluid \(\Omega _{\text {f}}\in [-1,0]\) and solid \(\Omega _{\text {s}}\in [0,1]\), each containing the species \(c_{\text {f}}\) and \(c_{\text {s}}\) respectively. Both species are restricted to their respective sub-domain, i.e. \(c_{\text {s}}=0\) in \(\Omega _{\text {f}}\) and vice versa. Consider the following elementary reaction at the \(x=0\) interface: Figure. 5
As \(c_{\text {s}}\) and \(c_{\text {f}}\) are restricted to \(\Omega _{\text {s}}\) and \(\Omega _{\text {f}}\) respectively the reactive conditions of Eqs. (51) and (52) become
where we have used the linear rate law to model the reaction rate. Note \(c_{\text {f}}\) and \(c_{\text {s}}\) in Eqs. (84) and (85) are evaluated on \(\Omega _{\text {f}}\) and \(\Omega _{\text {s}}\)’s side of \(x=0\) respectively. We set both species as uncharged, i.e. \(z_i=0\), to remove electrostatic effects and \(u=1\) in \(\Omega _{\text {f}}\) to ignore Stokes. We initially set \(c_{\text {s}}=0\) in \(\Omega _{\text {s}}\) and \(c_{\text {f}} = e^{-200(x+0.5)^{2}}\) in \(\Omega _{\text {f}}\) so that a clear increase in \(c_{\text {s}}\) can be seen.
Looking at the dimensionless numbers for the problem in Table 3 we can notice here that advection dominates. We also include two more numbers from the reactive interface conditions at \(x=0\). These are \(\text {Da}_{\text {II,f}}\) and \(\text {Da}_{\text {II,r}}\), the Damköhler numbers given as the ratio between the diffusion rate and reaction rates, forward and reverse, respectively.
When running pnpMultiFoam to show qualitative comparison we use a time step \(\Delta t = 10^{-3}\)s, second-order implicit time scheme backwards and mesh discretisation of \(N=1000\) cells (500 in \(\Omega _{\text {f}}\), 500 in \(\Omega _{\text {s}}\)). To show convergence of results and compute the \(L^2\) error point norm we move to the steadyState time scheme to compare steady states. Results of the transient case are shown on the left in Fig. 7 where we find good agreement. First an initial diffusion and advection of \(c_{\text {f}}\) is seen towards the interface, once \(c_{\text {f}}\) reaches \(x=0\) it reacts to form \(c_{\text {s}}\) in \(\Omega _{\text {s}}\), where afterwards \(c_{\text {s}}\) diffuses through \(\Omega _{\text {s}}\). After \(t=15\)s a steady state is reached implying chemical equilibrium of the reaction. As for the \(L^{2}\) error norm of the steady case, seen in Fig. 7, we find a second-order convergence of mappedChemicalKinetics to Chebfun. This is because the interface conditions are linear and therefore exactly approximated by the linear approximation.
6.4 Random porous REV
To demonstrate the capabilities of our solvers, we consider a randomly generated porous solid–fluid domain \(\Omega =\Omega _{\text {s}}\cup \Omega _{\text {f}}\), see Fig. 8. The random generation is done by a truncated Gaussian random field [12, 24], sampled at the mesh points and categorised into two bins, denoting solid and fluid cells, by a threshold. Raising or lowering this threshold alters the porosity of the domain.
To have \(\Omega \) be a microscopic representative elementary volume (REV) of a much larger macroscopic porous medium, we apply periodic conditions along the outer boundaries \(\Gamma _{\text {ext}}= \Gamma _{\text {in}}\cup \Gamma _{\text {out}}\cup \Gamma _{\text {t}}\cup \Gamma _{\text {b}}\). To generate movement, we fix a jump in \(\phi \) between \(\Gamma _{\text {in,s}}\) and \(\Gamma _{\text {out,s}}\), where the subscript s denotes the section of \(\Gamma _{\text {in}}\) neighbouring \(\Omega _{\text {s}}\). This is to mimic a fixed applied potential difference across the macroscopic medium, such as an applied voltage across a battery cell. We consider two ion species \(c_1\) and \(c_2\) with opposite valencies \(z_1=-z_2=-1\). The height and length of the region is set as \(H=1\times 10^{-4}\)m.
In \(\Omega _{\text {f}}\) we start with a uniform concentration of \(c_2\), the same is done for \(\Omega _{\text {s}}\) with \(c_1\). Fluid is initially taken at rest. Along \(\Gamma _{\text {sf}}\) we set no flux for \(c_1\) and flux continuity for \(c_2\). For \(\phi \) we assume continuity of the electric displacement \({\textbf {D}}=\varepsilon {\textbf {E}}\) along \(\Gamma _{\text {sf}}\). In Table 4 we list the dimensionless number values of the case.
The system is initialised with constant \(c_1\) and \(c_2\) in \(\Omega _{\text {f}}\) and \(\Omega _{\text {s}}\) respectively. All fields are periodic on the outer boundaries \(\Gamma _{\text {ext}}=\Gamma _{\text {in}}\cup \Gamma _{\text {out}}\cup \Gamma _{\text {t}}\cup \Gamma _{\text {b}}\), apart from \(\phi \) where we introduce a quasi-periodic condition with a fixed jump between \(\Gamma _{\text {in,s}}\) and \(\Gamma _{\text {out,s}}\), denoting the parts of \(\Gamma _{\text {in}}\) and \(\Gamma _{\text {out}}\) neighbouring \(\Omega _{\text {s}}\). We apply no flux and flux continuity for \(c_1\) and \(c_{\text {s}}\) along \(\Gamma _{\text {sf}}\) respectively. For \(\phi \) we assume continuity of the electric displacement \({\textbf {D}}=\varepsilon {\textbf {E}}\) along \(\Gamma _{\text {sf}}\):
To show consistency in the results we run four simulations in total. This is done for two randomly generated meshes, each discretised over two levels of refinement for \(N=1\times 10^{4}\) and \(N=4\times 10^{4}\) cells. We will use letters A and B to differentiate between the random generations and subscripts 1 and 2 for the levels of refinement. E.g, \(A_{2}\) denotes the first random mesh, refined using \(4\times 10^{4}\) cells. All runs use a time step \(\Delta t = 5\times 10^{-4}\) and second-order implicit time scheme backwards. To observe the advective and electrostatic effects on our ions we define the following velocities in \(\Omega _{\text {f}}\):
such that the continuity Eq. (5) in \(\Omega _{\text {f}}\) may be written as
Figure 9 shows the results of the first random realisation with a finer mesh (\(N=4\times 10 ^{4}\)), where we observe a gradient in \(\phi \) formed between regions of \(\Omega _{\text {s}}\) connected at \(\Gamma _{\text {in}}\) and \(\Gamma _{\text {out}}\). This is primarily due to our jump condition for \(\phi \) applied along \(\Gamma _{\text {in,s}}\) and \(\Gamma _{\text {out,s}}\). Whilst movement of our ion species have an effect on this gradient, for the most part it remains steady. The applied electrical driving force causes the uniform concentration \(c_1\) in \(\Omega _{\text {f}}\) to accumulate around the regions of \(\Omega _{\text {s}}\) connected at \(\Gamma _{\text {out}}\), where a higher electric potential is present. Conversely, around \(\Omega _{\text {s}}\) connected at \(\Gamma _{\text {in}}\) we find a much lower, but not zero, concentration of \(c_1\). A similar observation is found with \(c_2\), once diffused out of \(\Omega _{\text {s}}\), accumulating where there is a lower potential. As with \(c_1\), at the region of \(\Omega _{\text {s}}\) connected at \(\Gamma _{\text {out}}\) there is a much lower, but again not zero, concentration of \(c_2\). We observe therefore the formation of EDL’s, see §3, around these connected solids. Given more time to evolve these EDL’s would become further apparent, with more of \(c_2\) diffusing out of \(\Omega _{\text {s}}\). As for \({\textbf {v}}_1\) and \({\textbf {v}}_2\) we find their magnitudes \(||{\textbf {v}}_1||\) and \(||{\textbf {v}}_2||\) are highest within these EDL’s located at the connected solids due to higher gradients in \(\phi \).
We can compare these results with coarse mesh (\(N=1\times 10 ^{4}\)) results as well as with other random generation seed. Results of first realisation with a coarse mesh, and of a coarse and fine simulation of a second random realisation are reported respectively in Figs. 10, 11, and 12.
7 Conclusions
In this paper we present the development of open-source solvers in OpenFOAM® capable of simulating microscopic electrokinetic flows of dilute ionic fluids. The underlying system, known as Stokes-Poisson-Nernst-Planck, is thoroughly reviewed where we discuss the assumptions on the fluid properties and limitations these bring. We later apply dimensional analysis to characterise the effects of dominating physical forces. This analysis is later used to give better understanding to a common model reduction, known as the electro-neutrality assumption, as a result of such analysis.
Many real-world applications of these flows involve some form of reactions between involved ionic species at the interface between fluid and solid. As such, we formulate a fully general reaction model capable of describing said heterogeneous reactions as a balance of fluxes across all reacting species.
To verify flow descriptions obtained from our solvers are accurate, we compare against highly accurate solutions obtained, for simplified cases, with the Matlab toolbox Chebfun for a number of cases. With each case we find good agreement, showing spatial grid convergence of the results. We later use our solvers across a randomly generated solid–fluid porous cell, similar to a representative elementary volume (REV) used in homogenisation theory, to show the solvers ability in handling complex micro-structures.
In the future we plan on constructing full physically realistic cases, such as modelling the electrokinetic flow through a porous battery half-cell. Furthermore we later plan to apply uncertainty quantification in conjunction with these randomly generated porous cells, quantifying the effects on the flow for varying geometrical properties.
References
Alizadeh A, Hsu W, Wang M, Daiguji H (2021) Electroosmotic flow: From microfluidics to nanofluidics. Electrophoresis 42(7–8):834–868. https://doi.org/10.1002/elps.202000313. (ISSN 0173-0835)
Baird JK (1999) A generalized statement of the law of mass action. J Chem Educ 76:1146–1150
Basu HS, Bahga SS, Kondaraju S (2020) A fully coupled hybrid lattice Boltzmann and finite difference method-based study of transient electrokinetic flows. Proc Roy Soc A Math Phys Eng Sci 476(2242):20200423. https://doi.org/10.1098/rspa.2020.0423. (ISSN 1364-5021)
Berg P, Findlay J (2011) Analytical solution of the Poisson-Nernst-Planck-Stokes equations in a cylindrical channel. Proc Roy Soc A Math Phys Eng Sci 467(2135):3157–3169. https://doi.org/10.1098/rspa.2011.0080. (ISSN 1364-5021)
Boccardo G, Crevacore E, Passalacqua A, Icardi M (2020) Computational analysis of transport in three-dimensional heterogeneous materials. Comput Vis Sci 23(1):1–15
Chang R (2000) Physical chemistry for the chemical and biological sciences. University Science Books, California, p 2000
Constantin P, Ignatova M (2019) On the Nernst-Planck-Navier-Stokes system. Arch Ration Mech Anal 232(3):1379–1428. https://doi.org/10.1007/s00205-018-01345-6. (ISSN 0003-9527)
Dreyer W, Guhlke C, Müller R (2013) Overcoming the shortcomings of the Nernst-Planck model. Phys Chem Chem Phys 15(19):7075. https://doi.org/10.1039/c3cp44390f. (ISSN 1463-9076)
Driscoll TA, Hale N, Trefethen LN (2014) Chebfun Guide, Pafnuty Publications, Oxford, 2014
Gagneux G, Millet O (2016) Survey on properties of Nernst-Planck-Poisson system. Application to ionic transport in porous media. Appl Math Model 40:846–858
Icardi M, Barnett R (2021) F Municchi spnpFoam. https://doi.org/10.5281/zenodo.4973896
Icardi M, Pescimoro E, Municchi F, Hidalgo JH (2022) Computational framework for complex flow and transport in heterogeneous porous media, vol 12. ar**v:2212.10961 [math.NA]
Jensen M, Weerdt KD, Johannesson B, Geiker M (2015) Use of a multi-species reactive transport model to simulate chloride ingress in mortar exposed to NaCl solution or sea-water. Comput Mater Sci 105:75–82
Ji S, Liu W (2012) Poisson–Nernst–Planck systems for ion flow with density functional theory for hard-sphere potential: I-V relations and critical potentials. Part I: analysis. J Dyn Differ Equ 24(4):955–983. https://doi.org/10.1007/s10884-012-9277-y. (ISSN 1040-7294)
Kontturi K, Murtomaki L, Manzanares JA (2008) Ionic transport processes. Oxford Press, Oxford
Krishna R, Wesselingh J (1997) The Maxwell–Stefan approach to mass transfer. Chem Eng Sci 52(6):861–911. https://doi.org/10.1016/S0009-2509(96)00458-7. (ISSN 00092509)
Lai W, Ciucci F (2011) Mathematical modeling of porous battery electrodes—revisit of Newman’s model. Electrochim Acta 56:4369–4377
Latz A, Zausch J (2011) Thermodynamic consistent transport theory of Li-ion batteries. J Power Sci 196:3296–3302
Li H, Toschi F (2020) Plasma-induced catalysis: towards a numerical approach. Philos Trans Roy Soc A Math Phys Eng Sci 378(2175):20190396. https://doi.org/10.1098/rsta.2019.0396. (ISSN 1364-503X)
Liu J, Eisenberg B (2014) Poisson-Nernst-Planck-Fermi theory for modeling biological ion channels. J Chem Phys 141(22):22D532
Ma M, Xu Z, Zhang L (2020) Modified Poisson–Nernst–Planck model with Coulomb and hard-sphere correlations. http://arxiv.org/abs/2002.07489
Maex R (2017) On the Nernst–Planck equation. J Integr Neurosci 16(1):73–91. https://doi.org/10.3233/JIN-170008. (ISSN 1757448X)
Moshtarikhah S, Oppers NA, de Groot MT, Keurentjes JT, Schouten JC, van der Schaaf J (2017) Nernst–Planck modeling of multicomponent ion transport in a Nafion membrane at high current density. J Appl Electrochem 47:51–62
Municchi F, Di Pasquale N, Dentz M, Icardi M (2021) Heterogeneous multi-rate mass transfer models in OpenFOAM®. Comp Phys Commun 261:107763. https://doi.org/10.1016/j.cpc.2020.107763. (ISSN 00104655)
Němeček J, Kruis J, Koudelka T, Krejčí T (2018) Simulation of chloride migration in reinforced concrete. Appl Math Comput 319:575–585
Nernst W (1888) Zur kinetik der in lösung befindlichen körper. Phys Chem 2:613–637
Nuca R, Storvik E, Radu FA, Icardi M (2022) Splitting schemes for coupled differential equations: Block schur-based approaches and partial Jacobi approximation, vol 12. https://arxiv.org/pdf/2212.11111.pdf
Patankar SV, Spalding DB (1972) A calculation procedure for heat, mass and momentum transfer in three-dimensional parabolic flows. Int J Heat Mass Transf 15(10):1787–1806. https://doi.org/10.1016/0017-9310(72)90054-3. ISSN 00179310
Pimenta F, Alves M (2019) A coupled finite-volume solver for numerical simulation of electrically-driven flows. Comput Fluids 193:104279. https://doi.org/10.1016/j.compfluid.2019.104279. (ISSN 00457930)
Planck M (1890) Ueber die Erregung von Electricität und Wärme in Electrolyten. Ann Phys Chem 275(2):161–186. https://doi.org/10.1002/andp.18902750202 (ISSN 00033804)
Probstein RF (1994) Physicochemical hydrodynamics, 2nd edn. Wiley-Interscience, New Jersey (ISBN 0-471-01011-1)
Psaltis STP, Farrell TW (2011) Comparing charge transport predictions for a ternary electrolyte using the Maxwell-Stefan and Nernst-Planck equations. J Electrochem Soc 158:A33
Richardson G, Foster J, Ranom R, Please C, Ramos A (2020) Charge transport modelling of lithium ion batteries. ar**v preprint ar**v:2002.00806
Samson E, Marchand J (1999) Numerical solution of the extended Nernst–Planck model. J Colloid Interface Sci 215(1):1–8. ISSN 00219797. https://doi.org/10.1006/jcis.1999.6145
Schmuck M (2011) Modeling and deriving porous media Stokes-Poisson-Nernst-Planck equations by a multi-scale approach. Commun Math Sci 9:685–710
Squires TM (2009) Induced-charge electrokinetics: fundamental challenges and opportunities. Lab on a Chip 9(17):2477. https://doi.org/10.1039/b906909g (ISSN 1473-0197)
Voukadinova A, Gillespie D(2019) Energetics of counterion adsorption in the electrical double layer. J Chem Phys 150(15):154706. https://doi.org/10.1063/1.5087835 (ISSN 0021-9606)
Yang P, Sant G, Neithalath N (2017) A refined, self-consistent Poisson–Nernst–Planck (PNP) model for electrically induced transport of multiple ionic species through concrete. Cement Concr Compos 82:80-94
Ying J, Fan R, Li J, Lu B (2021) A new block preconditioner and improved finite element solver of Poisson-Nernst-Planck equation. J Comput Phys 430:110098. https://doi.org/10.1016/j.jcp.2020.110098 (ISSN 00219991)
Zheng Q, Wei G (2011) Poisson–Boltzmann–Nernst-Planck model. J Chem Phys 134
Zheng Q, Wei G (2011) Poisson-Boltzmann-Nernst-Planck model. J Chem Phys 134:194101
Zhu H, Kee R (2016) Membrane polarization in mixed-conducting ceramic fuel cells and electrolyzers. Int J Hydrogen Energy 41:2931–2943
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflicts of interest. MI and RB have been supported by the University of Nottingham Impact Acceleration Award.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
A. Quasi-coupled Newton iterative effective reactive Robin conditions
A. Quasi-coupled Newton iterative effective reactive Robin conditions
1.1 A.1. General non-linear reaction rate for restricted binary reaction
Let there be the following reversible binary reaction between species \(c_{\text {s}}\) and \(c_{\text {f}}\) along the interface \(\Gamma \) shared by \(\Omega _{\text {s}}\) and \(\Omega _{\text {f}}\),
and consider each species is restricted to their respective sub-domains:
In these circumstances we have the following condition along \(\Gamma \) with reaction rate r:
We denote here \({\textbf {n}}\) to be the unit normal along \(\Gamma \) facing outwards of \(\Omega _{\text {s}}\) and \({\textbf {n}}^\prime = -{\textbf {n}}\). Consider the reaction rate r is a non-linear function of \(c_{\text {s}}\) and \(c_{\text {f}}\). To obtain effective Robin conditions of Eq. (96) for \(c_{\text {s}}\) and \(c_{\text {f}}\) we employ the Newton–Raphson method. First, we take the vector form of Eq. (96) with all terms moved to the left. To simplify writing, for now we omit what side of \(\Gamma \) each term is evaluated on:
Assume we have a current approximate solution \({\textbf {c}}^{N} = (c_{\text {s}}^N \hspace{.5em} c_{\text {f}}^N)^\top \). Linearising \({\textbf {J}}\) around \({\textbf {c}}^N\) then gives
whereby setting \({\textbf {c}}={\textbf {c}}^{N+1}\) is the next iterative solution. We denote here \(\frac{\partial {\textbf {J}}}{\partial {\textbf {c}}}\) to be the Jacobian matrix of \({\textbf {J}}\). To determine the Jacobian we define the directional derivative for some function G(c) along the direction \(\delta c = c - c^N\) as:
Using this definition of the directional derivative we can then determine the Jacobian within Eq. (98). Since the method is similar for all components of \({\textbf {J}}\), we will focus on the first element \(J_1\). Taking the directional derivative of \(J_1\) with respect to \(c_{\text {s}}\) along \(\delta c_{\text {s}}\) at \({\textbf {c}}={\textbf {c}}^N\) gives:
Taking the following Taylor expansions about \(\varepsilon =0\) of r and the concentration gradient,
then substituting into Eq. (100) we obtain:
The same can be done to find the directional derivative of \(J_1\) with respect to \(c_{\text {f}}\), giving:
Repeating the same process for \(J_2\) of Eq. (97) and collecting all elements together and evaluating at \({\textbf {c}}^N\) gives
where derivatives in r are evaluated at \({\textbf {c}}^N\). We may then substitute Eq. (105) into Eq. (98) to get
where r and its derivatives are evaluated at \({\textbf {c}}^N\). Re-arranging the first element of Eq. 106, using the first order approximation \(\varvec{\nabla }_{{\textbf {n}}}c_{\text {s}} = B_{\text {s}}(c_{\text {s}} - c_{\text {s,c}})\) where \(c_{\text {s,c}}\) is the value at the cell centre of cells sharing a face with \(\Gamma \), and substituting into the second element then gives:
where
Setting \({\textbf {c}} = {\textbf {c}}^{N+1}\) to indicate the next iterative solution results in an iterative Robin condition of the form \(-D_{\text {f}}^*\varvec{\nabla }_{{\textbf {n}}^\prime }c_{\text {f}}^{N+1} = -K_{\text {f}}^*c_{\text {f}}^{N+1} -F_{\text {f}}^*\), with effective coefficients dependent on the previous iteration \({\textbf {c}}^N\):
Remember, r and its derivatives are evaluated at the previous iteration \({\textbf {c}}^N\). Similar steps can also be applied to the accompanying iterative Robin condition for \(c_{\text {s}}\) of the form \(-D_{\text {s}}^*\varvec{\nabla }_{{\textbf {n}}}c_{\text {s}}^{N+1} = -K_{\text {s}}^*c_{\text {s}}^{N+1} -F_{\text {s}}^*\), with coefficients:
1.2 A.2. General non-linear unrestricted reaction rate
Here we will formulate a set of iterative Robin conditions required to solve the reactive conditions for unrestricted species and non-linear reaction. Consider a general non-linear reaction with \(i=J,...,K\) reactants and \(i=K+1,...,M\) products:
We model Eq. (115) using the following conditions with general, possibly non-linear, reaction rates \(r_i\):
We begin by writing \({\textbf {j}}_i\) in full and use \({\textbf {n}}=-{\textbf {n}}^\prime \) to give \({\textbf {j}}_i|_{\Gamma _{\text {f}}}\cdot {\textbf {n}} = -{\textbf {j}}_{i}|_{\Gamma _{\text {f}}}\cdot {\textbf {n}}^\prime \), a more acceptable form for OpenFOAM® . Since formulating the necessary Robin conditions is the same for all species i, we omit the subscript from here onward unless necessary. Instead we introduce two new subscripts s and f denoting evaluation on the solid or fluid side of \(\Gamma \):
We next use the first order approximation \(\nabla _{{\textbf {n}}^\prime }c_{\text {f}} = B_{\text {f}}(c_{\text {f}} - c_{\text {f,c}})\), where the coefficient \(B_{\text {f}}\) is determined by OpenFOAM® and \(c_{\text {f,c}}\) denotes the cell centre value of cells sharing a face with \(\Gamma \). Alongside the continuity condition Eq. (117) this allows us to rearrange Eq. (118) into a form close to Robin:
Since \(r_i\) may be non-linear, we linearise about an initial guess \({\textbf {c}}^{N}=(c_{J}^{N},c_{J+1}^{N},...,c_i^N,...,c_{M}^{N})\) of concentrations and define \(\delta c_{j} = c_{j}-c_{j}^{N}\):
Substitute Eq. (120) into Eq. (119) and take \(c_{\text {s}}=c_{\text {s}}^{N+1}\) to be the next iterative solution. To decouple the iterative conditions, all other concentrations we set as \(c_j=c_j^N\) for \(i\ne j\). The result is the following iterative Robin condition for \(c_{\text {s}}^{N+1}\), the concentration of species i on the solid side of \(\Gamma \):
The same process can be done to determine the iterative Robin condition for \(c_{\text {f}}=c_{\text {f}}^{N+1}\), the concentration of species i on the fluid side of \(\Gamma \):
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Barnett, R., Municchi, F., King, J. et al. Electrochemical transport modelling and open-source simulation of pore-scale solid–liquid systems. Engineering with Computers 39, 4129–4152 (2023). https://doi.org/10.1007/s00366-023-01828-5
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00366-023-01828-5