From 96e88e415160c8050bc6b699551efc33aa409857 Mon Sep 17 00:00:00 2001 From: Jonas Erbesdobler Date: Sun, 9 Jun 2024 04:12:18 +0200 Subject: [PATCH] solver clean up --- cases/db.yaml | 2 +- jax_sph/solver.py | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/cases/db.yaml b/cases/db.yaml index d0748c4..4ad6e13 100644 --- a/cases/db.yaml +++ b/cases/db.yaml @@ -9,7 +9,7 @@ case: viscosity: 0.00005 special: L_wall: 5.366 - H_wall: 2.0 + H_wall: 5.366 #2.0 L: 2.0 # water column length H: 1.0 # water column height W: 0.2 # width in 3D case diff --git a/jax_sph/solver.py b/jax_sph/solver.py index 826297c..9902f7b 100644 --- a/jax_sph/solver.py +++ b/jax_sph/solver.py @@ -62,12 +62,9 @@ def rho_evol_riemann_fn( rho_L = rho_i # u_w from eq. (15), Yang (2020) - # u_d = 2 * u_i - u_j - u_d = 2 * u_i - u_tilde_j u_R = jnp.where( wall_mask_j == 1, - # -u_L + 2 * jnp.dot(u_j, n_w_j), - jnp.dot(u_d, -n_w_j), + -u_L + 2 * jnp.dot(u_j, -n_w_j), jnp.dot(u_j, -e_ij), ) p_R = jnp.where(wall_mask_j == 1, p_L + rho_L * jnp.dot(g_ext_i, -r_ij), p_j) @@ -215,13 +212,10 @@ def acceleration_fn_riemann( p_L = p_i rho_L = rho_i - # u_w from eq. (15), Yang (2020) - # u_d = 2 * u_i - u_j - u_d = 2 * u_i - u_tilde_j + # u_w from eq. (15), Yang (2020) u_R = jnp.where( wall_mask_j == 1, - # -u_L + 2 * jnp.dot(u_j, n_w_j), - jnp.dot(u_d, -n_w_j), + -u_L + 2 * jnp.dot(u_j, -n_w_j), jnp.dot(u_j, -e_ij), ) p_R = jnp.where(wall_mask_j == 1, p_L + rho_L * jnp.dot(g_ext_i, -r_ij), p_j) @@ -244,7 +238,6 @@ def acceleration_fn_riemann( eq_9 = -2 * m_j * (P_star / (rho_i * rho_j)) * kernel_grad # viscosity term eq. (6), Zhang (2019) - # TODO: u_j is supposed to be u_i, but why is it not working? u_d = 2 * u_j - u_tilde_j v_ij = jnp.where( wall_mask_j == 1, @@ -404,8 +397,7 @@ def free_weight(fluid_mask_i, tag_i): return fluid_mask_i def Riemann_velocities(u, w_dist, fluid_mask, i_s, j_s, N): - u_tilde = jnp.empty_like(u) - return u_tilde + return u else: def free_weight(fluid_mask_i, tag_i):