Commit 8931ca11 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Updated the ANARCHY-PU scheme with the new required functions for entropy floor and star formation.

parent 35ce681b
......@@ -362,6 +362,23 @@ hydro_set_physical_internal_energy_dt(struct part *restrict p,
p->u_dt = du_dt / cosmo->a_factor_internal_energy;
}
/**
* @brief Sets the physical entropy of a particle
*
* @param p The particle of interest.
* @param xp The extended particle data.
* @param cosmo Cosmology data structure
* @param entropy The physical entropy
*/
__attribute__((always_inline)) INLINE static void hydro_set_physical_entropy(
struct part *p, struct xpart *xp, const struct cosmology *cosmo,
const float entropy) {
/* Note there is no conversion from physical to comoving entropy */
const float comoving_entropy = entropy;
xp->u_full = gas_internal_energy_from_entropy(p->rho, comoving_entropy);
}
/**
* @brief Computes the hydro time-step of a given particle
*
......
......@@ -33,6 +33,8 @@
#include "chemistry_struct.h"
#include "cooling_struct.h"
#include "sftracers_struct.h"
#include "tracers_struct.h"
/**
* @brief Particle fields not needed during the SPH loops over neighbours.
......@@ -61,6 +63,12 @@ struct xpart {
/*! Additional data used to record cooling information */
struct cooling_xpart_data cooling_data;
/* Additional data used by the tracers */
struct tracers_xpart_data tracers_data;
/* Additional data used by the tracers */
struct sftracers_xpart_data sftracers_data;
} SWIFT_STRUCT_ALIGN;
/**
......
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