Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
thermal.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2023 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef THERMAL_H_
5 #define THERMAL_H_
6 
7 /* thermal.h */
8 
9 #include "module.h"
10 #include "depth_table.h"
11 
12 #define NCOLNT 10000L
13 
16 void TempChange(
17  double TempNew ,
18  /* option to force update of all variables */
19  bool lgForceUpdate);
20 
24 void TempChange(
25  double TempNew );
26 
27 class t_thermal : public module
28 {
29 public:
30  const char *chName() const
31  {
32  return "thermal";
33  }
34 
35  void zero();
36  void comment(t_warnings&) {}
37 
41 
45 
51 
57 
60 
64  long int nUnstable;
65  bool lgUnstable;
66 
69  tlowst;
70 
72  bool lgTeHigh;
73 
77  bool lgEdnGTcm;
78 
80  bool lgTLaw;
81 
84  bool lgTeBD96;
88  SigmaBD96;
89 
92  bool lgTeSN99;
93 
96  bool lgTeTLaw;
97 
104  double cooling[NCOLNT],
105  heatnt[NCOLNT];
106  long int ncltot;
107 # define NCOLNT_LAB_LEN 15
109 
110  /* element coolants, the last one is molecular */
111  double elementcool[LIMELM + 1];
112  /* heavy element collisional ionization cooling
113  * zero with CoolHeavy.colmet, add to element cooling
114  * at cool_save.cpp */
116 
117  /* cooling due to level 2 lines */
118  double dima;
119 
122  bool lgCNegChk;
123 
128 
130  double totcol,
132  ctot,
134  heatl,
136  coolheat;
137 
139  double dCooldT;
140 
142  double tsq1,
143  halfte;
144 
148  double te_update;
149 
153  cextpw;
154 
160 
163  long int ipMaxExtra;
164 
167 
169  double htot,
170 
172  power,
173 
175  dHeatdT;
176 
179 
182 private:
185 public:
186  double heating( long nelem, long ion )
187  {
188  return m_heating[nelem][ion];
189  }
190  void setHeating( long nelem, long ion, double heating )
191  {
192  m_heating[nelem][ion] = heating;
193  }
194  void AddHeating( long nelem, long ion, double heating )
195  {
196  m_heating[nelem][ion] += heating;
197  }
198 };
199 extern t_thermal thermal;
200 
201 struct t_phoHeat
202 {
204  double HeatNet;
206  double HeatLowEnr;
208  double HeatHiEnr;
209 };
210 
211 #endif /* THERMAL_H_ */
realnum cextpw
Definition: thermal.h:152
Definition: warnings.h:11
long int ipMaxExtra
Definition: thermal.h:163
double HeatHiEnr
Definition: thermal.h:208
double htot
Definition: thermal.h:169
double power
Definition: thermal.h:169
t_thermal thermal
Definition: thermal.cpp:6
double heavycollcool[LIMELM]
Definition: thermal.h:115
double te_update
Definition: thermal.h:148
char chCoolHeatMax[NCOLNT_LAB_LEN+1]
Definition: thermal.h:127
realnum GBarMax
Definition: thermal.h:162
double FreeFreeTotHeat
Definition: thermal.h:178
DepthTable tlaw
Definition: thermal.h:95
bool lgCoolEvalOK
Definition: thermal.h:159
realnum SigmaBD96
Definition: thermal.h:86
double cooling[NCOLNT]
Definition: thermal.h:104
bool lgTeHigh
Definition: thermal.h:72
double char_tran_heat
Definition: thermal.h:166
bool lgTemperatureConstant
Definition: thermal.h:44
double char_tran_cool
Definition: thermal.h:166
Definition: thermal.h:27
bool lgCExtraOn
Definition: thermal.h:151
void zero()
Definition: thermal.cpp:8
bool lgCNegChk
Definition: thermal.h:122
bool lgPredNextTe
Definition: thermal.h:40
bool lgUnstable
Definition: thermal.h:65
long int nUnstable
Definition: thermal.h:64
realnum CoolExtra
Definition: thermal.h:152
char chClntLab[NCOLNT][NCOLNT_LAB_LEN+1]
Definition: thermal.h:108
double tsq1
Definition: thermal.h:142
realnum tlowst
Definition: thermal.h:68
const char * chName() const
Definition: thermal.h:30
realnum HeatLineMax
Definition: thermal.h:181
float realnum
Definition: cddefines.h:127
bool lgTeTLaw
Definition: thermal.h:96
realnum thist
Definition: thermal.h:68
double HeatLowEnr
Definition: thermal.h:206
double totcol
Definition: thermal.h:130
bool lgTeBD96
Definition: thermal.h:84
double dima
Definition: thermal.h:118
double m_heating[LIMELM][LIMELM]
Definition: thermal.h:184
double halfte
Definition: thermal.h:142
double heating(long nelem, long ion)
Definition: thermal.h:186
void setHeating(long nelem, long ion, double heating)
Definition: thermal.h:190
bool lgTemperatureConstantCommandParsed
Definition: thermal.h:50
#define NCOLNT
Definition: thermal.h:12
long int ncltot
Definition: thermal.h:106
realnum collam[NCOLNT]
Definition: thermal.h:103
realnum ConstTemp
Definition: thermal.h:56
const int LIMELM
Definition: cddefines.h:318
double dHeatdT
Definition: thermal.h:169
bool lgTLaw
Definition: thermal.h:80
#define NCOLNT_LAB_LEN
Definition: thermal.h:107
double elementcool[LIMELM+1]
Definition: thermal.h:111
realnum ConstGrainTemp
Definition: thermal.h:59
bool lgTeSN99
Definition: thermal.h:92
realnum T0SN99
Definition: thermal.h:91
Definition: thermal.h:201
Definition: depth_table.h:7
double coolheat
Definition: thermal.h:130
double HeatNet
Definition: thermal.h:204
bool lgEdnGTcm
Definition: thermal.h:77
realnum wlCoolHeatMax
Definition: thermal.h:126
double dCooldT
Definition: thermal.h:139
void AddHeating(long nelem, long ion, double heating)
Definition: thermal.h:194
double heatl
Definition: thermal.h:130
realnum CoolHeatMax
Definition: thermal.h:125
double heatnt[NCOLNT]
Definition: thermal.h:104
void TempChange(double TempNew, bool lgForceUpdate)
Definition: temp_change.cpp:31
realnum T0BD96
Definition: thermal.h:86
void comment(t_warnings &)
Definition: thermal.h:36
Definition: module.h:26
double ctot
Definition: thermal.h:130