cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
prt_lines_molecules.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*lines_molecules put energetics, H, and He lines into line intensity stack */
4 #include "cddefines.h"
5 #include "coolheavy.h"
6 #include "thermal.h"
7 #include "dense.h"
8 #include "hmi.h"
9 #include "phycon.h"
10 #include "h2.h"
11 #include "co.h"
12 #include "radius.h"
13 #include "lines.h"
14 #include "lines_service.h"
15 #include "mole.h"
16 
17 void lines_molecules(void)
18 {
19  long int i;
20 
21  DEBUG_ENTRY( "lines_molecules()" );
22 
23  /* molecules */
24  i = StuffComment( "molecules" );
25  linadd( 0., (realnum)i , "####", 'i',
26  " molecules");
27 
28 
29  /* >>refer H2 rot Lepp, S., & Shull, J.M., 1983, ApJ, 270, 578-582
30  * roughly two microns */
31  linadd(CoolHeavy.h2line,20000.,"H2 l",'c',
32  "cooling due H2 rotation lines from simple model" );
33  /* remember largest fraction of H2 cooling for possible comment */
35 
36  /* HD rotation cooling */
37  linadd(CoolHeavy.HD,0,"HDro",'c',
38  "HD rotation cooling");
39 
40  /* molecular hydrogen heating */
43 
44  /* largest fraction of heating due to photo dissoc of H2+ */
46 
47  linadd(hmi.HeatH2Dish_used,0,"H2dH",'h',
48  "heating by H2 dissociation by photons and cosmic rays");
49 
50  /*remember largest fraction of heating due to H2 vib deexcitation */
52 
53  /*remember largest fraction of cooling due to H2 cooling */
55 
56  linadd( MAX2(0.,hmi.HeatH2Dexc_used),0,"H2vH",'h',
57  "heating by coll deexcit of vib-excited H2");
58 
59  linadd( MAX2(0.,-hmi.HeatH2Dexc_used) ,0,"H2vC",'c',
60  " cooling by coll deexcit of vib-excited H2");
61 
62  /* line emission by vib-excited H2 */
63  if( h2.lgEnabled )
64  {
65 
66  linadd( 0. ,0,"H2 v",'i',
67  " when large molecule is turned on do not print this simple estimate line emission by vib-excited H2 ");
68  }
69  else
70  {
71  linadd( findspecieslocal("H2*")->den*2e-7*4.17e-12,0,"H2 v",'i',
72  " H2 vib-excited lines from Tielens & Hollenbach 1985");
73  }
74 
75  /* add in explicit lines from the large H2 molecule
76  * routine in mole_h2_io.c */
77  for( diatom_iter diatom = diatoms.begin(); diatom != diatoms.end(); ++diatom )
78  (*diatom)->H2_LinesAdd();
79 
80  // the line blend, mostly the last, 1-0 S(0)
81  LinSv *Blnd = linadd(0.0,21210,"Blnd",'i',"Blend" );
82  if( h2.lgEnabled )
83  {
84  Blnd->addComponent("H2 ",21205.7);
85  Blnd->addComponent("H2 ",21209.9);
86  Blnd->addComponent("H2 ",21212.5);
87  }
88 
89  linadd(hmi.hmicol,0,"H-FB",'c',
90  " neg H ion free-bound emission, H + e -> H- + hnu ");
91 
92  linadd(CoolHeavy.brems_cool_hminus,0,"H-FF",'i',
93  " neg H ion free-free emission ");
94 
95  /* H-alpha produced by H- mutual neutralization */
96  linadd(mole.findrate("H-,H+=>H,H")*3.032e-12,6562.81,"H-CT",'i',
97  " H-alpha produced by H- mutual neutralization ");
98 
99  /* remember total heating */
101 
102  linadd(MAX2(0.,hmi.hmihet),0,"H- H",'h',
103  " H- heating ");
104 
105  linadd(MAX2(0.,-hmi.hmihet),0,"H-Hc",'c',
106  " induced H- cooling ");
107 
108  linadd(CoolHeavy.H2PlsCool,0,"H2+ ",'c',
109  " H+ + H => H2+ + photon continuum cooling ");
110 
111  linadd(hmi.h2plus_heat,0,"H2+p",'h',
112  " H2+ photo dissoc heating ");
113 
114  linadd(MAX2(3.27e-12+phycon.te*BOLTZMANN,0.)*dense.xIonDense[ipHYDROGEN][1]*dense.xIonDense[ipHELIUM][0]*1e-20+
115  (1.76e-11+phycon.te*BOLTZMANN)*dense.xIonDense[ipHYDROGEN][0]*dense.xIonDense[ipHELIUM][1]*1e-16,0,"HEH+",'i' ,
116  " HeH+ formation cooling ");
117 
118  /* carbon monoxide heating */
121 
122  linadd(co.CODissHeat,0,"COdh",'h',
123  " carbon monoxide co photodissociation ");
124 
125  return;
126 }
realnum h2line_cool_frac
Definition: hmi.h:57
double hmicol
Definition: hmi.h:33
realnum h2dtot
Definition: hmi.h:57
double htot
Definition: thermal.h:169
t_co co
Definition: co.cpp:5
t_thermal thermal
Definition: thermal.cpp:6
double hmihet
Definition: hmi.h:33
double hmitot
Definition: hmi.h:33
realnum codtot
Definition: co.h:22
t_phycon phycon
Definition: phycon.cpp:6
t_CoolHeavy CoolHeavy
Definition: coolheavy.cpp:5
molezone * findspecieslocal(const char buf[])
double h2plus_heat
Definition: hmi.h:48
double HeatH2Dexc_used
Definition: hmi.h:140
t_dense dense
Definition: global.cpp:15
double xIonDense[LIMELM][LIMELM+1]
Definition: dense.h:135
realnum H2PlsCool
Definition: coolheavy.h:47
double HeatH2Dish_used
Definition: hmi.h:140
bool lgEnabled
Definition: h2_priv.h:352
LinSv * linadd(double xEmiss, realnum wavelength, const char *chLab, char chInfo, const char *chComment)
t_mole_local mole
Definition: mole.cpp:8
float realnum
Definition: cddefines.h:124
vector< diatomics * > diatoms
Definition: h2.cpp:8
diatomics h2("h2", 4100.,&hmi.H2_total, Yan_H2_CS)
sys_float safe_div(sys_float x, sys_float y, sys_float res_0by0)
Definition: cddefines.h:1011
t_radius radius
Definition: radius.cpp:5
double heating(long nelem, long ion)
Definition: thermal.h:186
double brems_cool_hminus
Definition: coolheavy.h:36
realnum HeatH2DexcMax
Definition: hmi.h:57
void lines_molecules(void)
double findrate(const char buf[]) const
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
void addComponent(const char *species, const double wavelength)
Definition: lines.cpp:194
const int ipHELIUM
Definition: cddefines.h:350
#define MAX2(a, b)
Definition: cddefines.h:824
realnum codfrc
Definition: co.h:22
t_hmi hmi
Definition: hmi.cpp:5
double te
Definition: phycon.h:21
double h2line
Definition: coolheavy.h:18
const int ipHYDROGEN
Definition: cddefines.h:349
realnum h2dfrc
Definition: hmi.h:57
double HD
Definition: coolheavy.h:18
Definition: lines.h:157
realnum h2pmax
Definition: hmi.h:131
realnum CODissHeat
Definition: co.h:22
vector< diatomics * >::iterator diatom_iter
Definition: h2.h:13
double dVeffAper
Definition: radius.h:93
double ctot
Definition: thermal.h:130
long int StuffComment(const char *chComment)
Definition: prt_final.cpp:1938
realnum CoolH2DexcMax
Definition: hmi.h:57