00001
00002
00003
00004 #include "cddefines.h"
00005 #include "physconst.h"
00006 #include "hydrogenic.h"
00007 #include "phycon.h"
00008 #include "iso.h"
00009
00010 double HydroRecCool(
00011
00012 long int n ,
00013
00014 long int nelem)
00015 {
00016 long int nm1;
00017
00018 double fac,
00019 hclf_v,
00020 x;
00021 static double a[15]={-26.6446988,-26.9066506,-27.0619832,-27.1826903,
00022 -27.2783527,-27.3595949,-27.569406,-27.611159,-27.654748,-27.70479,
00023 -27.745398,-27.776126,-27.807261,-27.833093,-27.866134};
00024 static double b[15]={-0.40511045,-0.41644707,-0.45834359,-0.49137946,
00025 -0.51931762,-0.54971231,-0.18555807,-0.29204736,-0.36741085,
00026 -0.45843009,-0.49753713,-0.51418739,-0.52287028,-0.52445456,
00027 -0.52292803};
00028 static double c[15]={11.29232731,11.71035693,12.89309608,13.85569087,
00029 14.67354775,15.56090323,6.147461,9.0304953,11.094731,13.630431,
00030 14.721959,15.172335,15.413946,15.458123,15.428761};
00031 static double d[15]={.067257375,.07638384,.089925637,.102252192,
00032 .111016071,.119518918,0.0093832482,0.028119606,0.039357697,0.050378417,
00033 0.051644049,0.051367182,0.04938724,0.050139066,0.043085968};
00034 static double e[15]={-1.99108378,-2.26898352,-2.65163846,-3.02333001,
00035 -3.29462338,-3.56633674,-1.0019228,-1.5128672,-1.8327058,-2.1866371,
00036 -2.2286257,-2.1932699,-2.1205891,-2.1317169,-1.9175186};
00037 static double f[15]={-0.0050802618,-0.005849291,-0.0074854405,-0.0085677543,
00038 -0.0093067267,-0.0098455637,0.040903604,0.037491802,0.035618861,
00039 0.034132954,0.032418252,0.02947883,0.027393564,0.027607009,0.02433868};
00040 static double g[15]={.166267838,.196780541,.242675042,.282237211,
00041 .310204623,.335160025,-0.81087376,-0.73435108,-0.69164333,-0.64907209,
00042 -0.61216299,-0.55239109,-0.51048669,-0.51963194,-0.4504203};
00043 static double h[15]={.00020528663,.00027588492,.00033980652,.00041445515,
00044 .00046423276,.0005121808,-0.0011986559,-0.0011333973,-0.0010992935,
00045 -0.0010878727,-0.0010412678,-0.00095539899,-0.00089141547,-0.00089294364,
00046 -0.00079179756};
00047 static double i[15]={-0.0071357493,-0.0099630604,-0.01178647,-0.014696455,
00048 -0.01670318,-0.01887373,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.};
00049
00050 DEBUG_ENTRY( "HydroRecCool()" );
00051
00052
00053 ASSERT( n > 0 );
00054
00055
00056 x = phycon.telogn[0] - phycon.sqlogz[nelem];
00057
00058
00059
00060
00061
00062
00063 if( n > 15 || x < 0.2 )
00064 {
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 fac = HCoolRatio( phycon.te*POW2((double)n) /POW2(nelem+1.) );
00075 hclf_v = iso.RadRecomb[ipH_LIKE][nelem][n][ipRecRad]*phycon.te*BOLTZMANN* fac;
00076
00077 DEBUG_EXIT( "HydroRecCool()" );
00078 return( hclf_v );
00079 }
00080
00081
00082
00083
00084 if( x > 10. )
00085 {
00086 fprintf( ioQQQ, " HydroRecCool called with invalid temperature=%e nelem=%li\n",
00087 phycon.te , nelem );
00088 puts( "[Stop in HydroRecCool]" );
00089 cdEXIT(EXIT_FAILURE);
00090 }
00091
00092
00093 nm1 = n - 1;
00094
00095 if( nelem == 0 )
00096 {
00097
00098 fac = (a[nm1] +
00099 c[nm1]*phycon.telogn[0] +
00100 e[nm1]*phycon.telogn[1] +
00101 g[nm1]*phycon.telogn[2] +
00102 i[nm1]*phycon.telogn[3])/
00103 (1. + b[nm1]*phycon.telogn[0] +
00104 d[nm1]*phycon.telogn[1] +
00105 f[nm1]*phycon.telogn[2] +
00106 h[nm1]*phycon.telogn[3]);
00107 }
00108 else
00109 {
00110
00111 fac = (a[nm1] +
00112 c[nm1]*x +
00113 e[nm1]*POW2( x) +
00114 g[nm1]*POW3( x) +
00115 i[nm1]*powi( x,4) ) /
00116 (1. + b[nm1]*x +
00117 d[nm1]*POW2( x ) +
00118 f[nm1]*POW3( x ) +
00119 h[nm1]*powi( x ,4) );
00120 }
00121
00122 hclf_v = pow(10.,fac)*POW3(nelem+1.);
00123
00124 DEBUG_EXIT( "HydroRecCool()" );
00125 return( hclf_v );
00126 }
00127
00128
00129
00130
00131 double HCoolRatio(
00132
00133 double t )
00134 {
00135 double gamma;
00136
00137 DEBUG_ENTRY( "HCoolRatio()" );
00138
00139 if( t< 1e0 )
00140 {
00141 gamma = 1.;
00142 }
00143 else if( t < 7.4e5 )
00144 {
00145 double y;
00146 double x1,x2,x3,x4;
00147 x1=t;
00148 x2=t*sqrt(t);
00149 x3=t*t;
00150 x4=t*t*log(t);
00151 y=1.000285197084355-7.569939287228937E-06*x1
00152 +2.791888685624040E-08*x2-1.289820289839189E-10*x3
00153 +7.829204293134294E-12*x4;
00154 gamma = y;
00155 }
00156 else if( t < 5e10 )
00157 {
00158 double y;
00159 double x1,x2,x3,x4,xl;
00160 xl = log(t);
00161 x1=t;
00162 x2=xl*xl;
00163 x3=1.0/sqrt(t);
00164 x4=xl/(t*t);
00165 y=0.2731170438382388+6.086879204730784E-14*x1
00166 -0.0003748988159766978*x2+270.2454763661910*x3
00167 -1982634355.349780*x4;
00168 gamma = y;
00169 }
00170 else if( t < 3e14 )
00171 {
00172 double y;
00173 double x1,x2;
00174 x1=sqrt(t);
00175 x2=log(t);
00176 y=-17.02819709397900+4.516090033327356E-05*x1
00177 +1.088324678258230*x2;
00178 gamma = 1/y;
00179 }
00180 else
00181 {
00182
00183 gamma = 1.289e11 * pow(t , -0.9705 );
00184 }
00185
00186 DEBUG_EXIT( "HCoolRatio()" );
00187
00188 return( gamma );
00189 }