<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Engineering of polydisperse porous media for enhanced fluid flows through systematic topology tuning via differentiable direct numerical simulation</title></titleStmt>
			<publicationStmt>
				<publisher>American Physical Society</publisher>
				<date>05/01/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10699745</idno>
					<idno type="doi">10.1103/PhysRevFluids.9.054103</idno>
					<title level='j'>Physical Review Fluids</title>
<idno>2469-990X</idno>
<biblScope unit="volume">9</biblScope>
<biblScope unit="issue">5</biblScope>					

					<author>Mohammed G Alhashim</author><author>Michael P Brenner</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Not Available]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>Flow in porous media is important in various fields, including the design of heat exchangers, filtration systems, and fixed-bed reactors. Throughout the past century, substantial progress has been made in understanding the flow fields generated in these scenarios, aiding in the development of predictive models for dispersion and heat transfer under specific conditions. While a considerable number of theoretical and numerical studies have been dedicated to predicting the flow within porous media with a given topology at different Reynolds numbers for different fluids with different rheological behavior <ref type="bibr">[1]</ref><ref type="bibr">[2]</ref><ref type="bibr">[3]</ref><ref type="bibr">[4]</ref><ref type="bibr">[5]</ref><ref type="bibr">[6]</ref><ref type="bibr">[7]</ref>, limited attempts have been made to systematically tune the topology of the porous media to target a particular flow behavior <ref type="bibr">[8,</ref><ref type="bibr">9]</ref>. In this paper we leverage automatic differentiation to optimize the packing configuration of a bidisperse system comprising periodically arranged circular rods, a classical porous media setup, to maximize the flow rate in the direction of applied pressure gradient. With automatic differentiation, it is possible to directly differentiate through direct numerical simulations of fully resolved flows, allowing for gradient-based optimization of post geometry and arrangement for given Reynolds number flows. Automatic differentiation is extensively used by the machine learning community in deep learning <ref type="bibr">[10]</ref> due to its efficiency in computing gradients of complex loss functions with respect to millions of parameters. With the recent development of open-source packages such as JAX and PYTORCH <ref type="bibr">[11,</ref><ref type="bibr">12]</ref> that streamline the implementation of automatic differentiation for differentiable computer codes, attempts have been made to tackle challenging inverse problems in various scientific fields. For example, Alves et al. <ref type="bibr">[13]</ref> developed an inverse mapping of transient reaction systems. Kochkov et al. <ref type="bibr">[14]</ref> used automatic differentiation to develop a fast yet accurate weather forecasting model by replacing empirical components of a standard general circulation model with neural network models trained on weather data. Another example includes a demonstration of controlling the kinetics of colloidal particle self-assembly <ref type="bibr">[15]</ref>.</p><p>By differentiating over a fully resolved flow around posts in a periodic porous medium, we show that the optimum topology of a structured porous medium depends on the solid packing fraction and approaches a staggered square with a particle diameter ratio of &#8730; 2 -1 as the solid volume fraction reaches a critical value of &#960;/4[1 + ( &#8730; 2 -1) 2 ]. Interestingly, increasing the number of degrees of freedom, by considering a polydisperse system, does not significantly improve the performance. The pressure drop divergence follows a universal scaling, obtainable through lubrication analysis between two pores indicating that complete blockage for a homogeneous porous medium is always driven by a single pore closure along the main flow path. We also find that the optimum topology is independent of the flow's Reynolds number despite the different flow behavior when inertia becomes important <ref type="bibr">[16]</ref>. These results offer insights into the rheology of suspension systems for which the solid particles are assumed to be stationary and the study can be easily extended to consider threedimensional porous media.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. PROBLEM SETUP</head><p>To shed light on the underlying principles that determine the optimum flow path networks in porous media, we consider a pressure-driven flow of an incompressible Newtonian fluid through a periodic structure of a bidisperse assembly of circular cylinders, as depicted in Fig. <ref type="figure">1</ref>(a). In addition to controlling the bidispersity, i.e., the dissimilar cylinders' radius ratio &#955;, we optimize the unit-cell aspect ratio &#958; . By allowing adjustments of the interior cylinder's position, we enable exploring symmetry breaking, expanding the search space of the optimum configuration. The relative position of the interior cylinder is characterized by its distance r from the origin point of the unit cell and its position vector's angle &#952; as shown in Fig. <ref type="figure">1(a)</ref>.</p><p>With this setup of the problem, the optimization process explores various Bravais lattices, including hexagonal, square, triangular, and others. A simple square array is obtained when &#955; = 0 and &#958; = 1, while a hexagonal array is generated when &#955; = 1, &#958; = 1/ &#8730; 3, r = L y , and &#952; = 60 &#8226; , etc. The Reynolds number in this problem is defined as Re M = U D M /&#957;. Here U is the average fluid velocity along the unit cell's x axis. For a fixed solid fraction &#966;, the monodisperse particle diameter is given by D M = L y 2&#958;&#966; &#960; . Finally, &#957; is the kinematic viscosity. The choice of the monodisperse particle diameter to fix the Reynolds number across the different cases does not have an impact on the solution.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. METHOD</head><p>To solve the periodic velocity field past the array, we used JAX-CFD <ref type="bibr">[17]</ref>, which is a differentiable solver of the unsteady Navier-Stokes equations written in JAX <ref type="bibr">[11]</ref>. We modified the solver by incorporating a drag term following the Brinkman penalty method <ref type="bibr">[18,</ref><ref type="bibr">19]</ref> to account for the presence of solid obstacles and a forcing term to account for the macroscopic pressure gradient P over the periodic unit cell <ref type="bibr">[20]</ref>. For optimizing the array parameters, we used an interior-point-based nonlinear programming solver IPOPT <ref type="bibr">[21]</ref>. The Jacobian of the loss function and the constraints which include particle nonoverlapping conditions and fixed average velocity over the unit cell were evaluated using the backward mode of automatic differentiation when the number of degrees of freedom was lower than the number of constraints, while the forward mode was used when the number of constraints was higher. Figure <ref type="figure">1(b)</ref> gives a flowchart of the backward differentiation optimization algorithm.</p><p>Mathematically, the problem is formulated as follows. We aim to minimize the loss function F ,</p><p>subject to the constraint that the fluid velocity satisfies the momentum balance and the continuity equations such that</p><p>along with the initial and periodic boundary conditions, which are given by &#361;i (x i , 0) = 0 and &#361;i (x i , t ) = &#361;i (x i + L i , t ). Here &#361;1 is the periodic velocity profile in the flow direction; X k i and R k are the coordinates of the centers and radii of particles k; &#961; and &#181; are the fluid's density and viscosity, respectively; H (x) is the Heaviside function; and N is the number of particles in the unit cell. The parameter &#946; controls the permeability of the solid obstacles where &#946; = &#181;/K p , and as K p &#8594; 0, one retrieves impermeable solid obstacles. The last term in Eq. ( <ref type="formula">2</ref>) enforces the no-slip boundary condition at the surface of the obstacles.</p><p>Further constraints in the problem include fixing the Reynolds number. That is done by imposing a constraint to keep the average velocity U through the porous medium constant throughout the optimization iterations</p><p>Here T is the final time and it is set large enough for the velocity profile to reach steady state, L x is the unit-cell dimension along the x axis, and &#958; is the unit-cell aspect ratio. Moreover, we demand that the particles defining the porous medium do not overlap by enforcing the following constraints:</p><p>This setup is a classical constrained nonlinear optimal control problem where the trajectory of the fluid velocity is optimized. Equation ( <ref type="formula">1</ref>) is the loss function, which is equal to the pressure drop across the unit cell, P. Equation ( <ref type="formula">4</ref>) is an equality constraint that fixes the flow's Reynolds number. Equation ( <ref type="formula">5</ref>) is an inequality constraint that ensures no overlap between particles k and m, where FIG. <ref type="figure">2</ref>. Permeability of a periodic square lattice, i.e., &#958; = 1, for different solid packing fractions. The squares represent results obtained by Edwards et al. <ref type="bibr">[5]</ref> for Re = 0 while the circles are results obtained from the differentiable solver for Re p / &#8730; &#966; = 6.4&#215;10 -2 , where Re p = &#961;L 3</p><p>x P &#181; 2 . The orange line is an empirical formula generated by fitting the data of Edwards et al. To generate the simulation results, &#946; was set to 2&#215;10 5  and w = 1.5&#215;10 -5 .</p><p>&#8226; is the Euclidean norm. To ensure stability of the numerical solver, we replace the Heaviside function with a logistic function of the form f</p><p>The value of w controls the width of the transition region and it can be interpreted physically as half the thickness of a porous shell around the obstacle.</p><p>We validate the model by comparing the scaled permeability, i.e., U &#181;&#958; 2 / PL 2 x , for a square lattice with results obtained by Edwards et al. <ref type="bibr">[5]</ref> as shown in Fig. <ref type="figure">2</ref>. Since the fluid velocity is not known a priori, calculations were carried out for Re p / &#8730; &#966; = 6.4&#215;10 -2 , where Re p =</p><p>is the Reynolds number based on the applied pressure gradient over the unit cell. For all values of &#966;, the Reynolds number based on the particle diameter is much smaller than 1, ensuring that the flow is in the Stokes regime. In such simulations, the values of &#946; and w were set to 2&#215;10 5 and 1.5&#215;10 -5 , respectively. These values ensure a sharp logistic function that approaches a Heaviside function and ensures enforcement of the no-slip boundary conditions at the surface of the particles. We found that a time step of 4&#215;10 -6 is needed for numerical stability. The time at which the mean velocity was calculated is equal to 1.92, at which steady state is reached.</p><p>We found that values of w = 0.0015 and &#946; = 2&#215;10 4 are needed to obtain a smooth gradient of the loss function; beyond such values the gradient explodes. Under such conditions, the effective particle diameter is slightly increased as the logistic function becomes smooth. Moreover, the time at which the loss function was evaluated was set to T = 0.8, at which the steady-state conditions begins. To ensure that such approximations do not affect the optimum solutions, we conducted a thorough comparison of the loss function landscape. Specifically, we examined the landscape in relation to the particle diameter ratio for a bidisperse staggered square lattice with &#958; = 1 and &#966; = 0.76. This involved using the approximations and comparing the outcomes with those obtained using parameters chosen to replicate data from <ref type="bibr">[5]</ref>. Figure <ref type="figure">3</ref> shows a comparison between the loss function landscape for the case where the periodic porous medium is a bidisperse staggered square for different values of particle diameter ratio for the case for different values of the tunable parameters &#946; and w. As shown in the figure, there is a slight shift in the location of the optimum value of &#955; that minimizes the loss function. This gave us the confidence that the obtained optimum results are close to what would be found with alternative methods that enforce the no-slip boundary conditions in an exact way. Finally, we note that our use of the logistic function for smoothing effectively increases the value of the particle radius to R + 2w, which was used as an effective diameter in later theoretical calculations, as will be discussed in the following section. FIG. <ref type="figure">3</ref>. Loss function for different particle diameter ratio &#955; for the case where the periodic porous medium forms a staggered square. The blue line represents the case of the tuning parameters of the logistic function and the final time at which the loss function is evaluated. The orange line was generated using the tunable parameters used to reproduce the permeability of a square lattice that was compared with the data of Edwards et al. in Fig. <ref type="figure">2</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. RESULTS</head><p>The green triangles in Fig. <ref type="figure">4</ref>(a) show the minimum pressure drop (for Re M = 10&#215;10 -4 in the Stokes flow regime) of the described lattice for different solid volume fractions. To elucidate the effects of the packing fraction on the emergence of a distinct optimum arrangement of posts, the figure also includes the minimum pressure drop for special cases where fourfold symmetry is preserved and/or the unit-cell aspect ratio is fixed. Figure <ref type="figure">4(b)</ref> shows the optimum value of the lattice parameters &#955; * , &#958; * , r * , and &#952; * as a function of solid volume fraction. The results demonstrate four distinct array topologies for different packing regimes. (I) For extremely dilute porous media, i.e., &#966; &lt; 0.1, the pressure drop is a function of the solid volume fraction and is independent of the arrangement of the cylinders. This is evident by the convergence of the pressure drop of the optimum topology (green triangles) and the pressure drop curve of a simple square array (red dash-dotted curve) and is consistent with the analysis of Sangani and Acrivos <ref type="bibr">[6]</ref>. (II) In the low-packing regime 0.1 &#966; 0.2, forming channels of tightly packed monodisperse particles, i.e., a rectangular array, yields the minimum pressure drop. (III) As the solid volume fraction exceeds 0.2, the optimum structure maintains the formation of a straight channel but with an interior restriction by positioning the interior cylinder in between the corner cylinders as shown in Fig. <ref type="figure">4(b)</ref>. (IV) As the value of &#966; is further increased, the topology of the optimum array asymptotically approaches a bidisperse staggered square with a particle-size ratio of &#8730; 2 -1. This configuration corresponds to the maximum packing of &#960;/4[1 + ( &#8730; 2 -1) 2 ]. Beyond the extremely dilute limit, the pressure drop across the unit cell is affected by the tortuosity of the flow path line as well as the width of the thin gap between the corner cylinders of the unit cell. For regime II (0.1 &#966; 0.2), the optimal configuration forms a straight channel by placing the interior cylinder at angle &#952; = 0 with respect to the lattice's x direction. This configuration in fact corresponds to a rectangular lattice. The channel's width in this case is given by L y (1 -2 &#966;&#958; &#960; (1+&#955; 2 ) ). The constraint of nonoverlapping particles imposes a condition that the sum of the particles' diameters is smaller than or equal to the unit cell's width L x . This leads to the inequality constraint where &#958; 2(1 + &#955;) &#966;&#958; &#960; (1+&#955; 2 ) . Considering these restrictions, the optimum lattice parameters that maximize the gap thickness are &#958; * = 8&#966;/&#960; for &#955; * = 1 and &#958; * = 4&#966;/&#960; for &#955; * = 0. Both solutions correspond to a rectangular lattice array with the same gap thickness of L y (1 -4&#966;/&#960; ). The black dash-dotted line in Fig. <ref type="figure">4(b)</ref> shows a comparison between the optimum unit-cell aspect ratio and the theoretical prediction in the second regime.</p><p>As the solid volume fraction increases further, i.e., &#966; &gt; 0.2, maintaining a straight channel significantly reduces its width and consequently increases the pressure drop as shown by the divergence of the cyan dash-double-dotted curve in Fig. <ref type="figure">4(a)</ref>, which corresponds to the minimum pressure drop for a rectangular lattice. To counteract this effect and increase the channel width, we must position the interior cylinder at an angle relative to the reference particle. This introduces a flow restriction in the middle of the channel. Thus, the optimum particle-size ratio requires optimizing the pressure drop through both restrictions. By observation, the optimum position of the interior cylinder is found to be given by r * = L y (1</p><p>) in which the interior cylinder is positioned in between the corner cylinders, which ensures a minimum interior flow restriction for a given particle-size ratio and unit-cell aspect ratio.</p><p>As the solid volume fraction approaches the maximum packing fraction, the minimum number of flow restrictions (pores) is achieved when the interior cylinder is positioned between two horizontally aligned corner cylinders. Increasing the particle-size ratio decreases the gap thickness between the corner cylinders while wider pores are formed between the interior cylinder and the corner cylinders. Thus, the optimum value of the particle-size ratio ensures a minimum total pressure drop through all gaps. To quantify this, we assume lubrication theory holds within the formed pores and the interior cylinder's diameter is much smaller than that of the corner cylinders. Symmetry then implies that the total pressure drop across a unit cell is approximated by P&#958;/ U &#181; &#8764; l 1 /h 3  1</p><p>FIG. <ref type="figure">5</ref>. Minimum pressure drop of optimized bidisperse porous media for different number density ratios. The green up-pointing triangles, red down-pointing triangles, black diamonds, and blue stars correspond to n 1 /n 2 = 1, 2, 3, and 4, respectively. The optimum porous medium is visualized at &#966; = 0.84 for (i)</p><p>Here R = L y &#958;&#966;/&#960; (1 + &#955; 2 ) and the nonoverlapping constraint demands that h 2 &gt; 0. Thus the optimum values of the particle-size ratio &#955; * and the unit-cell aspect ratio &#958; * are obtained by solving an optimization problem to minimize the approximated total pressure drop across the unit cell. The black dash-dotted curves in Fig. <ref type="figure">4</ref>(b) show a comparison between the theory and the numerical results obtained from the optimization of the full flow problem. As the solid volume fraction is increased, the particle radius ratio, optimum unit-cell ratio, particle's relative position distance, and angle approach &#8730; 2 -1, 1, &#8730; 2, and &#960;/4, respectively. Interestingly, the optimum solution is independent of the flow Reynolds number Re M for moderate Reynolds numbers, indicating that flow recirculation which appears as the fluid inertia becomes important has no effect on determining the optimum flow channel topology. Figure <ref type="figure">S2</ref> in the Supplemental Material <ref type="bibr">[22]</ref> shows a comparison of the optimum lattice parameters for Re M / &#8730; &#966; = 43.0 and the results obtained in Stokes flow regime.</p><p>We further extended the problem to consider a variable number density ratio between the interior cylinders and the corner cylinders [dark blue and light blue cylinders in Fig. <ref type="figure">1(a)</ref>, respectively]. Using automatic differentiation, this is a straightforward modification that does not increase the computational cost. Here the optimum radius of the interior cylinders is equal to R(1 + &#955; * ), where R = L y &#958; * &#966;/&#960; (1 + &#955; * 2 ) and their relative positions are different and are given by r * i and &#952; i for cylinder i. Figure <ref type="figure">5</ref> shows the minimum pressure drop for various number density ratios n 1 /n 2 , where n 1 and n 2 are the number densities of the interior cylinders and the corner cylinders, respectively. Interestingly, we find that having two or three interior particles performs worse than a single-particle system at high packing fraction with the three-particle system performing better than the two-particle one. Recall that the optimum solution depends on how best to place the interior particles such that the effects of flow restrictions formed by all particles on the macroscopic pressure drop are minimized. Since we are constraining the interior cylinders to have identical diameters, increasing the number of particles does not always translate to having better flexibility in decreasing the pressure drop. Having two interior particles maximizing the gap thickness between the light blue particles by reducing the particle diameter ratio, the flow restriction between the interior particles increases, causing a high-pressure drop as shown in Fig. <ref type="figure">5</ref>(ii). Such limitations do</p><p>FIG. <ref type="figure">6</ref>. Minimum pressure drop of the optimized polydisperse porous medium for different total numbers of distinct cylinders. The green up-pointing triangles, black squares, blue left-pointing triangles, and purple stars correspond to the cases where N = 2, 3, 4, and 5, respectively. The optimum porous medium is visualized at &#966; = 0.72 for (i) N = 2, (ii) N = 3, and (iii) N = 4. not exist for the case of one interior particle allowing for a lower-pressure drop when compared with the two-interior-particle system. The same argument can be built on the four-particle system which had the lowest-pressure drop. Inspecting the geometry of the cluster formed in this case, we see the four particles form a square region positioned at the center of the unit cell, indicating that using a single cylinder with a square cross-sectional area with rounded edges could perform better than a circular cross-sectional cylinder.</p><p>By allowing the radius of interior cylinders to be independent, that is, the optimum radius of cylinder i is given by R&#955; i , where R = L y &#958;&#966;/&#960; (1 + N-1 i=1 &#955; 2 i ) and N is the total number of distinct cylinders, we optimized the topology of a polydisperse periodic array of cylinders. Figure <ref type="figure">6</ref>  polydisperse system performs similarly to the bidisperse system with an equal particle number density, indicating that the increase in the number of control parameters has no effect on the performance of the porous media. Finally, we note that all optimized topologies obey the same universal scaling for the divergence of the pressure drop that, as shown in Fig. <ref type="figure">7</ref>, we would obtain from lubrication theory for a simple square array where P &#8764; ( &#8730; &#966; c -&#8730; &#966;) 5/2 , indicating that full blockage of the flow occurs when the gap thickness between the corner cylinders approaches zero. Here &#966; c is the critical solid packing fraction beyond which there exists no flow path. This result also implies that the divergence of the fluid's viscosity of a dense suspension is independent of the suspension system's polydispersity or the microstructure.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. CONCLUSION</head><p>The employment of deep learning for understanding complex physical processes has led to a proliferation of inverse design studies that revolve around generating a surrogate model for a specific system. This model was trained on high-fidelity simulations and subsequently used in optimization calculations <ref type="bibr">[23]</ref><ref type="bibr">[24]</ref><ref type="bibr">[25]</ref>. In this study we challenge the conventional wisdom that leans towards surrogate models, showcasing the efficacy of a more streamlined approach empowered by platforms like JAX and PYTORCH. We showed that automatic differentiation, which is the key algorithm enabling the development of advanced surrogate models, can be directly used to efficiently compute the derivative of solution trajectories of partial differential equations with respect to control parameters.</p><p>In this paper we demonstrated the power of the method by solving a canonical problem that is complex enough to test the scalability of the technique to solve high-dimensional optimization problems and is amenable to theoretical treatment. Through this method, we showcased the simplicity of expanding the search space by increasing the number of design parameters without the need to develop a new solver, as necessitated by adjoint-based methods, or create a new surrogate model. A key advantage of our approach is the minimal impact on the computational cost of computing Jacobian elements when increasing the number of design parameters or the introduction of additional constraints. This feature facilitates the exploration of different setups, allowing for the discovery of practical solutions or the identification of new physical phenomena. Figure <ref type="figure">S1</ref> in <ref type="bibr">[22]</ref> presents computational costs for various scenarios, where the number of Jacobian elements approaches 1000. Notably, the computational cost of the derivative remains within the same order of magnitude as the computational cost of a forward simulation. This underscores the efficiency and practicality of our method in handling complex optimization tasks.</p><p>By studying the optimum configuration of a periodic array of cylindrical posts for various packing fractions, we found that the bidisperse system with equal particle number density provides an optimum configuration. Importantly, increasing polydispersity does not significantly minimize the pressure drop, and the optimum configuration remains independent of the Reynolds number. This implies that a simpler design with only two particle sizes may be just as effective in minimizing the pressure drop as more complex configurations. This insight can lead to more efficient and cost-effective designs in various engineering applications. Moreover, the universality of the pressure drop divergence holds true regardless of the porous medium configuration.</p><p>While our present study has focused on two-dimensional flow, the versatility of our method allows for seamless extension to three-dimensional systems. Possible future directions include controlling oscillating flows, the implementation of control strategies for flows in random porous media, and the optimization of mixing and dispersion within porous structures. Additionally, controlling multiphase flow in porous media holds promise for gaining a deeper understanding of intricate phenomena like viscous fingering.</p></div></body>
		</text>
</TEI>
