Manuscript Offprint
arXiv:2609.06199Gradient Reconstruction in Lattice Boltzmann Methods for Systems of Conservation Laws
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ADRIAN KUMMERLÄNDER*,†, FEDOR BUKREEV*,‡, AND MATHIAS J. KRAUSE*,†,‡
Abstract. The automatic derivation of [22] turns a declared system of conservation laws into a lattice Boltzmann scheme, giving each conserved physical quantity a set of populations whose linear equilibrium embeds the physical flux in their first moment. When the flux depends on gradients of the conserved state, those gradients are supplied by tracking them as additional transported fields. Since lattice Boltzmann is commonly memory-bound, these additional degrees of freedom reduce the achievable throughput. To reclaim it, we reconstruct the gradients from the moment structure of the equilibrium instead of transporting them. To leading order, the first moment of a conserved quantity's non-equilibrium part carries its gradient. Because the reconstructed flux enters its own equilibrium reference, that moment is the image of the gradient under a linear operator built from the diffusive-flux Jacobian. The reconstruction is that operator's algebraic inverse, generic across gradient-form constitutive closures and generated automatically from each declared flux. The resulting scheme carries the conserved quantities alone, reconstructing the required gradients from the populations and forming the fluxes locally. It converges at second order in double precision across advection–diffusion–reaction, Allen–Cahn, Navier–Stokes, resistive magnetohydrodynamics and homogenized compressible Navier–Stokes–Fourier systems, matching the accuracy of gradient tracking at equal resolution. On an NVIDIA RTX A5000 it is up to 3.7 times faster in single precision, the memory-bound kernels reaching up to 97% of peak memory bandwidth.
Key words. Lattice Boltzmann methods, gradient reconstruction, non-equilibrium moment, method of manufactured solutions, high-performance computing
MSC codes. 76M28, 65M12, 68W30, 65Y05, 35L65
- Introduction. The derivation in [22] produces a lattice Boltzmann scheme from a declared system of conservation laws, targeting OpenLB [19, 23]. It assigns an independent set of populations to each conserved field and embeds the physical flux in the first moment of a linear equilibrium, the vector-kinetic and relaxation route to systems of conservation laws [1, 2, 5, 6, 9, 12, 14, 16, 25, 28]. Wherever a constitutive closure is a first gradient of the conserved state, as for the Newtonian stress and the Fourier flux, the scheme needs that gradient. It has so far been provided by transport, in one of two forms [7, 8, 22]: Gradient tracking carries the gradient itself. The relaxed-flux form carries the diffusive flux itself: the viscous stress and the heat flux. Both append an auxiliary field, advanced by relaxation alongside the conserved ones, and differ only in what that field represents. Since lattice Boltzmann is commonly bound by memory bandwidth rather than floating-point performance [3, 4, 13, 15, 20, 31], the additional degree of freedom carried by the auxiliary field directly reduces the achievable throughput. Yet the field is redundant: while carried as an independent degree of freedom, it holds no information the conserved state does not already determine, because the closure ties the flux to a gradient of that state.
The present work recognizes these independent degrees of freedom as unnecessary and removes them. This route was noted in [22] but not pursued. To leading order, the first moment of a conserved field's non-equilibrium part carries that field's gradient, by the Chapman–Enskog relation that recovers strain rate and heat flux from the non-equilibrium populations [10, 17, 18, 20, 24, 26, 30]. As such, the gradients a
*All authors are with the Lattice Boltzmann Research Group (LBRG), Karlsruhe Institute of Technology (KIT), 76131 Karlsruhe, Germany (kummerlaender@kit.edu, corresponding author). †Institute for Applied and Numerical Mathematics (IANM), KIT, Englerstraße 2. ‡Institute of Mechanical Process Engineering and Mechanics (MVM), KIT, Straße am Forum 8.
A. KUMMERLÄNDER, F. BUKREEV, AND M. J. KRAUSE

FIG. 1. The compiler pipeline with the gradient reconstruction in place of the gradient-tracking cascade of [22]. A declared conservation law keeps its conserved state . The reconstruction operator recovers the gradient inside the collision (Sections 2.1–2.2), so the relaxation and lattice stages act on alone rather than on an augmented state .
closure needs can be reconstructed inside the collision from the conserved fields alone. The reconstruction is a single declaration, generated from the declared flux, trading transport for local computation.
Unlike the transport forms, where the gradient is read from its own transported field, the reconstructed gradient feeds back into its own measurement. The diffusive flux built from it is injected into the equilibrium first moment, the reference against which the next non-equilibrium moment is taken. The moment therefore returns not the gradient but its image under a linear operator built from the diffusive-flux Jacobian. Taken directly as the gradient, it carries an error that does not vanish under refinement.
The operator is linear, so the reconstruction is its algebraic inverse. Its coefficient is already assembled symbolically by the compiler of [22] with the SymPy computer algebra system [27], so the inverse can be generated in closed form from each declared flux. We verify the scheme by manufactured solutions across the five gradient-tracking systems of [22] and by a throughput study on an NVIDIA RTX A5000 GPU.
The remainder of this paper is organized as follows: Section 2 presents the method: Section 2.1 states the gradient reconstruction, Section 2.2 derives the reconstruction operator and Section 2.3 describes its generation by the compiler. Section 3 verifies the scheme by the method of manufactured solutions, and Section 4 benchmarks its throughput against the gradient-tracking scheme and hardware roofline.
- Methodology. Figure 1 shows the overall pipeline: a declared system of conservation laws is compiled to a lattice Boltzmann scheme, with the constitutive gradients reconstructed inside the collision rather than tracked as auxiliary fields.
2.1. Gradient Reconstruction. The method of [22] takes a system of conservation laws as its entry point,
(2.1)
with the conserved state, the physical flux and a local source. Each conserved field with moment and flux is assigned an independent set of populations on a discrete-velocity stencil. The flux is embedded in the first moment of a linear equilibrium, the field is recovered from the zeroth moment, and the scheme iterates by a BGK collide-and-stream update with the source projected onto the lattice weights.
The equilibrium of [22] is linear in the state and reproduces the conserved moment, the physical flux and an isotropic second moment,
(2.2)
with the lattice velocities and the lattice speed of sound. The Chapman–Enskog expansion , relates the non-equilibrium part, with the relaxation time of field , to the derivative of the equilibrium along the discrete velocity ,
(2.3)
Its first moment, evaluated with the equilibrium moments (2.2), is the non-equilibrium deviation flux
(2.4)
In [22] this relation supplies the relaxation diffusion. The flux time derivative is closed by the chain rule
(2.5)
where the second equality uses from (2.1). This closure is algebraic and transports no field. A constitutive gradient is different: where the flux depends on for a primitive , the augmented construction appends an auxiliary field and relaxes it alongside the conserved state. We instead set . This ties the gradient to the non-equilibrium moment and leaves no independent degree of freedom to transport.
Equation (2.4) then reads , so the gradient would follow as . This non-equilibrium moment , in lattice units where , subtracts the full equilibrium flux, but carries the gradient in its diffusive part and cannot be formed in-collide. Subtracting only its advective part , a function of the conserved state alone, gives the direct reconstruction
(2.6)
Both terms are known during the collision, so is available in-collide for every conserved field. The diffusive flux it still leaves in the moment is what Section 2.2 accounts for.
Recovering the gradient from the non-equilibrium moment while neglecting the flux time derivative is the local strain-rate and heat-flux evaluation of regularized and non-equilibrium lattice Boltzmann methods [10,24,26]. The neglected term is higher order under the diffusive and acoustic scalings, and the second-order convergence of Section 3 confirms it across the present systems.
A. KUMMERLÄNDER, F. BUKREEV, AND M. J. KRAUSE
The reconstructed gradients are the inputs the constitutive closures require, evaluated in Section 3 across the declared systems, most extensively for the resistive Magnetohydrodynamics (MHD) system, which couples a Newtonian stress, a Fourier flux and a resistive term through the reconstructed velocity, temperature and magnetic-field gradients.
2.2. The Reconstruction Operator. The diffusive flux left in the direct reconstruction (2.6) is the remainder of the physical flux after its advective part, . Because the constitutive closures are first gradients of the state, it is linear in the gradient,
(2.7)
with the diffusive-flux Jacobian. The equilibrium first moment (2.2) carries , so with the relaxation frequency of field , the direct reconstruction is
(2.8)
rather than itself. The true gradient is the inverse,
(2.9)
the reconstruction operator , assembled from the diffusive-flux Jacobian and the field relaxation frequencies. The form takes follows from the closure, and separates the systems into two cases. For a scalar diffusive closure, flux , the Jacobian (2.7) is the constant , and reduces to a single scaling factor
(2.10)
with the diffusivity in lattice units. The coefficient is constant, so this is formed once at compile time. The second, state-dependent case is a Newtonian stress . By the chain rule , its Jacobian is , with the symmetric-deviatoric map , which acts as the factor two on each shear pair. The shear block therefore keeps the scalar form , but its coefficient is now set by the local density through , and by the local temperature where . There is not a single constant but is evaluated per cell inside the collision (Section 2.3). The advection-diffusion-reaction and Allen-Cahn systems fall in the first case, the Navier-Stokes, magnetohydrodynamics and Homogenized Compressible Navier-Stokes-Fourier (HCNSF) systems in the second.
In both cases the correction is significant. At the diffusive working points, with and relaxation near the stability limit , for advection-diffusion-reaction ( ), 3.8 for Allen-Cahn, and 2.9 for the Navier-Stokes shear (there with the lattice kinematic viscosity , , quoted at the reference density that eliminates the mass dimension), a scaling factor (0.21 for Allen-Cahn). Under acoustic scaling grows with the resolution ( fixed), so for magnetohydrodynamics and 2.0 for the HCNSF system at the finest grids, factors 0.40 and 0.33. Because M does not decay in lattice units under refinement, this correction never vanishes: read directly as the gradient, the moment overshoots it several-fold and does not converge to the declared solution.
Algorithm 2.1 Gradient reconstruction compiler pass.
Require: flux , discrete velocities , relaxation freq.
Ensure: in-collide reconstruction of , no auxiliary state carried
Split (symbolic)
1: , a function of alone
2:
Form (symbolic) diffusive-flux Jacobian
3: by CAS differentiation [27]
Assemble (symbolic) reconstruction operator
4: in closed form
5: if is constant then
6: is a compile-time constant
7: else
8: is emitted as per-cell block solves
9: end if
Reconstruct (per cell, in-collide)
10: for each conserved field do
11:
12: end for
13:
14: evaluate the constitutive closures from
2.3. Compilation. In the compiler the reconstruction is generated for any declared flux rather than hand-written per system. The call reconstruct_gradients takes the quantities whose gradients the constitutive closures need and recovers each from the non-equilibrium moment rather than from an auxiliary field, dropping that field. Each argument must reduce to a function of the conserved state, so that its gradient can be reconstructed from the conserved populations, and a quantity that does not is rejected at compile time. The pass takes the place of the gradient-tracking cascade of [22]: the conserved state is not augmented, and the required gradients are recovered locally instead (Algorithm 2.1, Figure 1).
The gradients the closures require are those of the declared primitives , not of the conserved state directly. The compiler reconstructs the conserved-field gradients from the non-equilibrium moment (Section 2.1) and forms each requested gradient by the chain rule
(2.11)
with the Jacobian of the primitive in the conserved state, as in the Newtonian velocity gradient of Section 2.2. Because the physical flux is already held symbolically, the compiler forms this Jacobian together with the diffusive-flux Jacobian and the reconstruction operator of (2.9) in closed form in SymPy [27], the same way for every declared flux with a diffusive part. Listing 1 declares the resistive magnetohydrodynamics system of Section 3 in this form, its Newtonian stress, Fourier flux and resistive term written directly as first gradients and closed by the single call reconstruct_gradients([u, Temp, B]).
Where is state-dependent, is solved per cell. This per-cell solve is computationally affordable because is a block-sparse matrix: a few small strongly coupled
A. KUMMERLÄNDER, F. BUKREEV, AND M. J. KRAUSE
LISTING 1
DSL formulation of resistive MHD with gradient reconstruction. B is the Alfvén-scaled magnetic field and , , are the Powell -cleaning sources [29].
from pde2lbm import * eqs = ConservationLaws(dim=2)
parameters
gamma = eqs.parameter("gamma") mu = eqs.parameter("mu", dim=pressure * time) K = eqs.parameter("K", dim=pressure * time) eta = eqs.parameter("eta", dim=length**2 / time)
primitives
u = rhou / rho p_gas = (gamma - 1) * (E - 0.5 * rho * u.dot(u) - 0.5 * B.dot(B)) p_tot = p_gas + 0.5 * B.dot(B) Temp = p_gas / rho
gradient-form closures: Newtonian stress, Fourier flux, resistive term
tau = mu * (grad(u) + grad(u).T - Rational(2,3) * div(u) * eye(2)) q = -K * grad(Temp) E_r = eta * curl(B)
conservation laws
eqs.add([ Eq(dt(rho) + div(rhou), 0), Eq(dt(rhou) + div(outer(rhou, u) + p_toteye(2) - outer(B,B) - tau), S_rhou), Eq(dt(E) + div((E + p_tot)u - Bu.dot(B) - tauu + q + cross(E_r,B)), S_E), Eq(dt(B) + div(outer(B, u) - outer(u,B) - eta*grad(B)), S_B), ])
recover the closure gradients from the non-equilibrium moment
eqs.reconstruct_gradients([u, Temp, B]) eqs.compile(class_name="ResistiveMHDDynamics")
blocks, with the remaining couplings acyclic. R is then a few small block solves and scalar divisions by , ordered by dependence, rather than a dense inverse, at a cost of order the field count per cell. In any case, these operations are hidden behind the population loads and stores of the memory-bound kernel, so the reconstruction approaches the memory-bandwidth roofline in single precision (Section 4).
- Verification by Manufactured Solutions. We verify the reconstruction operator by the method of manufactured solutions on the five gradient-tracking systems of [22], reusing their exact solutions, lattices and refinement laws so that the errors are directly comparable at equal resolution. For each system the compiler evaluates the continuous residual of the analytical profile to form the manufactured source , which is injected into the update. At the final time we report the relative and errors per component and take the Empirical Order of Convergence (EOC) to be the negative least-squares slope of against over the resolution sequence , and for the three-dimensional HCNSF system. The only change from the gradient-tracking verification is that the auxiliary gradient is replaced by the reconstruction of Section 2.1 with the operator of Section 2.2. Each system is refined under its declared scaling, diffusive for the advection-diffusion-reaction, Allen-Cahn and Navier-Stokes systems and acoustic for the resistive magnetohydrodynamics and
TABLE 1
Manufactured-solution convergence of the gradient reconstruction operator. Relative and errors at the final time and the finest resolution , with the EOC the negative least-squares log-log slope over a factor-two ladder of four resolutions ending at the tabulated (512, or 256 for the three-dimensional HCNSF system). The manufactured solutions, lattices and refinement laws are those of the gradient-tracking verification [22]. Double and single precision use one relaxation working point per system.
| System | Scaling | Field | Precision | Rel. | EOC | Rel. | EOC | |
|---|---|---|---|---|---|---|---|---|
| Scalar ADR | Diffusive | Double | 512 | 2.00 | 2.00 | |||
| Float | 512 | 1.63 | 1.48 | |||||
| Allen-Cahn | Diffusive | Double | 512 | 1.99 | 1.99 | |||
| Float | 512 | 1.70 | 1.49 | |||||
| Navier-Stokes | Diffusive | Double | 512 | 2.03 | 2.02 | |||
| Float | 512 | 2.12 | 2.22 | |||||
| Double | 512 | 2.00 | 2.00 | |||||
| Float | 512 | 2.19 | 2.18 | |||||
| Resistive MHD | Acoustic | Double | 512 | 1.84 | 1.87 | |||
| Float | 512 | 1.85 | 1.81 | |||||
| Double | 512 | 1.86 | 1.90 | |||||
| Float | 512 | 1.91 | 1.95 | |||||
| Double | 512 | 1.89 | 1.91 | |||||
| Float | 512 | 1.97 | 2.00 | |||||
| Double | 512 | 2.02 | 2.05 | |||||
| Float | 512 | 2.05 | 2.06 | |||||
| HCNSF (3D) | Acoustic | Double | 256 | 1.92 | 1.94 | |||
| Float | 256 | 1.86 | 1.88 | |||||
| Double | 256 | 2.00 | 1.98 | |||||
| Float | 256 | 1.94 | 1.93 | |||||
| Double | 256 | 1.88 | 1.91 | |||||
| Float | 256 | 1.93 | 1.92 |
the three-dimensional HCNSF systems, matching [22]. The HCNSF system adds a moving-solid drag source and a porosity-weighted diffusive flux to the compressible equations. The impact of reconstruction onto the Compressible Navier–Stokes–Fourier (CNSF) system we previously [7] validated on shock-tube and Taylor–Green vortex flows will be treated separately. The purely hyperbolic systems of the approach carry no diffusive flux and no gradient closure to reconstruct and are outside the scope of the operator.
In double precision every conserved field of every system converges at second order (Table 1). Against the gradient-tracking scheme of the approach at equal resolution the reconstruction is competitive and on average slightly more accurate, its relative error lower by about a factor 1.4 across the conserved fields, behind only on the HCNSF density (Table 2). It reaches that accuracy carrying only the conserved fields, three against the seven of the gradient-tracking scheme on Navier–Stokes and six against eighteen on magnetohydrodynamics.
The single-precision runs inherit the nondimensionalization and reference-state shifting of [22], which express each field in physical (SI) units and subtract its reference value before collision. In single precision the resistive magnetohydrodynamics and Navier–Stokes systems keep second-order convergence at close to the double-precision error, and HCNSF at about twice it. The two lightest diffusively refined scalars, advection–diffusion–reaction and Allen–Cahn, fall below second order in single precision on the finest grids (Table 1), while double precision holds second order throughout.
A. KUMMERLÄNDER, F. BUKREEV, AND M. J. KRAUSE
TABLE 2
Reconstruction against the gradient-tracking scheme of [22] at matched scaling and resolution, in double precision. Relative error of each conserved field at , and at for the three-dimensional HCNSF system, and the ratio of the gradient-tracking error to the reconstruction error. A ratio above one is a lower reconstruction error.
| System | Field | Reconstruction | Tracking [22] | Ratio |
|---|---|---|---|---|
| Scalar ADR | c | 1.23 | ||
| Allen-Cahn | 1.34 | |||
| Navier-Stokes | 1.42 | |||
| 2.30 | ||||
| Resistive MHD | 2.20 | |||
| 1.80 | ||||
| 1.17 | ||||
| 1.29 | ||||
| HCNSF () | 0.86 | |||
| 1.23 | ||||
| 1.35 |
- Performance. A lattice Boltzmann kernel is commonly bound by memory bandwidth rather than floating-point throughput [3, 4, 13, 15, 20, 31], so the transported field count sets its throughput. By reconstructing the constitutive gradients rather than transporting them, the scheme carries only the conserved fields, whereas gradient tracking appends auxiliary fields for the tracked gradients. We benchmark the reconstruction's bare collide-and-stream operators, without statistics or manufactured source terms on an NVIDIA RTX A5000 (sm_86, measured 680 GB/s peak bandwidth, BabelStream Triad [11]). Results are compared against the published gradient-tracking figures of [22], obtained on the same hardware. The kernels are targeted at the hardware-abstracted framework of OpenLB [19, 23], which compiles a single-source implementation to diverse CPU and GPU targets [21]. Table 3 reports the throughput in Million Lattice Updates per Second (MLUP/s), the utilized bandwidth relative to peak, and the per-thread register count, local-memory spill and register-limited occupancy of the bulk collide kernel. The byte traffic per cell is , with the number of discrete velocities of the stencil, counting the read and the write of the in-place populations.
The reconstruction is faster for every target equation in both precisions (Table 3), the improvement scaling with the reduction in transported fields. Due to holding fewer populations it uses fewer registers which increases occupancy and avoids the local-memory spills that otherwise occur for the larger gradient-tracking kernels. It also does less arithmetic per cell since dropping fields eliminates more relaxation work than the moment, operator and closure evaluations add. Byte traffic falls by up to a factor of three, and in the memory-bound single-precision regime this reduction sets the speedup (Figure 2).
- Conclusion. We added a gradient reconstruction to the automatic lattice Boltzmann derivation of [22], invoked by a single declaration and generic across constitutive closures of gradient form. The gradients a closure requires are recovered from the non-equilibrium moment inside the collision, without any auxiliary state. The non-equilibrium moment is a linear image of that gradient through the diffusive flux, and the reconstruction is its algebraic inverse.
Across the gradient-tracking systems of the approach, advection-diffusion-reaction, Allen-Cahn, Navier-Stokes, resistive magnetohydrodynamics and the three-dimensional
TABLE 3
Throughput of the gradient reconstruction against the gradient-tracking scheme of [22]. The reconstruction is timed on the bare operator (statistics and manufactured source removed) on an NVIDIA RTX A5000 (sm_86, measured 680 GB/s peak bandwidth, BabelStream Triad [11]). Byte/cell is 2q n_fields sizeof(T), with q the number of discrete velocities, counting the read and the write of the in-place populations. FLOP/cell is the arithmetic-operation count of the emitted collide, loads and stores excluded. BW is the utilized bandwidth relative to this measured peak. Reg, Spill and Occ are the bulk collide kernel's per-thread register count, local-memory spill (bytes) and register-limited occupancy, from ptzas. The gradient-tracking figures are the published values of [22]. Their FLOP/cell can differ between precisions because [22] reports the faster of two emitted CSE variants at each precision. Speedup is the reconstruction MLUP/s over the gradient tracking at the same system and precision.
| System | Prec. | Scheme | Fields | Byte/cell | FLOP/cell | MLUP/s | BW | Reg | Spill | Occ. (%) | Speedup |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Scalar ADR | Double | Tracking | 3 | 240 | 141 | 1673 | 59% | 58 | - | 67 | |
| Recon. | 1 | 80 | 53 | 3843 | 45% | 40 | - | 100 | 2.30× | ||
| Single | Tracking | 3 | 120 | 253 | 5405 | 95% | 58 | - | 67 | ||
| Recon. | 1 | 40 | 53 | 13340 | 78% | 40 | - | 100 | 2.47× | ||
| Allen-Cahn | Double | Tracking | 3 | 240 | 124 | 1918 | 68% | 64 | - | 67 | |
| Recon. | 1 | 80 | 50 | 4182 | 49% | 40 | - | 100 | 2.18× | ||
| Single | Tracking | 3 | 120 | 245 | 5487 | 97% | 64 | - | 67 | ||
| Recon. | 1 | 40 | 50 | 13346 | 79% | 40 | - | 100 | 2.43× | ||
| Navier-Stokes | Double | Tracking | 7 | 560 | 387 | 662 | 55% | 126 | - | 33 | |
| Recon. | 3 | 240 | 150 | 865 | 31% | 86 | - | 48 | 1.31× | ||
| Single | Tracking | 7 | 280 | 387 | 2328 | 96% | 126 | - | 33 | ||
| Recon. | 3 | 120 | 150 | 5335 | 94% | 86 | - | 48 | 2.29× | ||
| Resistive MHD | Double | Tracking | 18 | 1440 | 2141 | 168 | 36% | 255 | 16 | 17 | |
| Recon. | 6 | 480 | 750 | 324 | 23% | 208 | - | 19 | 1.93× | ||
| Single | Tracking | 18 | 720 | 2141 | 736 | 78% | 255 | 32 | 17 | ||
| Recon. | 6 | 240 | 750 | 2746 | 97% | 208 | - | 19 | 3.73× | ||
| HCNSF (3D) | Double | Tracking | 14 | 1568 | 2234 | 163 | 38% | 255 | 104 | 17 | |
| Recon. | 5 | 560 | 680 | 248 | 20% | 254 | - | 17 | 1.52× | ||
| Single | Tracking | 14 | 784 | 2234 | 546 | 63% | 255 | 104 | 17 | ||
| Recon. | 5 | 280 | 680 | 2033 | 84% | 236 | - | 17 | 3.72× |

FIG. 2. Roofline of the generated kernels on the NVIDIA RTX A5000 (memory roof 680 GB/s and FP64 compute ceiling, with the FP32 ceiling an order of magnitude above the fastest kernel and off the top of the plot). Each kernel is placed at its arithmetic intensity and attained performance, a circle for double and a triangle for single precision, joined per system. In single precision the reconstruction kernels lie on or near the memory roof.
A. KUMMERLÄNDER, F. BUKREEV, AND M. J. KRAUSE
homogenized compressible Navier–Stokes–Fourier system, the scheme converges at second order in double precision, competitive with the gradient-tracking scheme at equal resolution while carrying only the conserved fields. In single precision the reference-shifted formulation of [22] keeps it at or near second order (Section 3). On an NVIDIA RTX A5000 it is up to 3.7 times faster in single precision, the memory-bound kernels reaching up to 97% of peak bandwidth. Removing the auxiliary gradient fields also removes the register spills of the magnetohydrodynamics and HCNSF gradient-tracking kernels.
Code Availability. The gradient reconstruction is specified by Section 2, and the manufactured solutions, lattices and refinement laws are those of [22]. The PDE2LBM compiler is available upon reasonable request.
Acknowledgments. Google Gemini and Anthropic Claude assisted in drafting and revising the manuscript. All content was reviewed, verified, and approved by the authors, who take full responsibility for it.
REFERENCES
[1] D. AREGBA-DRIOLLET AND R. NATALINI, Discrete kinetic schemes for multidimensional systems of conservation laws, SIAM J. Numer. Anal., (2000), 10.1137/S0036142998343075.
[2] D. AREGBA-DRIOLLET, R. NATALINI, AND S. TANG, Explicit diffusive kinetic schemes for nonlinear degenerate parabolic systems, Math. Comp., (2004), 10.1090/S0025-5718-03-01549-7.
[3] M. BAUER, S. EIBL, C. GODENSCHWAGER, N. KOHL, M. KURON, C. RETTINGER, F. SCHORNBaum, C. SCHWARZMEIER, D. THÖNNES, H. KÖSTLER, AND U. RÜDE, waLBerla: A block-structured high-performance framework for multiphysics simulations, Comput. Math. Appl., (2021), 10.1016/j.camwa.2020.01.007.
[4] M. BAUER, H. KÖSTLER, AND U. RÜDE, lbmpy: Automatic code generation for efficient parallel lattice Boltzmann methods, J. Comput. Sci., (2021), 10.1016/j.jocs.2020.101269.
[5] F. BOUCHUT, Construction of BGK models with a family of kinetic entropies for a given system of conservation laws, J. Stat. Phys., (1999), 10.1023/A:1004525427365.
[6] F. BOUCHUT, F. R. GUARGUAGLINI, AND R. NATALINI, Diffusive BGK approximations for nonlinear multidimensional parabolic equations, Indiana Univ. Math. J., (2000), 10.1512/iumj.2000.49.1811.
[7] F. BUKREEV, A. KUMMERLÄNDER, AND M. J. KRAUSE, Lattice Boltzmann method for compressible Navier–Stokes–Fourier equations, arXiv preprint, (2026), 10.48550/arXiv.2608.13437.
[8] F. BUKREEV, A. KUMMERLÄNDER, AND M. J. KRAUSE, Lattice Boltzmann methods for compressible (Magneto)hydrodynamics, arXiv preprint, (2026), 10.48550/arXiv.2606.00641.
[9] G.-Q. CHEN, C. D. LEVERMORE, AND T.-P. LIU, Hyperbolic conservation laws with stiff relaxation terms and entropy, Comm. Pure Appl. Math., (1994), 10.1002/cpa.3160470602.
[10] C. COREIXAS, G. WISSOCQ, G. PUIGT, J.-F. BOUSSUGE, AND P. SAGAUT, Recursive regularization step for high-order lattice Boltzmann methods, Phys. Rev. E, (2017), 10.1103/PhysRevE.96.033306.
[11] T. DEAKIN, J. PRICE, M. MARTINEAU, AND S. McINTOSH-SMITH, Evaluating attainable memory bandwidth of parallel programming models via BabelStream, Internat. J. Comput. Sci. Engrg., (2018), 10.1504/IJCSE.2018.095847.
[12] F. DUBOIS, Simulation of strong nonlinear waves with vectorial lattice Boltzmann schemes, Internat. J. Modern Phys. C, (2014), 10.1142/S0129183114410149.
[13] C. GODENSCHWAGER, F. SCHORNBaum, M. BAUER, H. KÖSTLER, AND U. RÜDE, A framework for hybrid parallel flow simulations with a trillion cells in complex geometries, in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13), 2013, 10.1145/2503210.2503273.
[14] B. GRAILLE, Approximation of mono-dimensional hyperbolic systems: A lattice Boltzmann scheme as a relaxation method, J. Comput. Phys., (2014), 10.1016/j.jcp.2014.02.017.
[15] M. JANUSZEWSKI AND M. KOSTUR, Sailfish: A flexible multi-GPU implementation of the lattice Boltzmann method, Comput. Phys. Comm., (2014), 10.1016/j.cpc.2014.04.018.
[16] S. JIN AND Z. XIN, The relaxation schemes for systems of conservation laws in arbitrary space dimensions, Comm. Pure Appl. Math., (1995), 10.1002/cpa.3160480303.
[17] M. JUNK, A. KLAR, AND L.-S. LUO, Asymptotic analysis of the lattice Boltzmann equation, J. Comput. Phys., (2005), 10.1016/j.jcp.2005.05.003.
[18] M. KRAFCEZYK, J. TÖLKE, AND L.-S. LUO, Large-eddy simulations with a multiple-relaxation-time LBE model, Internat. J. Modern Phys. B, (2003), 10.1142/S0217979203017059.
[19] M. J. KRAUSE, A. KUMMERLÄNDER, S. J. AVIS, H. KUSUMAATMAJA, D. DAPELO, F. KLEMENS, M. GAEDTKE, N. HAFEN, A. MINK, R. TRUNK, J. E. MARQUARDT, M. L. MAIER, M. HAUSSMANN, AND S. SIMONIS, OpenLB—open source lattice Boltzmann code, Comput. Math. Appl., (2021), 10.1016/j.camwa.2020.04.033.
[20] T. KRÜGER, H. KUSUMAATMAJA, A. KUZMIN, O. SHARDT, G. SILVA, AND E. M. VIGGEN, The Lattice Boltzmann Method: Principles and Practice, Springer International Publishing, 2016, 10.1007/978-3-319-44649-3.
[21] A. KUMMERLÄNDER, F. BUKREEV, L. DORNELES, M. DORN, S. ITO, AND M. J. KRAUSE, A hardware abstraction for exascale lattice Boltzmann simulations: rotor-resolved wind farms on Aurora and LUMI, in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC '26), 2026. Accepted for publication.
[22] A. KUMMERLÄNDER, F. BUKREEV, AND M. J. KRAUSE, Automated derivation of lattice Boltzmann methods for systems of conservation laws, arXiv preprint, (2026), 10.48550/arXiv.2607.05668.
[23] A. KUMMERLÄNDER, M. DORN, M. FRANK, AND M. J. KRAUSE, Implicit propagation of directly addressed grids in lattice Boltzmann methods, Concur. Comput. Pract. Exp., (2023), 10.1002/cpe.7509.
[24] J. LATT AND B. CHOPARD, Lattice Boltzmann method with regularized pre-collision distribution functions, Math. Comput. Simul., (2006), 10.1016/j.matcom.2006.05.017.
[25] C. LATTANZIO AND R. NATALINI, Convergence of diffusive BGK approximations for non-linear strongly parabolic systems, Proc. Roy. Soc. Edinburgh Sect. A, (2002), 10.1017/S0308210500001669.
[26] O. MALASPINAS, Increasing stability and accuracy of the lattice Boltzmann scheme: recursively and regularization, arXiv preprint, (2015), 10.48550/arXiv.1505.06900.
[27] A. MEURER, C. P. SMITH, M. PAPROCKI, O. CERTÍK, S. B. KIRPICHEV, M. ROCKLIN, A. KUMAR, S. IVANOV, J. K. MOORE, S. SINGH, T. RATHNAYAKE, S. VIG, B. E. GRANGER, R. P. MULLER, F. BONAZZI, H. GUPTA, S. VATS, F. JOHANSSON, F. PEDREGOSA, M. J. CURRY, A. R. TERREL, V. ROUCKA, A. SABOO, I. FERNANDO, S. KULAL, R. CIMRMAN, AND A. SCOPATZ, SymPy: symbolic computing in Python, PeerJ Comput. Sci., (2017), 10.7717/peerj-cs.103.
[28] R. NATALINI, A discrete kinetic approximation of entropy solutions to multidimensional scalar conservation laws, J. Differential Equations, (1998), 10.1006/jdeq.1998.3460.
[29] K. G. POWELL, P. L. ROE, T. J. LINDE, T. I. GOMBOSI, AND D. L. DE ZEEUW, A solution-adaptive upwind scheme for ideal magnetohydrodynamics, J. Comput. Phys., (1999), 10.1006/jcph.1999.6299.
[30] X. SHAN, X.-F. YUAN, AND H. CHEN, Kinetic theory representation of hydrodynamics: a way beyond the Navier–Stokes equation, J. Fluid Mech., (2006), 10.1017/S0022112005008153.
[31] J. TÖLKE, Implementation of a lattice Boltzmann kernel using the Compute Unified Device Architecture developed by nVIDIA, Comput. Vis. Sci., (2010), 10.1007/s00791-008-0120-2.