Skip to main content

surface_tension_force

Function surface_tension_force 

Source
pub fn surface_tension_force(
    positions: &[[f64; 3]],
    color_fn: &[f64],
    masses: &[f64],
    densities: &[f64],
    h: f64,
    sigma: f64,
) -> Vec<[f64; 3]>
Expand description

Compute surface tension forces using the color function gradient (CSF) method.

The color function gradient approximates the interface normal. The curvature κ is estimated from the divergence of the unit normal. The surface tension force on particle i is:

F_i^surf = σ · m_i / ρ_i · ∇(c_i)

where ∇c_i = sum_j m_j/ρ_j * (c_j - c_i) * ∇W(r_ij, h).

§Arguments

  • positions - Particle positions.
  • color_fn - Color function value per particle (1 = fluid, 0 = void).
  • masses - Per-particle masses.
  • densities - Per-particle densities.
  • h - Smoothing length.
  • sigma - Surface tension coefficient.