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
pressure.h
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
4
#ifndef _PRESSURE_H_
5
#define _PRESSURE_H_
6
7
#include "
rt.h
"
8
#include "
rfield.h
"
9
#include "
doppvel.h
"
10
#include "
physconst.h
"
11
14
void
PresTotCurrent
(
void
);
15
17
inline
double
PressureRadiationLine
(
const
transition
*t,
double
densityDenorm )
18
{
19
DEBUG_ENTRY
(
"PressureRadiationLine()"
);
20
21
/* RT_LineWidth gets line width in terms of RT effects */
22
double
width =
RT_LineWidth
(t);
23
24
double
PopOpc = t->
Emis
->
PopOpc
/t->
Lo
->
g
;
25
long
nelem = t->
Hi
->
nelem
-1;
26
/* return zero line radiation PressureReturned if line mases or has
27
* zero opacity */
28
if
( densityDenorm*PopOpc*t->
Emis
->
opacity
/
DoppVel
.
doppler
[nelem] <=
SMALLFLOAT
*1e5 ||
29
width<=0. )
30
return
0.;
31
32
double
PressureReturned =
PI8
*
HPLANCK
/ 3. *
POW4
(t->
EnergyWN
) *
33
(t->
Hi
->
Pop
/t->
Hi
->
g
)/PopOpc * width;
34
35
/* this prevents line radiation PressureReturned from being very large when line
36
* is not optically thick but total opacity at that energy is large
37
* due to overlapping transitions */
38
long
int
ipLineCenter = t->
Emis
->
ipFine
+
rfield
.
ipFineConVelShift
;
39
if
( ipLineCenter > 0 && ipLineCenter <
rfield
.
nfine
&&
rfield
.
lgOpacityFine
&&
40
rfield
.
fine_opac_zone
[ipLineCenter] >
SMALLFLOAT
)
41
{
42
double
FractionThisLine = densityDenorm * t->
Emis
->
PopOpc
* t->
Emis
->
opacity
/
DoppVel
.
doppler
[nelem]/
43
rfield
.
fine_opac_zone
[ipLineCenter];
44
if
( FractionThisLine<1e-5 )
45
FractionThisLine = 0.;
46
/* fine opacities are only reevaluated one time per zone due
47
* to the expense - PopOpc is for the current solution - but the two
48
* may be out of step by a few percent, due to the variation in
49
* abundance from zone to zone. This prevents the change
50
* in solution from increasing the radiation pressure.
51
* This correction is mainly an order of magnitude scaler to prevent
52
* optically thin lines from appearing to be optically thick due to
53
* overlapping lines */
54
FractionThisLine =
MIN2
(1., FractionThisLine);
55
ASSERT
( FractionThisLine >= 0. && FractionThisLine <= 1.0 );
56
PressureReturned *= FractionThisLine;
57
}
58
59
return
PressureReturned;
60
}
61
63
EXTERN
struct
t_pressure
{
64
69
realnum
PresLow
,
70
PresHigh
;
71
72
realnum
PresPowerlaw
;
73
75
double
PresRamCurr
;
76
78
double
PresTurbCurr
;
79
82
double
PresTotlCurr
,
83
PresTotlCorrect
,
85
PresGasCurr
;
86
88
double
PresTotlInit
;
89
92
bool
lgPressureInitialSpecified
;
94
double
PressureInitialSpecified
;
95
97
double
pres_radiation_lines_curr
;
98
101
bool
lgContRadPresOn
;
102
105
realnum
PresInteg
,
106
pinzon
;
107
110
bool
lgPres_radiation_ON
;
111
bool
lgPres_magnetic_ON
;
112
bool
lgPres_ram_ON
;
113
114
realnum
116
RadBetaMax
,
118
pbeta
,
120
PresMax
;
121
123
long
int
ipPradMax_line
;
124
126
long
int
ipPradMax_nzone
;
127
129
char
chLineRadPres
[101];
130
133
bool
lgPradCap
,
134
lgPradDen
;
135
137
bool
lgLineRadPresOn
;
138
141
bool
lgRadPresAbortOK
;
142
145
bool
lgSonicPointAbortOK
;
146
148
bool
lgSonicPoint
;
149
155
bool
lgStrongDLimbo
;
156
157
}
pressure
;
158
159
160
#endif
/* _PRESSURE_H_ */
Generated for cloudy by
1.8.4