gs.options.SPHOptions#

class genesis.options.solvers.SPHOptions(*, dt: float | None = None, gravity: tuple | None = None, particle_size: float = 0.02, pressure_solver: str = 'WCSPH', lower_bound: tuple = (-100.0, -100.0, 0.0), upper_bound: tuple = (100.0, 100.0, 100.0), hash_grid_res: tuple | None = None, hash_grid_cell_size: float | None = None, max_divergence_error: float = 0.1, max_density_error_percent: float = 0.05, max_divergence_solver_iterations: int = 100, max_density_solver_iterations: int = 100)[source]#

Options configuring the SPHSolver.

Note

If spatial hashing parameters are not given, we will compute them automatically this way: For hash_grid_cell_size, we will set it to be the support_radius, which is essentially 2 * particle_size. For hash_grid_res, if a small bound is given, it’s used for the hash grid; otherwise, we use a default value of a 150^3 cube. Any grid bigger than that will results in too many cells hence not ideal.

Parameters:
  • dt (float, optional) – Time duration for each simulation step in seconds. If none, it will inherit from SimOptions. Defaults to None.

  • gravity (tuple, optional) – Gravity force in N/kg. If none, it will inherit from SimOptions. Defaults to None.

  • particle_size (float, optional) – Particle diameter in meters. Defaults to 0.02.

  • pressure_solver (str, optional) – Pressure solver type. Current supported pressure solvers are ‘WCSPH’ and ‘DFSPH’. Defaults to ‘WCSPH’.

  • lower_bound (tuple, shape (3,), optional) – Lower bound of the simulation domain. Defaults to (-100.0, -100.0, 0.0).

  • upper_bound (tuple, shape (3,), optional) – Upper bound of the simulation domain. Defaults to (100.0, 100.0, 100.0).

  • hash_grid_res (tuple, optional) – Size of the spatially-repetitive spatial hashing grid in meters. If none, it will be computed automatically. Defaults to None.

  • hash_grid_cell_size (float, optional) – Size of the lattic cell of the spatial hashing grid in meters. This should be at least 2 * particle_size. If none, it will be computed automatically. Defaults to None.

  • max_divergence_error (float, optional) – Maximum divergence error for DFSPH. Defaults to 0.1.

  • max_density_error_percent (float, optional) – Maximum density error percent for DFSPH, so 0.1 means 0.1%. Defaults to 0.05.

  • max_divergence_solver_iterations (int, optional) – Maximum number of iterations for the divergence solver. Defaults to 100.

  • max_density_solver_iterations (int, optional) – Maximum number of iterations for the density solver. Defaults to 100.