gs.materials.SPH.Liquid#

gs.materials.SPH.Liquid drives an entity through the Smoothed Particle Hydrodynamics solver as a liquid, such as water. Use it for free-surface fluids simulated with particles. It is the only material in the SPH family.

class genesis.engine.materials.SPH.liquid.Liquid(*, use_visual_raycasting: bool = False, sampler: Literal['pbs', 'random', 'regular'] = 'regular', rho: float = 1000.0, stiffness: float = 50000.0, exponent: float = 7.0, mu: float = 0.005, gamma: float = 0.01) None[source]#

The liquid material class for SPH.

Parameters:
  • rho (float, optional) – The rest density (kg/m³). Default is 1000.0.

  • stiffness (float, optional) – State stiffness (N/m²). Controls how pressure increases with compression. Default is 50000.0.

  • exponent (float, optional) – State exponent. Controls how nonlinearly pressure scales with density. Default is 7.0.

  • mu (float, optional) – The viscosity of the liquid. Default is 0.005.

  • gamma (float, optional) – The surface tension of the liquid. Default is 0.01.

  • sampler (str, optional) – Particle sampler. Defaults to ‘regular’ for numerical stability with SPH.