cooling_struct.h 2.93 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*******************************************************************************
 * This file is part of SWIFT.
 * Copyright (c) 2016 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_STRUCT_NONE_H
#define SWIFT_COOLING_STRUCT_NONE_H

22
23
24
/* include grackle */
#include <grackle.h>

25
26
#include "../config.h"

27
28
29
30
31
32
33
34
35
36
/**
 * @file src/cooling/none/cooling_struct.h
 * @brief Empty infrastructure for the cases without cooling function
 */

/**
 * @brief Properties of the cooling function.
 */
struct cooling_function_data {

37
  /* Filename of the Cloudy Table */
38
  char cloudy_table[200];
39
40

  /* Enable/Disable UV backgroud */
41
  int with_uv_background;
42
43

  /* Redshift to use for the UV backgroud (-1 to use cosmological one) */
44
  double redshift;
45

46
47
48
  /* unit system */
  code_units units;

lhausamm's avatar
lhausamm committed
49
50
  /* grackle chemistry data */
  chemistry_data chemistry;
51
52
53
54
55
56
57
58
59
60
61
62

  /* Enable/Disable metal cooling */
  int with_metal_cooling;

  /* User provide volumetric heating rates */
  int provide_volumetric_heating_rates;

  /* User provide specific heating rates */
  int provide_specific_heating_rates;

  /* Self shielding method (<= 3) means grackle modes */
  int self_shielding_method;
lhausamm's avatar
lhausamm committed
63
64
65

  /* Output mode (correspond to primordial chemistry mode */
  int output_mode;
66
67
68
69
70
71

  /* convergence limit for first init */
  float convergence_limit;

  /* number of step max for first init */
  int max_step;
lhausamm's avatar
lhausamm committed
72
73
74

  /* over relaxation parameter */
  float omega;
75
76
77
};

/**
lhausamm's avatar
lhausamm committed
78
 * @brief Properties of the cooling stored in the extra particle data
79
80
81
82
83
 */
struct cooling_xpart_data {

  /*! Energy radiated away by this particle since the start of the run */
  float radiated_energy;
84

lhausamm's avatar
lhausamm committed
85
/* here all fractions are mass fraction */
86
87
#if COOLING_GRACKLE_MODE >= 1
  /* primordial chemistry >= 1 */
lhausamm's avatar
lhausamm committed
88
89
90
91
92
93
  float HI_frac;
  float HII_frac;
  float HeI_frac;
  float HeII_frac;
  float HeIII_frac;
  float e_frac;
94
95
96

#if COOLING_GRACKLE_MODE >= 2
  /* primordial chemistry >= 2 */
lhausamm's avatar
lhausamm committed
97
98
99
  float HM_frac;
  float H2I_frac;
  float H2II_frac;
100
101
102

#if COOLING_GRACKLE_MODE >= 3
  /* primordial chemistry >= 3 */
lhausamm's avatar
lhausamm committed
103
104
105
  float DI_frac;
  float DII_frac;
  float HDI_frac;
lhausamm's avatar
lhausamm committed
106
#endif  // MODE >= 3
107

lhausamm's avatar
lhausamm committed
108
109
110
#endif  // MODE >= 2

#endif  // MODE >= 1
111
112

  /* metal cooling = 1 */
lhausamm's avatar
lhausamm committed
113
  float metal_frac;
114
115
116
};

#endif /* SWIFT_COOLING_STRUCT_NONE_H */