Commit 3476460d authored by Josh Borrow's avatar Josh Borrow Committed by Matthieu Schaller
Browse files

Added diffusion reset in hydro when doing feedback and updated function signatures

parent 5c66158b
......@@ -208,7 +208,7 @@ runner_iact_nonsym_bh_feedback(const float r2, const float *dx, const float hi,
hydro_set_drifted_physical_internal_energy(pj, cosmo, u_new);
/* Impose maximal viscosity */
hydro_set_viscosity_alpha_max_feedback(pj);
hydro_diffusive_feedback_reset(pj);
/* message( */
/* "We did some AGN heating! id %llu BH id %llu probability " */
......
......@@ -301,7 +301,7 @@ runner_iact_nonsym_feedback_apply(const float r2, const float *dx,
hydro_set_drifted_physical_internal_energy(pj, cosmo, u_new);
/* Impose maximal viscosity */
hydro_set_viscosity_alpha_max_feedback(pj);
hydro_diffusive_feedback_reset(pj);
/* message( */
/* "We did some heating! id %llu star id %llu probability %.5e " */
......
......@@ -423,15 +423,18 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the viscosity alpha to the
* @brief Update the value of the diffusive coefficients to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part *restrict p) {
hydro_diffusive_feedback_reset(struct part *restrict p) {
/* Set the viscosity to the max, and the diffusion to the min */
hydro_set_viscosity_alpha(p,
hydro_props_default_viscosity_alpha_feedback_reset);
p->diffusion.alpha = hydro_props_default_diffusion_alpha_feedback_reset;
}
/**
......
......@@ -76,6 +76,14 @@
* sets the decay length for the diffusion. */
#define hydro_props_default_viscosity_length 0.25f
/* Diffusion parameters -- FIXED -- MUST BE DEFINED AT COMPILE-TIME */
/*! The diffusion that the particles are reset to after being hit by a
* feedback event. This should be set to the same value as the
* hydro_props_default_diffusion_alpha in fixed schemes, and likely
* to hydro_props_default_diffusion_alpha_min in variable schemes. */
#define hydro_props_default_diffusion_alpha_feedback_reset 0.0f
/* Diffusion parameters -- Defaults; can be changed at run-time */
/*! The "initial" diffusion, or the fixed value for non-variable
......
......@@ -431,15 +431,18 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the viscosity alpha to the
* @brief Update the value of the diffusive coefficients to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part *restrict p) {
hydro_diffusive_feedback_reset(struct part *restrict p) {
/* Set the viscosity to the max, and the diffusion to the min */
hydro_set_viscosity_alpha(p,
hydro_props_default_viscosity_alpha_feedback_reset);
p->diffusion.alpha = hydro_props_default_diffusion_alpha_feedback_reset;
}
/**
......
......@@ -76,6 +76,14 @@
* sets the decay length for the diffusion. */
#define hydro_props_default_viscosity_length 0.25f
/* Diffusion parameters -- FIXED -- MUST BE DEFINED AT COMPILE-TIME */
/*! The diffusion that the particles are reset to after being hit by a
* feedback event. This should be set to the same value as the
* hydro_props_default_diffusion_alpha in fixed schemes, and likely
* to hydro_props_default_diffusion_alpha_min in variable schemes. */
#define hydro_props_default_diffusion_alpha_feedback_reset 0.0f
/* Diffusion parameters -- Defaults; can be changed at run-time */
/* The "initial" diffusion, or the fixed value for non-variable
......
......@@ -423,13 +423,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the viscosity alpha to the
* @brief Update the value of the diffusive coefficients to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part *restrict p) {
hydro_diffusive_feedback_reset(struct part *restrict p) {
hydro_set_viscosity_alpha(p,
hydro_props_default_viscosity_alpha_feedback_reset);
}
......
......@@ -413,13 +413,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the viscosity alpha to the
* @brief Update the value of the diffusive coefficients to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part *restrict p) {
hydro_diffusive_feedback_reset(struct part *restrict p) {
/* This scheme has fixed alpha */
}
......
......@@ -1048,7 +1048,7 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part* restrict p) {
hydro_diffusive_feedback_reset(struct part* restrict p) {
/* Purposefully left empty */
}
......
......@@ -1119,7 +1119,7 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part* restrict p) {
hydro_diffusive_feedback_reset(struct part* restrict p) {
/* Purposefully left empty */
}
......
......@@ -408,13 +408,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the viscosity alpha to the
* @brief Update the value of the diffusive coefficients to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part *restrict p) {
hydro_diffusive_feedback_reset(struct part *restrict p) {
/* This scheme has fixed alpha */
}
......
......@@ -432,13 +432,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the viscosity alpha to the
* @brief Update the value of the diffusive coefficients to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part *restrict p) {
hydro_diffusive_feedback_reset(struct part *restrict p) {
/* This scheme has fixed alpha */
}
......
......@@ -433,13 +433,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the viscosity alpha to the
* @brief Update the value of the diffusive coefficients to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part *restrict p) {
hydro_diffusive_feedback_reset(struct part *restrict p) {
/* This scheme has fixed alpha */
}
......
......@@ -430,13 +430,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the viscosity alpha to the
* @brief Update the value of the diffusive coefficients to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part *restrict p) {
hydro_diffusive_feedback_reset(struct part *restrict p) {
hydro_set_viscosity_alpha(p,
hydro_props_default_viscosity_alpha_feedback_reset);
}
......
......@@ -195,13 +195,13 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
}
/**
* @brief Update the value of the viscosity alpha to the
* @brief Update the value of the diffusive coefficients to the
* feedback reset value for the scheme.
*
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part *restrict p) {
hydro_diffusive_feedback_reset(struct part *restrict p) {
/* This scheme has fixed alpha */
}
......
......@@ -892,7 +892,7 @@ __attribute__((always_inline)) INLINE static void hydro_set_viscosity_alpha(
* @param p the particle of interest
*/
__attribute__((always_inline)) INLINE static void
hydro_set_viscosity_alpha_max_feedback(struct part* restrict p) {
hydro_diffusive_feedback_reset(struct part* restrict p) {
/* Purposefully left empty */
}
......
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