MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
sfr_eff.h
Go to the documentation of this file.
1 #ifndef __SFR_H
2 #define __SFR_H
3 
4 #include "forcetree.h"
5 #include "utils/paramset.h"
6 #include "timestep.h"
7 #include "partmanager.h"
8 #include "slotsmanager.h"
9 #include "physconst.h"
10 
11 #define METAL_YIELD 0.02
13 /*
14  * additional sfr criteria
15  */
18  SFR_CRITERION_MOLECULAR_H2 = 3, /* 2 + 1 */
19  SFR_CRITERION_SELFGRAVITY = 5, /* 4 + 1 */
20  /* below are additional flags in SELFGRAVITY */
21  SFR_CRITERION_CONVERGENT_FLOW = 13, /* 8 + 4 + 1 */
22  SFR_CRITERION_CONTINUOUS_CUTOFF= 21, /* 16 + 4 + 1 */
23 };
24 
25 /*Set the parameters of the star formation module*/
26 void set_sfr_params(ParameterSet * ps);
27 
28 void init_cooling_and_star_formation(int CoolingOn, int StarformationOn, Cosmology * CP, const double avg_baryon_mass, const double BoxSize, const struct UnitSystem units);
29 /*Do the cooling and the star formation. The tree is required for the winds only.*/
30 void cooling_and_starformation(ActiveParticles * act, double Time, double dloga, ForceTree * tree, const Cosmology * CP, MyFloat * GradRho, FILE * FdSfr);
31 
32 /*Get the neutral fraction of a particle correctly, even when on the star-forming equation of state.
33  * This calls the cooling routines for the current internal energy when off the equation of state, but
34  * when on the equation of state calls them separately for the cold and hot gas.*/
35 double get_neutral_fraction_sfreff(double redshift, double hubble, struct particle_data * partdata, struct sph_particle_data * sphdata);
36 
37 /*Get the helium ionic fraction of a particle correctly, even when on the star-forming equation of state.
38  * This calls the cooling routines for the current internal energy when off the equation of state, but
39  * when on the equation of state calls them separately for the cold and hot gas.*/
40 double get_helium_neutral_fraction_sfreff(int ion, double redshift, double hubble, struct particle_data * partdata, struct sph_particle_data * sphdata);
41 
42 /* Return whether we are using a star formation model that needs grad rho computed for the gas particles*/
44 
45 /* Get the number of generations of stars that may form*/
46 int get_generations(void);
47 
48 /* Returns 1 if particle is on effective EOS, 0 otherwise*/
49 int sfreff_on_eeqos(const struct sph_particle_data * sph, const double a3inv);
50 
51 /* Get the Minimum temperature in internal energy*/
52 double get_MinEgySpec(void);
53 
54 #endif
static double dloga
Definition: lightcone.c:21
static Cosmology * CP
Definition: power.c:27
void init_cooling_and_star_formation(int CoolingOn, int StarformationOn, Cosmology *CP, const double avg_baryon_mass, const double BoxSize, const struct UnitSystem units)
Definition: sfr_eff.c:805
double get_helium_neutral_fraction_sfreff(int ion, double redshift, double hubble, struct particle_data *partdata, struct sph_particle_data *sphdata)
Definition: sfr_eff.c:548
int sfreff_on_eeqos(const struct sph_particle_data *sph, const double a3inv)
Definition: sfr_eff.c:486
double get_neutral_fraction_sfreff(double redshift, double hubble, struct particle_data *partdata, struct sph_particle_data *sphdata)
Definition: sfr_eff.c:520
int get_generations(void)
Definition: sfr_eff.c:87
double get_MinEgySpec(void)
Definition: sfr_eff.c:797
StarformationCriterion
Definition: sfr_eff.h:16
@ SFR_CRITERION_MOLECULAR_H2
Definition: sfr_eff.h:18
@ SFR_CRITERION_CONVERGENT_FLOW
Definition: sfr_eff.h:21
@ SFR_CRITERION_CONTINUOUS_CUTOFF
Definition: sfr_eff.h:22
@ SFR_CRITERION_SELFGRAVITY
Definition: sfr_eff.h:19
@ SFR_CRITERION_DENSITY
Definition: sfr_eff.h:17
void cooling_and_starformation(ActiveParticles *act, double Time, double dloga, ForceTree *tree, const Cosmology *CP, MyFloat *GradRho, FILE *FdSfr)
Definition: sfr_eff.c:167
int sfr_need_to_compute_sph_grad_rho(void)
Definition: sfr_eff.c:952
void set_sfr_params(ParameterSet *ps)
Definition: sfr_eff.c:129
LOW_PRECISION MyFloat
Definition: types.h:19