Solver
SPH Solver
Weakly compressible SPH solver.
- jax_sph.solver.rho_evol_fn(rho, mass, u, grad_w_dist, i_s, j_s, dt, N, **kwargs)[source]
Density evolution according to Adami et al. 2013.
- jax_sph.solver.rho_evol_riemann_fn_wrapper(kernel_fn, eos, c_ref)[source]
Density evolution according to Zhang et al. 2017.
- jax_sph.solver.rho_renorm_fn(rho, mass, i_s, j_s, w_dist, N)[source]
Renormalization of density according to Zhang et al. 2017.
- jax_sph.solver.wall_phi_vec_wrapper(kernel_fn)[source]
Compute the wall phi vector according to Zhang et al. 2017.
- jax_sph.solver.acceleration_tvf_fn_wrapper(kernel_fn)[source]
Transport velocity formulation acceleration according to Adami et al. 2013.
- jax_sph.solver.tvf_stress_fn(rho: float, u, v)[source]
Transport velocity stress tensor. See ‘A’ under (Eq. 4) in Adami et al. 2013.
- jax_sph.solver.acceleration_standard_fn_wrapper(kernel_fn)[source]
Standard SPH acceleration according to Adami et al. 2012.
- jax_sph.solver.acceleration_riemann_fn_wrapper(kernel_fn, eos, beta_fn, eta_limiter)[source]
Riemann solver acceleration according to Zhang et al. 2017.
- jax_sph.solver.artificial_viscosity_fn_wrapper(dx, artificial_alpha, u_ref=1.0)[source]
Artificial viscosity according to Adami et al. 2012.
- jax_sph.solver.gwbc_fn_wrapper(is_free_slip, is_heat_conduction, eos)[source]
Enforce wall boundary conditions by treating boundary particles in a special way.
If solid walls -> apply BC tricks
Update dummy particles before acceleration computation (if appl.).
Steps for boundary particles:
sum pressure over fluid with sheparding
inverse EoS for density
sum velocity over fluid with sheparding and * (-1)
if free-slip: project velocity onto normal vector
subtract that from 2 * u_wall - keeps lid intact
Based on: “A generalized wall boundary condition for smoothed particle hydrodynamics”, Adami, Hu, Adams, 2012
- jax_sph.solver.gwbc_fn_riemann_wrapper(is_free_slip, is_heat_conduction)[source]
Riemann solver boundary condition for wall particles.
- jax_sph.solver.limiter_fn_wrapper(eta_limiter, c_ref)[source]
if eta_limiter != -1, introduce dissipation limiter eq. (11), Zhang (2017).
- jax_sph.solver.temperature_derivative_wrapper(kernel_fn)[source]
Temperature derivative according to Cleary 1998.
- class jax_sph.solver.WCSPH(displacement_fn: Callable, eos: TaitEoS | RIEMANNEoS, g_ext_fn: Callable, dx: float, dim: int, dt: float, c_ref: float, eta_limiter: float = 3, solver: str = 'SPH', kernel: str = 'QSK', is_bc_trick: bool = False, is_rho_evol: bool = False, artificial_alpha: float = 0.0, is_free_slip: bool = False, is_rho_renorm: bool = False, is_heat_conduction: bool = False)[source]
Weakly compressible SPH solver with transport velocity formulation.
Equation of State
Equation of state.
- class jax_sph.eos.TaitEoS(p_ref, rho_ref, p_background, gamma)[source]
Tait equation of state.
From: “A generalized wall boundary condition for smoothed particle hydrodynamics”, Adami et al 2012
Kernels
SPH interpolation kernels.
- class jax_sph.kernel.WendlandC2Kernel(h, dim=3)[source]
The 5th-order C2 kernel function of Wendland.
- class jax_sph.kernel.WendlandC4Kernel(h, dim=3)[source]
The 5th-order C4 kernel function of Wendland.
- class jax_sph.kernel.WendlandC6Kernel(h, dim=3)[source]
The 5th-order C6 kernel function of Wendland.
Integrator
Integrator schemes.
- jax_sph.integrator.si_euler(tvf: float, model: Callable, shift_fn: Callable, bc_fn: Callable, nw_fn: Callable)[source]
Semi-implicit Euler integrator including Transport Velocity.
The integrator advances the state of the system following the steps:
Update u and v with dudt and dvdt
Update position r with velocity v
Update neighbor list
Compute accelerations - SPH model call
Impose boundary conditions as defined by the case.