cooling.h 4.61 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*******************************************************************************
 * This file is part of SWIFT.
 * Copyright (c) 2017 Matthieu Schaller (matthieu.schaller@durham.ac.uk)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 ******************************************************************************/
#ifndef SWIFT_COOLING_EAGLE_H
#define SWIFT_COOLING_EAGLE_H

/**
23
 * @file src/cooling/EAGLE/cooling.h
24
 * @brief EAGLE cooling function declarations
25
26
27
 */

/* Local includes. */
28
#include "cooling_struct.h"
29
30
31
32
33
34

struct part;
struct xpart;
struct cosmology;
struct hydro_props;
struct entropy_floor_properties;
35
struct space;
36
struct phys_const;
37

38
void cooling_update(const struct cosmology *cosmo,
39
                    struct cooling_function_data *cooling, struct space *s);
Alexei Borissov's avatar
Alexei Borissov committed
40

41
42
43
44
45
46
void cooling_cool_part(const struct phys_const *phys_const,
                       const struct unit_system *us,
                       const struct cosmology *cosmo,
                       const struct hydro_props *hydro_properties,
                       const struct entropy_floor_properties *floor_props,
                       const struct cooling_function_data *cooling,
47
                       struct part *restrict p, struct xpart *restrict xp,
Matthieu Schaller's avatar
Matthieu Schaller committed
48
                       const float dt, const float dt_therm, const double time);
Alexei Borissov's avatar
Alexei Borissov committed
49

50
51
52
53
54
55
56
float cooling_timestep(const struct cooling_function_data *restrict cooling,
                       const struct phys_const *restrict phys_const,
                       const struct cosmology *restrict cosmo,
                       const struct unit_system *restrict us,
                       const struct hydro_props *hydro_props,
                       const struct part *restrict p,
                       const struct xpart *restrict xp);
Alexei Borissov's avatar
Alexei Borissov committed
57

58
59
60
void cooling_first_init_part(
    const struct phys_const *restrict phys_const,
    const struct unit_system *restrict us,
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
61
    const struct hydro_props *hydro_props,
62
63
64
    const struct cosmology *restrict cosmo,
    const struct cooling_function_data *restrict cooling,
    const struct part *restrict p, struct xpart *restrict xp);
Alexei Borissov's avatar
Alexei Borissov committed
65

Matthieu Schaller's avatar
Matthieu Schaller committed
66
67
68
float cooling_get_temperature_from_gas(
    const struct phys_const *phys_const, const struct cosmology *cosmo,
    const struct cooling_function_data *cooling, const float rho_phys,
69
70
    const float XH, const float logZZsol, const float u_phys,
    const int HII_region);
Matthieu Schaller's avatar
Matthieu Schaller committed
71

72
73
float cooling_get_temperature(
    const struct phys_const *restrict phys_const,
74
    const struct hydro_props *restrict hydro_props,
75
76
77
    const struct unit_system *restrict us,
    const struct cosmology *restrict cosmo,
    const struct cooling_function_data *restrict cooling,
78
    const struct part *restrict p, const struct xpart *restrict xp);
79

80
double compute_subgrid_property(
Matthieu Schaller's avatar
Matthieu Schaller committed
81
82
83
84
85
    const struct cooling_function_data *cooling,
    const struct phys_const *phys_const,
    const struct entropy_floor_properties *floor_props,
    const struct cosmology *cosmo, const float rho_phys, const float logZZsol,
    const float XH, const float P_phys, const float log10_T,
86
87
88
    const float log10_T_EOS_max, const int HII_region,
    const float *abundance_ratio, const double log_u_cgs,
    const enum cooling_subgrid_properties isub);
Matthieu Schaller's avatar
Matthieu Schaller committed
89

90
float cooling_get_radiated_energy(const struct xpart *restrict xp);
91

92
93
void cooling_split_part(struct part *p, struct xpart *xp, double n);

94
95
96
97
void cooling_Hydrogen_reionization(const struct cooling_function_data *cooling,
                                   const struct cosmology *cosmo,
                                   struct space *s);

98
99
100
void cooling_init_backend(struct swift_params *parameter_file,
                          const struct unit_system *us,
                          const struct phys_const *phys_const,
101
                          const struct hydro_props *hydro_props,
102
                          struct cooling_function_data *cooling);
103

104
void cooling_print_backend(const struct cooling_function_data *cooling);
105

106
void cooling_clean(struct cooling_function_data *data);
107

108
109
110
/*! Stub defined to let the BH model compile */
#define colibre_cooling_N_elementtypes 1

111
#endif /* SWIFT_COOLING_EAGLE_H */