SFSolver#

The SFSolver is the Stable Fluid solver: a grid-based (Eulerian) solver for gaseous phenomena such as smoke. It advects a velocity field and one or more scalar density fields on a fixed 3D grid, then makes the velocity field divergence-free with a Jacobi pressure projection.

It simulates the SF.Smoke material; see Smoke. For usage and behavior, see Beyond rigid bodies.

Options#

class genesis.options.solvers.SFOptions(*, dt: float | None = None, res: int = 128, solver_iters: int = 500, decay: float = 0.99, T_low: float = 1.0, T_high: float = 0.0, inlet_pos: tuple[float, float, float] = (0.6, 0.0, 0.1), inlet_vel: tuple[float, float, float] = (0.0, 0.0, 1.0), inlet_quat: tuple[float, float, float, float] = (1.0, 0.0, 0.0, 0.0), inlet_s: float = 400.0) None[source]#

Options configuring the SFSolver.

SFSolver#

class genesis.engine.solvers.sf_solver.SFSolver(scene, sim, options)[source]#

Bases: TimeBasedMixin, Solver

Stable Fluid solver for eulerian-based gaseous simulation.

setup_fields()[source]#
init_fields()[source]#
reset_grad()[source]#
build()[source]#
property is_active#
set_jets(jets)[source]#
reset_swap()[source]#
pressure_jacobi(pf: <quadrants.types.annotations.Template object at 0x797f40f83200>, new_pf: <quadrants.types.annotations.Template object at 0x797f40f831a0>)[source]#
advect_and_impulse(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, t: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1ae70>)[source]#
divergence()[source]#
pressure_to_swap()[source]#
pressure_from_swap()[source]#
subtract_gradient()[source]#
compute_location(u, v, w, du, dv, dw)[source]#
is_free(u, v, w, du, dv, dw)[source]#
trilerp_scalar(qf, p, qf_idx)[source]#

p: position, within (0, 1). qf: field for interpolation

trilerp(qf, p)[source]#

p: position, within (0, 1). qf: field for interpolation

backtrace(vf, p, dt)[source]#

vf: velocity field

process_input(in_backward)[source]#
substep_pre_coupling(f)[source]#
substep_post_coupling(f)[source]#
collect_output_grads()[source]#
add_grad_from_state(state)[source]#
get_state(f)[source]#
set_state(f, state, envs_idx=None)[source]#
save_ckpt(ckpt_name)[source]#
load_ckpt(ckpt_name)[source]#

See also#

  • Smoke: the smoke material simulated by this solver.