WorksComputer Science
Intelligent Optimization of Multi-Parameter Micromixers Using a Scientific Machine Learning Framework
Abstract
Multidimensional optimization has consistently been a critical challenge in engineering. However, traditional simulation-based optimization methods have long been plagued by significant limitations: they are typically capable of optimizing only a single problem at a time and require substantial computational time for meshing and numerical simulation. This paper introduces a novel framework leveraging cutting-edge Scientific Machine Learning (Sci-ML) methodologies to overcome these inherent drawbacks of conventional approaches. The proposed method provides instantaneous solutions to a spectrum of complex, multidimensional optimization problems. A micromixer case study is employed to demonstrate this methodology. An agent, operating on a Deep Reinforcement Learning (DRL) architecture, serves as the optimizer to explore the relationships between key problem parameters. This optimizer interacts with an environment constituted by a parametric Physics-Informed Neural Network (PINN), which responds to the agent's actions at a significantly higher speed than traditional numerical methods. The agent's objective, conditioned on the Schmidt number is to discover the optimal geometric and physical parameters that maximize the micromixer's efficiency. After training the agent across a wide range of Schmidt numbers, we analyzed the resulting optimal designs. Across this entire spectrum, the achieved efficiency was consistently greater than the baseline, normalized value. The maximum efficiency occurred at a Schmidt number of 13.3, demonstrating an improvement of approximately 32%. Finally, a comparative analysis with a Genetic Algorithm was conducted under equivalent conditions to underscore the advantages of the proposed method.
Introduction
Recently, the use of micromixers in various microfluidic applications has attracted considerable attention from researchers [1]. These systems, due to their compact size, fast response time, and low cost, are ideal candidates for lab-on-a-chip studies [2]. Generally, micromixers are categorized into two main types: active and passive [3]. Active micromixers promote fluid mixing by utilizing external energy sources such as electric, magnetic, or ultrasonic fields [4, 5]. However, the requirement for external energy and the associated high costs limit the practical applications of active methods [6]. In contrast, passive micromixers rely solely on carefully designed channel geometries to disrupt the fluid flow and enhance mixing efficiency [7]. Given the low fluid flow velocities at the microscale, mixing processes occur slowly, which has driven researchers to continuously seek effective strategies for improving mixing performance [8].
One of the important passive methods in micromixer applications is the use of baffles within the microchannel. These internal structures disturb the flow behavior and generate vortices, thereby enhancing fluid mixing and increasing key performance indicators such as the Mixing Index (MI) and Mixing Efficiency (ME) [9, 10]. The integration of baffles with various shapes in both two-dimensional and three-dimensional microchannels has been a focus of recent studies [11, 12]. Three-dimensional investigations of this concept have been conducted by researchers such as Afzal and Kim [13], and Chen and Zhao [14], while Chen and Lv [15] explored the effects of the ratio between three geometric parameters of the micromixer in 3D microchannels containing internal baffles. Due to the complexity and high computational cost associated with simulating three-dimensional micromixers, many researchers have turned to two-dimensional analyses as an efficient alternative for studying the mixing behavior in such systems [16, 17, 18]. Various experimental and numerical methods have been employed by researchers to study the phenomenon of fluid mixing [19, 20].
In addition to traditional approaches, recent studies have increasingly focused on the use of Artificial Intelligence (AI) and Machine Learning (ML) techniques to predict fluid behavior [21]. Despite recent advancements in AI and data-driven modeling, the limited availability of experimental data and the relatively low accuracy of numerical methods in capturing all possible flow conditions have posed significant challenges [22]. To address these limitations, a new class of approaches known as Scientific Machine Learning (SciML) has emerged [23]. SciML aims to integrate existing data with physical knowledge of the system to simulate and predict complex fluid flow behavior. One of the key developments in this field has been introduced by Raissi et al. [24] under the framework of Physics-Informed Neural Networks (PINNs). This method combines the strengths of AI—particularly deep neural networks—with the governing equations and boundary conditions of the physical system. Remarkably, PINNs have demonstrated the ability to predict fluid behavior even in the absence of training data, relying solely on the embedded physics of the problem [25].
In recent years, researchers have utilized the PINN method to investigate fluid flow behavior across various engineering applications [26, 27, 28]. Specifically, in the field of fluid mixing and mass transfer, limited studies have been conducted, such as the work by Kou et al. [29], who investigated the integration of the mass transfer equation in mixing phenomena. The fluid concentration distribution was predicted in addition to a limited amount of experimental data. Additionally, Hassanzadeh et al. [30] studied a three-dimensional micromixer equipped with baffles of various shapes and configurations under different Reynolds numbers. The adopted flexible network architecture successfully handled the problem's complexity, yielding accurate and reliable predictions of flow behavior. Owing to the multitude of physical and geometric parameters characterizing the problem, parametric investigation using PINNs has been adopted by researchers. In the realm of parametric modeling using PINN, Beltrán-Pulido et al. [31] examined two-dimensional electro-magnetic flow problems. Various magnetic field parameters were introduced as network inputs, enabling the model to predict flow behavior under different physical conditions. The results indicate a maximum absolute error of 2.2%. In another study, Arthurs and King [32] treated the geometry as a parametric input to the neural network, applying this approach to channel walls of varying shapes. The simulation was conducted parametrically to capture the effect of geometric variations. Furthermore, Ghaderi et al. [33] investigated fluid flow within channels with various radius of obstruction under magnetic fields, incorporating multiple geometric and physical parameters as inputs to the learning process. This enabled the model to generalize effectively across different scenarios. Parametric modeling has also attracted attention in other applications such as high Reynolds number flows [34], turbulent flow simulations [35], and combustion problems [36], demonstrating its broad utility in complex fluid dynamics challenges.
Parametric studies using the PINN method are often employed in optimization problems, as a single solution of the problem enables prediction of the output for various network input values. This capability can significantly accelerate the solution process in optimization tasks [37, 38]. For example, Sun et al. [39] employed a parametric solution for the flow around an airfoil to determine the optimal angle of attack. The optimization algorithm used during the network training phase of the PINN method was also applied to optimize the angle of attack at the network input stage. In another study, Priyadarshi et al. [40] incorporated the physics of the problem into the network inputs and performed the optimization after completing the PINN process, using the data obtained from the trained network. Owing to the solutions provided by the PINN method, the optimization stage could be conducted on the resulting dataset in a short computational time. Recently, the use of advanced machine learning algorithms—such as Reinforcement Learning (RL)—has garnered attention in optimization [41, 42]. In RL, the goal is to optimize a target parameter through interaction with the environment and a trial-and-error process, adapting to changes in other parameters [43]. While the application of RL in PINN-based learning processes has been investigated by Banerjee et al. [44], to the best of our knowledge, its use for optimization within the PINN framework has not yet been reported in the literature.
Based on the points mentioned above, no study to date has utilized RL to optimize solutions obtained from parametric studies conducted via PINNs. This study employs a Generalized Deep Reinforcement Learning (GDRL) framework for optimization. The primary objective is to develop a model that does not require retraining for different physical conditions, such as varying Schmidt or Reynolds numbers. The key advantage of this method is its generalizability across a wide range of physical problems. Unlike traditional optimization techniques, which are typically limited to finding an optimal solution for a single specific problem, the proposed GDRL model, once trained, can instantly provide optimal solutions for a broad spectrum of physical scenarios. To evaluate the method's performance, a two-dimensional micromixer was selected as a case study. This problem is particularly suitable for demonstrating the method's capability in high-dimensional optimization, as it simultaneously depends on both geometric and physical parameters. The system is simulated using a parametrically trained PINN. The use of a PINN enables the concurrent execution of a large number of simulations without the need for retesting, thereby allowing for a more accurate and efficient comparison of different optimization strategies. Within this framework, the PINN model serves as the DRL environment, facilitating action deployment and feedback collection at a significantly higher speed than conventional numerical methods.
Problem Description
The geometry of the problem is illustrated in Figure 1. The shaded region represents the various possible configurations that may arise in the problem. Considering the parametric solution for different geometries, several sample spline profiles are presented in figure. Furthermore, a summary of the geometric dimensions is provided in Table 1.

Figure 1. Schematic of the problem geometry and sample Spline profiles.
| Notation | Definition | Value |
| The Length of the microchannel | 2.1 mm | |
| First Spline inlet distance | 0.9 mm | |
| The length of the inlet of the microchannel | 1.3 mm | |
| The height of the microchannel | 0.3 mm | |
| The width of the microchannel inlet | 0.3 mm | |
| Distance between two consecutive Spline | 0.15 mm | |
| Allowable height deviation for Spline | 0.3 mm | |
| Allowable length deviation for Spline | 0.15 mm |
Table 1. Geometric specifications of the microchannel.
The fluid flow enters the channel from the top and bottom, and the mixing phenomenon within the channel is investigated. The governing equations of the problem are expressed in vector form as Equations under the assumptions of incompressible and steady-state flow in two dimensions (1-3) [30].
The governing equations—comprising the continuity, momentum, and mass transfer equations—involve first and second-order spatial derivatives. To streamline the solution process, these equations are reformulated into first-order derivatives [30]. This approach ensures that back propagation in the neural network is performed only once, enhancing computational efficiency. Accordingly, in this study, the equations are expressed in terms of lower-order, dimensionless derivatives, as detailed in Equations (4)–(12) in Cartesian coordinates. Furthermore, to improve solution accuracy, the dimensionless form of the equations is employed [30], which helps balance the terms in the loss function. Specifically, Equation (4) describes the continuity equation, Equations (5)–(6) represent the momentum equations in two spatial directions, and Equation (10) governs mass transfer. The remaining equations are constitutive relations that support the conservation equations. These equations are simplified into their dimensionless form, given by Equations (4)-(12) [30]. In these relations, is the velocity vector, and are the dimensionless velocity components in the and directions, correspondingly. Additionally, , , and represent the dimensionless pressure, dimensionless stress, and dimensionless concentration, respectively. Moreover, , , , and are the density, viscosity, diffusion coefficient of concentration, and the mean velocity of the fluid in the main channel, respectively. In these relations, is the dimensionless concentration flux, and the Reynolds and Schmidt numbers are defined in equations (13) and (14) [30].
The above equations, along with the boundary conditions governing the mixing problem (as illustrated in Figure 2), are applied to the problem. As illustrated in the figure, a parabolic velocity profile is prescribed at the inlet, while different concentration boundary conditions are applied along the upper and lower channel inlets. Moreover, a no-slip boundary condition is imposed on all channel walls, including those defined by splines that act as baffles. Due to the geometric complexity of the spline-based walls, enforcing the zero mass flux boundary condition on these surfaces presents a significant challenge. One of the key contributions of this study lies in the high flexibility of the proposed method in handling such complex boundary conditions. For details on the spline formulation and its normal vectors, see Supplementary § 1. The implementation is available in the GitHub repository.

Figure 2. The boundary conditions of the problem.
Solution Methodology
This study introduces a framework that integrates a parametric Physics-Informed Neural Network (FlexPINN) with a Reinforcement Learning (RL) optimizer to automate the design of micromixers. The overall process, illustrated in Figure 3, consists of two main components: a pre-trained simulation environment and an RL-based design agent.

Figure 3. The architecture employed in this study.
The FlexPINN as a Simulation Environment
A FlexPINN model, extending the work of Hassanzadeh et al. [30], serves as the digital environment. This network takes spatial coordinates , physical parameters (Schmidt number, Reynolds number), and geometric parameters (spline shape) as inputs and outputs the resulting flow and concentration fields. By embedding the physics directly into the neural network's loss function, it acts as a fast and differentiable simulator, replacing computationally expensive numerical solvers. The complete implementation of the FlexPINN architecture and its training code are available in this work's GitHub repository.
Reinforcement Learning for Design Optimization
The core of the design automation is a Proximal Policy Optimization (PPO) agent [45], which learns to propose optimal designs through iterative interaction with the FlexPINN environment.
State (s): The Schmidt number (Sc), representing the fluid properties.
Action (a): A four-dimensional vector comprising the Reynolds number () and three parameters defining the mixer's spline geometry.
Reward (r): The Mixing Efficiency (ME), calculated from the FlexPINN-predicted concentration field according to Eq. (15) [30]. This reward incentivizes the agent to find designs that maximize mixing performance.
The agent's objective is to learn a policy () that maps any given Schmidt number to the optimal set of physical and geometric parameters. The training involves a continuous loop: the agent proposes a design (action), the FlexPINN environment evaluates it and returns a mixing efficiency (reward), and the agent updates its policy to favor higher-rewarding actions (Algorithm 1).
Training and Implementation
The PPO algorithm ensures stable learning through an actor-critic architecture and a clipped objective function. The actor network proposes actions, while the critic network evaluates the expected cumulative reward. The policy is updated by maximizing the objective , where is the probability ratio between new and old policies, is the advantage function estimated by the critic, and is a clipping parameter that prevents overly large policy updates. For full algorithmic details, see Supplementary § 2.
Algorithm 1 PPO for PINN-Based Mixing Optimization
Initialize:
Actor , Critic networks
Action bounds: ,
Hyperparameters: , ,
for episode to do
Sample batch:
Actor Forward Pass:
Scale actions to physical bounds
PINN Evaluation:
for each pair do
Generate mesh points for PINN
▷ Concentration
▷ Pressure
end for
PPO Update:
Normalize advantages
for to do
Update using
end for
end for
To perform the simulations using the proposed method, the point distribution within the computational domain was generated via the Latin Hypercube Sampling (LHS) technique [46], as illustrated in Figure 4. Due to the parametric definition of the spline geometries in this study, certain points within these regions overlap in the figure. Furthermore, as outlined in the FlexPINN methodology, additional points were incorporated to account for the penalty term during the solution process. The source codes for geometry generation and the proposed solution method are provided at the following GitHub repository.

Figure 4. Point distributions generated using Latin Hypercube Sampling (LHS). (Note: The orange slices indicate regions where a constant mass flow rate was enforced as a penalty term in the FlexPINN method [30]).
Results and Discussion
The results derived from the described methodology are presented and discussed in this section. Figure 5 depicts the distributions of non-dimensional velocity, pressure, concentration, and the corresponding streamlines inside the channel. The investigation covered the following parameter ranges: Reynolds number, 5 to 40; Schmidt number, 1 to 100; and spline parameters, -0.5 to 0.5. Given the extensive parameter space defined by these geometric and physical variables, a randomized sampling approach was employed to select specific values for analysis. These results serve to confirm that the proposed algorithm produces physically realistic solutions.

Figure 5.

Figure 5 (PDF p. 13). Contours of dimensionless velocity, pressure, and concentration (from left to right). a) , , , , . b) , , , , . c) , , , , . d) , , , , . e) , , , , .
Validation
The validation of the results was conducted by comparing the mixing efficiency, which serves as the key performance indicator in this analysis, with the findings reported by [47]. Their investigation, which employed a hybrid experimental-numerical approach, examined a range of channel and baffle geometries. From their study, two specific cases with geometries most analogous to the one used in the current research were chosen for comparison. Figure 6 demonstrates that the proposed method achieves excellent agreement, predicting the mixing efficiency with a maximum relative error under 4%. Additionally, it should be noted that in this figure (Figure 6a), the term "" refers to the baseline case of a channel without a baffle.
(a)
(b)
Figure 6. Comparison with the benchmark results of Shi et al. [47] for model validation: (a) channel without a baffle, (b) channel with a baffle.
The influence of parameters on the Mixing Efficiency (ME)
This section investigates the influence of various physical and geometric parameters on mixing efficiency using the proposed methodology. Initially, a channel without baffle (where all spline parameters are set to zero) is considered. The effects of the Reynolds and Schmidt numbers on the baseline mixing efficiency (denoted as ) are presented in Figure 7a. The value of is subsequently used to normalize mixing efficiency values in all other studied cases. As illustrated in the figure, the mixing efficiency in the channel without baffle increases with a decrease in both the Reynolds number and the Schmidt number. This behavior can be attributed to two primary factors. First, in the absence of a baffle, an increase in the Reynolds number leads to a significant pressure drop within the channel. The detrimental effect of this pressure loss on the flow regime outweighs its potential benefit for enhancing mass transfer, resulting in a net reduction of mixing efficiency. Second, an increase in the Schmidt number signifies a reduction in the relative importance of molecular diffusion, consequently, the mixing between the two fluids is diminished [48]. Although fluid advection may be enhanced at higher Reynolds numbers, the absence of a baffle means there is no mechanism present to capitalize on this by disrupting the flow and actively promoting mixing [49].
Figure 7. Influence of geometric and physical parameters on mixing efficiency. (a) Variation of the baseline mixing efficiency () with Reynolds and Schmidt numbers. (b) Variation of mixing efficiency with Reynolds number and spline parameters at a Schmidt number of 1. (c) Variation of mixing efficiency with Reynolds number and spline parameters at a Schmidt
Moreover, in this work, the Schmidt number is treated as a core parameter, with other parameters analyzed relative to its influence. Accordingly, the Schmidt number is held constant at values of 1, 10, and 100 in Figure 7b, Figure 7c, and Figure 7d, respectively. These figures illustrate the combined effects of the Reynolds number and spline parameters on mixing efficiency under each condition. Figure 7b corresponds to a Schmidt number regime where molecular diffusion is dominant. Consistent with the trend observed in Figure 7a, the relative mixing efficiency in this regime decreases with an increasing Reynolds number. Furthermore, the results indicate that baffle configurations positioned externally and exhibiting symmetry yield superior performance compared to those that are internally positioned and asymmetric. This behavior can be interpreted as evidence that, under these conditions, the system's performance is more significantly influenced by pressure drop than by mass transfer enhancement. Consequently, the pressure loss plays a more dominant role in determining the mixing efficiency.
Figure 7c, corresponding to a Schmidt number of 10, reveals a non-monotonic trend in the relative mixing efficiency. For all baffle configurations, the efficiency initially decreases with increasing Reynolds number up to a certain threshold, beyond which a consistent increase is observed. This trend can be attributed to a transition in the dominant mixing mechanism. At intermediate Reynolds numbers, molecular diffusion does not have sufficient time to act, while advective transport is not yet strong enough to enhance mixing; consequently, the overall mixing efficiency decreases. In transitional Schmidt number regimes, the interplay between molecular diffusion and Reynolds-dependent convection leads to non-intuitive variations in mixing performance, such that the optimal condition occurs not at low or high Reynolds numbers, but near one of these extremes. At lower Reynolds numbers, molecular diffusion is the predominant factor. Beyond a critical Reynolds number, the influence of convective transport becomes more pronounced, with its effectiveness varying significantly based on the specific baffle geometry. This indicates that a Schmidt number of 10 lies within a transitional regime where the contributions of molecular diffusion and convective transport are comparable, leading to the distinct behavioral differences observed between internally and externally positioned baffles. Specifically, in the diffusion-dominated regime, the external baffles demonstrate superior performance, whereas the internal baffles exhibit better mixing efficiency when convective transport becomes the dominant mechanism. Furthermore, consistent with the other cases, the described behavior shows negligible dependence on the symmetry or asymmetry of the external baffles.
Figure 7d, corresponding to a Schmidt number of 100, demonstrates a consistent increase in relative mixing efficiency with the Reynolds number across all configurations. This trend is attributed to the dominant role of convective mass transfer over molecular diffusion at high Schmidt numbers. Under these conditions, an increase in the Reynolds number directly enhances the convective transport of concentration, thereby improving mixing efficiency. Furthermore, the results indicate that at low Reynolds numbers, the pressure drop has a more pronounced effect than mass transfer. Consequently, the presence of internal baffles in this regime does not lead to significant performance improvement. However, as the Reynolds number increases and convective effects intensify, the internal baffles induce a superior enhancement in mass transfer, resulting in a higher mixing efficiency compared to external baffles. Additionally, at high Reynolds numbers, the asymmetric internal baffles outperform their symmetric counterparts. This superior performance suggests that the gain in mass transfer achieved by the asymmetric geometry outweighs the associated increase in pressure drop.
(a)
(b)
Figure 12 (PDF p. 17).
number of 10. (d) Variation of mixing efficiency with Reynolds number and spline parameters at a Schmidt number of 100.
Optimization
This section presents the optimization of the objective function, mixing efficiency, with respect to the physical and geometric parameters discussed in the previous section. Figure 8 illustrates the progression of the reward as a function of the epoch during the optimization process conducted via the Deep Reinforcement Learning (Deep RL) method. As the figure indicates, the fluctuations in the reward diminish over time, demonstrating the algorithm's successful convergence towards an optimal answer. In the figure, the "smoothed" curve represents the moving average of the reward, calculated over a window of 50 episodes. Given the extensive range of the geometric and physical parameters under investigation, the learning process exhibits significant initial oscillations. To clearly depict the underlying convergence trend amidst this fluctuation, the plot concurrently displays both the raw reward and its smoothed value.

Figure 8. Reward progression during the optimization process using the PINN-RL algorithm.
Through the optimization process, the optimal configurations were extracted from the agent, and their corresponding relative mixing efficiencies for all Schmidt numbers are presented in Figure 9. The overall trend indicates an increase in relative efficiency with the Schmidt number up to a value of 13.3, beyond which the trend reverses and the efficiency decreases. For selected Schmidt numbers, the optimal parameters (Reynolds number and spline control points) are specified. Additionally, a cropped velocity contour plot around the baffle is provided for each case. The morphology of the optimal baffle evolved consistently with the dominant mixing mechanism: for Schmidt numbers up to 13.3, where diffusive mixing is dominant, the optimal configuration consistently featured a symmetric, internally-mounted baffle. At the transition point of , this internal baffle reached its largest, most pronounced symmetric, streamlined shape. Beyond this critical point, as convective effects grew dominant, the optimal geometry shifted towards an asymmetric, internal configuration. This shift resulted in the formation of larger vortices behind the baffle. While this enhanced convective mixing, the associated increase in pressure loss was more significant, leading to the observed net reduction in overall relative mixing efficiency. Complete animated sequences of the results are available in the GitHub repository.

Figure 9. Optimal designs (with design parameters including the Reynolds number and spline control points) and their corresponding relative mixing efficiency for each Schmidt number.
For a more detailed analysis of the optimal configurations across different Schmidt numbers, Figure 10 illustrates the specific variations of the Reynolds number and spline parameters for these optimized cases. As evidenced by the figure, lower Reynolds numbers yield optimal solutions at low Schmidt numbers, whereas higher Reynolds numbers are optimal in the high Schmidt number regime. Furthermore, the trends in the spline control points reveal a distinct pattern: the value of CP1 generally decreases, while CP2 and CP3 initially decrease and subsequently increase. This specific progression of the spline parameters facilitates the formation of a symmetric, internal baffle up to a Schmidt number of 13.3, transitioning to an asymmetric baffle-shaped geometry beyond this point. The chart is constructed such that each vertical line represents the set of optimal design parameters for a specific Schmidt number. For further details and animated visualizations (GIF format) of the spline parameter evolution, please refer to the GitHub repository.

Figure 10. Parameter study of the optimal design configurations achieving maximum mixing efficiency across the Schmidt number range. (Note: Each vertical line in the plot represents the set of optimal design parameters for a specific Schmidt number).
Finally, to confirm the solutions obtained from the proposed optimization method, a parametric study was also conducted using a Genetic Algorithm (GA), which yielded its own set of optimal solutions. In the GA, an optimal solution must be found for each individual Schmidt number after the parametric analysis is complete [50]. Consequently, as shown in Figure 11, the computational cost of this process increases linearly with the number of Schmidt numbers considered. In contrast, the DRL-based agent employed in this study possesses learning capabilities. After an initial, more computationally intensive training phase, the trained agent can provide near-instantaneous optimal solutions for any number of input samples (i.e., Schmidt numbers). As the graph clearly indicates, the proposed DRL method becomes computationally more efficient than the GA when the number of samples exceeds 1,296. Moreover, unlike the Genetic Algorithm, which relies purely on stochastic search and requires repeated evaluations, the reinforcement learning (RL)-based framework exploits gradient-based updates and learns a generalized mapping between flow parameters and optimal designs. This enables the agent to generalize its learned policy to unseen Schmidt numbers without retraining, resulting in a significant reduction in computational cost for parametric studies. The proposed method also produces smoother and more physically consistent design transitions across parameter variations, which is crucial for manufacturable geometries and stable flow performance. Overall, the RL-based optimization demonstrates superior scalability, sample efficiency, and adaptability compared to population-based algorithms such as GA [51, 52]. For detailed implementation of the GA and its hybrid integration with the proposed DRL framework, please refer to the GitHub repository.

Figure 11. Computational time versus sample count for the PINN-RL method compared to the Genetic Algorithm (GA).
Conclusion
This study successfully established a novel Scientific Machine Learning (Sci-ML) framework for the generalized, efficient optimization of multi-parameter systems, demonstrated through the design of a passive micromixer. By integrating a parametrically trained Physics-Informed Neural Network (PINN) as a rapid simulation environment with a Generalized Deep Reinforcement Learning (GDRL) agent, we have addressed critical limitations of traditional optimization approaches. The primary achievement of this work is the development of a model that, after a single training phase, provides instantaneous optimal solutions across a wide range of physical conditions, eliminating the need for case-specific retraining or computationally expensive simulations.
The optimization process yielded physically insightful results, revealing a clear correlation between the optimal design and the dominant mixing mechanism. For Schmidt numbers up to 13.3, where molecular diffusion prevails, the optimal configuration consistently featured a symmetric, internal baffle. Beyond this transitional point, as convective mass transfer became dominant, the optimal geometry shifted towards an asymmetric internal baffle. This shift enhanced mixing through intensified vortices; however, the associated increase in pressure loss ultimately led to a net reduction in the relative mixing efficiency at higher Schmidt numbers, highlighting the critical trade-off between mixing enhancement and hydraulic cost. The framework consistently generated designs that outperformed the baseline case across the entire spectrum, with a peak performance gain of approximately 32% observed at a Schmidt number of 13.3.
The advantages of the proposed methodology were further underscored through a comparative analysis with a Genetic Algorithm (GA). The results demonstrated that while the initial training of the DRL agent is computationally intensive, its ability to provide near-instantaneous solutions for any number of subsequent queries makes it vastly more efficient for extensive parametric studies. The crossover point, beyond which our method outperforms the GA in computational speed, was found to be a sample size of 1,296, proving its superior scalability. In summary, this research presents a robust, efficient, and generalizable optimization paradigm that bridges scientific computing and machine learning, with significant potential for application to a broad class of complex, multi-parameter design problems in fluid dynamics and beyond. The proposed optimization framework demonstrates significant potential for generalization beyond the current application. It can be adapted to a wide range of other scientific and engineering domains, such as heat transfer, turbulence modeling, and any field requiring efficient exploration of high-dimensional parameter spaces.
Future research directions are multi-faceted. Firstly, the current methodology conditions the optimization on a single key parameter, the Schmidt number. A compelling extension would be to increase the dimensionality of the state space by incorporating multiple governing parameters simultaneously, thereby enabling the solution of more complex, multi-faceted design problems. Secondly, while the parametric PINN served as an efficient and high-fidelity environment in this study, the underlying reinforcement learning architecture is inherently compatible with real-world experimental setups. Replacing the PINN environment with real-time laboratory systems would represent a critical step towards bridging the gap between simulation and practical implementation, facilitating direct, real-time optimization of physical systems.
CRediT authorship contribution statement
Meraj Hassanzadeh: Conceptualization, Methodology, Validation, Visualization, Software, Investigation, Writing the original draft.
Ehsan Ghaderi: Conceptualization, Methodology, Validation, Visualization, Software, Investigation, Writing the original draft.
Mohamad Ali Bijarchi: Review and Editing, Supervision.
Siamak Kazemzadeh Hannani: Review and Editing, Supervision.
Acknowledgment
The authors gratefully acknowledge the assistance of AI-based language tools in improving the clarity and fluency of the English writing. All ideas, arguments, and scientific content are solely the responsibility of the authors.
Statements and Declarations
No funding was received to assist with the preparation of this manuscript.
Baffle Geometry Generation and Boundary Condition Implementation
Mathematical Formulation of Baffle Geometry
Control Points Definition
The baffle contour is defined by five control points in the Cartesian plane:
In this formulation, the y-coordinates of the control points () serve as the sole parametric variables. A diverse set of spline shapes can be generated by systematically perturbing these y-values, while the x-coordinates remain fixed to ensure uniform parameterization. A graphical example of this parameterization is provided in Figure S.1.
Cubic Spline Interpolation
The baffle geometry is constructed as a cubic spline passing through all control points. For each interval between consecutive control points, the curve is described by a cubic polynomial:
where denotes the segment index.
Spline Coefficient Determination
The coefficients , , , are determined by enforcing the following conditions:
Interpolation conditions:
First derivative continuity (C1):
Second derivative continuity (C2C2):
Natural boundary conditions:
This yields a tridiagonal system of equations that uniquely determines the spline coefficients.
Normal Vector Computation
Tangent Vector Derivation
The first derivative of the spline function provides the slope of the curve:
The tangent vector at any point along the curve is:
Unit Tangent Vector
The unit tangent vector is obtained by normalization:
Unit Normal Vector
The unit normal vector is obtained by rotating the unit tangent vector counterclockwise by :
This normal vector points to the left of the direction of increasing along the curve.
Boundary Condition Implementation
No-Flux Boundary Condition
The mass conservation boundary condition at the baffle surface requires that the normal component of the mass flux vanishes:
where is the mass flux vector and is the unit normal vector derived in § 12.3. This concept is visualized in Figure S.1.
Physical Interpretation
This condition ensures that no mass crosses the baffle surface, making it an impermeable boundary. Mathematically, this constrains the velocity field such that its component normal to the baffle surface is zero at the boundary.
Discrete Implementation
For numerical implementation, the boundary condition is enforced at discrete sample points along the channel walls:
where the sample points are uniformly distributed along the x-domain of the baffle. This mathematical formulation guarantees consistent implementation of the no-flux boundary condition in computational simulations of mass transport around the baffle structures.

Figure S1. Baffle geometry generation via cubic spline interpolation. Control points (blue) define spline contours with analytically computed normal vectors (red) for boundary condition implementation. Lower panels illustrate geometric variations achieved through parametric y-coordinate modifications.
Supplementary Section 2: PPO-PINN Algorithm Overview
The proposed algorithm combines Proximal Policy Optimization (PPO) with Physics-Informed Neural Networks (PINNs) to optimize mixing performance in microfluidic devices. The algorithm learns optimal control parameters that maximize mixing efficiency while minimizing pressure costs.
Mathematical Formulation
State and Action Spaces
State Space:
Schmidt number:
State vector:
Action Space:
Control parameters:
Physical constraints:
Policy Representation
The actor network implements a Gaussian policy:
Mean:
Standard deviation:
Policy distribution:
PINN-Based Reward Function
Field Evaluation
For each state-action pair :
Inlet Region Evaluation:
Input tensor:
Pressure field:
Outlet Region Evaluation:
Input tensor:
Concentration field:
Performance Metrics
Mixing Index:
Pressure Cost:
Reward Function:
PPO Optimization
Advantage Estimation
Value Function:
Advantage:
Normalized Advantage:
Policy Optimization Objective
Probability Ratio:
Clipped Objective:
Value Function Loss:
Entropy Bonus:
Total Loss:
where
Training Procedure
Batch Processing
For each episode:
Sample N Schmidt numbers:
Form state batch:
Generate actions:
Scale actions to physical bounds
Compute rewards:
Policy Update
For K epochs:
Compute new policy
Calculate probability ratios
Compute advantages
Update parameters:
Hyperparameters
Discount factor:
Clipping parameter:
Optimization epochs:
Learning rates: ,
Batch size:
Total episodes:
This formulation enables efficient optimization of mixing parameters across varying Schmidt numbers while respecting physical constraints and maximizing the mixing efficiency-to-pressure cost ratio.
To ensure reproducibility and facilitate further research, the full implementation of the PPO algorithm and the PINN environment has been made publicly available on GitHub.
References
- [1]Lee, C.Y. and Fu, L.M., 2018. Recent advances and applications of micromixers. Sensors and Actuators B: Chemical, 259, pp.677-702. https://doi.org/10.1016/j.snb.2017.12.034.
- [2]Whitesides, G.M., 2006. The origins and the future of microfluidics. nature, 442(7101), pp.368-373. https://doi.org/10.1038/nature05058.
- [3]Han, W., Li, W. and Zhang, H., 2024. A comprehensive review on the fundamental principles, innovative designs, and multidisciplinary applications of micromixers. Physics of Fluids, 36(10). http://dx.doi.org/10.1063/5.0238393.
- [4]Hessel, V., Löwe, H. and Schönfeld, F., 2005. Micromixers—a review on passive and active mixing principles. Chemical engineering science, 60(8-9), pp.2479-2501. https://doi.org/10.1016/j.ces.2004.11.033.
- [5]Majumdar, P. and Dasgupta, D., 2024. Enhancing micromixing using external electric and magnetic fields. Physics of Fluids, 36(8). http://dx.doi.org/10.1063/5.0221764.
- [6]Stone, H.A., Stroock, A.D. and Ajdari, A., 2004. Engineering flows in small devices: microfluidics toward a lab-on-a-chip. Annu. Rev. Fluid Mech., 36(1), pp.381-411. https://doi.org/10.1146/annurev.fluid.36.050802.122124.
- [7]Stroock, A.D., Dertinger, S.K., Ajdari, A., Mezic, I., Stone, H.A. and Whitesides, G.M., 2002. Chaotic mixer for microchannels. Science, 295(5555), pp.647-651. https://doi.org/10.1126/science.1066238.
- [8]Squires, T.M. and Quake, S.R., 2005. Microfluidics: Fluid physics at the nanoliter scale. Reviews of modern physics, 77(3), pp.977-1026. https://doi.org/10.1103/RevModPhys.77.977.
- [9]Ansari, M.A. and Kim, K.Y., 2010. Mixing performance of unbalanced split and recombine micromixers with circular and rhombic sub-channels. Chemical Engineering Journal, 162(2), pp.760-767. https://doi.org/10.1016/j.cej.2010.05.068.
- [10]Ouro-Koura, H., Ogunmolasuyi, A., Suleiman, O., Omodia, I., Easter, J., Roye, Y. and Das, K.S., 2022. Boundary condition induced passive chaotic mixing in straight microchannels. Physics of Fluids, 34(5). https://doi.org/10.1063/5.0088014.
- [11]Agarwal, T. and Wang, L., 2022. Numerical analysis of vortex T micromixer with diffuser plates and obstacles. Thermal Science and Engineering Progress, 28, p.101156. https://doi.org/10.1016/j.tsep.2021.101156.
- [12]Cunegatto, E.H.T., Zinani, F.S.F., B iserni, C. and Rocha, L.A.O., 2023. Constructal design of passive micromixers with multiple obstacles via computational fluid dynamics. International Journal of Heat and Mass Transfer, 215, p.124519. https://doi.org/10.1016/j.ijheatmasstransfer.2023.124519.
- [13]Afzal, A. and Kim, K.Y., 2014. Three-objective optimization of a staggered herringbone micromixer. Sensors and Actuators B: Chemical, 192, pp.350-360. https://doi.org/10.1016/j.snb.2013.10.109.
- [14]Chen, X. and Zhao, Z., 2017. Numerical investigation on layout optimization of obstacles in a three-dimensional passive micromixer. Analytica chimica acta, 964, pp.142-149. https://doi.org/10.1016/j.aca.2017.01.066.
- [15]Chen, X. and Lv, H., 2022. New insights into the micromixer with Cantor fractal obstacles through genetic algorithm. Scientific Reports, 12(1), p.4162. https://doi.org/10.1038/s41598-022-08144-w.
- [16]Zou, L., Gong, Y., Chen, L., Yi, X. and Liu, W., 2021. Design and evaluation of two-dimensional passive micromixer based on unbalanced convergence-divergence-splits and reverse-collisions-recombination. Chemical Engineering Science, 244, p.116816. https://doi.org/10.1016/j.ces.2021.116816.
- [17]Li, P., Shi, L., Zhao, J., Liu, B., Yan, H., Deng, Y., Yin, B., Zhou, T. and Zhu, Y., 2023. Topology optimization design of a passive two-dimensional micromixer. Chemical Physics Letters, 821, p.140445. https://doi.org/10.1016/j.cplett.2023.140445.
- [18]Kheirkhah Barzoki, A., 2024. Optimization of passive micromixers: effects of pillar configuration and gaps on mixing efficiency. Scientific Reports, 14(1), p.16245. https://doi.org/10.1038/s41598-024-66664-z.
- [19]Yang, L., Xu, F. and Chen, G., 2024. Effective mixing in a passive oscillating micromixer with impinging jets. Chemical Engineering Journal, 489, p.151329. https://doi.org/10.1016/j.cej.2024.151329.
- [20]Chen, X., Zhai, J. and Chen, X., 2024. A novel micromixer based on coastal fractal for manufacturing controllable size liposome. Physics of Fluids, 36(11). https://doi.org/10.1063/5.0239840.
- [21]Brunton, S.L., Noack, B.R. and Koumoutsakos, P., 2020. Machine learning for fluid mechanics. Annual review of fluid mechanics, 52(1), pp.477-508. https://doi.org/10.1146/annurev-fluid-010719-060214.
- [22]Li, K., Savari, C., Sheikh, H.A. and Barigou, M., 2023. A data-driven machine learning framework for modeling of turbulent mixing flows. Physics of Fluids, 35(1). https://doi.org/10.1063/5.0136830.
- [23]Rackauckas, C., Ma, Y., Martensen, J., Warner, C., Zubov, K., Supekar, R., Skinner, D., Ramadhan, A. and Edelman, A., 2020. Universal differential equations for scientific machine learning. arXiv preprint arXiv:2001.04385. https://doi.org/10.48550/arXiv.2001.04385.
- [24]Raissi, M., Perdikaris, P. and Karniadakis, G.E., 2019. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational physics, 378, pp.686-707. https://doi.org/10.1016/j.jcp.2018.10.045.
- [25]Ang, E.H.W., Wang, G. and Ng, B.F., 2023. Physics-informed neural networks for low Reynolds number flows over cylinder. Energies, 16(12), p.4558. https://doi.org/10.3390/en16124558.
- [26]Cai, S., Mao, Z., Wang, Z., Yin, M. and Karniadakis, G.E., 2021. Physics-informed neural networks (PINNs) for fluid mechanics: A review. Acta Mechanica Sinica, 37(12), pp.1727-1738. https://doi.org/10.1007/s10409-021-01148-1.
- [27]Sharma, P., Chung, W.T., Akoush, B. and Ihme, M., 2023. A review of physics-informed machine learning in fluid mechanics. Energies, 16(5), p.2343. https://doi.org/10.3390/en16052343.
- [28]Zhao, C., Zhang, F., Lou, W., Wang, X. and Yang, J., 2024. A comprehensive review of advances in physics-informed neural networks and their applications in complex fluid dynamics. Physics of Fluids, 36(10). https://doi.org/10.1063/5.0226562.
- [29]Kou, C., Yin, Y., Zeng, Y., Jia, S., Luo, Y. and Yuan, X., 2024. Physics-informed neural network integrate with unclosed mechanism model for turbulent mass transfer. Chemical Engineering Science, 288, p.119752. https://doi.org/10.1016/j.ces.2024.119752.
- [30]Hassanzadeh, M., Ghaderi, E. and Bijarchi, M.A., 2025. FlexPINN: Modeling Fluid Dynamics and Mass Transfer in 3D Micromixer Geometries Using a Flexible Physics-Informed Neural Network. arXiv preprint arXiv:2504.17896. https://doi.org/10.48550/arXiv.2504.17896.
- [31]Beltrán-Pulido, A., Bilionis, I. and Aliprantis, D., 2022. Physics-informed neural networks for solving parametric magnetostatic problems. IEEE Transactions on Energy Conversion, 37(4), pp.2678-2689. https://doi.org/10.1109/TEC.2022.3180295.
- [32]Arthurs, C.J. and King, A.P., 2021. Active training of physics-informed neural networks to aggregate and interpolate parametric solutions to the Navier-Stokes equations. Journal of Computational Physics, 438, p.110364. https://doi.org/10.1016/j.jcp.2021.110364.
- [33]Ghaderi, E., Bijarchi, M., Hannani, S.K. and Nouri-Borujerdi, A., 2024. Parametric and inverse analysis of flow inside an obstructed channel under the influence of magnetic field using physics informed neural networks. arXiv preprint arXiv:2404.17261. https://doi.org/10.48550/arXiv.2404.17261.
- [34]Ren, X., Hu, P., Su, H., Zhang, F. and Yu, H., 2024. Physics-informed neural networks for transonic flow around a cylinder with high Reynolds number. Physics of Fluids, 36(3). https://doi.org/10.1063/5.0200384.
- [35]Harmening, J.H., Pioch, F., Fuhrig, L., Peitzmann, F.J., Schramm, D. and el Moctar, O., 2024. Data-assisted training of a physics-informed neural network to predict the separated Reynolds-averaged turbulent flow field around an airfoil under variable angles of attack. Neural Computing and Applications, 36(25), pp.15353-15371. https://doi.org/10.1007/s00521-024-09883-9.
- [36]Liu, K., Luo, K., Cheng, Y., Liu, A., Li, H., Fan, J. and Balachandar, S., 2023. Surrogate modeling of parameterized multi-dimensional premixed combustion with physics-informed neural networks for rapid exploration of design space. Combustion and Flame, 258, p.113094. https://doi.org/10.1016/j.combustflame.2023.113094.
- [37]Cao, Z., Liu, K., Luo, K., Cheng, Y. and Fan, J., 2023. Efficient optimization design of flue deflectors through parametric surrogate modeling with physics-informed neural networks. Physics of Fluids, 35(12). https://doi.org/10.1063/5.0180594.
- [38]Lu, Z., Li, Y., He, C., Ren, J., Yu, H., Zhang, B. and Chen, Q., 2024. Multi-objective inverse design of finned heat sink system with physics-informed neural networks. Computers & Chemical Engineering, 180, p.108500. https://doi.org/10.1016/j.compchemeng.2023.108500.
- [39]Sun, Y., Sengupta, U. and Juniper, M., 2023. Physics-informed deep learning for simultaneous surrogate modeling and PDE-constrained optimization of an airfoil geometry. Computer Methods in Applied Mechanics and Engineering, 411, p.116042. https://doi.org/10.1016/j.cma.2023.116042.
- [40]Priyadarshi, G., Murali, C., Agarwal, S. and Naik, B.K., 2024. Parametric investigation and optimization of phase change material-based thermal energy storage integrated desiccant coated energy exchanger through physics informed neural networks oriented deep learning approach. Journal of Energy Storage, 80, p.110231. https://doi.org/10.1016/j.est.2023.110231.
- [41]Powell, K.M., Machalek, D. and Quah, T., 2020. Real-time optimization using reinforcement learning. Computers & Chemical Engineering, 143, p.107077. https://doi.org/10.1016/j.compchemeng.2020.107077.
- [42]Mazyavkina, N., Sviridov, S., Ivanov, S. and Burnaev, E., 2021. Reinforcement learning for combinatorial optimization: A survey. Computers & Operations Research, 134, p.105400. https://doi.org/10.1016/j.cor.2021.105400.
- [43]Arulkumaran, K., Deisenroth, M.P., Brundage, M. and Bharath, A.A., 2017. Deep reinforcement learning: A brief survey. IEEE signal processing magazine, 34(6), pp.26-38. https://doi.org/10.1109/MSP.2017.2743240.
- [44]Banerjee, C., Nguyen, K., Fookes, C. and Raissi, M., 2025. A survey on physics informed reinforcement learning: Review and open problems. Expert Systems with Applications, p.128166. https://doi.org/10.1016/j.eswa.2025.128166.
- [45]Schulman, J., Wolski, F., Dhariwal, P., Radford, A. and Klimov, O., 2017. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347. https://doi.org/10.48550/arXiv.1707.06347.
- [46]Minasny, B. and McBratney, A.B., 2006. A conditioned Latin hypercube method for sampling in the presence of ancillary information. Computers & geosciences, 32(9), pp.1378-1388. https://doi.org/10.1016/j.cageo.2005.12.009.
- [47]Shi, H., Zhao, Y. and Liu, Z., 2020. Numerical investigation of the secondary flow effect of lateral structure of micromixing channel on laminar flow. Sensors and Actuators B: Chemical, 321, p.128503. https://doi.org/10.1016/j.snb.2020.128503.
- [48]Rasouli, M., Mehrizi, A.A., Goharimanesh, M., Lashkaripour, A. and Bazaz, S.R., 2018. Multi-criteria optimization of curved and baffle-embedded micromixers for bio-applications. Chemical Engineering and Processing-Process Intensification, 132, pp.175-186. https://doi.org/10.1016/j.cep.2018.08.021.
- [49]Sreenivasan, K.R., 2019. Turbulent mixing: A perspective. Proceedings of the National Academy of Sciences, 116(37), pp.18175-18183. https://doi.org/10.1073/pnas.1800463115.
- [50]De Jong, K., 1988. Learning with genetic algorithms: An overview. Machine learning, 3(2), pp.121-138. https://doi.org/10.1007/BF00113894.
- [51]Konak, A., Coit, D.W. and Smith, A.E., 2006. Multi-objective optimization using genetic algorithms: A tutorial. Reliability engineering & system safety, 91(9), pp.992-1007. https://doi.org/10.1016/j.ress.2005.11.018.
- [52]Zhou, H., Yu, X., Sun, C. and Kang, C., 2025. Genetic algorithm-enhanced hybrid physics-informed neural networks for very high cycle fatigue life prediction. Engineering Fracture Mechanics, p.111359. https://doi.org/10.1016/j.engfracmech.2025.111359.




