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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/// Standard physical rest density of liquid water at 20 °C in `kg/m³`.
pub const WATER_REST_DENSITY_KGM3: f32 = 1000.0;
/// Physical refractive index (IOR) of liquid water at visible wavelengths.
pub const WATER_REFRACTIVE_INDEX: f32 = 1.333;
/// Physical dynamic viscosity of pure water at 20 °C in `Pa·s`.
pub const WATER_DYNAMIC_VISCOSITY_PAS: f32 = 0.001_002;
/// Physical air-water surface tension coefficient at 20 °C in `N/m`.
pub const WATER_SURFACE_TENSION_NPM: f32 = 0.072_8;
/// Physical density of pure water ice at 0 °C in `kg/m³` (~91.7% submerged).
pub const ICE_DENSITY_KGM3: f32 = 917.0;
/// Physical density of the lightweight buoyant floating orb in `kg/m³` (~45% submerged).
pub const FLOATING_ORB_DENSITY_KGM3: f32 = 450.0;
/// Default physical handheld glass vessel width in meters (`12 cm`).
pub const DEFAULT_VESSEL_WIDTH_M: f32 = 0.12;
/// Default physical handheld glass vessel height in meters (`9 cm`).
pub const DEFAULT_VESSEL_HEIGHT_M: f32 = 0.09;
/// Minimum allowed water volume fill ratio.
pub const FLUID_MIN_FILL_RATIO: f32 = 0.20;
/// Maximum allowed water volume fill ratio.
pub const FLUID_MAX_FILL_RATIO: f32 = 0.85;
/// Default water volume fill ratio.
pub const FLUID_DEFAULT_FILL_RATIO: f32 = 0.48;
/// Maximum pre-allocated PBF fluid particle capacity (zero steady-state reallocation).
pub const FLUID_MAX_PARTICLES: usize = 960;
/// Maximum pre-allocated entrained micro-bubble / foam capacity.
pub const FLUID_MAX_BUBBLES: usize = 220;
/// Maximum pre-allocated buoyant floating rigid bodies inside the vessel.
pub const FLUID_MAX_BUOYANT_BODIES: usize = 4;
/// Default target particle count at 50% vessel fill ratio.
pub const FLUID_BASE_PARTICLES_HALF_FILL: usize = 520;
/// Default fixed physics substeps per frame tick.
pub const FLUID_DEFAULT_SUBSTEPS: u32 = 2;
/// Default PBF Jacobi density constraint iterations per substep.
pub const FLUID_DEFAULT_SOLVER_ITERS: u32 = 3;
/// Maximum cached PBF neighbor indices stored per particle in the flat zero-alloc neighbor table.
pub const FLUID_MAX_NEIGHBORS: usize = 32;
/// Smoothing radius multiplier relative to nominal resting particle spacing `d0`.
pub const FLUID_KERNEL_RADIUS_MULT: f32 = 2.45;
/// Dimensionless CFM relaxation factor scaled by inverse particle area `1 / A_p`.
pub const FLUID_CFM_RELAXATION_FACTOR: f32 = 0.09;
/// Tensile-instability artificial pressure coefficient (`s_corr`, Macklin & Müller 2013).
pub const FLUID_SCORR_K: f32 = 0.001_4;
/// Tensile-instability reference distance fraction `Δq / h`.
pub const FLUID_SCORR_DQ_RATIO: f32 = 0.25;
/// Base XSPH viscosity blending coefficient corresponding to 20 °C water.
pub const FLUID_BASE_XSPH_COEFF: f32 = 0.018;
/// Vorticity confinement strength keeping wave curls and eddies crisp.
pub const FLUID_VORTICITY_EPSILON: f32 = 0.000_28;
/// Cohesive surface tension correction strength in PBF position space.
pub const FLUID_COHESION_STRENGTH: f32 = 0.000_045;
/// Hydrophilic glass wall capillary adhesion strength near the free surface.
pub const FLUID_WALL_MENISCUS_STRENGTH: f32 = 0.000_14;
/// Maximum clamped particle speed in `m/s` preventing tunneling on extreme impulses.
pub const FLUID_MAX_PARTICLE_SPEED_MPS: f32 = 3.2;
/// Maximum clamped linear shake acceleration in `m/s²`.
pub const FLUID_MAX_LINEAR_ACCEL_MPS2: f32 = 65.0;
/// Maximum clamped angular velocity in `rad/s`.
pub const FLUID_MAX_OMEGA_RAD_S: f32 = 24.0;
/// Maximum clamped angular acceleration in `rad/s²`.
pub const FLUID_MAX_ALPHA_RAD_S2: f32 = 140.0;
/// Wall boundary restitution coefficient for high-speed liquid splash impacts.
pub const FLUID_WALL_RESTITUTION: f32 = 0.12;
/// Wall boundary tangential slip retention factor (smooth glass interior).
pub const FLUID_WALL_TANGENTIAL_KEEP: f32 = 0.985;
/// Glass tank inner corner bevel radius expressed as a fraction of the smaller vessel axis.
pub const FLUID_CORNER_RADIUS_RATIO: f32 = 0.075;
/// Virtual shake decay rate per second (`exp(-decay * dt)`).
pub const FLUID_SHAKE_DECAY_PER_SEC: f32 = 9.0;
/// Buoyant micro-bubble terminal rise velocity in `m/s`.
pub const FLUID_BUBBLE_RISE_SPEED_MPS: f32 = 0.16;
/// Speed threshold in `m/s` above which surface particles entrain foam and micro-bubbles.
pub const FLUID_FOAM_SPEED_THRESHOLD_MPS: f32 = 0.26;
/// Pointer stir radius expressed as a fraction of vessel width.
pub const FLUID_STIR_RADIUS_RATIO: f32 = 0.16;
/// Maximum spatial hash grid cell capacity (`64 * 64 = 4096` cells, zero reallocation).
pub const FLUID_MAX_GRID_CELLS: usize = 4096;
/// Maximum clamped fixed-update delta time in seconds for unconditional stability.
pub const FLUID_MAX_STEP_DT: f32 = 1.0 / 30.0;
/// Deterministic PRNG initial seed for bubble jitter and splash micro-variation.
pub const FLUID_RNG_SEED: u64 = 0x517C_C1B7_2722_0A95;