00001 /* This file is part of Cloudy and is copyright (C)1978-2010 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 /*H_cross_section returns cross section (cm^-2), 00004 * given EgammaRyd, the photon energy in Ryd, 00005 * ipLevel, the index of the level, 0 is ground, 00006 * nelem is charge, equal to 0 for Hydrogen */ 00007 #include "cddefines.h" 00008 #include "physconst.h" 00009 #include "hydro_bauman.h" 00010 #include "iso.h" 00011 #include "helike.h" 00012 #include "dense.h" 00013 #include "opacity.h" 00014 #include "atmdat.h" 00015 #include "taulines.h" 00016 00017 /*H_cross_section returns cross section (cm^-2), 00018 * given EgammaRyd, the photon energy in Ryd, 00019 * EthRyd, the threshold energy in Ryd, 00020 * quantum numbers n and l 00021 * nelem is charge, equal to 0 for Hydrogen */ 00022 double H_cross_section( double EgammaRyd , double EthRyd, long n, long l, long nelem ) 00023 { 00024 double cs; 00025 double rel_photon_energy; 00026 00027 /* >>chng 02 apr 24, more protection against calling with too small an energy */ 00028 /* evaluating H-like photo cs at He energies, may be below threshold - 00029 * prevent this from happening */ 00030 rel_photon_energy = EgammaRyd / EthRyd; 00031 rel_photon_energy = MAX2( rel_photon_energy , 1. + FLT_EPSILON*2. ); 00032 00033 cs = H_photo_cs(rel_photon_energy , n, l, nelem + 1 ); 00034 00035 ASSERT( cs > 0. && cs < 1.E-8 ); 00036 00037 return cs; 00038 }
1.6.1