cloudy trunk
Loading...
Searching...
No Matches
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 */
14void 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",
61 wind.fmul ,
62 opac.opacity_sct[1000],
63 dense.eden ,
66 }
67
68 return;
69}
void PunFeII(FILE *io)
Definition: atom_feii.cpp:2799
float realnum
Definition: cddefines.h:103
const int ipHYDROGEN
Definition: cddefines.h:305
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:684
long & ipCont() const
Definition: transition.h:450
TransitionProxy trans(const long ipHi, const long ipLo)
Definition: iso.h:444
vector< two_photon > TwoNu
Definition: iso.h:586
qList st
Definition: iso.h:453
t_dense dense
Definition: dense.cpp:24
t_iso_sp iso_sp[NISO][LIMELM]
Definition: iso.cpp:8
const int ipH1s
Definition: iso.h:27
const int ipH2p
Definition: iso.h:29
const int ipH2s
Definition: iso.h:28
const int ipH_LIKE
Definition: iso.h:62
t_opac opac
Definition: opacity.cpp:5
UNUSED const double EN1RYD
Definition: physconst.h:179
UNUSED const double RYDLAM
Definition: physconst.h:176
t_radius radius
Definition: radius.cpp:5
t_rfield rfield
Definition: rfield.cpp:8
void SaveSpecial(FILE *ioPUN, const char *chTime)
realnum fmul
Definition: wind.h:65
realnum AccelCont
Definition: wind.h:55
double eden
Definition: dense.h:190
realnum gas_phase[LIMELM]
Definition: dense.h:71
realnum xMassDensity
Definition: dense.h:91
double * opacity_sct
Definition: opacity.h:98
double Radius
Definition: radius.h:25
realnum * anu2
Definition: rfield.h:79
realnum * widflx
Definition: rfield.h:65
double * anu
Definition: rfield.h:58
Wind wind
Definition: wind.cpp:5