1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/// Minimum supported cell count along any axis of `MacFluidGrid2D` or `MacFluidGrid3D`.
pub const MAC_MIN_GRID_DIM: usize = 4;
/// Maximum supported cell count along any axis of `MacFluidGrid2D`.
pub const MAC_MAX_GRID_DIM_2D: usize = 256;
/// Maximum supported cell count along any axis of `MacFluidGrid3D`.
pub const MAC_MAX_GRID_DIM_3D: usize = 64;
/// Default uniform grid cell size in meters.
pub const MAC_DEFAULT_CELL_SIZE_M: f32 = 0.1;
/// Default pressure solver iterations per incompressible projection step.
pub const MAC_DEFAULT_PRESSURE_ITERS: u32 = 48;
/// Default thermal buoyancy coefficient lifting warmer fluid upward along `+Y`.
pub const MAC_DEFAULT_THERMAL_BUOYANCY: f32 = 2.4;
/// Default dense dye/smoke gravity pull along `-Y`.
pub const MAC_DEFAULT_DYE_GRAVITY: f32 = 0.35;
/// Default vorticity confinement strength preserving swirling smoke and ink eddies.
pub const MAC_DEFAULT_VORTICITY_EPSILON: f32 = 1.8;
/// Default exponential dissipation rate applied to dye concentration per second.
pub const MAC_DEFAULT_DYE_DISSIPATION: f32 = 0.12;
/// Default exponential cooling rate applied to temperature excess per second.
pub const MAC_DEFAULT_TEMP_DISSIPATION: f32 = 0.25;
/// Over-relaxation factor `omega` for Red-Black Gauss-Seidel SOR pressure iteration.
pub const MAC_SOR_OMEGA: f32 = 1.62;
/// Maximum time step accepted per `step` invocation in seconds.
pub const MAC_MAX_DT_SECS: f32 = 0.05;
/// Maximum velocity component clamp in meters per second guarding against extreme impulses.
pub const MAC_MAX_VELOCITY_MPS: f32 = 60.0;
/// Relative residual convergence tolerance for Matrix-Free Conjugate Gradient pressure projection.
pub const MAC_CG_TOLERANCE_SQ: f32 = 1e-10;