cloudy
trunk
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
rt_line_one_tauinc.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
/*RT_line_one_tauinc increment optical depths for all heavy element lines, zone by zone,
4
* mainly called by RT_tau_inc, but also by FeII */
5
#include "
cddefines.h
"
6
#include "
doppvel.h
"
7
#include "
geometry.h
"
8
#include "
rfield.h
"
9
#include "
radius.h
"
10
#include "
wind.h
"
11
#include "
rt.h
"
12
13
void
RT_line_one_tauinc
(
transition
* t ,
14
/* following four are flags to generate info if some species has extreme maser */
15
long
int
maser_flag_species,
16
long
int
maser_flag_ion,
17
long
int
maser_flag_hi,
18
long
int
maser_flag_lo )
19
20
{
21
DEBUG_ENTRY
(
"RT_line_one_tauinc()"
);
22
23
/* routine increments optical depths for static or expanding atmosphere */
24
25
/* this is line center frequency, including bulk motion of gas */
26
long
int
ipLineCenter = t->
Emis
->
ipFine
+
rfield
.
ipFineConVelShift
;
27
double
OpacityEffective, EffectiveThickness;
28
realnum
dTau_total;
29
30
/* find line center opacity - use fine opacity if array indices are OK */
31
if
( t->
Emis
->
ipFine
>=0 && ipLineCenter>0 && ipLineCenter<
rfield
.
nfine
&&
rfield
.
lgOpacityFine
)
32
{
33
/* use fine opacities fine grid fine mesh to get optical depth
34
* to continuum source */
35
/* total line center optical depth, all overlapping lines included */
36
OpacityEffective =
rfield
.
fine_opac_zone
[ipLineCenter];
37
}
38
else
39
{
40
OpacityEffective = t->
Emis
->
PopOpc
* t->
Emis
->
opacity
/
DoppVel
.
doppler
[ t->
Hi
->
nelem
-1];
41
}
42
43
/* use cumulated fine optical depth for both d-critical and static,
44
* for d-critical speeds are only roughly sonic
45
* optical depth is computed including velocity shift */
46
if
(
wind
.
windv
<= 0. )
47
{
48
/* static and negative velocity solutions */
49
50
EffectiveThickness =
radius
.
drad_x_fillfac
;
51
dTau_total = (
realnum
)(OpacityEffective * EffectiveThickness);
52
53
t->
Emis
->
TauIn
+= dTau_total;
54
t->
Emis
->
TauCon
+= dTau_total;
55
56
}
57
58
else
59
{
60
/* this is effective length scale for Sobolev or LVG approximation.
61
* This is equation 3 of
62
* >>refer RT wind Castor, J.I., Abbott, D.C., & Klein, R.I., 1975, ApJ, 195, 157
63
*/
64
65
/* dv/dr (s-1), equal to dv/dt / v */
66
realnum
dvdr = fabs(
wind
.
AccelTot
) /
wind
.
windv
;
67
/* depth (cm) over which wind accelerates by one velocity width
68
* include filling factor */
69
EffectiveThickness =
DoppVel
.
doppler
[ t->
Hi
->
nelem
-1] /
SDIV
(dvdr) *
70
geometry
.
FillFac
;
71
72
/* min2 is to not let the physical scale exceed the current depth */
73
EffectiveThickness =
MIN2
(
radius
.
depth
, EffectiveThickness );
74
dTau_total = (
realnum
)(OpacityEffective * EffectiveThickness);
75
76
t->
Emis
->
TauIn
= dTau_total;
77
t->
Emis
->
TauCon
= dTau_total;
78
t->
Emis
->
TauTot
= dTau_total;
79
}
80
81
/* keep track of any masers */
82
if
( dTau_total <
rt
.
dTauMase
)
83
{
84
rt
.
dTauMase
= dTau_total;
85
rt
.
mas_species
= maser_flag_species;
86
rt
.
mas_ion
= maser_flag_ion;
87
rt
.
mas_hi
= maser_flag_hi;
88
rt
.
mas_lo
= maser_flag_lo;
89
if
(
rt
.
dTauMase
< -1. )
90
rt
.
lgMaserCapHit
=
true
;
91
}
92
93
return
;
94
}
Generated for cloudy by
1.8.4