cloudy
trunk
Loading...
Searching...
No Matches
source
prt_lines_grains.cpp
Go to the documentation of this file.
1
/* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and
2
* others. For conditions of distribution and use see copyright notice in license.txt */
3
/*lines_hydro put H-iso seq into line intensity stack */
4
#include "
cddefines.h
"
5
#include "
radius.h
"
6
#include "
thermal.h
"
7
#include "
dense.h
"
8
#include "
lines_service.h
"
9
#include "
grainvar.h
"
10
#include "
lines.h
"
11
12
void
lines_grains
(
void
)
13
{
14
double
15
dhtot,
16
hold;
17
long
i;
18
19
DEBUG_ENTRY
(
"lines_grains()"
);
20
21
if
( !
gv
.lgGrainPhysicsOn )
22
{
23
return
;
24
}
25
26
i =
StuffComment
(
"grains"
);
27
linadd
( 0., (
realnum
)i ,
"####"
,
'i'
,
28
"the grain output"
);
29
30
/* find total grain heating */
31
dhtot = 0.;
32
for
(
size_t
nd=0; nd <
gv
.bin.size(); nd++ )
33
{
34
/* add heating due to all grain species that are included */
35
dhtot +=
gv
.bin[nd]->GasHeatPhotoEl;
36
}
37
38
/* total heating due to dust integrated over model */
39
gv
.TotalDustHeat += (
realnum
)(dhtot*
radius
.dVeffAper);
40
/* largest fraction of local heating due to grains photo */
41
gv
.dphmax =
MAX2
((
realnum
)(dhtot/
thermal
.htot),
gv
.dphmax);
42
/* largest local cooling of gas by collisions with grains */
43
gv
.dclmax =
MAX2
(
gv
.dclmax,(
realnum
)(
gv
.GasCoolColl/
thermal
.htot));
44
45
/* largest relative number of electrons donated by grains */
46
hold =
SDIV
(
dense
.EdenTrue);
47
gv
.GrnElecDonateMax =
48
(
realnum
)
MAX2
(
gv
.GrnElecDonateMax ,
gv
.TotalEden/hold );
49
50
/* largest relative number of electrons on grain surface */
51
gv
.GrnElecHoldMax =
52
(
realnum
)
MAX2
(
gv
.GrnElecHoldMax , -
gv
.TotalEden/hold );
53
54
linadd
(dhtot,0,
"GrGH"
,
'h'
,
55
" gas heating by grain photoionization"
);
56
57
linadd
(
thermal
.heating[0][25],0,
"GrTH"
,
'h'
,
58
" gas heating by thermionic emissions of grains "
);
59
60
linadd
(
MAX2
(0.,
gv
.GasCoolColl),0,
"GrGC"
,
'c'
,
61
"gas cooling by collisions with grains "
);
62
63
linadd
(
MAX2
(0.,-
gv
.GasCoolColl),0,
"GrGC"
,
'c'
,
64
" gas heating by collisions with grains "
);
65
66
linadd
(
gv
.GrainHeatSum,0,
"GraT"
,
'i'
,
67
" total grain heating by all sources, lines, collisions, incident continuum "
);
68
69
linadd
(
gv
.GrainHeatInc,0,
"GraI"
,
'i'
,
70
" grain heating by incident continuum "
);
71
72
linadd
(
gv
.GrainHeatLya,1216,
"GraL"
,
'i'
,
73
" grain heating due to destruction of Ly alpha "
);
74
75
linadd
(
gv
.GrainHeatCollSum,0,
"GraC"
,
'i'
,
76
" grain heating due to collisions with gas "
);
77
78
linadd
(
gv
.GrainHeatDif,0,
"GraD"
,
'i'
,
79
" grain heating due to diffuse fields, may also have grain emission "
);
80
return
;
81
82
}
cddefines.h
realnum
float realnum
Definition
cddefines.h:103
MAX2
#define MAX2
Definition
cddefines.h:782
SDIV
sys_float SDIV(sys_float x)
Definition
cddefines.h:952
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition
cddefines.h:684
dense
t_dense dense
Definition
dense.cpp:24
dense.h
gv
GrainVar gv
Definition
grainvar.cpp:5
grainvar.h
lines.h
StuffComment
long int StuffComment(const char *chComment)
Definition
prt_final.cpp:1932
linadd
void linadd(double xInten, realnum wavelength, const char *chLab, char chInfo, const char *chComment)
Definition
lines_service.cpp:316
lines_service.h
lines_grains
void lines_grains(void)
Definition
prt_lines_grains.cpp:12
radius
t_radius radius
Definition
radius.cpp:5
radius.h
thermal
t_thermal thermal
Definition
thermal.cpp:5
thermal.h
Generated by
1.14.0