Skip to content
Snippets Groups Projects
Commit 1d895563 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Drift entopy in grad-h term for PE-SPH

parent bec2f704
No related branches found
No related tags found
No related merge requests found
......@@ -338,11 +338,10 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
/* Compute "grad h" term (note we use rho here and not rho_bar !)*/
const float rho_inv = 1.f / p->rho;
const float entropy_minus_one_over_gamma = 1.f / p->entropy_one_over_gamma;
const float rho_dh =
1.f / (1.f + hydro_dimension_inv * p->h * p->density.rho_dh * rho_inv);
const float pressure_dh = p->density.pressure_dh * rho_inv * p->h *
hydro_dimension_inv * entropy_minus_one_over_gamma;
const float pressure_dh =
p->density.pressure_dh * rho_inv * p->h * hydro_dimension_inv;
const float grad_h_term = rho_dh * pressure_dh;
......
......@@ -255,8 +255,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
/* Now, convolve with the kernel */
const float visc_term = 0.5f * visc * (wi_dr + wj_dr);
const float sph_term = (S_gamma_j / S_gamma_i - f_i) * P_over_rho2_i * wi_dr +
(S_gamma_i / S_gamma_j - f_j) * P_over_rho2_j * wj_dr;
const float sph_term =
(S_gamma_j / S_gamma_i - f_i / S_gamma_i) * P_over_rho2_i * wi_dr +
(S_gamma_i / S_gamma_j - f_j / S_gamma_j) * P_over_rho2_j * wj_dr;
/* Eventually got the acceleration */
const float acc = (visc_term + sph_term) * r_inv;
......@@ -365,8 +366,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
/* Now, convolve with the kernel */
const float visc_term = 0.5f * visc * (wi_dr + wj_dr);
const float sph_term = (S_gamma_j / S_gamma_i - f_i) * P_over_rho2_i * wi_dr +
(S_gamma_i / S_gamma_j - f_j) * P_over_rho2_j * wj_dr;
const float sph_term =
(S_gamma_j / S_gamma_i - f_i / S_gamma_i) * P_over_rho2_i * wi_dr +
(S_gamma_i / S_gamma_j - f_j / S_gamma_j) * P_over_rho2_j * wj_dr;
/* Eventually got the acceleration */
const float acc = (visc_term + sph_term) * r_inv;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment