// undine docs
Simulation
The simulation core is responsible for all numerical computations in Undine.
It is written in C++ and optimized for heavy numerical workloads, while the Blender addon acts as the bridge that configures and launches the solver.
Simulation Core
The simulation core handles particle integration, pressure solving, viscosity modeling, boundary interaction, particle redistribution, neighbor search, and solver stabilization.
Because fluid simulation is inherently sensitive to numerical instabilities, Undine prioritizes internal consistency and predictable solver behavior over purely heuristic approaches.
The Actions tab starts and monitors the solve, while the Sim Params tab controls the numerical behavior of the solver.
Grid resolution and host memory
Grid Resolution sets the working resolution for grid-based solver stages. It is one of the most important quality and cost controls in the simulation.
The Host pin estimate is shown next to the grid controls so memory impact is visible before committing to a heavy solve.
| Control | Purpose | Practical guidance |
|---|---|---|
| Grid Resolution | Sets the main grid density used by solver stages. | Raise for detail; lower when iteration speed or memory is more important. |
| Host pin est | Estimates pinned host memory for several buffer counts. | Use it to spot settings that may exceed the available system budget. |
| Host Pinning | Chooses how Undine manages pinned host memory. | Auto is the safest starting point for general use. |
| Host Pinning Budget (MB) | Limits the amount of pinned host memory available to the solver. | Increase only when the system has enough memory headroom. |
| Pin FLIP Old Buffers | Keeps older FLIP buffers pinned when enabled. | Useful for workflows that benefit from faster buffer reuse, but it can increase memory pressure. |
Pressure solver
The pressure group controls incompressibility and volume behavior. It is one of the main places to tune stability when the fluid gains energy, compresses too much, or reacts poorly near boundaries.
Preset values can write default pressure settings. Editing an individual pressure field switches that group toward custom behavior.
| Control | Purpose | Notes |
|---|---|---|
| Pressure preset | Chooses the pressure tuning source, such as Custom. | Use presets for broad starting points, then customize only the values needed for the shot. |
| Backend | Chooses CPU or GPU pressure execution. | GPU is the normal high-performance path when available. |
| Method | Chooses the pressure algorithm, such as PCG. | PCG is a standard iterative pressure solve choice. |
| Allow Exact | Allows exact-style pressure behavior where supported. | Use only when the backend and method make it useful for the shot. |
| Iterations | Maximum pressure iterations. | Higher values can improve pressure quality but increase solve time. |
| RelTol | Relative tolerance for pressure convergence. | Lower values ask the solver to converge more tightly. |
| Fallback | Chooses how Undine reacts when a pressure path is unsuitable or fails. | Warn + Fallback preserves progress while surfacing that a fallback occurred. |
| Rhie-Chow | Optional stabilization around pressure/velocity coupling. | Leave disabled unless diagnosing pressure artifacts that this option is meant to address. |
Advanced pressure controls
The advanced pressure section exposes preconditioners, operator behavior, air treatment, and GPU multigrid retry controls.
These controls are technical. Change them one at a time and keep notes on the visual effect and performance impact.
| Group | Visible controls | Purpose |
|---|---|---|
| PCG preconditioning | CPU PCG Precond, GPU PCG Precond | Controls how the iterative pressure solve is prepared for faster or more stable convergence. |
| MG smoother | auto / jacobi / sym_rbgs | When the V-cycle multigrid is in use, selects the smoother. sym_rbgs (symmetric red-black Gauss-Seidel) preserves the SPD invariant PCG requires and typically halves iterations versus Jacobi on Poisson 3D. |
| Operator and air mode | Operator, Air Mode | Controls how solid boundaries and air-side behavior are represented in the pressure system. |
| Phi options | Use Phi, Symmetric Div-Grad, Phi Builder, Phi Reinit | Controls signed-distance or boundary-field inputs used by pressure and solid-aware behavior. |
| GPU MG safe retry | Cap Auto, Target Levels Cap, Vcycles, Smooth Scale | Limits and retries multigrid-style pressure behavior when the GPU path needs a safer configuration. |
| Coarse solve | Coarse Weighted Jacobi Enabled, Coarse Omega Manual | Tunes the coarser pressure solve used by the retry path. |
| Density boost cap | Density Boost Cap | Caps density compensation used by the pressure path to avoid excessive correction. |
FP32 tolerance floor and retry chain
On the GPU happy path, pressure runs in FP32. The FP32 PCG residual accumulates ≈ √N · ε_f32 of relative roundoff, so a requested tolerance of 1e-6 on a 256³ grid is unachievable — the solver would otherwise burn iterations against noise.
Undine clamps the requested tolerance from below by safety · √N · ε_f32 (default safety = 4.0). The floor is logged. When PCG breaks down anyway, the retry chain takes over: relax tolerance → promote to FP64 → escalate to multigrid → fall back to CPU. Each step is logged with code, iters, rel_res, and chosen backend.
When to relax safety
- Bench-comparing against an older run: set UNDINE_PRESSURE_PCG_FP32_TOL_SAFETY=2 to match prior floors.
- Very small grids where √N is small enough that the floor barely moves — the safety factor has little effect.
- Diagnostic runs where you want to see exact convergence behavior unclamped.
Transport, PIC, and vorticity
Transfer and vorticity controls shape how particle motion is carried between solver stages and how small rotational detail is preserved or enhanced.
The visible screenshots show APIC transfer, PIC Blend, Vorticity Confinement, and individual vorticity strength, scale, and time controls.
| Control | Purpose | Practical effect |
|---|---|---|
| Transfer | Chooses the particle/grid transfer model. | APIC generally preserves richer motion than a purely dissipative transfer. |
| PIC Blend | Blends toward PIC-style velocity transfer. | Higher values add damping and can calm noisy motion. |
| Surface Tension | Adds cohesive force at the liquid surface. | Useful for droplets and small-scale surface behavior; high values can look sticky or unstable if overused. |
| Surface Band | Defines the band where surface tension or surface-aware behavior applies. | Wider bands make the effect influence a thicker surface region. |
| Surface Friction | Controls tangential friction between fluid and boundaries. | Low values (ice-like) make fluid slide freely; high values (absorbent surfaces) make fluid stick and drag along walls. |
| Fluid Density | Sets the liquid density in kg/m^3. | Water-like setups typically start near 1000. |
| Vorticity Confinement | Restores or enhances rotational detail. | Useful when motion looks overly damped, but too much can add artificial energy. |
| Vorticity Strength / Scale / Time | Breaks vorticity shaping into separate controls. | Use small changes and compare playback before committing. |
Surface Friction
Surface friction controls how fluid interacts with solid boundaries in the tangential direction — whether it slides freely like water on ice or grips and drags like honey on porous cloth.
This parameter models the Coulomb-style friction coefficient between the fluid free surface and collider surfaces, affecting velocity parallel to the boundary.
Physical Foundation
In real fluid-solid interactions, the boundary condition determines how velocity behaves at the wall:
- No-slip (high friction): Fluid velocity matches wall velocity exactly. The fluid "sticks" to the surface. This is the standard assumption for most Navier-Stokes solvers.
- Free-slip (zero friction): Fluid slides freely along the wall with no tangential resistance. Only normal velocity is constrained (no penetration). Like water on perfectly smooth ice.
- Partial slip (intermediate friction): A blend between no-slip and free-slip. The tangential velocity is partially damped based on a friction coefficient.
Mathematically, friction introduces a tangential force proportional to the relative velocity between fluid and surface:
F_tangent = -μ_friction · v_tangent
Where μ_friction is the friction coefficient and v_tangent is the fluid velocity component parallel to the boundary.
Parameter Range and Behavior
Surface Friction is normalized to a 0.0 – 1.0 range for artist-friendly control:
| Value | Physical Interpretation | Visual Behavior | Real-World Analogy |
|---|---|---|---|
| 0.0 | Perfect free-slip (zero friction) | Fluid slides effortlessly along walls. No drag. Fast, slippery motion. | Water on polished ice, oil on Teflon, superfluid on smooth glass |
| 0.1 – 0.3 | Low friction (mostly slip) | Slight resistance at boundaries. Fluid still flows freely but with minor drag. | Water on smooth plastic, light oil on metal |
| 0.4 – 0.6 | Moderate friction (balanced) | Noticeable drag along walls. Fluid velocity near boundaries is visibly reduced. | Water on rough concrete, syrup on wood |
| 0.7 – 0.9 | High friction (mostly no-slip) | Strong grip on surfaces. Fluid near walls moves slowly, creating velocity gradients. | Honey on fabric, thick paint on rough stone |
| 1.0 | Perfect no-slip (full friction) | Fluid at the boundary has zero relative velocity. Maximum drag and boundary layer formation. | Molasses on absorbent material, wet cement on porous brick |
Artistic and Technical Use Cases
Low Friction (0.0 – 0.3): Slippery Surfaces
Use when:
- Simulating water on ice, glass, or polished metal
- Creating fast-flowing rivers or waterfalls where boundary drag is negligible
- Stylized fluid that needs to look frictionless and energetic
- Reducing unwanted damping at walls in high-velocity flows
Visual effect: Fluid maintains speed near boundaries, creates less turbulence at walls, and flows smoothly around obstacles without sticking.
Medium Friction (0.4 – 0.6): Realistic General-Purpose
Use when:
- Simulating water on typical surfaces (concrete, wood, soil)
- General-purpose setups where realistic boundary interaction is desired
- Balancing performance and physical accuracy
- Creating natural-looking velocity gradients near walls
Visual effect: Believable drag at boundaries, visible boundary layer separation, natural-looking flow around corners and obstacles.
High Friction (0.7 – 1.0): Sticky, Absorbent Surfaces
Use when:
- Simulating honey, syrup, or thick liquids on porous materials
- Modeling fluid on fabric, sponge, or rough stone
- Creating "sticky" artistic effects where fluid clings to walls
- Emphasizing boundary layer separation and vortex shedding
- Slowing down fluid near colliders to prevent unrealistic sliding
Visual effect: Strong grip on surfaces, slow creeping flow near walls, pronounced velocity gradients, boundary layer instabilities, vortex formation behind obstacles.
Interaction with Viscosity
Surface Friction and Viscosity work together to control fluid behavior near boundaries:
- Low Viscosity + Low Friction: Fast, slippery flow. Water on ice. Minimal boundary effects.
- Low Viscosity + High Friction: Water on rough, absorbent surfaces. Fast bulk flow but strong drag at walls. Pronounced boundary layers.
- High Viscosity + Low Friction: Thick fluid (honey) on a slippery surface (Teflon). Slow bulk motion but slides freely at boundaries.
- High Viscosity + High Friction: Thick fluid (molasses) on porous material (cloth). Maximum drag everywhere — both internal (viscosity) and boundary (friction). Very slow, sticky flow.
Physically, viscosity controls internal shear resistance within the fluid, while surface friction controls boundary shear resistance at solid interfaces. Together, they determine the velocity profile from the wall into the bulk fluid.
Performance Considerations
Surface Friction is computationally cheap — it is applied as a velocity damping term at particle-collider interaction points during the boundary collision stage. Unlike viscosity (which requires a global solve), friction is a local operation.
- Cost: Negligible. Safe to adjust freely without impacting solve time.
- Stability: Does not affect CFL or substep count. Purely dissipative (removes energy).
- Iteration: Excellent parameter for rapid artistic iteration. Change it, scrub playback, see immediate results.
Advanced: Anisotropic and Spatially-Varying Friction
In advanced workflows, friction can be varied per collider or even spatially across a surface:
- Per-collider friction: Different collider objects can have different friction values (e.g., ice floor = 0.1, cloth curtain = 0.9).
- Texture-driven friction: Use a texture map to modulate friction spatially — creating patches of high and low grip on the same surface.
- Direction-dependent friction: Anisotropic friction along vs. across surface grooves (like brushed metal or wood grain). Check collider material settings for this option.
Consult the Colliders documentation for per-material friction overrides.
Troubleshooting
Fluid slides unrealistically on rough surfaces
- Increase Surface Friction to 0.6–0.9.
- Check that collider SDF resolution is high enough to capture surface detail.
- Verify that the collider is tagged correctly and not being ignored.
Fluid sticks too much at walls, looks frozen
- Reduce Surface Friction to 0.2–0.4.
- Check if Viscosity is also set too high — the combination may be over-damping the flow.
- Ensure particles are not trapped inside the collider SDF (collision margin too tight).
Inconsistent friction behavior across colliders
- Check per-collider material overrides — individual colliders may have custom friction values.
- Verify that all colliders are using the same SDF bake settings (narrow band width, resolution).
- Review the Debug panel for collision stage diagnostics.
Surface Friction is one of the most intuitive and visually impactful parameters in Undine. Unlike viscosity (which requires careful balancing to avoid instability), friction is safe, cheap, and immediate. Use it early in the look-dev process to dial in how "grippy" vs. "slippery" your fluid feels against surfaces. It's often the difference between fluid that looks lifeless and fluid that feels tactile and believable.
Time stepping and velocity limits
The Numerics group controls how much work is performed per frame and how the solver reacts to fast motion.
Substeps and CFL settings are the first place to look when high velocity flows become unstable.
| Control | Purpose | Guidance |
|---|---|---|
| Substeps | Base number of simulation steps per frame. | Increase for fast motion, thin interactions, or difficult collisions. |
| Auto | Allows automatic substep adjustment. | Useful when velocity varies across the shot. |
| CFL Target | Targets a stable relationship between velocity, cell size, and timestep. | Lower values are usually safer; higher values may be faster but less stable. |
| Max Auto | Caps automatic substeps. | Set high enough for difficult frames but not so high that a bad setup runs indefinitely. |
| Max Velocity | Optional velocity clamp. | A zero value usually means the clamp is disabled. |
| Viscosity Mode | Chooses the viscosity path when viscosity is enabled. | Simple is the visible default in the screenshots. |
| Fast / Balanced / Quality | Chooses the quality bias for enabled viscosity/rheology behavior. | Fast is for iteration; Quality is for final stability and visual polish. |
Viscosity
Viscosity controls a fluid's internal resistance to deformation and shear flow. It is the property that makes honey flow slowly, water flow freely, and cream hold folds longer than milk.
In Undine, viscosity is a first-class solver stage that runs between advection and pressure projection. When enabled, it modifies particle velocities to resist relative motion between neighboring fluid regions.
Physical Foundation
Viscosity arises from internal friction within a fluid. Molecularly, it represents momentum transfer between fluid layers moving at different speeds. Macroscopically, it appears as a diffusion-like term in the Navier-Stokes momentum equation:
∂u/∂t + (u·∇)u = -∇p/ρ + ν∇²u + g
The viscous term ν∇²u diffuses velocity across the domain, smoothing out sharp velocity gradients. The coefficient ν is the kinematic viscosity, measured in m²/s.
Dynamic viscosity μ (Pa·s or kg/(m·s)) measures absolute resistance to shear stress. Kinematic viscosity ν = μ/ρ (m²/s) normalizes by density and appears directly in the momentum equation. Undine works internally with kinematic viscosity because it decouples material density from diffusion timescale.
Common kinematic viscosity values:
| Material | ν (m²/s) | Visual Behavior |
|---|---|---|
| Water (20°C) | 1.0 × 10⁻⁶ | Thin, flows freely, splashes |
| Olive oil | 8.4 × 10⁻⁵ | Slightly thick, pours smoothly |
| Honey | ~1.0 × 10⁻³ | Very thick, slow drip, cohesive |
| Corn syrup | ~5.0 × 10⁻³ | Extremely thick, barely flows |
| Toothpaste | ~1.0 × 10⁻¹ | Holds shape, plastic deformation |
UI Controls
Undine exposes viscosity through a percentage slider (0–100%) for artist-friendly interaction and displays the corresponding kinematic viscosity in m²/s for scientific validation.
When Viscosity > 0%, the advanced viscosity panel appears, exposing solver method, quality settings, rheology models, and numerical parameters.
The viscosity percentage uses a logarithmic mapping to cover nine orders of magnitude:
ν = 10^(-6 + 9·p/100)
Where p is the percentage (0–100) and ν is kinematic viscosity in m²/s.
- 0% → 1.0 × 10⁻⁶ m²/s (water at 20°C)
- 33.3% → 1.0 × 10⁻³ m²/s (honey)
- 50% → 3.16 × 10⁻² m²/s (thick cream)
- 66.7% → 1.0 × 10⁰ m²/s (very thick paste)
- 100% → 1.0 × 10³ m²/s (extremely viscous, near-solid behavior)
This logarithmic scale ensures fine control in the low-viscosity regime (water to oil) while still reaching yield-stress plasticity at high percentages.
Viscosity Percentage Reference Table
Quick reference for common materials mapped to the percentage slider:
| Percentage | ν (m²/s) | Approximate Material | Visual Behavior |
|---|---|---|---|
| 0% | 1.0 × 10⁻⁶ | Water (20°C) | Free-flowing, splashes, low internal friction |
| 10% | 7.9 × 10⁻⁶ | Thin oil | Slightly thicker than water, pours easily |
| 20% | 6.3 × 10⁻⁵ | Light syrup, olive oil | Moderate thickness, smooth pour |
| 30% | 5.0 × 10⁻⁴ | Motor oil, glycerin | Thick liquid, slow pour, visible viscous damping |
| 40% | 3.98 × 10⁻³ | Honey, corn syrup | Very thick, slow drip, strong cohesion |
| 50% | 3.16 × 10⁻² | Thick honey, molasses | Extremely slow flow, holds shape briefly |
| 60% | 2.51 × 10⁻¹ | Heavy cream, condensed milk | Near-paste consistency, plastic deformation |
| 70% | 2.0 × 10⁰ | Thick paste, wet cement | Holds shape under low stress, flows slowly under weight |
| 80% | 1.58 × 10¹ | Toothpaste, heavy mud | Requires significant stress to flow, yield-stress regime |
| 90% | 1.26 × 10² | Thick paint, lava | Near-solid behavior, flows only under high stress |
| 100% | 1.0 × 10³ | Extremely viscous (theoretical limit) | Solid-like, plastic deformation only |
Control Reference
| Control | Purpose | Technical Notes |
|---|---|---|
| Viscosity (0–100%) | Artist-friendly blend from water-thin to highly viscous | Logarithmically mapped to 10⁻⁶ – 10³ m²/s range. 0% disables the viscosity stage entirely. |
| Kinematic viscosity (m²/s) | Scientific measure displayed for validation | Read-only display of the internal solver value. Use this to match real-world material data. |
| Viscosity Mode | Selects solver algorithm: Off, Simple, Advanced, Legacy, Weighted Implicit | Off disables viscosity. Simple is explicit integration. Advanced/Weighted Implicit are implicit solvers for stiff regimes. |
| Viscosity Active | Toggle to enable/disable viscosity solve per substep | Useful for diagnostic comparisons without changing the viscosity value. |
| Base viscosity (m²/s) | Direct entry for kinematic viscosity | Overrides percentage slider when manually set. Useful for matching published material data. |
| Fast water bypass | Optimization for near-zero viscosity regimes | When enabled and viscosity is below threshold, skips viscosity stage entirely. Saves cost for water-like flows. |
| Effective method | Read-only display of resolved solver path | Shows which algorithm is actually running: explicit, implicit, variational, etc. |
Viscosity Modes
Undine supports multiple viscosity solver paths, each with different computational cost, stability, and accuracy trade-offs.
Off
Viscosity stage is completely disabled. The fluid behaves as inviscid (zero internal friction). Use for thin water, splashes, or when viscous effects are negligible.
Simple (Explicit Integration)
Forward Euler integration of the viscous term: u_new = u_old + Δt·ν·∇²u.
- Stability: Conditionally stable. Requires
Δt ≤ h²/(2dν)wheredis spatial dimension (3). For smallhor largeν, this can force many substeps. - Cost: Cheapest per substep. Single Laplacian evaluation per iteration.
- Use when: Viscosity is low (water, thin oils), voxel size is large, or iteration speed is critical.
- Avoid when: Viscosity is high (honey, cream) or voxel size is small — the timestep restriction becomes prohibitive.
Advanced (Implicit Integration)
Backward Euler or semi-implicit integration: (I - Δt·ν·∇²)u_new = u_old. Solves a linear system per substep.
- Stability: Unconditionally stable. Can take large timesteps without blowing up.
- Cost: More expensive per substep due to linear solve (PCG, Jacobi, or direct methods).
- Use when: Viscosity is moderate to high, or when the explicit stability limit would require excessive substeps.
- Quality settings: Fast uses fewer iterations, Quality uses tighter convergence tolerances.
Weighted Implicit
Particle-based implicit viscosity solve with weighted least-squares or SPH-style kernel coupling. Preserves Lagrangian particle structure while solving the viscous system implicitly.
- Stability: Unconditionally stable like Advanced, but operates on particle neighborhoods instead of grid.
- Cost: Depends on particle count and neighbor density. Can be more expensive than grid-based implicit for very dense particle fields.
- Use when: Particle-level detail matters (anisotropic flows, free surfaces with complex topology), or when grid-based viscosity introduces unwanted diffusion.
Legacy
Preserves older viscosity solver behavior for compatibility with scenes from earlier Undine versions. Not recommended for new work.
Method Parameters
When Advanced or Weighted Implicit modes are active, additional numerical controls appear:
| Parameter | Purpose | Typical Range |
|---|---|---|
| Min Substeps | Minimum number of viscosity sub-iterations per frame substep | 2–10. Higher for stiff materials. |
| Max Iterations | Maximum iterative solver iterations per viscosity substep | 50–250. Increase if viscosity solver fails to converge. |
| Relative Tolerance | Convergence threshold for implicit solve residual | 1e-4 to 1e-6. Tighter = more accurate but slower. |
| Absolute Tolerance | Absolute residual floor below which solver stops | 1e-6 to 1e-8. Prevents over-iteration on near-zero velocities. |
| Preconditioner | Preconditioning strategy for implicit linear system | Jacobi, Block Jacobi, MG-Style. MG-Style fastest for large grids. |
| Fallback | Behavior when viscosity solve fails or hits max iterations | Warn + Fallback retries with relaxed settings. Abort stops the simulation. |
| Legacy Max Passes | Maximum outer passes for legacy mode multi-pass structure | 8–16. Only visible in Legacy mode. |
Rheology: Non-Newtonian Behavior
Real-world fluids are often non-Newtonian: their effective viscosity changes with shear rate, stress history, or deformation. Undine supports rheological models for yield-stress plasticity, shear-thinning, and shear-thickening.
Newtonian (Default)
Viscosity is constant regardless of shear rate. Water, simple oils, and glycerin are Newtonian. The stress-strain relationship is linear: τ = μ·(du/dy).
Bingham Plastic
Material does not flow until stress exceeds a yield stress τ_y. Below yield, it behaves like a solid. Above yield, it flows like a Newtonian fluid with constant plastic viscosity.
- Use cases: Toothpaste, mud, thick paint, lava, mayonnaise.
- Parameters: Yield Stress (Pa), Consistency (plastic viscosity).
- Visual behavior: Holds shape under low stress, flows smoothly once yield threshold is exceeded.
Herschel-Bulkley
Generalization of Bingham: combines yield stress with power-law shear dependence. τ = τ_y + K·(du/dy)^n.
- Use cases: Drilling mud, food pastes, cosmetic creams.
- Parameters: Yield Stress, Flow Index
n(shear-thinning ifn < 1, shear-thickening ifn > 1), ConsistencyK. - Visual behavior: Complex flow regime transitions depending on stress and shear rate.
Additional Models
The Rheology dropdown may expose additional models such as Power-Law, Cross, Carreau, or custom presets. Consult the model tooltip or preset documentation for parameter definitions.
| Rheology Parameter | Physical Meaning | Units |
|---|---|---|
| Yield Stress | Minimum stress required to initiate flow | Pa (Pascals) |
| Consistency | Effective viscosity above yield (Bingham) or power-law prefactor (Herschel-Bulkley) | Pa·s or Pa·s^n |
| Flow Index | Power-law exponent: n < 1 (shear-thinning), n > 1 (shear-thickening) | Dimensionless |
| Density Ref | Reference density for rheology model normalization | kg/m³ |
| Gamma Min / Max | Shear rate clamps to prevent numerical instability at extreme deformation rates | 1/s |
| Nu Min / Max | Effective viscosity clamps to bound the viscous diffusion timescale | m²/s |
| Outer Iters / Relax | Nonlinear solver iterations and relaxation factor for rheology model convergence | Dimensionless |
| Early Exit Threshold | Residual threshold for early termination of rheology solve | Dimensionless |
Advanced Rheology Controls
The rheology system exposes fine-grained control over solver behavior, temporal blending, and adaptive refinement.
| Control | Purpose |
|---|---|
| Use Phi | Enables signed-distance field for boundary-aware rheology. Useful for yield-stress materials near colliders. |
| Adaptive Rebalance | Dynamically adjusts solver strategy when convergence stalls. Helps with difficult rheology regimes. |
| Temporal Blending | Blends current and previous rheology state to smooth out temporal oscillations in yield-stress transitions. |
| Tau (temporal blend factor) | Controls temporal smoothing strength. Higher values = more history influence, smoother transitions, potentially more lag. |
Practical Workflows
Water and Thin Liquids
Set Viscosity: 0–5%. Use Viscosity Mode: Off or enable Fast water bypass. Viscous effects are negligible; save cost by disabling the stage entirely.
Olive Oil, Light Syrup
Set Viscosity: 10–30%, Viscosity Mode: Simple. Explicit integration is stable enough for moderate viscosity. Monitor substep count; if CFL or viscous timestep restriction becomes expensive, switch to Advanced.
Honey, Thick Cream
Set Viscosity: 40–70%, Viscosity Mode: Advanced, Quality: Balanced or Quality. Implicit solve handles the stiff viscous diffusion without requiring excessive substeps. Increase Max Iterations if convergence warnings appear.
Toothpaste, Mud, Lava (Yield-Stress Materials)
Set Viscosity: 60–90%, Viscosity Mode: Advanced, Rheology: Bingham or Herschel-Bulkley. Tune Yield Stress to control when the material starts flowing. Use Temporal Blending to smooth yield transitions. Enable Use Phi if the material interacts heavily with colliders.
Scale-Aware Viscosity
Kinematic viscosity scales as ν → s²·ν under Cinematic Scale Lock (where s is the scale factor). This preserves the diffusion timescale across domain resizing. When using Fixed Voxels Per Meter + Cinematic Scale Lock, the effective viscosity changes to maintain visual proportionality, but CFL and diffusion constraints may relax for smaller domains.
Diagnostics and Troubleshooting
Viscosity solver fails to converge
- Increase
Max Iterations(try 250–500 for very stiff regimes). - Relax
Relative Toleranceslightly (e.g., from 1e-5 to 1e-4). - Switch
PreconditionertoMG-Stylefor large grids. - Increase
Min Substepsto give the solver more temporal resolution. - Check that
Nu Maxis not clamping the effective viscosity too aggressively.
Fluid looks overly damped or frozen
- Reduce
Viscositypercentage. - Check
Effective methoddisplay — ensure you're not accidentally using a much higher viscosity than intended. - If using rheology, verify
Yield Stressis not so high that the entire fluid is below yield threshold. - Disable
Temporal Blendingif it's over-smoothing dynamic behavior.
Viscosity is expensive (low FPS)
- Switch from
AdvancedtoSimpleif viscosity is low enough for explicit stability. - Enable
Fast water bypassfor near-zero viscosity regimes. - Use
Fastquality preset instead ofQuality. - Increase voxel size (lower VPM) — viscous timestep restriction scales as
h². - Reduce
Min Substepsif rheology is forcing excessive inner iterations.
Yield-stress transitions look jittery
- Enable
Temporal Blendingand increaseTauto 2.0–3.0. - Increase
Outer Itersfor rheology model convergence. - Reduce
Outer Relaxslightly (e.g., from 1.0 to 0.8) to stabilize nonlinear iterations. - Use
Adaptive Rebalanceto let the solver adjust strategy when stuck.
Scientific Validation
Undine's viscosity solver is designed to match published fluid mechanics behavior for validation and VFX credibility:
- Poiseuille flow: Parabolic velocity profile in pipe flow matches analytical solution for Newtonian fluids.
- Couette flow: Linear velocity gradient between parallel plates under shear matches expected viscous dissipation.
- Dam break with viscosity: Flow front speed and profile match experimental data for glycerin and honey.
- Bingham plug flow: Central unyielded plug region in pipe flow matches Bingham plastic theory.
When matching real-world data, use the m²/s display to set kinematic viscosity directly from published material tables. For dynamic viscosity μ (Pa·s), convert via ν = μ/ρ where ρ is density in kg/m³.
Viscosity is one of the most artistically powerful and numerically expensive solver stages. Start with low viscosity and Simple mode for iteration. Switch to Advanced + rheology only when the shot requires it. Profile the Debug panel to see viscosity stage cost — if it dominates frame time, consider reducing quality settings or increasing voxel size before compromising the look.
Modular Solver Stages
The Undine solver is organized as a sequence of well-defined simulation stages.
Each stage performs a specific transformation of the simulation state and is designed to remain compatible with the rest of the pipeline.
Primary step sequence
- Advection
- Boundary interaction
- Viscosity solving
- Pressure projection
- Particle Redistribution
Additional core responsibilities
- Particle integration
- Neighbor search
- Solver stabilization
Why staged design matters
This architecture improves maintainability, allows targeted changes to individual stages, and makes debugging and validation more straightforward because each stage has a clear responsibility.
Particle separation, bricks, and density
Several Sim Params groups control how particles are distributed and how active simulation regions are maintained.
These settings matter most when particle count, density, or sparse active regions produce visible artifacts.
Bricks are Undine's sparse-grid layer: empty space costs nothing, and the solver only allocates and moves cells that hold particles plus a halo wide enough for the pressure stencil. The current backend is velocity-pages; a future-only full-pages mode is reserved internally.
| Group | Visible controls | Purpose |
|---|---|---|
| Separation | Iterations, Radius, Rate | Pushes nearby particles apart to reduce clustering and preserve a more even distribution. |
| Volume Equalization | Enable toggle | Attempts to keep perceived volume more consistent across the solve. |
| Bricks | Brick Size, Halo, TTL Frames | Controls sparse active regions used for performance and locality. |
| Dense fallback | Auto Dense Fallback, Disable Active Brick %, Re-enable Active Brick % | Switches between active-brick behavior and a denser path when active coverage crosses thresholds. |
| Density Mode | P2G | Chooses how density is transferred or estimated for grid-based stages. |
| Density Strength | Scalar density correction strength. | Higher values make density correction more aggressive. |
Simulation Consistency
In many fluid systems, different execution paths may behave slightly differently depending on whether the simulation runs on CPU or GPU.
While these differences may appear minor, they can accumulate over long simulations and lead to visually noticeable divergence.
Undine is designed with the goal of maintaining consistent solver behavior across execution paths whenever possible.
Achieving perfect numerical equivalence between hardware backends is rarely possible in practice, but maintaining comparable solver behavior remains an important design objective.
Numerical Robustness
Fluid simulations often operate in regimes that are difficult for numerical solvers.
Undine prioritizes robustness in these scenarios by favoring stable solver formulations, consistent boundary handling, careful control of particle density, and well-behaved pressure projection.
Difficult regimes
- High velocity flows
- Thin liquid sheets
- High viscosity fluids
- Complex collider interactions
Why the tradeoff matters
This approach may sometimes favor stability over raw speed, but it helps ensure that simulations remain visually believable and numerically stable across a wide range of setups.