root/branches/newmole/source/atomfeii.h
| Revision 1739, 9.1 kB (checked in by rjrw, 12 months ago) | |
|---|---|
|
|
| Line | |
|---|---|
| 1 | /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and |
| 2 | * others. For conditions of distribution and use see copyright notice in license.txt */ |
| 3 | |
| 4 | #ifndef _ATOMFEII_H_ |
| 5 | #define _ATOMFEII_H_ |
| 6 | |
| 7 | /**\file atomfeii.h |
| 8 | these routines are in FeIILevelPops.c */ |
| 9 | |
| 10 | /** |
| 11 | called by assert feii depart coef command |
| 12 | \param *pred |
| 13 | \param *BigError |
| 14 | \param *StdDev |
| 15 | */ |
| 16 | void AssertFeIIDep( double *pred , double *BigError , double *StdDev ); |
| 17 | |
| 18 | /** FeIIFillLow16 |
| 19 | */ |
| 20 | void FeIIFillLow16(void); |
| 21 | |
| 22 | /** reads in feii data from disk, creates space for main arrays */ |
| 23 | void FeIICreate(void); |
| 24 | /** FeIIPrint */ |
| 25 | void FeIIPrint(void); |
| 26 | |
| 27 | void FeIILevelPops(void); |
| 28 | |
| 29 | /** |
| 30 | called in LineSet4, this sums over FeII bands and returns intensities args are lower and upper edges of bands as set in fe2bands.dat |
| 31 | \param wl1 |
| 32 | \param wl2 |
| 33 | */ |
| 34 | double FeIISumBand(realnum wl1, |
| 35 | realnum wl2); |
| 36 | |
| 37 | /**FeII_RT_TauInc called once per zone in RT_tau_inc to increment large FeII atom line optical depths */ |
| 38 | void FeII_RT_TauInc(void); |
| 39 | |
| 40 | /**FeII_RT_tau_reset reset optical depths for large FeII atom, called by update after each iteration */ |
| 41 | void FeII_RT_tau_reset(void); |
| 42 | |
| 43 | /**FeIIPoint called by ContCreatePointers to create pointers for lines in large FeII atom */ |
| 44 | void FeIIPoint(void); |
| 45 | |
| 46 | |
| 47 | /** |
| 48 | called by rt_line_driving to compute radiative acceleration due to FeII lines |
| 49 | \param *fe2drive |
| 50 | */ |
| 51 | void FeIIAccel(double *fe2drive); |
| 52 | |
| 53 | |
| 54 | /** |
| 55 | called in LineSet4 to add FeII lines to save array |
| 56 | \param lgDoEsc |
| 57 | \param lgUpdateFineOpac |
| 58 | */ |
| 59 | void FeII_RT_Make( bool lgDoEsc , |
| 60 | bool lgUpdateFineOpac ); |
| 61 | |
| 62 | /** called by LineSet4, this adds feii line intensities together */ |
| 63 | void FeIIAddLines( void ); |
| 64 | |
| 65 | /** called by parse_punch, punch level energies and stat weights |
| 66 | \param ioPUN |
| 67 | */ |
| 68 | void FeIIPunchLevels( FILE * ioPUN ); |
| 69 | |
| 70 | /** |
| 71 | FeIIPunchColden punch level energies, stat weights, column density |
| 72 | \param *ioPUN file we will punch to |
| 73 | */ |
| 74 | void FeIIPunchColden( |
| 75 | FILE *ioPUN ); |
| 76 | |
| 77 | /** |
| 78 | FeII_Colden maintain H2 column densities within X |
| 79 | \param *chLabel |
| 80 | */ |
| 81 | void FeII_Colden( const char *chLabel ); |
| 82 | |
| 83 | |
| 84 | /** called by FeIIPunchLevels, this creates the punch feii line intensity |
| 85 | \param ioPUN |
| 86 | */ |
| 87 | void FeIIPunchLines( FILE * ioPUN ); |
| 88 | |
| 89 | /** called by FeIIPunchLevels, this creates the punch feii line optical depths |
| 90 | \param ioPUN |
| 91 | */ |
| 92 | void FeIIPunchOpticalDepth( FILE * ioPUN ); |
| 93 | |
| 94 | /** initialize optical depth arrays, called by TauOut */ |
| 95 | void FeII_LineZero(void); |
| 96 | |
| 97 | /**FeIIIntenZero zero out intensity of FeII atom */ |
| 98 | void FeIIIntenZero(void); |
| 99 | |
| 100 | /** rad pre due to FeII lines called in PresTotCurrent*/ |
| 101 | double FeIIRadPress(void); |
| 102 | |
| 103 | /** internal energy of FeII called in PresTotCurrent |
| 104 | \return |
| 105 | */ |
| 106 | double FeII_InterEnergy(void); |
| 107 | |
| 108 | /** |
| 109 | punch some departure coef for large atom, set with punch feii departure command |
| 110 | \param ioPUN |
| 111 | \param lgDoAll option to punch all dep coef if true |
| 112 | */ |
| 113 | void FeIIPunDepart(FILE* ioPUN , |
| 114 | bool lgDoAll ); |
| 115 | |
| 116 | void PunFeII( FILE * io ); |
| 117 | |
| 118 | /** |
| 119 | send the departure coef for physical level nPUN to unit ioPUN |
| 120 | \param ioPUN the io unit where the print should be directed |
| 121 | \param nPUN the physical (not c) number of the level |
| 122 | */ |
| 123 | void FeIIPun1Depart(FILE * ioPUN , long int nPUN ); |
| 124 | /** |
| 125 | punch line data for FeII atom |
| 126 | \param ioPUN io unit for punch |
| 127 | \param lgDoAll punch all levels if true, only subset if false |
| 128 | */ |
| 129 | void FeIIPunData( |
| 130 | FILE* ioPUN , |
| 131 | bool lgDoAll ); |
| 132 | |
| 133 | /** |
| 134 | punch some level pops for large atom, set with punch feii level populations command |
| 135 | \param ioPUN |
| 136 | \param lgPunchRange punch range of levels if true, only selected subset if false |
| 137 | \param ipRangeLo if ipPunchRange is true, this is lower bound of range on C scale |
| 138 | \param ipRangeHi if ipPunchRange is true, this is upper bound of range on C scale |
| 139 | \param lgPunchDensity flag saying whether to punch density (cm-3, true) or relative population (flase) |
| 140 | */ |
| 141 | void FeIIPunPop(FILE* ioPUN , |
| 142 | bool lgPunchRange , |
| 143 | long int ipRangeLo , |
| 144 | long int ipRangeHi , |
| 145 | bool lgPunchDensity ); |
| 146 | |
| 147 | |
| 148 | /** |
| 149 | include FeII lines in punched optical depths, etc, called from PunchLineStuff |
| 150 | \param io |
| 151 | \param xLimit |
| 152 | \param index |
| 153 | */ |
| 154 | void FeIIPunchLineStuff( FILE * io , realnum xLimit , long index); |
| 155 | |
| 156 | #if 0 |
| 157 | |
| 158 | /** |
| 159 | send the level pops for physical level nPUN to unit ioPUN |
| 160 | \param ioPUN the io unit where the print should be directed |
| 161 | \param nPUN the physical (not c) number of the level |
| 162 | */ |
| 163 | void FeIIPun1Pop( |
| 164 | FILE * ioPUN , |
| 165 | long int nPUN ); |
| 166 | #endif |
| 167 | |
| 168 | /** zero out variables that deal with FeII, called by zero */ |
| 169 | void FeIIZero(void); |
| 170 | |
| 171 | /** initialize some variables, called by zero */ |
| 172 | void FeIIReset(void); |
| 173 | |
| 174 | /** do OTS and outward parts of FeII lines, if large atom is turned on */ |
| 175 | void FeII_OTS(void); |
| 176 | |
| 177 | /** do outward rates for FeII, called by RT_diffuse */ |
| 178 | void FeII_RT_Out(void); |
| 179 | |
| 180 | /**ParseAtomFeII parse the atom feii command */ |
| 181 | void ParseAtomFeII(char *chCard ); |
| 182 | |
| 183 | /** this is the number of levels for the large FeII atom */ |
| 184 | #define NFE2LEVN 371 |
| 185 | |
| 186 | /** this is set true when space is allocated for the FeII arrays, |
| 187 | * once this happens FeII.nFeIILevel cannot be changed with the atom feii levels command |
| 188 | * set false in cddefines */ |
| 189 | extern bool lgFeIIMalloc; |
| 190 | |
| 191 | EXTERN struct t_FeII { |
| 192 | |
| 193 | /** number of levels for the large FeII atom, changed with the atom feii levels command |
| 194 | * set to NFE2LEVN in cddefines */ |
| 195 | long int nFeIILevel; |
| 196 | /** this remembers number of FeII levels allocated when MALLOC first called. */ |
| 197 | long int nFeIILevelAlloc; |
| 198 | |
| 199 | /** this flag is true if the full FeII is being done and we do not want to use the |
| 200 | * simple FeII UV approximation. Is false if only low levels of FeII are being done |
| 201 | * with full atom, and still want to use the simple atom */ |
| 202 | bool lgFeIILargeOn; |
| 203 | |
| 204 | /** option to always evaluate model atom, set with SLOW key on atom feii command */ |
| 205 | bool lgSlow; |
| 206 | |
| 207 | /** option to print calls to FeIILevelPops, set with print key on atom feii */ |
| 208 | bool lgPrint; |
| 209 | |
| 210 | /** option to only simulate calls to FeIILevelPops */ |
| 211 | bool lgSimulate; |
| 212 | |
| 213 | /** say which FeII atom this is, Verner or Netzer */ |
| 214 | char chFeIIAtom[7]; |
| 215 | |
| 216 | /** punch verner short for shorter punch */ |
| 217 | bool lgShortFe2; |
| 218 | |
| 219 | /** says whether (true) or not (false) pumping of the FeiI model atom by HI Lya is included |
| 220 | * normally true, set false with the NO FEII command */ |
| 221 | bool lgLyaPumpOn; |
| 222 | |
| 223 | /** energy range for FeII lines output with punch verner, |
| 224 | * set with punch verner range e ryd, e ryd */ |
| 225 | realnum fe2ener[2]; |
| 226 | |
| 227 | /** energy range and threshold for FeII lines output with punch verner */ |
| 228 | realnum fe2thresh; |
| 229 | |
| 230 | /** these are the lower and upper bounds to the FeII continuum, in Angstroms,*/ |
| 231 | realnum fe2con_wl1 , fe2con_wl2; |
| 232 | /** the number of intervals to break the FeII continuum into */ |
| 233 | long int nfe2con; |
| 234 | |
| 235 | /** redistribution function to use for resonance and subordinate lines */ |
| 236 | int ipRedisFcnResonance; |
| 237 | int ipRedisFcnSubordinate; |
| 238 | |
| 239 | /** cooling computed by large FeII model atom |
| 240 | * Fe2_large_cool is total cooling (or heating if negative) |
| 241 | * and ddT_Fe2_large_cool is its derivative wrt temperature */ |
| 242 | double Fe2_large_cool, |
| 243 | ddT_Fe2_large_cool, |
| 244 | Fe2_large_heat; |
| 245 | |
| 246 | /** total cooling due to 16 level model FeII atom |
| 247 | * fe2cool is total cooling due to 16 level atom, */ |
| 248 | double /*Fe2_16levl_cool , |
| 249 | ddT_Fe2_16levl_cool ,*/ |
| 250 | ddT_Fe2_UVsimp_cool , |
| 251 | Fe2_UVsimp_cool; |
| 252 | |
| 253 | /** lines from the lowest 16 levels, predicted in FeIILevelPops routine FeIIFillLow16 */ |
| 254 | double fe21308, |
| 255 | fe21207, |
| 256 | fe21106, |
| 257 | fe21006, |
| 258 | fe21204, |
| 259 | fe21103, |
| 260 | fe21104, |
| 261 | fe21001, |
| 262 | fe21002, |
| 263 | fe20201, |
| 264 | fe20302, |
| 265 | fe20706, |
| 266 | fe20807, |
| 267 | fe20908, |
| 268 | fe21007, |
| 269 | fe21107, |
| 270 | fe21108, |
| 271 | fe21110, |
| 272 | fe21507, |
| 273 | fe21208, |
| 274 | fe21209, |
| 275 | fe21211, |
| 276 | fe21406, |
| 277 | fe21508, |
| 278 | fe21609; |
| 279 | /** these are only predicted by the very large feii atom */ |
| 280 | double |
| 281 | fe25to6 , |
| 282 | fe27to7 , |
| 283 | fe28to8 , |
| 284 | fe29to9 , |
| 285 | fe32to6 , |
| 286 | fe33to7 , |
| 287 | fe37to7 , |
| 288 | fe39to8 , |
| 289 | fe40to9 , |
| 290 | fe37to6 , |
| 291 | fe39to7 , |
| 292 | fe40to8 , |
| 293 | fe41to9 , |
| 294 | fe39to6 , |
| 295 | fe40to7 , |
| 296 | fe42to7 , |
| 297 | fe41to8 , |
| 298 | fe42to6 , |
| 299 | fe43to7 , |
| 300 | fe36to2 , |
| 301 | fe36to3 , |
| 302 | fe32to1 , |
| 303 | fe33to2 , |
| 304 | fe36to5 , |
| 305 | fe32to2 , |
| 306 | fe33to3 , |
| 307 | fe30to3 , |
| 308 | fe33to6 , |
| 309 | fe24to2 , |
| 310 | fe32to7 , |
| 311 | fe35to8 , |
| 312 | fe34to8 , |
| 313 | fe27to6 , |
| 314 | fe28to7 , |
| 315 | fe30to8 , |
| 316 | fe24to6 , |
| 317 | fe29to8 , |
| 318 | fe24to7 , |
| 319 | fe22to7 , |
| 320 | fe38to11 , |
| 321 | fe19to8 , |
| 322 | fe17to6 , |
| 323 | fe18to7 , |
| 324 | fe18to8 , |
| 325 | fe80to28 , |
| 326 | fe17to7 , |
| 327 | for7; |
| 328 | |
| 329 | } FeII; |
| 330 | |
| 331 | /* this info used to estimate destruction of Lya by overlap with FeII |
| 332 | * in case where large atom is not turned on */ |
| 333 | |
| 334 | /** number of FeII lines in Fred's atom */ |
| 335 | const int NFEII = 373; |
| 336 | /** number of points in partition function table */ |
| 337 | const int NFE2PR = 61; |
| 338 | |
| 339 | class t_fe2ovr_la : public Singleton<t_fe2ovr_la> |
| 340 | { |
| 341 | friend class Singleton<t_fe2ovr_la>; |
| 342 | protected: |
| 343 | t_fe2ovr_la(); |
| 344 | private: |
| 345 | realnum fe2lam[NFEII]; |
| 346 | realnum fe2osc[NFEII]; |
| 347 | realnum fe2enr[NFEII]; |
| 348 | realnum fe2gs[NFEII]; |
| 349 | |
| 350 | long int ipfe2[NFEII]; |
| 351 | |
| 352 | /** opacity and optical depths for ground of Fred's FeII atom */ |
| 353 | realnum feopc[NFEII]; |
| 354 | realnum Fe2TauLte[NFEII]; |
| 355 | realnum Fe2PopLte[NFEII]; |
| 356 | |
| 357 | double fe2pt[NFE2PR]; |
| 358 | double fe2pf[NFE2PR]; |
| 359 | |
| 360 | /** fe2par evaluate FeII partition function */ |
| 361 | double fe2par(double te); |
| 362 | public: |
| 363 | void zero_opacity(); |
| 364 | |
| 365 | void init_pointers(); |
| 366 | |
| 367 | /** tau_inc: update line opacities */ |
| 368 | void tau_inc(); |
| 369 | |
| 370 | /** atoms_fe2ovr compute FeII overlap with Lya */ |
| 371 | void atoms_fe2ovr(void); |
| 372 | }; |
| 373 | |
| 374 | #endif /* _ATOMFEII_H_ */ |
Note: See TracBrowser
for help on using the browser.
