cloudy trunk
Loading...
Searching...
No Matches
atom_pop2.cpp
Go to the documentation of this file.
1/* This file is part of Cloudy and is copyright (C)1978-2013 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
9double 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}
t_abund abund
Definition abund.cpp:5
double atom_pop2(double omega, double g1, double g2, double a21, double bltz, double abund)
Definition atom_pop2.cpp:9
#define ASSERT(exp)
Definition cddefines.h:578
#define DEBUG_ENTRY(funcname)
Definition cddefines.h:684
t_dense dense
Definition dense.cpp:24
t_phycon phycon
Definition phycon.cpp:6