Transport in periodic sphere packings
One of the fields which most commonly deals with the study of transport in porous media is filtration theory. For example, this has been applied for the investigation of aquifer contamination and remediation, [9, 25, 27, 37]. Correspondingly, a lot of effort has been expended in the past decades to approach this problem, both experimentally and via theoretical investigation. These kind of problems are basically equivalent, in their simplest formulation, to linear advection-diffusion equations. Upscaling techniques are therefore robust and well-known [2, 17]. However, despite the simplicity of the problem, some issues are still unsolved, such as the quantitative understanding of the role of geometrical parameters in transport processes or the effect of non-linearities. In recent years, computational studies have begun to complement the available analytical and empirical results, especially when the physical problem presented further difficulties (e.g.: mixing controlled reactions, heterogeneous materials, etc.) which rendered an a-priori upscaling process exceedingly difficult, if not outright impossible [1].
As mentioned elsewhere, the pre-processing step constitutes a big part of a CFD case of transport in porous media. While in the next sections we explored the process of the generation of the geometrical model, here we will explore the issue of the choice of the optimal meshing strategy and its consequences in the convergence of the finite volume scheme. To this end, we will consider here the Stokes flow over a unit cell of a periodic arrangement of spheres. Then, in Sect. 4.1.3, we turn to look to the upscaling step, and specifically on how to conveniently solve unsteady transport Eulerian equations and on an alternative Lagrangian approach to extract residence-time distribution curves for a solute transport problem.
Unstructured meshing generation
Tests were performed meshing a body-centred cubic structure, where grains were spheres of equal size [10], and the medium porosity was held fixed at 0.366 (i.e.: close to the minimum porosity, but sufficiently high to avoid issues due to the meshing of contact points between adjacent spheres). Four different meshing strategy were then employed:
-
snappyHexMesh with uniform cell size (sHM_U);
-
snappyHexMesh with one level of refinement (sHM_R);
-
foamyHexMesh with uniform cell size (fHM_U);
-
foamyHexMesh with one level of refinement (fHM_R).
A representation of these different meshing strategies can be found in Fig. 3. When present, the refinement level is located around the grain surface, in order to allow a better discretisation of the boundary layers (of the momentum and concentration/temperature gradients). For each meshing strategy, meshes of different cell size were built, paying attention to both the mean cells size and the total number of cells. This latter parameter, see Table 1, was used to analyse the grid convergence results. Technical details on the meshing generation are reported in the Appendix. Equations (1) and (2) were solved imposing a pressure drop between two opposite faces of the domain (along the x-axis). The resulting (mean) velocity is thus comparable with environmental applications (Re \(\approx \) 3).
Fluid flow convergence study
Using the meshes described above, we solve the Stokes Footnote 6 problem Eqs.(1) and (2), and analyse the numerical performance of the finite-volume schemes. Technical details on the meshing generation are reported in the Appendix.
Table 1 Total number of cells for ten increasingly fine meshes
In Fig. 4 we can observe the effect of the various meshing strategies, combined with different schemes. The mean velocity (or equivalently the drag coefficient) is compared against a finer resolution result (and reference results in literature [24]). First of all, it is interesting to notice how in the first part of the plot (i.e.: coarse grids) the main error is always approximately second-order. This is due to the fact that, in our meshing strategy, the surface of the sphere is not exactly preserved but it is itself discretised. This can be easily estimated from simple geometrical arguments and the theory of elliptic operators. This “geometrical error” can instead behave very differently in presence of significant boundary-layer effects (Navier-Stokes or boundary reactions). After this first regime, we can observe that, in general, the uniform meshes generated with snappyHexMesh perform significantly better reaching a second- and third-order convergence, according to the finite-volume scheme chosen. On the other hand, the refined grid sHM_R loses the second-order accuracy due to the introduced non-orthogonality and skewness of the cells. As explained earlier, this can be corrected only with explicit terms that could cause unboundedness. Therefore we limit the corrections, and obtain and sub-optimal convergence rate.
For this linear problem, the advantage of refining near the boundary does not pay off, as the computational savings are not enough to justify this deterioration of the numerical convergence. Similarly, the unstructured meshing strategies based on Voronoi tessellation (fHM both uniform and refined), despite being attractive for their robustness and simplicity, are characterised only by a linear decay of the error; please note that fHM_R is not reported in Fig. 4 for sake of simplicity, as it practically behaves like the fHM_U. However they seem to perform better for very coarse meshes where the geometrical features can be better represented with a small number of Voronoi tiles.
Residence time distribution and breakthrough curves
The solute transport problem can be solved, either in a Lagrangian or Eulerian way, given the computation of the flow field (from now on, we will refer only to the results obtained with the finest uniform mesh with second-order schemes). For infinite Péclet numbers (purely hyperbolic equation), the transport can be fully characterised by the streamlines. This is particularly convenient as, within an Eulerian formulation, specific advection schemes and highly refined meshes would be needed to avoid significant numerical artificial diffusion or instabilities [3]. Streamlines are integrated with the streamLine post-processing tool available in OpenFOAM\(\textregistered {}\) 4, and they are generated seeding a cloud of points that can be located wherever within the domain. In particular, we provided points seeded on the inlet face of the domain, perpendicular to the flow direction. Points can be placed either randomly or on a regular grid; the former strategy should be preferred to provide statistically reliable samples.
In presence of finite (possibly very small) diffusion, a linear drift diffusion Ito’s Stochastic Differential Equation should instead be solved. This requires more sophisticated and expensive random walk algorithms. These are usually coupled to the fluid flow equations, allowing a possible coupling between the solute concentration and the fluid. Despite the higher accuracy of Lagrangian methods for advection-dominated transport, the Lagrangian discretisation of more complex non-linear advection diffusion reaction and the coupling with the fluid flow can be non trivial and give rise to significant statistical errors due to the finite number of trajectories.
Here we follow 1000 particle trajectories from the inlet to the outlet and compute the cumulative distribution of arrival (or residence) times f(t) in the pure advection regime, and compare them with Eulerian simulations at increasing Péclet numbers. The cumulative arrival times of a random ensemble of particles initially positioned at the inlet is equivalent to the time integral of the concentration of particles at the outlet with inlet concentration delta-distributed in time (the “response” function of an impulse at time \(t=0\)). This is therefore equivalent to the time-derivative of the so-called “breakthrough curve”, i.e. the response to an Heaviside function.
Having established a connection between Eulerian and Lagrangian simulations in the non-reacting case, what we want to study is the appearance of “anomalous transport” characteristics when the diffusion is small enough not to allow for a significant mixing, therefore resulting in particles following preferential directions and staying for long times in the same streamline. This, apart from very special cases (e.g. Gaussian distributed flow field), generates non-Fickian transport behaviour. This is a well-known problem in porous media who has received significant attention (see, for example, [12] and [13]). It can be easily understood if one tries to fit the three-dimensional results with an equivalent one-dimensional linear advection diffusion equation (with constant velocity, equal to the mean velocity, and unknown diffusionFootnote 7).
For the purpose of this section, simulation were performed on a face-centred body structure (made of spherical grains of equal size) with porosity 0.40. In Fig. 5 the residual concentration \(1-f(t)\) is shown for Lagrangian streamlines (equivalent to infinite Péclet number) and for Péclet numbers ranging from 10 to 1000, against the dimensionless advective time \(t/\tau \), where \(\tau \) is the arrival time for the advective front (i.e., considering the mean velocity). At first, a uniform (across the inlet plane) boundary condition has been tested (ref. Fig. 5 continuous lines). Here it can be seen that for \(Pe=10\) the transport is still dominated by diffusion, with a first arrival time lower than the front arrival time. Then, for higher Péclet numbers, the curves start to show a significant power-law “tailing”, while the solution of a 1D advection diffusion equation would predict an exponential decay. This is due to the incomplete mixing and preferential trajectories. Although it is not in the objectives of the paper to analyse the anomalous transport characteristics, it is interesting to notice here that a significantly different behaviour is observed when the technique and boundary conditions described in 2.3 are used (dashed lines). In fact, when the non reactive stationary quasi-periodic problem is solved within the porous space, an “asymptotic” self-similar profile is obtained. When using this asymptotic profile as the boundary condition at the inlet, the resulting transport becomes clearly “Fickian”, with exponential tails. This is because the profile found by the quasi-periodic “closure” represents the profile for which the stationary outlet concentration is uniform. Therefore, it can be considered as an inverse problem of finding the profile that cancels out the preferential trajectories. The black solid line finally represents the arrival (or transit or residence) times of purely advective Lagrangian trajectories. As it can be seen, the first arrival times match well with the high Péclet case but the absence of diffusion cause a very significant tailing with a power-law behaviour.
Flow over porous surfaces
In this section, we will explore the case of flow and heat transfer in a pipe containing, for a small portion of its volume, a number of spherical solid grains settled on its lower side. The problem of studying heat transfer in pipes, and consequently evaluating the heat transfer coefficient in pipes has been extensively studied [4, 8, 20, 26, 29]; in this work, we want to show how the presence of randomly arranged solid matter affects fluid flow and heat transfer. We compare the results with the analogous “clean” cases where no deposited matter is present. In particular, this section will serve as a proof-of-concept for the methodology we employed for both the generation of the geometry comprising the settled matter (as described in the following paragraphs) and the easiness with which it is possible to explore geometrical parameter space and operating conditions. Then, an overview of the numerical details of the performed simulations, as well as the results obtained, are presented.
Geometry generation
As it has been mentioned, all the geometrical models used in this work were built in-silico, avoiding the costly step of obtaining experimental samples and adapting them for use in CFD codes. Specifically, the case study presented in this section was created with Blender, a free and open-source software used in computer graphics applications, which can be used to perform rigid-body simulations.
The settled matter is represented by uniformly-sized spheres, which were chosen to be of a diameter equal to one-twentieth of the pipe diameter. In the Blender simulation setup, grains are first located above the container (which is now represented by just the bottom half of the pipe, to let the granular matter settle into it), taking care of adding randomness to their initial position in order to avoid unwanted “arranged” structures in the final packing. Then, the solid grains are free to fall due to the effect of gravity, which is the only outside force. The final state of the system is given by the solution of the rigid-body problem, where the solid grains are treated as non-deformable and impenetrable entitiesFootnote 8, and the only interactions considered are instantaneous collisions and sliding. After reaching the final state, identified by the absence of relative motion between all the solid grains and the pipe, the geometric model is exported for its use in the CFD code (substituting the half-pipe with the complete pipe for the simulations). This kind of methodology has been successfully used to represent both packings of catalyst particles in chemical reactors [5, 7] and in digital rock physics applications [19]: the numerical details of the rigid-body simulations can be found therein.
With the process just described, we created three different geometries, each characterised by the (increasing) volume of settled matter, roughly corresponding to an average height, \(H_g\), of the settled matter packings equal to two, three, and four grain diameters respectively. In all cases, the pipe length is equal to three times the pipe diameter. The spatial domain was discretised with a sHM_R strategy. Also, an in-depth description of the use of this mesh generator in the case of random packings and an analysis of mesh convergence for the study of advection-transport problems can be found in our earlier work [18].
Numerical details
The first step, as for the case described in the previous section, has been to solve the equation for the motion of fluid inside the pipe. We thus solved Eqs.(1) and (2) in laminar regime by setting a constant pressure drop between the inlet and the outlet of the domain, corresponding to a Reynolds number Re \(\approx \) 1 (we used again second-order schemes). A snapshot of the velocity contour plot inside the pipe can be found in Fig. 6, together with a representation of the slower fluid streamlines inside the volume occupied by the settled granular matter.
A simulation of heat transfer was then performed solving Eq. (6), setting a constant fluid temperature at inlet, equal to T=293 K , and a zero flux at the outlet. A Dirichlet condition of constant temperature T=343 K was set on the pipe wall, while a zero thermal flux (corresponding to \(\nabla T=0\)) was set on the grains. This choice of boundary conditions is equivalent to assume a situation of perfect thermal equilibrium between the flowing fluid and the solid grains: this is justified in the limiting cases of infinitely fast heat transport in the solid, if one considers the long-time, steady-state, solution of the problem. A snapshot of the contour plots of fluid temperature on the median length-wise section of the pipeFootnote 9 is found in Fig. 7, which shows the amount of solid matter in each case and the slight difference in the thermal boundary layer at the bottom.
In the next section, we will instead explore the problem of pure heat transfer in solids, between a continuous matrix and a disperse solid phase, characterised by two different thermal diffusivity values: these two cases are meant to represent, in a way, two opposite situations in the study of heat transfer in heterogeneous materials.
Heat transfer coefficient
When the steady-state solution of the problem of advection-diffusion has been obtained, the heat fluxes along the main flow direction are extracted in order to calculate the local heat transfer coefficient \(h_{loc}\) [4] evaluated at a number of successive planes orthogonal to the main flow direction (i.e. the pipe axis):
$$\begin{aligned} h_{loc}=\dfrac{q \rho C_p}{\pi D}\dfrac{d T_{bulk}(x)}{d x}\dfrac{1}{T_{wall}-T_{bulk}} \end{aligned}$$
(20)
where q (\(\text {m s}^{-1}\)) is the average flow velocity, \(\rho \) (\(\hbox {kg} \ \hbox {m}^{-3}\)) its density, \(C_p\) (\(\text {J kg}^{-1}\ \hbox {K}^{-1}\)) its specific heat capacity, x (m) the distance of the averaging plane from the inlet boundary, and \(T_{wall}\) and \(T_{bulk}\) (K) respectively the temperature on the wall of the pipe and the local average of the fluid bulk temperature.
The \(h_{loc}\) results for each case are shown in Fig. 8, compared with the heat transfer coefficient of the “clean” pipe devoid of settled matter. As it can be seen, the presence of granular solids at the bottom of the pipe cause two effects. The first is that of reducing the total heat transfer coefficient (and consequently Nusselt number), which is smaller the bigger the volume of settled particles: this is due to the reduction of the contribution of advective heat transport with respect to conductive transport, caused by the much lower fluid velocities in the inter-granular portion of the domain. Then, it can also be noticed that the presence of randomly arranged grains have an effect on the dynamics of reaching an asymptotic regime: while in the “clean” pipe case the heat transfer coefficient reaches a plateau not far from the inlet (as it is expected), for the cases with granular matter it is clear that a decreasing trend is still present even close to the domain outlet.
Heat transfer in heterogeneous materials
In the preceding section, we only considered the effect of the presence of a granular solid on flow and heat transfer in pipes, neglecting the heat transfer between the bulk of the fluid (or the pipe wall) and the grains themselves. In this section, we will instead explore a case where no fluid flow is present, investigating the case of heat transfer between two solid phases with different thermal diffusivities \(\alpha _{1}\) and \(\alpha _{2}\), the first phase constituting a continuous matrix and the second phase dispersed (as solid inclusions) in the first; moreover, the diffusivity in the continuous matrix is anisotropic, having different values for its longitudinal and transversal components.
Extended Jodrey–Tory algorithm (EJT)
For this application, a periodic extension of the classical Jodrey–Tory algorithm [22] has been implemented to deal with randomly oriented ellipsoids. Despite not being computationally optimal for low-porosity (high-density) materials, it can easily generate random packings with a specific porosity and a specific overlapping between grains, as well as clustering. The new algorithm has been implemented in the open-source repository mlmc-porescale[19], and can be sketched as follows:
-
1.
The user specifies a domain size (including periodicity information), a target porosity, the minimum degree of overlapping \(\theta \) (\(\theta <1\) allows overlapping, \(\theta >1\) prescribe a certain distance from grain to grain), a maximum distance between grains \(\varTheta >\theta \) (this is enforced on clusters of \(N_{\varTheta }\) particles), and a maximum limit of particle numbers and displacement iterations. Furthermore, geometrical statistics about the ellipticity of the grains and their size have be to provided. In the simplest (isotropic) case, a single random variable is selected (log-normal, truncated Gaussian or uniform) to describe the ellipses canonical axes length.
-
2.
Random ellipsoids are generated until they reach the desired porosity (not considering overlapping). For each ellipsoid, a random unitary matrix C is sampled [34] according to the axes lengths and orientation statistics. This is then decomposed \(C=C_{1}C_{2}\) into a rigid rotation part \(C_{1}\in SO(3)\) and a diagonal part \(C_{2}\)(responsible for scaling).
-
3.
Once all ellipsoids have been randomly placed in the box, a greedy-type algorithm is executed: at each iteration, the pair-wise distances are generated and the first \(N_{moves}\) pairs, characterised by the largest overlapping ratio, are detached along the line of the pair-wise distance axis. The displacement length controls the convergence properties of the algorithm but its optimal value strongly depends on the porosity of the packing. Usually a relative displacement of 0.2–0.5 times the particle size is chosen.
-
4.
If a maximum distance is specified, the same type of moves are applied to shorten the pair-wise distance. Here, however, this can be only applied to a specific cluster of particles selected as the closest ones.
-
5.
The moves are applied iteratively until all the pair-wise distances satisfy the criteria. Periodicity is ensured by implementing the appropriate toric metric to compute the distances.
It has to be noted that there is not ensured stopping point for the algorithm and a total number of moves of the greedy algorithm described in point 3. is fixed as an upper bound. For a given available volume and number of ellipsoids, in the current implementation of the code, one needs to choose the overlapping layer appropriately and large enough for a packing solution to exist. In the future, however, simple adaptivity could be implemented to override the settings for overlaps or for ellipsoid size, to converge faster to a final arrangement.
An example of 200 touching (\(\theta =1,\,\varTheta =\infty \)) ellipsoids in a periodic arrangement with 0.45 porosity is shown in Fig. 9.
Effective diffusion
The micro-scale heat transfer problem to be solved is Eq. (6) with \(\mathbf {u}=0\) and
$$\begin{aligned} \alpha (\mathbf {x})= {\left\{ \begin{array}{ll} \text{ diag }(0.1, 10, 10) \quad \text{ for }\; \mathbf {x}\in \varOmega _{1}\;,\\ \text{ diag }(1, 1, 1) \quad \qquad \; \text{ for }\; \mathbf {x}\in \varOmega _{2} \end{array}\right. } \end{aligned}$$
Where diag is the diagonal matrix constructed from the vector. This represents the case of a continuous phase made of highly conductive layers (e.g., graphene, therefore with large conductivity in only two directions), reinforced with ellipsoidal inclusions with isotropic conductive properties.
In Fig. 10, the periodic structure (with the same properties of the one in Fig. 9 but with up to a 20% overlapping allowed) is shown with the underlying locally refined mesh (sHM_R). We have shown above that the local refinements destroys the second-order convergence of the numerical schemes. However, due to the discontinuous diffusion coefficient, a second-order convergence would not be possible with our numerical schemes.
To compute the effective (homogenised) diffusion coefficient, one may follow a volume averaging strategy, applying the quasi-periodic BCs in Eq. (10) (results shown in Fig. 11). This is more convenient than solving the homogenisation cell problem where the derivative of the discontinuous conductivity appears as a source term of the equation [17]. The resulting effective diffusion is, in this case:
$$\begin{aligned} \alpha _{eff}=\begin{pmatrix}4.955 &{} \epsilon &{} \epsilon \\ \epsilon &{} 39.86 &{} \epsilon \\ \epsilon &{} \epsilon &{} 38.41\end{pmatrix} \end{aligned}$$
where \(\epsilon \) represents small coefficients \(\approx 10^{-3}\). As it can be seen, the resulting effective diffusion, as expected, is again anisotropic.