Commit 630b09af authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Also updated the Pressure-Entropy SPH scheme to use the new definition of the...

Also updated the Pressure-Entropy SPH scheme to use the new definition of the number of neighbours and its derivative. Back to correct results.
parent 73d8876b
......@@ -212,14 +212,15 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
p->density.pressure_dh -=
hydro_dimension * p->mass * p->entropy_one_over_gamma * kernel_root;
p->density.wcount += kernel_root;
p->density.wcount_dh -= hydro_dimension * kernel_root;
/* Finish the calculation by inserting the missing h-factors */
p->rho *= h_inv_dim;
p->rho_bar *= h_inv_dim;
p->density.rho_dh *= h_inv_dim_plus_one;
p->density.pressure_dh *= h_inv_dim_plus_one;
p->density.wcount *= kernel_norm;
p->density.wcount_dh *= h_inv * kernel_gamma * kernel_norm;
p->density.wcount *= h_inv_dim;
p->density.wcount_dh *= h_inv_dim_plus_one;
const float rho_inv = 1.f / p->rho;
const float entropy_minus_one_over_gamma = 1.f / p->entropy_one_over_gamma;
......
......@@ -59,7 +59,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
/* Compute contribution to the number of neighbours */
pi->density.wcount += wi;
pi->density.wcount_dh -= ui * wi_dx;
pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
/* Compute contribution to the weighted density */
pi->rho_bar += mj * pj->entropy_one_over_gamma * wi;
......@@ -77,7 +77,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
/* Compute contribution to the number of neighbours */
pj->density.wcount += wj;
pj->density.wcount_dh -= uj * wj_dx;
pj->density.wcount_dh -= (hydro_dimension * wj + uj * wj_dx);
/* Compute contribution to the weighted density */
pj->rho_bar += mi * pi->entropy_one_over_gamma * wj;
......@@ -147,7 +147,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
/* Compute contribution to the number of neighbours */
pi->density.wcount += wi;
pi->density.wcount_dh -= ui * wi_dx;
pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
/* Compute contribution to the weighted density */
pi->rho_bar += mj * pj->entropy_one_over_gamma * wi;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment