cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
save_special.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 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 "save.h"
6 #include "wind.h"
7 #include "opacity.h"
8 #include "dense.h"
9 #include "radius.h"
10 
11 /*SaveSpecial generate output for the save special command */
12 void SaveSpecial(FILE* ioPUN ,
13  const char *chTime)
14 {
15  /*long int i;*/
16 
17  DEBUG_ENTRY( "SaveSpecial()" );
18 
19  if( strncmp(chTime,"LAST",4) == 0 )
20  {
21  /* code to execute only after last zone */
22 # if 0
23  long ipISO , nelem , limit , i;
24  double EdenAbund , fach;
25 # include "physconst.h"
26 # include "hydrogenic.h"
27  ipISO = ipHYDROGEN;
28  nelem = ipHYDROGEN;
29 
30  /* in all following the factor of two is because a single
31  * decay produces two photons */
32  EdenAbund = iso_sp[ipH_LIKE][nelem].st[ipH2s].Pop*8.226*powi(1.+nelem,6);
33  fprintf(ioPUN," 2s = %.3e\n", EdenAbund);
34 
35  /* upper limit to H-like 2-phot is energy of La, which is in ipCont-1 cell */
36  limit = iso_sp[ipH_LIKE][nelem].trans(ipH2p,ipH1s).ipCont()-1;
37  /* remember sum of rates, this will add up to twice the real rate since
38  * each transition makes two photons */
39  for( i=0; i < limit; i++ )
40  {
41  /*>>chng 01 jan 23, previous change had doubled cross section for H two-photon,
42  * so here we divide by 2 to get old answer */
44  fach = iso_sp[ipISO][nelem].TwoNu[0].As2nu[i]/2.f;
45  fach *= rfield.anu2(i)/rfield.widflx(i)*EN1RYD;
46  fprintf(ioPUN,"%.3e\t%.3e\t%.3e\n",
47  RYDLAM/1e4/rfield.anu(i) , fach , fach*(realnum)EdenAbund );
48  }
49 # endif
50 
51  }
52  else
53  {
54  /* code to do for every zone */
55  fprintf(ioPUN,"%.5e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
56  radius.Radius ,
57  wind.AccelCont ,
58  wind.fmul ,
59  opac.opacity_sct[1000],
60  dense.eden ,
63  }
64 
65  return;
66 }
double Radius
Definition: radius.h:31
void SaveSpecial(FILE *io, const char *chTime)
qList st
Definition: iso.h:482
double widflx(size_t i) const
Definition: mesh.h:156
t_opac opac
Definition: opacity.cpp:5
double * opacity_sct
Definition: opacity.h:107
double anu(size_t i) const
Definition: mesh.h:120
t_dense dense
Definition: global.cpp:15
t_iso_sp iso_sp[NISO][LIMELM]
Definition: iso.cpp:11
Wind wind
Definition: wind.cpp:5
realnum AccelCont
Definition: wind.h:55
vector< two_photon > TwoNu
Definition: iso.h:598
const int ipH1s
Definition: iso.h:29
t_rfield rfield
Definition: rfield.cpp:9
long & ipCont() const
Definition: transition.h:489
float realnum
Definition: cddefines.h:124
double powi(double, long int)
Definition: service.cpp:594
double anu2(size_t i) const
Definition: mesh.h:124
t_radius radius
Definition: radius.cpp:5
TransitionProxy trans(const long ipHi, const long ipLo)
Definition: iso.h:473
realnum gas_phase[LIMELM]
Definition: dense.h:76
const int ipH2p
Definition: iso.h:31
const int ipH2s
Definition: iso.h:30
const int ipH_LIKE
Definition: iso.h:64
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
realnum xMassDensity
Definition: dense.h:101
double eden
Definition: dense.h:201
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
const int ipHYDROGEN
Definition: cddefines.h:349
realnum fmul
Definition: wind.h:65