diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index dada62acab7c9e4c2ffa279423bae104ad5d7182..e407957a754e2183f1038c973a989b7fb344a77b 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -767,6 +767,7 @@ INPUT += @top_srcdir@/src/stars/Default INPUT += @top_srcdir@/src/riemann INPUT += @top_srcdir@/src/potential/point_mass INPUT += @top_srcdir@/src/equation_of_state/ideal_gas +INPUT += @top_srcdir@/src/cooling/const_du INPUT += @top_srcdir@/src/cooling/const_lambda INPUT += @top_srcdir@/src/cooling/EAGLE INPUT += @top_srcdir@/src/chemistry/EAGLE diff --git a/src/cooling/const_du/cooling.h b/src/cooling/const_du/cooling.h index b6fea7eea7b0fb208c4bffece425ec836d5df0c0..fe8deb55f185108ec2ba03d5eb5e5f9f26da48fa 100644 --- a/src/cooling/const_du/cooling.h +++ b/src/cooling/const_du/cooling.h @@ -54,26 +54,30 @@ * @param phys_const The physical constants in internal units. * @param us The internal system of units. * @param cosmo The current cosmological model. + * @param hydro_props The properties of the hydro scheme. * @param cooling The #cooling_function_data used in the run. * @param p Pointer to the particle data. * @param xp Pointer to the extended particle data. * @param dt The time-step of this particle. + * @param dt_therm The time-step operator used for thermal quantities. */ __attribute__((always_inline)) INLINE static void cooling_cool_part( const struct phys_const* restrict phys_const, const struct unit_system* restrict us, const struct cosmology* restrict cosmo, + const struct hydro_props* hydro_props, const struct cooling_function_data* restrict cooling, - struct part* restrict p, struct xpart* restrict xp, float dt) { + struct part* restrict p, struct xpart* restrict xp, const float dt, + const float dt_therm) { /* Internal energy floor */ const float u_floor = cooling->min_energy; /* Get current internal energy */ - const float u_old = hydro_get_physical_internal_energy(p, cosmo); + const float u_old = hydro_get_physical_internal_energy(p, xp, cosmo); /* Current du_dt */ - const float hydro_du_dt = hydro_get_internal_energy_dt(p); + const float hydro_du_dt = hydro_get_physical_internal_energy_dt(p, cosmo); /* Get cooling function properties */ float cooling_du_dt = -cooling->cooling_rate; @@ -86,7 +90,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part( } /* Update the internal energy time derivative */ - hydro_set_internal_energy_dt(p, hydro_du_dt + cooling_du_dt); + hydro_set_physical_internal_energy_dt(p, cosmo, hydro_du_dt + cooling_du_dt); /* Store the radiated energy */ xp->cooling_data.radiated_energy += -hydro_get_mass(p) * cooling_du_dt * dt; @@ -103,16 +107,21 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part( * @param phys_const The physical constants in internal units. * @param cosmo The current cosmological model. * @param us The internal system of units. + * @param hydro_props The properties of the hydro scheme. * @param p Pointer to the particle data. + * @param xp Pointer to the extedended particle data. */ __attribute__((always_inline)) INLINE static float cooling_timestep( const struct cooling_function_data* restrict cooling, const struct phys_const* restrict phys_const, const struct cosmology* restrict cosmo, - const struct unit_system* restrict us, const struct part* restrict p) { + const struct unit_system* restrict us, + const struct hydro_props* hydro_props, const struct part* restrict p, + const struct xpart* xp) { const float cooling_rate = cooling->cooling_rate; - const float internal_energy = hydro_get_physical_internal_energy(p, cosmo); + const float internal_energy = + hydro_get_physical_internal_energy(p, xp, cosmo); return cooling->cooling_tstep_mult * internal_energy / fabsf(cooling_rate); } @@ -126,7 +135,10 @@ __attribute__((always_inline)) INLINE static float cooling_timestep( * * @param p Pointer to the particle data. * @param xp Pointer to the extended particle data. + * @param phys_const The physical constants in internal units. * @param cooling The properties of the cooling function. + * @param us The internal system of units. + * @param cosmo The current cosmological model. */ __attribute__((always_inline)) INLINE static void cooling_first_init_part( const struct phys_const* restrict phys_const, diff --git a/src/cooling/const_du/cooling_io.h b/src/cooling/const_du/cooling_io.h index 52a943aca86e51665fd1841d7bcb8a100b046ed8..accdb44ef8ecc543293808f0f54af795cb694c19 100644 --- a/src/cooling/const_du/cooling_io.h +++ b/src/cooling/const_du/cooling_io.h @@ -31,19 +31,20 @@ /** * @brief Writes the current model of SPH to the file - * @param h_grpsph The HDF5 group in which to write + * @param h_grp The HDF5 group in which to write + * @param cooling the parameters of the cooling function. */ __attribute__((always_inline)) INLINE static void cooling_write_flavour( - hid_t h_grpsph) { + hid_t h_grp, const struct cooling_function_data* cooling) { - io_write_attribute_s(h_grpsph, "Cooling Model", "Constant du/dt"); + io_write_attribute_s(h_grp, "Cooling Model", "Constant du/dt"); } #endif /** * @brief Specifies which particle fields to write to a dataset * - * @param parts The particle array. + * @param xparts The exended particle data array. * @param list The list of i/o properties to write. * @param cooling The #cooling_function_data * diff --git a/src/cooling/const_lambda/cooling.h b/src/cooling/const_lambda/cooling.h index e38b6a602e741babef5f7f201ead815d828652a2..6bb716be1128acf12e42d9fc517b9dce56fc9b80 100644 --- a/src/cooling/const_lambda/cooling.h +++ b/src/cooling/const_lambda/cooling.h @@ -146,7 +146,6 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part( * * @param cooling The #cooling_function_data used in the run. * @param phys_const The physical constants in internal units. - * @param us The internal system of units. * @param cosmo The current cosmological model. * @param hydro_props The properties of the hydro scheme. * @param us The internal system of units. diff --git a/src/cooling/none/cooling.h b/src/cooling/none/cooling.h index 0cc465adcdad8fe19afe4a9867e5d68a22ed9119..c21af9c3f1b491256e9f2a65f2f924fa606f665d 100644 --- a/src/cooling/none/cooling.h +++ b/src/cooling/none/cooling.h @@ -44,17 +44,21 @@ * @param phys_const The physical constants in internal units. * @param us The internal system of units. * @param cosmo The current cosmological model. + * @param hydro_props The properties of the hydro scheme. * @param cooling The #cooling_function_data used in the run. * @param p Pointer to the particle data. * @param xp Pointer to the extended particle data. * @param dt The time-step of this particle. + * @param dt_therm The time-step operator used for thermal quantities. */ __attribute__((always_inline)) INLINE static void cooling_cool_part( const struct phys_const* restrict phys_const, const struct unit_system* restrict us, const struct cosmology* restrict cosmo, + const struct hydro_props* hydro_props, const struct cooling_function_data* restrict cooling, - struct part* restrict p, struct xpart* restrict xp, float dt) {} + struct part* restrict p, struct xpart* restrict xp, const float dt, + const float dt_therm) {} /** * @brief Computes the cooling time-step. @@ -64,14 +68,18 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part( * @param cooling The #cooling_function_data used in the run. * @param phys_const The physical constants in internal units. * @param cosmo The current cosmological model. + * @param hydro_props The properties of the hydro scheme. * @param us The internal system of units. * @param p Pointer to the particle data. + * @param xp Pointer to the extended data of the particle. */ __attribute__((always_inline)) INLINE static float cooling_timestep( const struct cooling_function_data* restrict cooling, const struct phys_const* restrict phys_const, const struct cosmology* restrict cosmo, - const struct unit_system* restrict us, const struct part* restrict p) { + const struct unit_system* restrict us, + const struct hydro_props* hydro_props, const struct part* restrict p, + const struct xpart* restrict xp) { return FLT_MAX; } diff --git a/src/cooling/none/cooling_io.h b/src/cooling/none/cooling_io.h index e4c84f506bcd31ff95ededb5be889fbf9a27261b..518c166480a0b81f6856c8a39e2a64d34369dc84 100644 --- a/src/cooling/none/cooling_io.h +++ b/src/cooling/none/cooling_io.h @@ -29,12 +29,13 @@ /** * @brief Writes the current model of SPH to the file - * @param h_grpsph The HDF5 group in which to write + * @param h_grp The HDF5 group in which to write + * @param cooling the parameters of the cooling function. */ __attribute__((always_inline)) INLINE static void cooling_write_flavour( - hid_t h_grpsph) { + hid_t h_grp, const struct cooling_function_data* cooling) { - io_write_attribute_s(h_grpsph, "Cooling Model", "None"); + io_write_attribute_s(h_grp, "Cooling Model", "None"); } #endif