cloudy
trunk
source
save_special.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
/*SaveSpecial generate output for the save special command */
4
#include "
cddefines.h
"
5
#include "
wind.h
"
6
#include "
opacity.h
"
7
#include "
dense.h
"
8
#include "
taulines.h
"
9
#include "
radius.h
"
10
#include "
phycon.h
"
11
#include "
save.h
"
12
13
/*SaveSpecial generate output for the save special command */
14
void
SaveSpecial
(FILE* ioPUN ,
15
const
char
*chTime)
16
{
17
/*long int i;*/
18
19
DEBUG_ENTRY
(
"SaveSpecial()"
);
20
21
if
( strncmp(chTime,
"LAST"
,4) == 0 )
22
{
23
/* code to execute only after last zone */
24
# if 0
25
long
ipISO , nelem , limit , i;
26
double
EdenAbund , fach;
27
# include "
physconst.h
"
28
# include "
hydrogenic.h
"
29
PunFeII
( ioPUN );*/
30
ipISO =
ipHYDROGEN
;
31
nelem =
ipHYDROGEN
;
32
33
/* in all following the factor of two is because a single
34
* decay produces two photons */
35
EdenAbund =
iso_sp
[
ipH_LIKE
][nelem].
st
[
ipH2s
].Pop*8.226*pow(1.+nelem,6);
36
fprintf(ioPUN,
" 2s = %.3e\n"
, EdenAbund);
37
38
/* upper limit to H-like 2-phot is energy of La, which is in ipCont-1 cell */
39
limit =
iso_sp
[
ipH_LIKE
][nelem].
trans
(
ipH2p
,
ipH1s
).
ipCont
()-1;
40
/* remember sum of rates, this will add up to twice the real rate since
41
* each transition makes two photons */
42
for
( i=0; i < limit; i++ )
43
{
44
/*>>chng 01 jan 23, previous change had doubled cross section for H two-photon,
45
* so here we divide by 2 to get old answer */
47
fach =
iso_sp
[ipISO][nelem].
TwoNu
[0].As2nu[i]/2.f;
48
fach *=
rfield
.
anu2
[i]/
rfield
.
widflx
[i]*
EN1RYD
;
49
fprintf(ioPUN,
"%.3e\t%.3e\t%.3e\n"
,
50
RYDLAM
/1e4/
rfield
.
anu
[i] , fach , fach*(
realnum
)EdenAbund );
51
}
52
# endif
53
54
}
55
else
56
{
57
/* code to do for every zone */
58
fprintf(ioPUN,
"%.5e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n"
,
59
radius
.
Radius
,
60
wind
.
AccelCont
,
61
wind
.
fmul
,
62
opac
.
opacity_sct
[1000],
63
dense
.
eden
,
64
dense
.
xMassDensity
,
65
dense
.
gas_phase
[
ipHYDROGEN
] );
66
}
67
68
return
;
69
}
t_dense::eden
double eden
Definition:
dense.h:190
dense
t_dense dense
Definition:
dense.cpp:24
Wind::fmul
realnum fmul
Definition:
wind.h:65
rfield
t_rfield rfield
Definition:
rfield.cpp:8
PunFeII
void PunFeII(FILE *io)
Definition:
atom_feii.cpp:2799
realnum
float realnum
Definition:
cddefines.h:103
t_iso_sp::TwoNu
vector< two_photon > TwoNu
Definition:
iso.h:586
t_dense::gas_phase
realnum gas_phase[LIMELM]
Definition:
dense.h:71
TransitionProxy::ipCont
long & ipCont() const
Definition:
transition.h:450
ipHYDROGEN
const int ipHYDROGEN
Definition:
cddefines.h:305
opac
t_opac opac
Definition:
opacity.cpp:5
wind
Wind wind
Definition:
wind.cpp:5
radius
t_radius radius
Definition:
radius.cpp:5
SaveSpecial
void SaveSpecial(FILE *ioPUN, const char *chTime)
Definition:
save_special.cpp:14
dense.h
cddefines.h
ipH2s
const int ipH2s
Definition:
iso.h:28
t_opac::opacity_sct
double * opacity_sct
Definition:
opacity.h:98
t_radius::Radius
double Radius
Definition:
radius.h:25
radius.h
t_dense::xMassDensity
realnum xMassDensity
Definition:
dense.h:91
RYDLAM
const UNUSED double RYDLAM
Definition:
physconst.h:176
t_iso_sp::st
qList st
Definition:
iso.h:453
save.h
t_rfield::anu2
realnum * anu2
Definition:
rfield.h:79
hydrogenic.h
ipH2p
const int ipH2p
Definition:
iso.h:29
t_rfield::anu
double * anu
Definition:
rfield.h:58
wind.h
physconst.h
t_rfield::widflx
realnum * widflx
Definition:
rfield.h:65
t_iso_sp::trans
TransitionProxy trans(const long ipHi, const long ipLo)
Definition:
iso.h:444
taulines.h
phycon.h
ipH1s
const int ipH1s
Definition:
iso.h:27
opacity.h
iso_sp
t_iso_sp iso_sp[NISO][LIMELM]
Definition:
iso.cpp:8
EN1RYD
const UNUSED double EN1RYD
Definition:
physconst.h:179
Wind::AccelCont
realnum AccelCont
Definition:
wind.h:55
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition:
cddefines.h:684
ipH_LIKE
const int ipH_LIKE
Definition:
iso.h:62
Generated by
1.8.17