As micromixers offer the cheap and simple mixing of fluids and suspensions, they have become a key device in microfluidics. Their mixing performance can be significantly increased by periodically varying the inlet pressure, which leads to a non-static flow and improved mixing process. In this work, a micromixer with a T-junction and a meandering channel is considered. A periodic pulse function for the inlet pressure is numerically optimized with regard to frequency, amplitude and shape. Thereunto, fluid flow and adsorptive concentration are simulated three-dimensionally with a lattice Boltzmann method (LBM) in OpenLB. Its implementation is then combined with forward automatic differentiation (AD), which allows for the generic application of fast gradient-based optimization schemes. The mixing quality is shown to be increased by 21.4% in comparison to the static, passive regime. Methodically, the results confirm the suitability of the combination of LBM and AD to solve process-scale optimization problems and the improved accuracy of AD over difference quotient approaches in this context.
28 May 2024 in Computers & Mathematics with Applications
Adjoint-based optimization is widely used to address large-scale flow control problems with distributed control variables, as the computational cost of gradient evaluation is independent of the dimension of the control space. Within this context, the lattice Boltzmann method (LBM) represents an attractive discretization scheme, as it not only reduces the computational expense within optimization iteration loops but also exposes Jacobian expressions through its explicit operator-split formulation, thereby simplifying adjoint analysis. Despite these advantages, most existing adjoint LBM approaches rely on manual derivation of the adjoint system, lack automation, and are highly case-specific. High-level frameworks based on automatic differentiation (AD) address this limitation by enabling generic gradient computation but often compromise numerical performance. In this work, we present a novel framework implemented in the open-source LBM library OpenLB that enables the automated generation of discrete adjoint LBM collision kernels. AD is applied locally to evaluate the Jacobians of the adjoint system, eliminating manual derivations. Code generation combined with common subexpression elimination (CSE) removes the runtime overhead of AD tapes, allowing efficient adjoint collision kernels to be generated from their primal implementations. We conduct a detailed kernel-level performance analysis that is rarely addressed in the literature, where the arithmetically preferred AD mode for adjoint LBM kernels is identified within the proposed approach, and roofline analysis evaluates performance rather than strong and weak scaling tests, which primarily reflect communication overhead. The impact of CSE is investigated across different hardware architectures and floating-point precisions, demonstrating speedups of up to a factor of seven for adjoint collision kernels for double precision on GPUs.