MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
thermal.h
Go to the documentation of this file.
1 #ifndef THERMALVEL_H
2 #define THERMALVEL_H
3 
4 #include <gsl/gsl_interp.h>
5 #include <gsl/gsl_rng.h>
6 /*Length of the table*/
7 #define MAX_FERMI_DIRAC 17.0
8 #define LENGTH_FERMI_DIRAC_TABLE 2000
9 
10 struct thermalvel
11 {
14  double m_vamp;
15  gsl_interp * fd_intp;
16  gsl_interp_accel * fd_intp_acc;
17 };
18 
19 /*Single parameter is the amplitude of the random velocities. All the physics is in here.
20  * max_fd and min_fd give the maximum and minimum velocities to integrate over.
21  * Note these values are dimensionless*/
22 /*Returns total fraction of the Fermi-Dirac distribution between max_fd and min_fd*/
23 double
24 init_thermalvel(struct thermalvel * thermals, const double v_amp, double max_fd, const double min_fd);
25 
26 /*Add a randomly generated thermal speed in v_amp*(min_fd, max_fd) to a 3-velocity.*/
27 void
28 add_thermal_speeds(struct thermalvel * thermals, gsl_rng *g_rng, float Vel[]);
29 
30 /*Amplitude of the random velocity for neutrinos*/
31 double
32 NU_V0(const double Time, const double kBTNubyMNu, const double UnitVelocity_in_cm_per_s);
33 
34 /*Amplitude of the random velocity for WDM*/
35 double
36 WDM_V0(const double Time, const double WDM_therm_mass, const double Omega_CDM, const double HubbleParam, const double UnitVelocity_in_cm_per_s);
37 
38 unsigned int *
39 init_rng(int Seed, int Nmesh);
40 
41 
42 #endif
gsl_interp * fd_intp
Definition: thermal.h:15
double fermi_dirac_cumprob[LENGTH_FERMI_DIRAC_TABLE]
Definition: thermal.h:13
double m_vamp
Definition: thermal.h:14
double fermi_dirac_vel[LENGTH_FERMI_DIRAC_TABLE]
Definition: thermal.h:12
gsl_interp_accel * fd_intp_acc
Definition: thermal.h:16
double NU_V0(const double Time, const double kBTNubyMNu, const double UnitVelocity_in_cm_per_s)
Definition: thermal.c:24
double WDM_V0(const double Time, const double WDM_therm_mass, const double Omega_CDM, const double HubbleParam, const double UnitVelocity_in_cm_per_s)
Definition: thermal.c:30
unsigned int * init_rng(int Seed, int Nmesh)
Definition: thermal.c:90
double init_thermalvel(struct thermalvel *thermals, const double v_amp, double max_fd, const double min_fd)
Definition: thermal.c:47
void add_thermal_speeds(struct thermalvel *thermals, gsl_rng *g_rng, float Vel[])
Definition: thermal.c:109
#define LENGTH_FERMI_DIRAC_TABLE
Definition: thermal.h:8