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

Merge branch 'fix-cosmology-monaghan-av' into 'master'

Clarified cosmology dependence in morris av. Closes #568

Closes #568

See merge request !897
parents fa8aea3e c874afb0
No related branches found
No related tags found
1 merge request!897Clarified cosmology dependence in morris av. Closes #568
......@@ -640,14 +640,14 @@ __attribute__((always_inline)) INLINE static void hydro_prepare_force(
/* Artificial viscosity updates */
/* TODO: Actually work out why this cosmology factor is correct
* and update the SPH / cosmology theory documents. */
/* We perform all of this in physical space. */
const float h_inv_physical = cosmo->a_inv * h_inv;
const float soundspeed_physical = cosmo->a_factor_sound_speed * soundspeed;
/* We divide by a^2 here to make this transform under cosmology the
* same as the velocity (which in SWIFT has an extra 1/a^2 factor.
* See the cosmology theory documents for more information. */
/* Decay rate */
const float inverse_tau =
(hydro_props->viscosity.length * cosmo->a2_inv) * soundspeed * h_inv;
hydro_props->viscosity.length * soundspeed_physical * h_inv_physical;
/* Source term (div v) is already in physical co-ordinates for this scheme */
const float source_term = -1.f * min(p->density.div_v, 0.f);
/* Compute da/dt */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment