27 STATIC double Hydcs123(
long int ilow,
long int ihigh,
long int iz,
long int chType);
36 inline double C2_PR78(
double x,
double y);
42 static const realnum HCSTE[
NHCSTE] = {5802.f,11604.f,34812.f,58020.f,116040.f,174060.f,232080.f,290100.f};
53 if( ipLo==1 && ipHi==2 )
55 fprintf(
ioQQQ,
"HCSAR_interp was called for the 2s-2p transition, which it cannot do\n");
72 for( ip=1; ip<
NHCSTE; ++ip )
84 fprintf(
ioQQQ,
" insane cs returned by HCSAR_interp, values are\n");
133 static const double ap[5] = {-2113.113,729.0084,1055.397,854.632,938.9912};
134 static const double bp[5] = {-6783.515,-377.7190,724.1936,493.1107,735.7466};
135 static const double cp[5] = {-3049.719,226.2320,637.8630,388.5465,554.6369};
136 static const double dp[5] = {3514.5153,88.60169,-470.4055,-329.4914,-450.8459};
137 static const double ep[5] = {0.005251557,0.009059154,0.008725781,0.009952418,0.01098687};
138 static const double ae[5] = {-767.5859,-643.1189,-461.6836,-429.0543,-406.5285};
139 static const double be[5] = {-1731.9178,-1442.548,-1055.364,-980.3079,-930.9266};
140 static const double ce[5] = {-939.1834,-789.9569,-569.1451,-530.1974,-502.0939};
141 static const double de[5] = {927.4773,773.2008,564.3272,524.2944,497.7763};
142 static const double ee[5] = {-0.002528027,-0.003793665,-0.002122103,-0.002234207,-0.002317720};
143 static const double A[2] = {4.4394,0.0};
144 static const double B[2] = {0.8949,0.8879};
145 static const double C0[2] = {-0.6012,-0.2474};
146 static const double C1[2] = {-3.9710,-3.7562};
147 static const double C2[2] = {-4.2176,2.0491};
148 static const double D0[2] = {2.930,0.0539};
149 static const double D1[2] = {1.7990,3.4009};
150 static const double D2[2] = {4.9347,-1.7770};
249 else if( ipLow == 2 )
255 else if( ipLow == 3 )
267 Charge = (double)(nelem + 1);
269 ChargeSquared = Charge*Charge;
271 if( ipLow == 2 && ipHi == 3 )
282 else if( nelem == 1 )
290 else if( nelem <= 5 )
297 else if( nelem <= 11 )
304 else if( nelem <= 15 )
311 else if( nelem <= 17 )
332 TeUse =
MIN2(x,0.80);
333 x =
MAX2(0.025,TeUse);
340 Ratelow = ae[j-1] + be[j-1]*x + ce[j-1]*
pow2(x)*logx + de[j-1]*
341 exp(x) + ee[j-1]*logx/
pow2(x);
343 else if( chType ==
'p' )
345 Ratelow = ap[j-1] + bp[j-1]*x + cp[j-1]*
pow2(x)*logx + dp[j-1]*
346 exp(x) + ep[j-1]*logx/
pow2(x);
351 fprintf(
ioQQQ,
" insane collision species given to Hydcs123\n" );
363 TeUse =
MIN2(x,0.80);
364 x =
MAX2(0.025,TeUse);
368 Ratehigh = ae[k-1] + be[k-1]*x + ce[k-1]*
pow2(x)*logx +
369 de[k-1]*exp(x) + ee[k-1]*logx/
pow2(x);
373 Ratehigh = ap[k-1] + bp[k-1]*x + cp[k-1]*
pow2(x)*logx +
374 dp[k-1]*exp(x) + ep[k-1]*logx/
pow2(x);
377 slope = (Ratehigh - Ratelow)/(zhigh - zlow);
378 rate = slope*(Charge - zlow) + Ratelow;
380 rate = rate/ChargeSquared/Charge*1.0e-7;
382 templow = 0.025*27.211396*TE1RYD/EVRYD*ChargeSquared;
383 temphigh = 0.80*27.211396*TE1RYD/EVRYD*ChargeSquared;
385 temp =
MAX2(TeUse,templow);
386 Hydcs123_v = rate*gHi*sqrt(temp)/COLL_CONST;
391 Hydcs123_v *=
powpq( PROTON_MASS/ELECTRON_MASS, 3, 2 );
394 else if( ipHi == 4 || ipHi == 5 || ipHi == 6 )
403 else if( nelem == 1 )
410 else if( nelem > 1 && nelem <= 5 )
415 Ratehigh =
C6cs123(ipLow,ipHi);
417 else if( nelem > 5 && nelem <= 9 )
424 else if( nelem > 9 && nelem <= 19 )
431 else if( nelem > 19 && nelem <= 25 )
456 slope = (Ratehigh - Ratelow)/(zhigh - zlow);
457 rate = slope*(Charge - zlow) + Ratelow;
474 return( Hydcs123_v );
480 EE = ChargeSquared*EVRYD*(1./QuanNLo/QuanNLo - 1./QuanNUp/QuanNUp);
490 C = C0[i] + C1[i]/Charge + C2[i]/ChargeSquared;
491 D = D0[i] + D1[i]/Charge + D2[i]/ChargeSquared;
517 rate = (B[i] + D*q)/expq + (A[i] + C*q - D*q*q)*
522 rate *= 8.010e-8/(2. * ChargeSquared * sqrt(tev));
524 rate *= expq*gLo/gHi;
529 return( Hydcs123_v );
541 static const double a[3] = {-92.23774,-1631.3878,-6326.4947};
542 static const double b[3] = {-11.93818,-218.3341,-849.8927};
543 static const double c[3] = {0.07762914,1.50127,5.847452};
544 static const double d[3] = {78.401154,1404.8475,5457.9291};
545 static const double e[3] = {332.9531,5887.4263,22815.211};
562 t =
MIN2(TeUse,1.6e6);
566 if( i == 1 && j == 2 )
569 fprintf(
ioQQQ,
" Carbon VI 2s-1s not done in C6cs123\n" );
573 else if( i == 1 && j == 3 )
576 fprintf(
ioQQQ,
" Carbon VI 2p-1s not done in C6cs123\n" );
580 else if( i == 1 && ( j == 4 || j == 5 || j == 6 ) )
583 C6cs123_v = a[0] + b[0]*x + c[0]*
pow2(x)*sqrt(x) + d[0]*logx +
586 else if( i == 2 && ( j == 4 || j == 5 || j == 6 ) )
589 C6cs123_v = a[1] + b[1]*x + c[1]*
pow2(x)*sqrt(x) + d[1]*logx +
592 else if( i == 3 && ( j == 4 || j == 5 || j == 6 ) )
595 C6cs123_v = a[2] + b[2]*x + c[2]*
pow2(x)*sqrt(x) + d[2]*logx +
600 fprintf(
ioQQQ,
" insane levels for C VI n=1,2,3 !!!\n" );
615 static const double a[3] = {-12.5007,-187.2303,-880.18896};
616 static const double b[3] = {-1.438749,-22.17467,-103.1259};
617 static const double c[3] = {0.008219688,0.1318711,0.6043752};
618 static const double d[3] = {10.116516,153.2650,717.4036};
619 static const double e[3] = {45.905343,685.7049,3227.2836};
638 t =
MIN2(TeUse,1.585e7);
642 if( i == 1 && j == 2 )
645 fprintf(
ioQQQ,
" Ca XX 2s-1s not done in Ca20cs123\n" );
649 else if( i == 1 && j == 3 )
652 fprintf(
ioQQQ,
" Ca XX 2p-1s not done in Ca20cs123\n" );
656 else if( i == 1 && ( j == 4 || j == 5 || j == 6 ))
659 Ca20cs123_v = a[0] + b[0]*x + c[0]*
pow2(x)*sqrt(x) + d[0]*logx +
662 else if( i == 2 && ( j == 4 || j == 5 || j == 6 ))
665 Ca20cs123_v = a[1] + b[1]*x + c[1]*
pow2(x)*sqrt(x) + d[1]*logx +
668 else if( i == 3 && ( j == 4 || j == 5 || j == 6 ))
671 Ca20cs123_v = a[2] + b[2]*x + c[2]*
pow2(x)*sqrt(x) + d[2]*logx +
676 fprintf(
ioQQQ,
" insane levels for Ca XX n=1,2,3 !!!\n" );
679 return( Ca20cs123_v );
691 static const double a[3] = {3.346644,151.2435,71.7095};
692 static const double b[3] = {0.5176036,20.05133,13.1543};
693 static const double c[3] = {-0.00408072,-0.1311591,-0.1099238};
694 static const double d[3] = {-3.064742,-129.8303,-71.0617};
695 static const double e[3] = {-11.87587,-541.8599,-241.2520};
712 t =
MIN2(TeUse,1.6e6);
716 if( i == 1 && j == 2 )
719 fprintf(
ioQQQ,
" Neon X 2s-1s not done in Ne10cs123\n" );
723 else if( i == 1 && j == 3 )
726 fprintf(
ioQQQ,
" Neon X 2p-1s not done in Ne10cs123\n" );
730 else if( i == 1 && ( j == 4 || j == 5 || j == 6 ) )
733 Ne10cs123_v = a[0] + b[0]*x + c[0]*
pow2(x)*sqrt(x) + d[0]*logx +
736 else if( i == 2 && ( j == 4 || j == 5 || j == 6 ) )
739 Ne10cs123_v = a[1] + b[1]*x + c[1]*
pow2(x)*sqrt(x) + d[1]*logx +
742 else if( i == 3 && ( j == 4 || j == 5 || j == 6 ) )
745 Ne10cs123_v = a[2] + b[2]*x + c[2]*
pow2(x)*sqrt(x) + d[2]*logx +
750 fprintf(
ioQQQ,
" insane levels for Ne X n=1,2,3 !!!\n" );
753 return( Ne10cs123_v );
762 static const double a[11]={0.12176209,0.32916723,0.46546497,0.044501688,
763 0.040523277,0.5234889,1.4903214,1.4215094,1.0295881,4.769306,9.7226127};
764 static const double b[11]={0.039936166,2.9711166e-05,-0.020835863,3.0508137e-04,
765 -2.004485e-15,4.41475e-06,1.0622666e-05,2.0538877e-06,0.80638448,2.0967075e-06,
767 static const double c[11]={143284.77,0.73158545,-2.159172,0.43254802,2.1338557,
768 8.9899702e-06,-2.9001451e-12,1.762076e-05,52741.735,-2153.1219,-3.3996921e-11};
790 else if( t > 5.0e05 )
797 if( i == 1 && j == 2 )
800 He2cs123_v = a[0] + b[0]*exp(-t/c[0]);
802 else if( i == 1 && j == 3 )
805 He2cs123_v = a[1] + b[1]*pow(t,c[1]);
807 else if( i == 1 && j == 4 )
810 double logt = log(t);
811 He2cs123_v = a[2] + b[2]*logt + c[2]/logt;
813 else if( i == 1 && j == 5 )
816 He2cs123_v = a[3] + b[3]*pow(t,c[3]);
818 else if( i == 1 && j == 6 )
821 He2cs123_v = a[4] + b[4]*pow(t,c[4]);
823 else if( i == 2 && j == 4 )
826 He2cs123_v = (a[5] + c[5]*t)/(1 + b[5]*t);
828 else if( i == 2 && j == 5 )
831 He2cs123_v = a[6] + b[6]*t + c[6]*t*t;
833 else if( i == 2 && j == 6 )
836 He2cs123_v = (a[7] + c[7]*t)/(1 + b[7]*t);
838 else if( i == 3 && j == 4 )
841 He2cs123_v = a[8] + b[8]*exp(-t/c[8]);
843 else if( i == 3 && j == 5 )
846 He2cs123_v = a[9] + b[9]*t + c[9]/t;
848 else if( i == 3 && j == 6 )
851 He2cs123_v = a[10] + b[10]*t + c[10]*t*t;
856 fprintf(
ioQQQ,
" insane levels for He II n=1,2,3 !!!\n" );
859 return( He2cs123_v );
871 static const double a[3] = {-4.238398,-238.2599,-1211.5237};
872 static const double b[3] = {-0.4448177,-27.06869,-136.7659};
873 static const double c[3] = {0.0022861,0.153273,0.7677703};
874 static const double d[3] = {3.303775,191.7165,972.3731};
875 static const double e[3] = {15.82689,878.1333,4468.696};
892 t =
MIN2(TeUse,1.585e7);
896 if( i == 1 && j == 2 )
899 fprintf(
ioQQQ,
" Fe XXVI 2s-1s not done in Fe26cs123\n" );
903 else if( i == 1 && j == 3 )
906 fprintf(
ioQQQ,
" Fe XXVI 2p-1s not done in Fe26cs123\n" );
910 else if( i == 1 && ( j == 4 || j == 5 || j == 6 ) )
913 Fe26cs123_v = a[0] + b[0]*x + c[0]*
pow2(x)*sqrt(x) + d[0]*logx +
916 else if( i == 2 && ( j == 4 || j == 5 || j == 6 ) )
919 Fe26cs123_v = a[1] + b[1]*x + c[1]*
pow2(x)*sqrt(x) + d[1]*logx +
922 else if( i == 3 && ( j == 4 || j == 5 || j == 6 ) )
925 Fe26cs123_v = a[2] + b[2]*x + c[2]*
pow2(x)*sqrt(x) + d[2]*logx +
930 fprintf(
ioQQQ,
" insane levels for Ca XX n=1,2,3 !!!\n" );
933 return( Fe26cs123_v );
950 kTRyd = temp / TE1RYD;
981 return pow2(x)*log1p(2./3.*x)/(2.*y + 1.5*x);
997 double Ebar2 =
pow2(Ebar);
1003 double A = 8./(3.*s) *
pow3(np/(s*n)) * (0.184 - 0.04/
pow2(cbrt(s))) *
powi(1.-0.2*s/nnp, 1+2*is);
1005 double Z3 = (double)(nelem + 1 - ipISO);
1006 double Z32 =
pow2(Z3);
1008 double D = exp(-Z32/(nnp*Ebar2));
1010 double L = log((1.+0.53*Ebar2*nnp/Z32) / (1.+0.4*Ebar));
1012 double F =
powi(1.-0.3*s*D/nnp, 1+2*is);
1014 double G = 0.5*
pow3(Ebar*n2/(Z3*np));
1016 double h1 = sqrt(2. -
pow2(n/np));
1017 double h2 = 2.*Z3/(n2*Ebar);
1018 double xPlus = h2/(h1+1.);
1019 double xMinus = h2/(h1-1.);
1021 double y = 1./(1.-D*log(18.*s)/(4.*s));
1028 cross_section *= PI*
pow2(n2*BOHR_RADIUS_CM/Z3) / Ebar;
1032 stat_weight = 2.*n2;
1034 stat_weight = 4.*n2;
1039 return cross_section*stat_weight*Ebar / (PI*
pow2(BOHR_RADIUS_CM));
1043 STATIC void TestPercivalRichards(
void )
1048 for(
long i=0; i<5; i++ )
1050 double Ebar[5] = {0.1, 0.4, 0.8, 1.0, 10.};
1056 for(
long i=0; i<5; i++ )
1058 double Ebar[5] = {0.1, 0.4, 0.8, 1.0, 10.};
1087 const char *where=
" ";
1090 nHi, lHi, sHi, gHi, IP_Ryd_Hi,
1091 nLo, lLo, sLo, gLo, IP_Ryd_Lo,
1092 tauLo, EnerErg, &where );
1097 long nHi,
long lHi,
long sHi,
long gHi,
double IP_Ryd_Hi,
1098 long nLo,
long lLo,
long sLo,
long gLo,
double IP_Ryd_Lo,
1099 double tauLo,
double EnerErg,
const char **where )
1109 double deltaE_eV = EnerErg/EN1EV;
1119 abs( lLo - lHi ) != 1 )
1162 abs( lLo - lHi ) != 1 )
1172 CStemp /= 2.*
pow2(nHi);
1182 if( (CStemp =
HlikeCSInterp( nelem, ipCollider, nHi, lHi, sHi, nLo, lLo, sLo )) >= 0.f )
1184 fixit(
"do something here and throughout this routine with where as in helike_cs.cpp." );
1190 CStemp =
hydro_vs_deexcit( nHi, gHi, IP_Ryd_Hi, nLo, gLo, IP_Ryd_Lo, Aul_j );
1194 CStemp /= 2.*
pow2(nHi);
1196 else if( nLo == nHi )
1288 CStemp /= 2.*
pow2(nHi);
1301 if( lLo < 0 || lHi < 0 )
1304 ASSERT( sHi==2 && sLo==2 );
1317 cs =
Hydcs123(ipLo + 1,ipHi + 1,nelem,
'e');
1319 else if( nelem>
ipHYDROGEN && Collider==
ipPROTON && nHi==2 && lHi==1 && nLo==2 && lLo==0 )
1321 cs =
Hydcs123(ipLo + 1,ipHi + 1,nelem,
'p');
realnum EnergyErg() const
STATIC double Ne10cs123(long int i, long int j)
bool lgCS_PSClassic[NISO]
NORETURN void TotalInsanity(void)
realnum h_coll_str(long ipLo, long ipHi, long ipTe)
bool lgCS_therm_ave[NISO]
double CS_l_mixing_VF01(long ipISO, long nelem, long n, long l, long lp, long s, long gLo, double tauLo, double IP_Ryd_Hi, double IP_Ryd_Lo, double temp, long Collider)
STATIC double Fe26cs123(long int i, long int j)
double C2_PR78(double x, double y)
double CS_l_mixing_PS64(long nelem, double tau, double target_charge, long n, long l, double gLo, long lp, double deltaE_eV, long Collider)
bool lgCS_Vrinceanu[NISO]
STATIC double Hydcs123(long int ilow, long int ihigh, long int iz, long int chType)
realnum GetHlikeCollisionStrength(long nelem, long ipCollider, long nHi, long lHi, long sHi, long gHi, double IP_Ryd_Hi, long nLo, long lLo, long sLo, long gLo, double IP_Ryd_Lo, double tauLo, double EnerErg, const char **where)
t_iso_sp iso_sp[NISO][LIMELM]
STATIC double CS_ThermAve_PR78(long ipISO, long nelem, long nHi, long nLo, double deltaE, double temp)
bool fp_equal(sys_float x, sys_float y, int n=3)
realnum HydroCSInterp(long nelem, long ipHi, long ipLo, long ipCollider)
double CS_l_mixing_VOS12(long n, long l, long lp, long nelem, double gLo, long Ztarget, long Collider, double sqrte)
STATIC realnum HCSAR_interp(int ipLo, int ipHi)
static const realnum HCSTE[NHCSTE]
STATIC double He2cs123(long int i, long int j)
STATIC double CS_PercivalRichards78(double Ebar)
double powi(double, long int)
diatomics h2("h2", 4100.,&hmi.H2_total, Yan_H2_CS)
multi_arr< long, 3 > QuantumNumbers2Index
TransitionProxy trans(const long ipHi, const long ipLo)
STATIC double Ca20cs123(long int i, long int j)
double CS_l_mixing_VOS12QM(long ipISO, long nelem, long n, long l, long lp, long s, long gLo, double tauLo, double IP_Ryd_Hi, double IP_Ryd_Lo, double temp, long Collider)
double HydroEinstA(long int n1, long int n2)
static double global_deltaE
double qg32(double, double, double(*)(double))
STATIC double C6cs123(long int i, long int j)
#define DEBUG_ENTRY(funcname)
double powpq(double x, int p, int q)
STATIC double cross_section(double EgammaRyd, double EthRyd, long nelem, long n, long l, long s)
int fprintf(const Output &stream, const char *format,...)
STATIC realnum HlikeCSInterp(long nelem, long Collider, long nHi, long lHi, long sHi, long nLo, long lLo, long sLo)
double hydro_vs_deexcit(long nHi, long gHi, double IP_Ryd_Hi, long nLo, long gLo, double IP_Ryd_Lo, double Aul)
double CS_l_mixing_PS64_expI(long nelem, double tau, double target_charge, long n, long l, double g, long lp, double deltaE_eV, long Collider)
STATIC double Therm_ave_coll_str_int_PR78(double EOverKT)
bool lgCaseB_HummerStorey