cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
atmdat_2photon.cpp
Go to the documentation of this file.
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 /*atmdat_2phot_shapefunction two photon emission function for hydrogen */
4 /*atmdat_2phot_rate hydrogen two photon emission, including induced emission */
5 #include "cddefines.h"
6 #include "taulines.h"
7 #include "thirdparty.h"
8 #include "trace.h"
9 #include "rfield.h"
10 #include "iso.h"
11 #include "atmdat.h"
12 
13 static const int NCRS_H = 9;
14 static const int NCRS_HE = 51;
15 
16 /* A grid of energies for hydrogenic two photon, in steps of 1/16 E2Nu */
17 static double Hydro2NuEnergies[NCRS_H] = { 0., 0.0625, 0.125, 0.1875,
18  0.25, 0.3125, 0.375, 0.4375, 0.5};
19 
20 /* Goldman and Drake only give values for 1, 20, 40, and up. The other numbers
21  * (Z=2-19 and 21-30) are calculated from simple linear interpolation. */
22 /*>>refer Hydro 2nu Goldman,S.P. & Drake,G.W.F. 1981 Phys. Rev. A 24, 183. */
23 static double Hydro2NuShapeFunc[30][NCRS_H]={
24  {0.0,2.03239,3.15792,3.84452,4.28435,4.56958,4.74855,4.84732,4.87892},
25  {0.0,2.02777,3.15409,3.84145,4.28193,4.56766,4.74699,4.84597,4.87764},
26  {0.0,2.02316,3.15026,3.83839,4.27950,4.56574,4.74542,4.84462,4.87636},
27  {0.0,2.01854,3.14643,3.83532,4.27708,4.56382,4.74386,4.84327,4.87509},
28  {0.0,2.01392,3.14260,3.83226,4.27466,4.56190,4.74230,4.84192,4.87381},
29  {0.0,2.00931,3.13877,3.82919,4.27223,4.55997,4.74073,4.84057,4.87253},
30  {0.0,2.00469,3.13494,3.82613,4.26981,4.55805,4.73917,4.83922,4.87125},
31  {0.0,2.00007,3.13111,3.82306,4.26739,4.55613,4.73761,4.83787,4.86997},
32  {0.0,1.99546,3.12728,3.82000,4.26496,4.55421,4.73604,4.83652,4.86870},
33  {0.0,1.99084,3.12345,3.81693,4.26254,4.55229,4.73448,4.83517,4.86742},
34  {0.0,1.98622,3.11962,3.81387,4.26012,4.55037,4.73292,4.83383,4.86614},
35  {0.0,1.98160,3.11579,3.81080,4.25770,4.54845,4.73136,4.83248,4.86486},
36  {0.0,1.97699,3.11196,3.80774,4.25527,4.54653,4.72979,4.83113,4.86359},
37  {0.0,1.97237,3.10813,3.80467,4.25285,4.54461,4.72823,4.82978,4.86231},
38  {0.0,1.96775,3.10430,3.80161,4.25043,4.54269,4.72667,4.82843,4.86103},
39  {0.0,1.96314,3.10047,3.79854,4.24800,4.54076,4.72510,4.82708,4.85975},
40  {0.0,1.95852,3.09664,3.79548,4.24558,4.53884,4.72354,4.82573,4.85847},
41  {0.0,1.95390,3.09281,3.79241,4.24316,4.53692,4.72198,4.82438,4.85720},
42  {0.0,1.94929,3.08898,3.78935,4.24073,4.53500,4.72041,4.82303,4.85592},
43  {0.0,1.94467,3.08515,3.78628,4.23831,4.53308,4.71885,4.82168,4.85464},
44  {0.0,1.93317,3.07480,3.77774,4.23144,4.52756,4.71432,4.81774,4.85090},
45  {0.0,1.92167,3.06444,3.76919,4.22456,4.52205,4.70979,4.81381,4.84717},
46  {0.0,1.91016,3.05409,3.76065,4.21769,4.51653,4.70525,4.80987,4.84343},
47  {0.0,1.89866,3.04374,3.75210,4.21082,4.51101,4.70072,4.80594,4.83969},
48  {0.0,1.88716,3.03338,3.74356,4.20394,4.50549,4.69619,4.80200,4.83596},
49  {0.0,1.87566,3.02303,3.73501,4.19707,4.49998,4.69166,4.79807,4.83222},
50  {0.0,1.86416,3.01268,3.72647,4.19020,4.49446,4.68713,4.79413,4.82848},
51  {0.0,1.85265,3.00232,3.71792,4.18332,4.48894,4.68259,4.79020,4.82474},
52  {0.0,1.84115,2.99197,3.70938,4.17645,4.48342,4.67806,4.78626,4.82101},
53  {0.0,1.82965,2.98162,3.70083,4.16958,4.47791,4.67353,4.78233,4.81727}};
54 static double Hydro2NuShapeFuncY2[30][NCRS_H];
55 
56 /* A grid of energies, in 1% of E2Nu steps */
57 static double He2NuEnergies[NCRS_HE] = { 0., 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1,
58  0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2, 0.21, 0.22, 0.23, 0.24, 0.25,
59  0.26, 0.27, 0.28, 0.29, 0.3, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.4,
60  0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5};
61 
62 /* These numbers come directly from Walter Johnson. */
63 /*>>refer HeI 2nu Johnson,W. 2002, private communication */
64 static double He2NuShapeFunc[29][NCRS_HE]={
65  {0.0,0.02034,0.09681,0.21242,0.34804,0.49162,0.63613,0.77764,0.91399,1.0441 ,1.16747,
66  1.28401,1.39382,1.49713,1.59422,1.68542,1.77106,1.85147,1.92697,1.99784,2.06438,
67  2.12685,2.18549,2.24053,2.29218,2.34064,2.38607,2.42864,2.46851,2.50581,2.54066,
68  2.5732 ,2.60351,2.6317 ,2.65786,2.68207,2.7044 ,2.72492,2.7437 ,2.76078,2.77622,
69  2.79006,2.80235,2.8131 ,2.82237,2.83017,2.83652,2.84144,2.84494,2.84704,2.84774},
70  {0.0,0.02988,0.12882,0.26547,0.41655,0.57004,0.71996,0.86344,0.99923,1.12691,1.24653,
71  1.35836,1.46281,1.56031,1.65134,1.73632,1.81569,1.88984,1.95915,2.02395,2.08456,
72  2.14126,2.19431,2.24396,2.29041,2.33388,2.37454,2.41255,2.44807,2.48124,2.51218,
73  2.541 ,2.56781,2.59271,2.61578,2.63711,2.65675,2.67479,2.69127,2.70625,2.71978,
74  2.7319 ,2.74265,2.75206,2.76016,2.76697,2.77252,2.77681,2.77987,2.7817 ,2.78231},
75  {0.0,0.03916,0.15567,0.3059 ,0.46528,0.62293,0.77411,0.91688,1.05064,1.17543,1.29163,
76  1.39971,1.50024,1.59375,1.68078,1.76183,1.83735,1.90777,1.97346,2.03479,2.09206,
77  2.14558,2.19559,2.24234,2.28605,2.3269 ,2.36509,2.40076,2.43407,2.46515,2.49412,
78  2.5211 ,2.54619,2.56947,2.59103,2.61095,2.6293 ,2.64614,2.66152,2.6755 ,2.68812,
79  2.69942,2.70945,2.71822,2.72576,2.73211,2.73728,2.74128,2.74413,2.74584,2.74641},
80  {0.0,0.04796,0.17833,0.33778,0.50199,0.66147,0.81255,0.95401,1.08572,1.20803,1.32148,
81  1.4267 ,1.52433,1.61497,1.69919,1.77751,1.8504 ,1.91828,1.98157,2.04059,2.09568,
82  2.14711,2.19515,2.24004,2.28197,2.32116,2.35777,2.39196,2.42388,2.45365,2.48139,
83  2.50722,2.53123,2.55351,2.57414,2.5932 ,2.61074,2.62684,2.64155,2.65491,2.66698,
84  2.67778,2.68735,2.69574,2.70295,2.70901,2.71395,2.71777,2.7205 ,2.72213,2.72267},
85  {0.0,0.05615,0.19754,0.36344,0.53056,0.69076,0.84124,0.98133,1.11121,1.23145,1.34271,
86  1.44572,1.54115,1.62964,1.71177,1.78808,1.85906,1.92512,1.98667,2.04405,2.09758,
87  2.14754,2.1942 ,2.23777,2.27848,2.3165 ,2.35202,2.38518,2.41613,2.44499,2.47189,
88  2.49693,2.5202 ,2.54179,2.56178,2.58024,2.59724,2.61284,2.62708,2.64003,2.65171,
89  2.66217,2.67145,2.67956,2.68655,2.69242,2.6972 ,2.7009 ,2.70354,2.70512,2.70565},
90  {0.0,0.0637 ,0.21393,0.38444,0.55335,0.7137 ,0.8634 ,1.00219,1.1305 ,1.24903,1.35853,
91  1.45978,1.55349,1.64031,1.72085,1.79564,1.86516,1.92985,1.9901 ,2.04625,2.09862,
92  2.14749,2.19312,2.23573,2.27552,2.31269,2.3474 ,2.37981,2.41006,2.43826,2.46454,
93  2.489 ,2.51173,2.53282,2.55235,2.57038,2.58699,2.60222,2.61613,2.62877,2.64018,
94  2.6504 ,2.65945,2.66738,2.6742 ,2.67993,2.6846 ,2.68821,2.69079,2.69233,2.69284},
95  {0.0,0.07061,0.22794,0.4018 ,0.5718 ,0.732 ,0.88089,1.01851,1.14548,1.26258,1.37065,
96  1.47049,1.56282,1.64833,1.72762,1.80121,1.86961,1.93324,1.99248,2.04769,2.09917,
97  2.14721,2.19205,2.23391,2.27302,2.30954,2.34364,2.37548,2.40519,2.4329 ,2.45871,
98  2.48273,2.50506,2.52577,2.54495,2.56266,2.57897,2.59393,2.60759,2.62 ,2.63121,
99  2.64124,2.65013,2.65791,2.66461,2.67024,2.67483,2.67838,2.6809 ,2.68242,2.68292},
100  {0.0,0.07687,0.23997,0.41628,0.58691,0.74682,0.89492,1.03151,1.15733,1.27324,1.38014,
101  1.47882,1.57005,1.6545 ,1.73278,1.80543,1.87294,1.93572,1.99418,2.04864,2.09943,
102  2.14681,2.19104,2.23233,2.27089,2.30691,2.34054,2.37194,2.40124,2.42856,2.45401,
103  2.4777 ,2.49972,2.52014,2.53905,2.55652,2.57259,2.58734,2.60081,2.61305,2.6241 ,
104  2.63399,2.64276,2.65043,2.65704,2.66259,2.66711,2.67061,2.6731 ,2.67459,2.67509},
105  {0.0,0.08253,0.2503 ,0.42842,0.59941,0.75894,0.90631,1.042 ,1.16683,1.28176,1.38767,
106  1.4854 ,1.57573,1.65932,1.73679,1.80868,1.87546,1.93758,1.9954 ,2.04927,2.09951,
107  2.14637,2.19011,2.23095,2.26909,2.30471,2.33797,2.36902,2.398 ,2.42502,2.45019,
108  2.47362,2.49539,2.51559,2.53429,2.55156,2.56746,2.58205,2.59537,2.60748,2.6184 ,
109  2.62819,2.63686,2.64445,2.65098,2.65647,2.66094,2.6644 ,2.66686,2.66834,2.66883},
110  {0.0,0.08761,0.25918,0.43865,0.6098 ,0.76892,0.91562,1.05051,1.17451,1.2886 ,1.39369,
111  1.49064,1.58022,1.66311,1.73992,1.81118,1.87738,1.93895,1.99626,2.04966,2.09945,
112  2.1459 ,2.18925,2.22973,2.26753,2.30284,2.33581,2.36658,2.3953 ,2.42208,2.44703,
113  2.47026,2.49184,2.51186,2.5304 ,2.54752,2.56328,2.57774,2.59095,2.60295,2.61378,
114  2.62348,2.63207,2.6396 ,2.64607,2.65151,2.65594,2.65938,2.66182,2.66328,2.66377},
115  {0.0,0.09214,0.2668 ,0.44726,0.61845,0.77717,0.92327,1.05746,1.18075,1.29412,1.39853,
116  1.49482,1.58379,1.66609,1.74236,1.81311,1.87884,1.93997,1.99687,2.04988,2.09931,
117  2.14543,2.18847,2.22866,2.26619,2.30125,2.33398,2.36454,2.39306,2.41965,2.44443,
118  2.46749,2.48892,2.5088 ,2.52721,2.54421,2.55987,2.57423,2.58735,2.59926,2.61002,
119  2.61965,2.62819,2.63566,2.64209,2.6475 ,2.6519 ,2.65531,2.65774,2.65919,2.65968},
120  {0.0,0.09615,0.27332,0.45452,0.62566,0.78399,0.92954,1.06313,1.1858 ,1.29858,1.40241,
121  1.49816,1.58661,1.66844,1.74426,1.8146 ,1.87994,1.94071,1.99728,2.04998,2.09912,
122  2.14497,2.18777,2.22773,2.26504,2.2999 ,2.33245,2.36284,2.39119,2.41764,2.44228,
123  2.46521,2.48653,2.5063 ,2.52461,2.54152,2.55709,2.57138,2.58443,2.59628,2.60698,
124  2.61656,2.62506,2.63249,2.63889,2.64427,2.64864,2.65204,2.65445,2.6559 ,2.65638},
125  {0.0,0.09967,0.27888,0.4606 ,0.63164,0.7896 ,0.93467,1.06774,1.18989,1.30216,1.4055 ,
126  1.50081,1.58883,1.67027,1.74572,1.81572,1.88075,1.94123,1.99753,2.04998,2.0989 ,
127  2.14453,2.18713,2.22691,2.26406,2.29876,2.33116,2.36142,2.38965,2.41598,2.44052,
128  2.46335,2.48458,2.50427,2.52251,2.53935,2.55486,2.56908,2.58208,2.59389,2.60454,
129  2.61409,2.62255,2.62995,2.63632,2.64168,2.64604,2.64942,2.65183,2.65327,2.65375},
130  {0.0,0.10275,0.28358,0.46567,0.63656,0.79418,0.93882,1.07145,1.19315,1.30499,1.40793,
131  1.50286,1.59053,1.67165,1.7468 ,1.81653,1.88131,1.94155,1.99764,2.0499 ,2.09863,
132  2.1441 ,2.18654,2.22618,2.2632 ,2.29778,2.33007,2.36023,2.38837,2.41461,2.43907,
133  2.46183,2.48299,2.50262,2.5208 ,2.53759,2.55305,2.56724,2.5802 ,2.59197,2.6026 ,
134  2.61211,2.62055,2.62793,2.63429,2.63963,2.64398,2.64735,2.64975,2.65119,2.65166},
135  {0.0,0.1054 ,0.28752,0.46984,0.64058,0.79788,0.94214,1.07438,1.19571,1.30719,1.4098 ,
136  1.50442,1.59181,1.67266,1.74758,1.81709,1.88167,1.94173,1.99765,2.04976,2.09835,
137  2.14369,2.18602,2.22555,2.26247,2.29696,2.32918,2.35926,2.38733,2.41352,2.43792,
138  2.46063,2.48174,2.50133,2.51947,2.53623,2.55166,2.56581,2.57874,2.5905 ,2.6011 ,
139  2.6106 ,2.61902,2.62639,2.63273,2.63807,2.64241,2.64577,2.64817,2.6496 ,2.65008},
140  {0.0,0.10766,0.29077,0.47323,0.6438 ,0.8008 ,0.94474,1.07665,1.19766,1.30884,1.41118,
141  1.50555,1.59271,1.67336,1.74809,1.81743,1.88185,1.94177,1.99757,2.04956,2.09805,
142  2.1433 ,2.18554,2.225 ,2.26185,2.29628,2.32844,2.35847,2.3865 ,2.41264,2.43701,
143  2.45969,2.48077,2.50034,2.51845,2.53519,2.5506 ,2.56474,2.57766,2.58939,2.59999,
144  2.60948,2.61789,2.62525,2.63159,2.63692,2.64126,2.64462,2.64701,2.64844,2.64892},
145  {0.0,0.10955,0.29339,0.47592,0.6463 ,0.80304,0.9467 ,1.07833,1.19907,1.31001,1.41213,
146  1.5063 ,1.59328,1.67377,1.74835,1.81756,1.88187,1.94169,1.9974 ,2.04931,2.09773,
147  2.14292,2.18511,2.22451,2.26133,2.29572,2.32784,2.35784,2.38585,2.41197,2.43631,
148  2.45898,2.48005,2.4996 ,2.51771,2.53443,2.54984,2.56397,2.57688,2.58862,2.59921,
149  2.6087 ,2.61711,2.62447,2.6308 ,2.63613,2.64047,2.64383,2.64622,2.64765,2.64813},
150  {0.0,0.1111 ,0.29546,0.47797,0.64817,0.80468,0.94808,1.07948,1.20001,1.31076,1.4127 ,
151  1.50671,1.59356,1.67393,1.74841,1.81753,1.88176,1.94151,1.99716,2.04902,2.0974 ,
152  2.14255,2.18471,2.22409,2.26088,2.29526,2.32737,2.35736,2.38536,2.41147,2.43582,
153  2.45848,2.47955,2.4991 ,2.51721,2.53394,2.54934,2.56348,2.5764 ,2.58814,2.59873,
154  2.60822,2.61664,2.624 ,2.63034,2.63567,2.64001,2.64337,2.64576,2.6472 ,2.64767},
155  {0.0,0.11234,0.29702,0.47946,0.64947,0.80576,0.94896,1.08016,1.20052,1.31111,1.41293,
156  1.50683,1.59358,1.67386,1.74827,1.81734,1.88152,1.94124,1.99685,2.0487 ,2.09705,
157  2.14219,2.18435,2.22372,2.26052,2.29489,2.32701,2.35701,2.38501,2.41114,2.43549,
158  2.45817,2.47925,2.49881,2.51694,2.53368,2.5491 ,2.56325,2.57617,2.58792,2.59853,
159  2.60803,2.61645,2.62382,2.63017,2.6355 ,2.63985,2.64321,2.64561,2.64704,2.64752},
160  {0.0,0.11328,0.29812,0.48043,0.65025,0.80635,0.94937,1.08042,1.20064,1.31112,1.41284,
161  1.50666,1.59336,1.67359,1.74797,1.81701,1.88117,1.94088,1.99649,2.04833,2.0967 ,
162  2.14185,2.18401,2.22341,2.26022,2.29462,2.32675,2.35678,2.3848 ,2.41095,2.43533,
163  2.45803,2.47913,2.49872,2.51687,2.53363,2.54907,2.56324,2.57619,2.58795,2.59858,
164  2.60809,2.61653,2.62391,2.63027,2.63561,2.63996,2.64333,2.64574,2.64717,2.64765},
165  {0.0,0.11396,0.29878,0.48093,0.65056,0.80649,0.94936,1.08028,1.2004 ,1.31081,1.41247,
166  1.50625,1.59291,1.67313,1.74749,1.81653,1.88071,1.94043,1.99606,2.04793,2.09632,
167  2.1415 ,2.1837 ,2.22312,2.25997,2.2944 ,2.32658,2.35664,2.3847 ,2.41089,2.4353 ,
168  2.45803,2.47917,2.4988 ,2.51697,2.53376,2.54923,2.56343,2.5764 ,2.58819,2.59884,
169  2.60837,2.61683,2.62423,2.6306 ,2.63595,2.64031,2.64369,2.6461 ,2.64754,2.64802},
170  {0.0,0.11439,0.29907,0.481 ,0.65045,0.80621,0.94896,1.07979,1.19985,1.31021,1.41184,
171  1.50561,1.59227,1.6725 ,1.74688,1.81595,1.88016,1.93992,1.99559,2.0475 ,2.09594,
172  2.14117,2.18342,2.2229 ,2.25979,2.29428,2.32651,2.35661,2.38473,2.41096,2.43542,
173  2.4582 ,2.47939,2.49905,2.51727,2.5341 ,2.5496 ,2.56383,2.57684,2.58866,2.59933,
174  2.60889,2.61737,2.62479,2.63117,2.63654,2.64092,2.64431,2.64672,2.64816,2.64864},
175  {0.0,0.1146 ,0.29899,0.48067,0.64993,0.80556,0.9482 ,1.07897,1.19898,1.30933,1.41096,
176  1.50474,1.59143,1.67169,1.74612,1.81524,1.8795 ,1.93932,1.99505,2.04703,2.09554,
177  2.14083,2.18315,2.22269,2.25965,2.2942 ,2.32649,2.35667,2.38484,2.41114,2.43565,
178  2.45849,2.47972,2.49944,2.5177 ,2.53458,2.55013,2.5644 ,2.57744,2.5893 ,2.6 ,
179  2.60959,2.61809,2.62554,2.63194,2.63733,2.64172,2.64512,2.64754,2.64899,2.64947},
180  {0.0,0.11461,0.29859,0.47999,0.64905,0.80455,0.94712,1.07784,1.19785,1.3082 ,1.40986,
181  1.50368,1.59042,1.67074,1.74524,1.81443,1.87877,1.93866,1.99448,2.04654,2.09512,
182  2.1405 ,2.1829 ,2.22252,2.25957,2.2942 ,2.32656,2.35681,2.38506,2.41142,2.43601,
183  2.4589 ,2.4802 ,2.49998,2.5183 ,2.53523,2.55083,2.56514,2.57823,2.59012,2.60086,
184  2.61049,2.61902,2.62649,2.63292,2.63833,2.64273,2.64614,2.64857,2.65003,2.65051},
185  {0.0,0.11442,0.2979 ,0.47897,0.64783,0.80322,0.94573,1.07643,1.19645,1.30683,1.40854,
186  1.50242,1.58924,1.66965,1.74423,1.81351,1.87795,1.93794,1.99385,2.04601,2.09469,
187  2.14017,2.18266,2.22238,2.25952,2.29424,2.32669,2.35703,2.38536,2.4118 ,2.43646,
188  2.45943,2.4808 ,2.50064,2.51903,2.53602,2.55167,2.56604,2.57918,2.59112,2.6019 ,
189  2.61156,2.62012,2.62762,2.63408,2.63951,2.64393,2.64735,2.64979,2.65125,2.65174},
190  {0.0,0.11408,0.29693,0.47764,0.6463 ,0.80158,0.94405,1.07475,1.1948 ,1.30523,1.40702,
191  1.50099,1.5879 ,1.66841,1.7431 ,1.81249,1.87704,1.93715,1.99317,2.04544,2.09424,
192  2.13983,2.18243,2.22226,2.2595 ,2.29433,2.32688,2.35731,2.38573,2.41227,2.43701,
193  2.46007,2.48151,2.50143,2.51988,2.53694,2.55266,2.56708,2.58027,2.59226,2.60309,
194  2.61279,2.62139,2.62892,2.63541,2.64086,2.6453 ,2.64874,2.65119,2.65266,2.65315},
195  {0.0,0.11358,0.29571,0.47603,0.64448,0.79966,0.94209,1.07281,1.19291,1.30343,1.4053 ,
196  1.49938,1.58641,1.66704,1.74186,1.81138,1.87605,1.93629,1.99245,2.04485,2.09378,
197  2.13949,2.18222,2.22217,2.25952,2.29446,2.32712,2.35766,2.38618,2.41282,2.43766,
198  2.4608 ,2.48233,2.50233,2.52086,2.53799,2.55378,2.56827,2.58151,2.59356,2.60443,
199  2.61418,2.62282,2.63039,2.6369 ,2.64238,2.64685,2.6503 ,2.65277,2.65424,2.65473},
200  {0.0,0.11294,0.29426,0.47415,0.64238,0.79747,0.93989,1.07064,1.19081,1.30142,1.40341,
201  1.49761,1.58477,1.66554,1.7405 ,1.81017,1.87499,1.93538,1.99168,2.04423,2.0933 ,
202  2.13915,2.18201,2.22209,2.25958,2.29464,2.32742,2.35807,2.38671,2.41345,2.43839,
203  2.46163,2.48326,2.50334,2.52196,2.53917,2.55502,2.56958,2.58289,2.595 ,2.60593,
204  2.61572,2.62441,2.63201,2.63856,2.64407,2.64855,2.65203,2.6545 ,2.65599,2.65648},
205  {0.0,0.11219,0.2926 ,0.47203,0.64004,0.79503,0.93744,1.06825,1.1885 ,1.29922,1.40134,
206  1.49568,1.58299,1.66392,1.73904,1.80887,1.87385,1.9344 ,1.99086,2.04356,2.09279,
207  2.13879,2.1818 ,2.22202,2.25965,2.29484,2.32776,2.35853,2.38729,2.41415,2.4392 ,
208  2.46255,2.48428,2.50446,2.52316,2.54045,2.55639,2.57102,2.5844 ,2.59656,2.60755,
209  2.6174 ,2.62613,2.63378,2.64036,2.6459 ,2.65041,2.6539 ,2.65639,2.65788,2.65838}};
210 static double He2NuShapeFuncY2[LIMELM-1][NCRS_HE];
211 static bool lgFirstCall=true;
212 
213 /*atmdat_2phot_shapefunction two photon emission function */
214 double atmdat_2phot_shapefunction( double EbyE2nu, long ipISO, long nelem )
215 {
216  double result,y;
217  int i;
218 
219 #if 0
220  const int NCRS = 21;
221  /* this is the photon energy in Rydbergs, energy Table 1 */
222  /* >>refer HI 2nu Spitzer, L., & Greenstein, J., 1951, ApJ, 114, 407 */
223  static double ener[NCRS]={
224  0.0, 0.05, 0.10, 0.15, 0.20, 0.25,
225  0.30, 0.35, 0.40, 0.45, 0.50, 0.55,
226  0.60, 0.65, 0.70, 0.75, 0.80, 0.85,
227  0.90, 0.95, 1.00};
228 
229  /* probability \psi(y), from col 3 of Table 1 of SG 51
230  * but normalized so that the integral from 0 to 1 equals 1 */
231  static double psi[NCRS]={
232  0.000, 0.458, 0.738, 0.923, 1.051, 1.142, 1.206,
233  1.250, 1.280, 1.297, 1.302, 1.297, 1.280, 1.250,
234  1.206, 1.142, 1.051, 0.923, 0.738, 0.458, 0.000};
235 #endif
236 
237  DEBUG_ENTRY( "atmdat_2phot_shapefunction()" );
238 
239  /* must reset spline coefficients every time...otherwise every one but
240  * the first is wrong! */
241  /* >>chng 06 Oct 18 rjrw: cache interpolant coefficients so spline coeffs are only defined once */
242  if( lgFirstCall )
243  {
244  for(i=0;i<30;i++)
247  for(i=0;i<29;i++)
249  He2NuShapeFuncY2[i]);
250  lgFirstCall = false;
251  }
252 
253  if( ipISO == ipH_LIKE )
254  {
255  /* EbyE2nu is analogous to the "y" in SG51 */
256  if( EbyE2nu < 0. || EbyE2nu >= 1.0 )
257  {
258  result = 0.;
259  }
260  else
261  {
262  /* H-like table only goes up to 0.5,
263  * but other half is symmetric. */
264  if( EbyE2nu > 0.5 )
265  EbyE2nu = 1. - EbyE2nu;
266 
268  result = y;
269  }
270  }
271  else
272  {
273  ASSERT( ipISO == ipHE_LIKE );
274 
275  /* EbyE2nu is analogous to the "y" in SG51 */
276  if( EbyE2nu < 0. || EbyE2nu >= 1.0 )
277  {
278  result = 0.;
279  }
280  else
281  {
282  /* Helike table only goes up to 0.5,
283  * but other half is symmetric. */
284  if( EbyE2nu > 0.5 )
285  EbyE2nu = 1. - EbyE2nu;
286 
287  splint(He2NuEnergies,He2NuShapeFunc[nelem-1],He2NuShapeFuncY2[nelem-1],NCRS_HE,EbyE2nu,&y);
288  /* divide by two here because Johnson gave us numbers that integrate up
289  * to two on the range [0,1]. */
290  result = y/2.;
291  }
292  }
293 
294  ASSERT( result > 0. );
295 
296  return result;
297 }
298 
300 /*atmdat_2phot_rate evaluate rate of induced hydrogen two photon emission */
301 /* A Two photon constant is not needed in this routine at all! Everything here depends
302  * upon transition probability per energy bin, which is exactly what As2nu gives
303  * Also, everything in this routine is INDUCED except SponRate, which is only used for sanity
304  * checking (redundant) and optional output. */
306  /* the iso sequence, must be either 0 (hydrogen) or 1 (he-like) */
307  long ipISO ,
308  /* atomic number on c scale */
309  long nelem )
310 {
311  long int i,
312  limit;
313  realnum SponRate, s1, s2, t1, t2, t3, p;
314 
315  DEBUG_ENTRY( "atmdat_2phot_rate()" );
316 
317  /* ipISO must be either 0 or 1 */
318  /* This routine should be reviewed VERY carefully if other ISO's are added
319  * since logic to identify 2s-1s levels is important. */
320  ASSERT( ipISO==ipH_LIKE || ipISO==ipHE_LIKE );
321 
322  /* initialize rates to zero now, we bail if fluorescense is turned off */
323 
324  s1 = s2 = 0;
325 
326  /* return if induced processes are turned off */
327  if( !rfield.lgInducProcess )
328  {
329  return;
330  }
331 
332  SponRate = 0.;
333  limit = iso.ipHalfTwoPhoE[ipISO][nelem];
334  for( i=0; i <= limit; i++ )
335  {
336 
337  /*ASSERT( iso.ipSym2nu[ipISO][nelem][i] <= iso.ipTwoPhoE[ipISO][nelem] );*/
338  /* the integral over the product of the two occupation numbers and the
339  * effecive spontaneous A. As2nu already has width of cell included */
340 
341  /* this is the induced downward rate, DOES NOT INCLUDE SPONTANEOUS */
342  t1 = iso.As2nu[ipISO][nelem][i];
343  t2 = rfield.SummedOcc[i];
344  t3 = rfield.SummedOcc[iso.ipSym2nu[ipISO][nelem][i]-1];
345  p = t1*t2*t3;
346  s1 += t1*(t2+t3)+p;
347 
348  s2 += p;
349 
350  SponRate += t1;
351  }
352  /* above was only half the integral - other half is symmetric */
353  s1 *= 2;
354 
355  iso.TwoNu_induc_dn[ipISO][nelem] = s1;
356  /* absorption should almost certainly be multiplied by 1/2 here, to account for
357  * the fact that this absorption can only happen if the two photons are oppositely
358  * polarized, so that the sum of their ang mom is 0, rather than 2. Also, why do we
359  * not subtract one from each occupation number for absorption, as we add one to
360  * each for emission? With these two things taken together, should we have
361  * s2 = t1*(t2-1)*(t3-1) = t1*t2*t3 + t1 - t1*t2- t1*t3 instead of s2 = 2*t1*t2*t3? */
364  iso.TwoNu_induc_up[ipISO][nelem] = s2;
365  SponRate *= 2.;
366 
367  /* remember maximum value of induced downward rate on per species basis */
368  if(s1 > iso.TwoNu_induc_dn_max[ipISO][nelem])
369  iso.TwoNu_induc_dn_max[ipISO][nelem] = s1;
370 
371  /* >>chng 01 jan 26, from 8.23 to 8.226 */
372  /* The 1+ipISO is not rigorous, it just works. Must most likely change if other
373  * ISO's are added. */
374  ASSERT( fabs(SponRate-Transitions[ipISO][nelem][1+ipISO][0].Emis->Aul) / SponRate < 0.05);
375  if( trace.lgTrace && trace.lgBug2nu )
376  {
377  limit = iso.ipTwoPhoE[ipISO][nelem];
378  for( i=1; i < limit; i += 10 )
379  {
380  fprintf( ioQQQ, "%12.4e%12.4e", rfield.anu[i],
382  }
383  fprintf( ioQQQ, "\n" );
384 
385  /* sum two-nu A's to check OK */
386  SponRate = 0.;
387  for( i=0; i < limit; i++ )
388  {
389  SponRate += iso.As2nu[ipISO][nelem][i];
390  }
391 
392  fprintf( ioQQQ, " TWOPHT finds induced two photon rate =%12.3e spontaneous A=%12.3e\n",
393  iso.TwoNu_induc_dn[ipISO][nelem], SponRate );
394  }
395  return;
396 }

Generated for cloudy by doxygen 1.8.1.2