/home66/gary/public_html/cloudy/c08_branch/source/prt_lines_grains.cpp

Go to the documentation of this file.
00001 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
00002  * others.  For conditions of distribution and use see copyright notice in license.txt */
00003 /*lines_hydro put H-iso seq into line intensity stack */
00004 #include "cddefines.h"
00005 #include "radius.h"
00006 #include "thermal.h"
00007 #include "dense.h"
00008 #include "lines_service.h"
00009 #include "grainvar.h"
00010 #include "lines.h"
00011 
00012 void lines_grains(void)
00013 {
00014         double 
00015           dhtot,
00016           hold;
00017         long i,
00018           nd;
00019 
00020         DEBUG_ENTRY( "lines_grains()" );
00021 
00022         if( !gv.lgGrainPhysicsOn )
00023         {
00024                 return;
00025         }
00026 
00027         i = StuffComment( "grains" );
00028         linadd( 0., (realnum)i , "####", 'i',
00029                 "the grain output");
00030 
00031         /* find total grain heating */
00032         dhtot = 0.;
00033         for( nd=0; nd < gv.nBin; nd++ )
00034         {
00035                 /* add heating due to all grain species that are included */
00036                 dhtot += gv.bin[nd]->GasHeatPhotoEl;
00037         }
00038 
00039         /* total heating due to dust integrated over model */
00040         gv.TotalDustHeat += (realnum)(dhtot*radius.dVeff);
00041         /* largest fraction of local heating due to grains photo */
00042         gv.dphmax = MAX2((realnum)(dhtot/thermal.htot),gv.dphmax);
00043         /* largest local cooling of gas by collisions with grains */
00044         gv.dclmax = MAX2(gv.dclmax,(realnum)(gv.GasCoolColl/thermal.htot));
00045 
00046         /* largest relative number of electrons donated by grains */
00047         hold = SDIV(dense.EdenTrue);
00048         gv.GrnElecDonateMax = 
00049                 (realnum)MAX2( gv.GrnElecDonateMax , gv.TotalEden/hold );
00050 
00051         /* largest relative number of electrons on grain surface */
00052         gv.GrnElecHoldMax = 
00053                 (realnum)MAX2( gv.GrnElecHoldMax , -gv.TotalEden/hold );
00054 
00055         linadd(dhtot,0,"GrGH",'h',
00056                 " gas heating by grain photoionization");
00057 
00058         linadd(thermal.heating[0][25],0,"GrTH",'h',
00059                 " gas heating by thermionic emissions of grains ");
00060 
00061         linadd(MAX2(0.,gv.GasCoolColl),0,"GrGC",'c',
00062                 "gas cooling by collisions with grains ");      
00063 
00064         linadd(MAX2(0.,-gv.GasCoolColl),0,"GrGC",'c',
00065                 " gas heating by collisions with grains ");     
00066 
00067         linadd(gv.GrainHeatSum,0,"GraT",'i',
00068                 " total grain heating by all sources, lines, collisions, incident continuum ");
00069 
00070         linadd(gv.GrainHeatInc,0,"GraI",'i',
00071                 " grain heating by incident continuum ");
00072 
00073         linadd(gv.GrainHeatLya,1216,"GraL",'i',
00074                 " grain heating due to destruction of Ly alpha  ");
00075 
00076         linadd(gv.GrainHeatCollSum,0,"GraC",'i',
00077                 " grain heating due to collisions with gas ");
00078 
00079         linadd(gv.GrainHeatDif,0,"GraD",'i',
00080                 " grain heating due to diffuse fields, may also have grain emission ");
00081         return;
00082 
00083 }

Generated on Mon Feb 16 12:01:26 2009 for cloudy by  doxygen 1.4.7