Peano
Loading...
Searching...
No Matches
equation_of_state.h File Reference
#include <math.h>
#include "adiabatic_index.h"
#include "inline.h"
Include dependency graph for equation_of_state.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  eos_parameters
 The parameters of the equation of state for the gas. More...
 

Functions

 __attribute__ ((always_inline, const)) INLINE static float gas_internal_energy_from_entropy(float density
 Returns the internal energy given density and entropy.
 
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.
 

Variables

struct eos_parameters eos
 
float entropy
 
float pressure
 
float u
 
float P
 

Function Documentation

◆ __attribute__()

__attribute__ ( (always_inline, const) )

Returns the internal energy given density and entropy.

Returns the sound speed given density and pressure.

Returns the sound speed given density and internal energy.

Returns the internal energy given density and pressure.

Returns the pressure given density and internal energy.

Returns the entropy given density and internal energy.

Returns the sound speed given density and entropy.

Returns the entropy given density and pressure.

Returns the pressure given density and entropy.

Computes \(u = \frac{A\rho^{\gamma-1} }{\gamma - 1}\).

Parameters
densityThe density \(\rho\).
entropyThe entropy \(A\).

Computes \(P = A\rho^\gamma\).

Parameters
densityThe density \(\rho\).
entropyThe entropy \(A\).

Computes \(A = \frac{P}{\rho^-\gamma}\).

Parameters
densityThe density \(\rho\).
pressureThe pressure \(P\).
Returns
The entropy \(A\).

Computes \(c = \sqrt{\gamma A \rho^{\gamma-1}}\).

Parameters
densityThe density \(\rho\).
entropyThe entropy \(A\).

Computes \(A = \frac{(\gamma - 1)u}{\rho^{\gamma-1}}\).

Parameters
densityThe density \(\rho\)
uThe internal energy \(u\)

Computes \(P = (\gamma - 1)u\rho\).

Parameters
densityThe density \(\rho\)
uThe internal energy \(u\)

Computes \(u = \frac{1}{\gamma - 1}\frac{P}{\rho}\).

Parameters
densityThe density \(\rho\).
pressureThe pressure \(P\).
Returns
The internal energy \(u\).

Computes \(c = \sqrt{\gamma (\gamma - 1) u }\).

Parameters
densityThe density \(\rho\)
uThe internal energy \(u\)

Computes \(c = \sqrt{\frac{\gamma P}{\rho} }\).

Parameters
densityThe density \(\rho\)
PThe pressure \(P\)

◆ eos_init()

static INLINE void eos_init ( struct eos_parameters * e,
const struct phys_const * phys_const,
const struct unit_system * us,
struct swift_params * params )
static

Initialize the eos parameters.

Nothing to do here since this EoS is parameter-free.

Parameters
eThe eos_parameters.
phys_constThe physical constants in the internal unit system.
usThe internal unit system.
paramsThe parsed parameters.

Definition at line 179 of file equation_of_state.h.

◆ eos_print()

static INLINE void eos_print ( const struct eos_parameters * e)
static

Print the equation of state.

Parameters
eThe eos_parameters

Definition at line 188 of file equation_of_state.h.

Variable Documentation

◆ entropy

float entropy
Initial value:
{
return entropy * pow_gamma_minus_one(density) *
hydro_one_over_gamma_minus_one
float entropy

Definition at line 49 of file equation_of_state.h.

◆ eos

struct eos_parameters eos
extern

Definition at line 46 of file equation_of_state.c.

◆ P

◆ pressure

◆ u