Tune collision, relaxation, and boundary conditions quickly today. Run compact simulations and inspect macroscopic fields. Export CSV and PDF reports for transparent research workflows.
Simulate two-dimensional fluid flow using a lattice Boltzmann solver. Configure grids, viscosity, boundaries, and forcing. View stability checks, Reynolds estimates, and export results for verification.
| Case | Nx | Ny | Steps | ν | U (lid) | Fx |
|---|---|---|---|---|---|---|
| Lid-driven cavity | 60 | 60 | 500 | 0.02 | 0.08 | 0 |
| Channel | 100 | 50 | 1200 | 0.05 | 0 | 1e-6 |
This calculator uses the D2Q9 lattice with BGK collision. The discrete populations \(f_i\) evolve as:
Streaming + collision:
f_i(x + c_i, t + 1) = f_i(x, t) - \omega\,[f_i(x,t) - f_i^{eq}(x,t)] + S_i
where \omega = 1/\tau, and c_s^2 = 1/3
Macroscopic fields follow:
rho = \sum_i f_i
u = (\sum_i f_i c_{ix}) / rho
v = (\sum_i f_i c_{iy}) / rho
The equilibrium distribution (low-Mach expansion) is:
f_i^{eq} = w_i rho [ 1 + 3(c_i·u) + 4.5(c_i·u)^2 - 1.5|u|^2 ]
For the channel case, an optional small body force is applied using a standard forcing source term to drive Poiseuille-like flow.
LBM evolves discrete particle populations and reconstructs flow from their moments. This solver uses the 2D D2Q9 stencil with 9 velocities. Density is ρ = Σfi, and velocity is u = (Σfici)/ρ, computed at every lattice node.
D2Q9 includes 1 rest direction, 4 axis directions, and 4 diagonals with weights 4/9, 1/9, and 1/36. The lattice sound speed is fixed at cs2 = 1/3. Keep max |u| small (Mach ≤ 0.1) to limit compressibility error.
Collision uses a single-relaxation-time BGK step with ω = 1/τ. The kinematic viscosity maps as ν = cs2(τ - 0.5), so τ must remain above 0.5. Larger ν increases damping and helps stability on coarse meshes, while smaller ν demands finer resolution.
No-slip walls use bounce-back, reflecting populations along the opposite direction to enforce near-zero wall velocity. The lid-driven cavity applies a top-wall velocity boundary using a Zou/He-style reconstruction with u = U and v = 0, suitable for moderate lid speeds.
The channel case uses periodic boundaries in x and solid walls in y. A small body force Fx can be applied using a forcing source term to mimic a pressure gradient. Start with Fx near 10-6 and confirm that maximum speed stays low as the profile approaches steady flow.
At each reporting interval, the calculator records average speed, maximum speed, average kinetic energy, and a residual based on changes in average speed. When enabled, the run stops once the residual falls below your tolerance, saving steps during near-steady evolution.
A Reynolds estimate is computed as Re ≈ UrefL/ν, using L ≈ N − 1 in the primary flow direction. For cavities, Uref is the lid speed; for channels, Uref is the maximum speed. Use Re to compare configurations.
Begin with grids near 50–60 cells per side and a few hundred steps, then increase resolution until trends stabilize. If warnings appear, reduce U or Fx, increase ν, or refine the mesh. Export CSV for auditing and PDF for quick sharing.
D2Q9 means two spatial dimensions with nine discrete velocity directions. It is the most common LBM stencil for 2D incompressible-style flows and supports stable vortex formation and channel profiles.
In BGK LBM, viscosity scales with τ - 0.5. If τ approaches 0.5, viscosity becomes too small and numerical stability deteriorates. This calculator nudges τ slightly above 0.5 when needed.
Start with 50–60 cells per direction and a few hundred steps to validate settings. Then increase steps and resolution until the residual decreases smoothly and results stop changing noticeably with refinement.
The body force acts like a pressure gradient, driving flow between no-slip walls. Keep it small to maintain low-Mach behavior. Use the time-series trends to confirm the profile is settling.
Large lattice velocities increase compressibility error and can destabilize BGK collision. As max speed grows, reduce forcing or lid speed, increase viscosity, or refine the grid to recover stability.
The CSV stores step-by-step report rows for average speed, maximum speed, kinetic energy, and residual. The PDF provides a compact summary plus the first rows of the time series for quick sharing.
Yes. The channel case can be compared qualitatively to a parabolic Poiseuille profile once steady. Use consistent viscosity and forcing, and refine the grid to reduce discretization effects.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.