19#ifndef SWIFT_IDEAL_GAS_EQUATION_OF_STATE_H
20#define SWIFT_IDEAL_GAS_EQUATION_OF_STATE_H
49gas_internal_energy_from_entropy(
float density,
float entropy) {
51 return entropy * pow_gamma_minus_one(density) *
52 hydro_one_over_gamma_minus_one;
64gas_pressure_from_entropy(
float density,
float entropy) {
66 return entropy * pow_gamma(density);
79gas_entropy_from_pressure(
float density,
float pressure) {
81 return pressure * pow_minus_gamma(density);
93gas_soundspeed_from_entropy(
float density,
float entropy) {
95 return sqrtf(hydro_gamma * pow_gamma_minus_one(density) *
entropy);
107gas_entropy_from_internal_energy(
float density,
float u) {
109 return hydro_gamma_minus_one *
u * pow_minus_gamma_minus_one(density);
121gas_pressure_from_internal_energy(
float density,
float u) {
123 return hydro_gamma_minus_one *
u *
density;
136gas_internal_energy_from_pressure(
float density,
float pressure) {
150gas_soundspeed_from_internal_energy(
float density,
float u) {
152 return sqrtf(
u * hydro_gamma * hydro_gamma_minus_one);
164gas_soundspeed_from_pressure(
float density,
float P) {
166 return sqrtf(hydro_gamma *
P / density);
180 const struct phys_const *phys_const,
181 const struct unit_system *us,
182 struct swift_params *params) {}
195#if defined(HAVE_HDF5)
202INLINE static void eos_print_snapshot(hid_t h_grpsph,
205 io_write_attribute_f(h_grpsph,
"Adiabatic index", hydro_gamma);
207 io_write_attribute_s(h_grpsph,
"Equation of state",
"Ideal gas");
Defines the adiabatic index (polytropix index) of the problem and (fast) mathematical functions invo...
static INLINE void eos_init(struct eos_parameters *e, const struct phys_const *phys_const, const struct unit_system *us, struct swift_params *params)
Initialize the eos parameters.
static INLINE void eos_print(const struct eos_parameters *e)
Print the equation of state.
__attribute__((always_inline, const)) INLINE static float gas_internal_energy_from_entropy(float density
Returns the internal energy given density and entropy.
struct eos_parameters eos
#define INLINE
Defines inline.
The parameters of the equation of state for the gas.