PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
cooling.h
1 /* ############################################################
2 
3  FILE: cooling.h
4 
5  PURPOSE: contains common definitions for the
6  whole CODE
7 
8  Notice: the order is absolutely important and MUST NOT
9  be changed !!!
10  ############################################################ */
11 
12 
13 #define C_IONS 3 /* in [1,5] */
14 #define N_IONS 3 /* in [1,5] */
15 #define O_IONS 3 /* in [1,5] */
16 #define Ne_IONS 3 /* in [1,5] */
17 #define S_IONS 3 /* in [1,5] */
18 #define Fe_IONS 0 /* in [0,3] */
19 
20 #if C_IONS == 0
21  #define C_EXPAND(a,b,c,d,e)
22 #elif C_IONS == 1
23  #define C_EXPAND(a,b,c,d,e) ,a
24 #elif C_IONS == 2
25  #define C_EXPAND(a,b,c,d,e) ,a,b
26 #elif C_IONS == 3
27  #define C_EXPAND(a,b,c,d,e) ,a,b,c
28 #elif C_IONS == 4
29  #define C_EXPAND(a,b,c,d,e) ,a,b,c,d
30 #elif C_IONS == 5
31  #define C_EXPAND(a,b,c,d,e) ,a,b,c,d,e
32 #endif
33 
34 #if N_IONS == 0
35  #define N_EXPAND(a,b,c,d,e)
36 #elif N_IONS == 1
37  #define N_EXPAND(a,b,c,d,e) ,a
38 #elif N_IONS == 2
39  #define N_EXPAND(a,b,c,d,e) ,a,b
40 #elif N_IONS == 3
41  #define N_EXPAND(a,b,c,d,e) ,a,b,c
42 #elif N_IONS == 4
43  #define N_EXPAND(a,b,c,d,e) ,a,b,c,d
44 #elif N_IONS == 5
45  #define N_EXPAND(a,b,c,d,e) ,a,b,c,d,e
46 #endif
47 
48 #if O_IONS == 0
49  #define O_EXPAND(a,b,c,d,e)
50 #elif O_IONS == 1
51  #define O_EXPAND(a,b,c,d,e) ,a
52 #elif O_IONS == 2
53  #define O_EXPAND(a,b,c,d,e) ,a,b
54 #elif O_IONS == 3
55  #define O_EXPAND(a,b,c,d,e) ,a,b,c
56 #elif O_IONS == 4
57  #define O_EXPAND(a,b,c,d,e) ,a,b,c,d
58 #elif O_IONS == 5
59  #define O_EXPAND(a,b,c,d,e) ,a,b,c,d,e
60 #endif
61 
62 #if Ne_IONS == 0
63  #define Ne_EXPAND(a,b,c,d,e)
64 #elif Ne_IONS == 1
65  #define Ne_EXPAND(a,b,c,d,e) ,a
66 #elif Ne_IONS == 2
67  #define Ne_EXPAND(a,b,c,d,e) ,a,b
68 #elif Ne_IONS == 3
69  #define Ne_EXPAND(a,b,c,d,e) ,a,b,c
70 #elif Ne_IONS == 4
71  #define Ne_EXPAND(a,b,c,d,e) ,a,b,c,d
72 #elif Ne_IONS == 5
73  #define Ne_EXPAND(a,b,c,d,e) ,a,b,c,d,e
74 #endif
75 
76 #if S_IONS == 0
77  #define S_EXPAND(a,b,c,d,e)
78 #elif S_IONS == 1
79  #define S_EXPAND(a,b,c,d,e) ,a
80 #elif S_IONS == 2
81  #define S_EXPAND(a,b,c,d,e) ,a,b
82 #elif S_IONS == 3
83  #define S_EXPAND(a,b,c,d,e) ,a,b,c
84 #elif S_IONS == 4
85  #define S_EXPAND(a,b,c,d,e) ,a,b,c,d
86 #elif S_IONS == 5
87  #define S_EXPAND(a,b,c,d,e) ,a,b,c,d,e
88 #endif
89 
90 #if Fe_IONS == 0
91  #define Fe_EXPAND(a,b,c)
92 #elif Fe_IONS == 1
93  #define Fe_EXPAND(a,b,c) ,a
94 #elif Fe_IONS == 2
95  #define Fe_EXPAND(a,b,c) ,a,b
96 #elif Fe_IONS == 3
97  #define Fe_EXPAND(a,b,c) ,a,b,c
98 #endif
99 
100 /* **********************************************************************
101  Ions are labeled progressively, depending on how many ionization
102  stages are effectively included in the network through the previous
103  X_EXPAND macros.
104  Elements are ordered as {H, He, C, N, O, Ne, S, Fe} and must be
105  carefully respected everywhere in the code.
106  Hydrogen and Helium are always included.
107  ********************************************************************** */
108 
109 enum {
110  HI = NFLX, HeI, HeII
111  C_EXPAND(CI, CII, CIII, CIV, CV)
112  N_EXPAND(NI, NII, NIII, NIV, NV)
113  O_EXPAND(OI, OII, OIII, OIV, OV)
114  Ne_EXPAND(NeI, NeII, NeIII, NeIV, NeV)
115  S_EXPAND(SI, SII, SIII, SIV, SV)
116  Fe_EXPAND(FeI, FeII, FeIII)
117 };
118 
119 #define NIONS (3+C_IONS+N_IONS+O_IONS+Ne_IONS+S_IONS+Fe_IONS)
120 
121 /*
122 #define HI (NFLX)
123 #define HeI (NFLX + 1)
124 #define HeII (NFLX + 2)
125 #define CI (NFLX + 3)
126 #define CII (NFLX + 4)
127 #define CIII (NFLX + 5)
128 #define CIV (NFLX + 6)
129 #define CV (NFLX + 7)
130 #define NI (NFLX + 8)
131 #define NII (NFLX + 9)
132 #define NIII (NFLX + 10)
133 #define NIV (NFLX + 11)
134 #define NV (NFLX + 12)
135 #define OI (NFLX + 13)
136 #define OII (NFLX + 14)
137 #define OIII (NFLX + 15)
138 #define OIV (NFLX + 16)
139 #define OV (NFLX + 17)
140 #define NeI (NFLX + 18)
141 #define NeII (NFLX + 19)
142 #define NeIII (NFLX + 20)
143 #define NeIV (NFLX + 21)
144 #define NeV (NFLX + 22)
145 #define SI (NFLX + 23)
146 #define SII (NFLX + 24)
147 #define SIII (NFLX + 25)
148 #define SIV (NFLX + 26)
149 #define SV (NFLX + 27)
150 #if INCLUDE_Fe == YES
151  #define FeI (NFLX + 28)
152  #define FeII (NFLX + 29)
153  #define FeIII (NFLX + 30)
154 #endif
155 */
156 
157 real GetMaxRate (double *, double *, double);
158 real MeanMolecularWeight (double *);
159 double H_MassFrac (void);
160 real CompEquil (double, double, double *);
161 real find_N_rho ();
162 void Radiat (double *, double *);
163 
164 void CHECK_NORMALIZATION (double *, char *);
165 void NORMALIZE_IONS (double *);
166 /*
167 int Ros4_expl, Ros4_impl, Ros4_sup_dt;
168 */
169 
170 
171 
172 
173 
174 
175 
176