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

Added more explicit cosmological conversion factors to the cosmology structure.

parent ee0e8e63
No related branches found
No related tags found
1 merge request!509Cosmological time integration
......@@ -138,6 +138,9 @@ void cosmology_update(struct cosmology *c, integertime_t ti_current) {
c->a_inv = a_inv;
c->a2_inv = a_inv * a_inv;
c->a3_inv = a_inv * a_inv * a_inv;
c->a_factor_internal_energy =
pow(a, -3. * hydro_gamma_minus_one); /* a^{3*(1-gamma)} */
c->a_factor_pressure = pow(a, -3. * hydro_gamma); /* a^{-3*gamma} */
c->a_factor_sound_speed =
pow(a, -1.5 * hydro_gamma_minus_one); /* a^{3*(1-gamma)/2} */
c->a_factor_grav_accel = a_inv * a_inv; /* 1 / a^2 */
......@@ -459,6 +462,8 @@ void cosmology_init_no_cosmo(struct cosmology *c) {
c->a_inv = 1.;
c->a2_inv = 1.;
c->a3_inv = 1.;
c->a_factor_internal_energy = 1.;
c->a_factor_pressure = 1.;
c->a_factor_sound_speed = 1.;
c->a_factor_mu = 1.;
c->a_factor_hydro_accel = 1.;
......
......@@ -44,10 +44,18 @@ struct cosmology {
/*! Inverse cube of the current expansion factor of the Universe */
double a3_inv;
/*! Power of the scale-factor used for sound-speed conversion */
/*! Power of the scale-factor used for internal energy conversion to physical
*/
double a_factor_internal_energy;
/*! Power of the scale-factor used for pressure conversion to physical */
double a_factor_pressure;
/*! Power of the scale-factor used for sound-speed conversion to physical */
double a_factor_sound_speed;
/*! Power of the scale-factor used for relative velocities in viscosity ter */
/*! Power of the scale-factor used for relative velocities in viscosity term
*/
double a_factor_mu;
/*! Power of the scale-factor used for gravity accelerations */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment