cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
atom_pop2.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*atom_pop2 do level population for simple two level atom, no radiative transfer */
4 #include "cddefines.h"
5 #include "phycon.h"
6 #include "dense.h"
7 #include "atoms.h"
8 
9 double atom_pop2(double omega,
10  double g1,
11  double g2,
12  double a21,
13  double bltz,
14  double abund)
15 {
16  double boltz,
17  popexc_v,
18  q12,
19  q21,
20  r;
21 
22  DEBUG_ENTRY( "atom_pop2()" );
23 
24  /* result is density (cm-3) of excited state times a21
25  * result normalized to n1+n2=abund
26  * cdsqte is eden / sqrte * 8.629e-6
27  * */
28  boltz = bltz*phycon.teinv;
29  if( abund == 0. || boltz > 15. )
30  {
31  popexc_v = 0.;
32  return( popexc_v );
33  }
34 
35  /*begin sanity check */
36  ASSERT( omega > 0. );
37 
38  q21 = dense.cdsqte*omega;
39  q12 = q21/g1*exp(-boltz);
40  q21 /= g2;
41  r = (a21 + q21)/q12;
42  popexc_v = abund*a21/(r + 1.);
43  return( popexc_v );
44 }

Generated for cloudy by doxygen 1.8.3.1