Implementations of various collision operators such as Landau or Lenard–Bernstein.
Structure-preserving particle discretisation of the conservative 2D
Lenard–Bernstein operator: the density is reconstructed in a tensor-product
B-spline finite-element space (via Mantis),
particles are advected by implicit midpoint, and a 3×3 Lagrange-multiplier
system enforces exact discrete conservation of momentum and energy. Follows
Jeyakumar et al. (2024). See the
documentation
for the scheme and the conservation algebra.
| File | Role |
|---|---|
main_LB.jl |
Driver: time loop, implicit solve (Picard / Anderson), checkpointing, CSV + PNG output |
functions.jl |
LB physics: L² projection, log-gradient, drift multipliers, velocity update, diagnostics |
MantisWrappers.jl |
FEM scaffolding around Mantis (mesh, mass matrix, particle location/evaluation, Workspace) |
Parameters.jl |
SimParameters struct + CLI override parsing + Gaussian IC sampling |
parameters_LB*.jl |
Presets, each building a PARAMS::SimParameters |
plot_dashboard_LB*.jl, plot_scatter_LB*.jl |
Post-processing plots of the CSV output |
julia --project=. main_LB.jl parameters_LB2D_v3.jl
# scalar overrides:
julia --project=. main_LB.jl parameters_LB2D_v3.jl --N_STEPS=200 --suffix=foo
# resume from last checkpoint:
julia --project=. main_LB.jl parameters_LB2D_v3.jl --resume=autoARGS[1] is the preset file; ARGS[2:] are --key=value scalar overrides.
Vector fields (bp1, bp2) are not CLI-overridable — edit the preset.
conservation_history_<suffix>.csv— one row per step:step,time,entropy,energy,p1,p2,iter,residual,fp_minus_fs,neg_partfs_snapshot_<suffix>_step#####.csv— B-spline coefficients off_s(mesh breakpoints in the header) everysnap_everysteps + final- diagnostic PNG + particle dump at each snapshot step