cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
prt_lines_grains.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 /*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 "grainvar.h"
9 #include "lines.h"
10 #include "lines_service.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 */
40  /* largest fraction of local heating due to grains photo */
41  gv.dphmax = MAX2((realnum)(safe_div(dhtot,thermal.htot,0.0)),gv.dphmax);
42  /* largest local cooling of gas by collisions with grains */
44 
45  /* largest relative number of electrons donated by grains */
46  hold = SDIV(dense.EdenTrue);
49 
50  /* largest relative number of electrons on grain surface */
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,1215.67,"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 }
double htot
Definition: thermal.h:169
t_thermal thermal
Definition: thermal.cpp:6
double GrainHeatLya
Definition: grainvar.h:544
double GrainHeatSum
Definition: grainvar.h:544
realnum dclmax
Definition: grainvar.h:559
double GasCoolColl
Definition: grainvar.h:544
double GrainHeatCollSum
Definition: grainvar.h:544
t_dense dense
Definition: global.cpp:15
realnum GrnElecDonateMax
Definition: grainvar.h:531
double TotalEden
Definition: grainvar.h:529
LinSv * linadd(double xEmiss, realnum wavelength, const char *chLab, char chInfo, const char *chComment)
double EdenTrue
Definition: dense.h:232
float realnum
Definition: cddefines.h:124
double GrainHeatDif
Definition: grainvar.h:544
bool lgGrainPhysicsOn
Definition: grainvar.h:479
sys_float safe_div(sys_float x, sys_float y, sys_float res_0by0)
Definition: cddefines.h:1011
t_radius radius
Definition: radius.cpp:5
double heating(long nelem, long ion)
Definition: thermal.h:186
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
vector< GrainBin * > bin
Definition: grainvar.h:583
#define MAX2(a, b)
Definition: cddefines.h:824
realnum GrnElecHoldMax
Definition: grainvar.h:532
sys_float SDIV(sys_float x)
Definition: cddefines.h:1002
GrainVar gv
Definition: grainvar.cpp:5
realnum TotalDustHeat
Definition: grainvar.h:559
realnum dphmax
Definition: grainvar.h:559
double GrainHeatInc
Definition: grainvar.h:544
double dVeffAper
Definition: radius.h:93
void lines_grains(void)
long int StuffComment(const char *chComment)
Definition: prt_final.cpp:1938