cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hydro_recom.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 /*H_cross_section returns cross section (cm^-2),
4  * given EgammaRyd, the photon energy in Ryd,
5  * ipLevel, the index of the level, 0 is ground,
6  * nelem is charge, equal to 0 for Hydrogen */
7 #include "cddefines.h"
8 #include "hydrogenic.h"
9 #include "hydro_bauman.h"
10 
11 /*H_cross_section returns cross section (cm^-2),
12  * given EgammaRyd, the photon energy in Ryd,
13  * EthRyd, the threshold energy in Ryd,
14  * quantum numbers n and l
15  * nelem is charge, equal to 0 for Hydrogen */
16 double H_cross_section( double EgammaRyd , double EthRyd, long n, long l, long nelem )
17 {
18  double cs;
19  double rel_photon_energy;
20 
21  /* >>chng 02 apr 24, more protection against calling with too small an energy */
22  /* evaluating H-like photo cs at He energies, may be below threshold -
23  * prevent this from happening */
24  rel_photon_energy = EgammaRyd / EthRyd;
25  rel_photon_energy = MAX2( rel_photon_energy , 1. + FLT_EPSILON*2. );
26 
27  cs = H_photo_cs(rel_photon_energy , n, l, nelem + 1 );
28 
29  ASSERT( cs > 0. && cs < 1.E-8 );
30 
31  return cs;
32 }
double H_cross_section(double EgammaRyd, double EthRyd, long n, long l, long nelem)
Definition: hydro_recom.cpp:16
double H_photo_cs(double rel_photon_energy, long int n, long int l, long int iz)
#define ASSERT(exp)
Definition: cddefines.h:613
#define MAX2(a, b)
Definition: cddefines.h:824