Skip to content
Snippets Groups Projects
Commit 4edc5565 authored by Jacob Kegerreis's avatar Jacob Kegerreis
Browse files

Define the viscosity beta as a constant instead of hard-coded

parent 9f747b8b
No related branches found
No related tags found
1 merge request!627Define the viscosity beta as a constant instead of a hardcoded value
......@@ -21,7 +21,10 @@
#define SWIFT_CONST_H
/* SPH Viscosity constants. */
#define const_viscosity_alpha 0.8f
/* Cosmology defaults: a=0.8, b=1.5a. Planetary defaults: a=1.5, b=2.0a */
#define const_viscosity_alpha 1.5f
#define const_viscosity_beta_over_alpha 2.0f
#define const_viscosity_alpha_min \
0.1f /* Values taken from (Price,2004), not used in legacy gadget mode */
#define const_viscosity_alpha_max \
......
......@@ -189,7 +189,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
/* Compute sound speeds and signal velocity */
const float ci = pi->force.soundspeed;
const float cj = pj->force.soundspeed;
const float v_sig = ci + cj - 3.f * mu_ij;
const float v_sig = ci + cj - 2.f * const_viscosity_beta_over_alpha * mu_ij;
/* Now construct the full viscosity term */
const float rho_ij = 0.5f * (rhoi + rhoj);
......@@ -315,7 +315,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
const float cj = pj->force.soundspeed;
/* Signal velocity */
const float v_sig = ci + cj - 3.f * mu_ij;
const float v_sig = ci + cj - 2.f * const_viscosity_beta_over_alpha * mu_ij;
/* Construct the full viscosity term */
const float rho_ij = 0.5f * (rhoi + rhoj);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment