cloudy trunk
|
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 /*atom_pop2 do level population for simple two level atom, no radiative transfer */ 00004 #include "cddefines.h" 00005 #include "phycon.h" 00006 #include "dense.h" 00007 #include "atoms.h" 00008 00009 double atom_pop2(double omega, 00010 double g1, 00011 double g2, 00012 double a21, 00013 double bltz, 00014 double abund) 00015 { 00016 double boltz, 00017 popexc_v, 00018 q12, 00019 q21, 00020 r; 00021 00022 DEBUG_ENTRY( "atom_pop2()" ); 00023 00024 /* result is density (cm-3) of excited state times a21 00025 * result normalized to n1+n2=abund 00026 * cdsqte is eden / sqrte * 8.629e-6 00027 * */ 00028 boltz = bltz*phycon.teinv; 00029 if( abund == 0. || boltz > 15. ) 00030 { 00031 popexc_v = 0.; 00032 return( popexc_v ); 00033 } 00034 00035 /*begin sanity check */ 00036 ASSERT( omega > 0. ); 00037 00038 q21 = dense.cdsqte*omega; 00039 q12 = q21/g1*exp(-boltz); 00040 q21 /= g2; 00041 r = (a21 + q21)/q12; 00042 popexc_v = abund*a21/(r + 1.); 00043 return( popexc_v ); 00044 }