Commit d908d35f authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Remove wrong factors in prepare_force() for DEFAULT_SPH

parent 16c4113f
......@@ -56,8 +56,8 @@
/* SPH variant to use */
//#define MINIMAL_SPH
#define GADGET2_SPH
//#define DEFAULT_SPH
//#define GADGET2_SPH
#define DEFAULT_SPH
/* Gravity properties */
#define EXTERNAL_POTENTIAL_POINTMASS
......
......@@ -136,15 +136,12 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
/* Some smoothing length multiples. */
const float h = p->h;
const float ih = 1.0f / h;
const float ih2 = ih * ih;
const float ih4 = ih2 * ih2;
/* Pre-compute some stuff for the balsara switch. */
const float normDiv_v = fabs(p->density.div_v / p->rho * ih4);
const float normDiv_v = fabs(p->density.div_v);
const float normRot_v = sqrtf(p->density.rot_v[0] * p->density.rot_v[0] +
p->density.rot_v[1] * p->density.rot_v[1] +
p->density.rot_v[2] * p->density.rot_v[2]) /
p->rho * ih4;
p->density.rot_v[2] * p->density.rot_v[2]);
/* Compute this particle's sound speed. */
const float u = p->u;
......
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