31STATIC double S62_Therm_ave_coll_str(
double proj_energy_overKT,
long nelem,
long Collider,
double deltaE,
double osc_strength,
double temp,
32 double stat_weight,
double I_energy_eV );
37 double ColliderCharge,
double temp,
double velOrEner,
bool lgParamIsRedVel );
67 return exp( -1.*EOverKT ) *
col_str;
93 long i, i1, j, nelem, ipHi, ipLo;
97# define chLine_LENGTH 1000
104 fprintf(
ioQQQ,
" HeCollidSetup opening he1_cs.dat:");
111 fprintf(
ioQQQ,
" HeCollidSetup could not read first line of he1_cs.dat.\n");
115 i1 = (long)
FFmtRead(chLine,&i,
sizeof(chLine),&lgEOL);
123 " HeCollidSetup: the version of he1_cs.dat is not the current version.\n" );
125 " HeCollidSetup: I expected to find the number %i and got %li instead.\n" ,
127 fprintf(
ioQQQ,
"Here is the line image:\n==%s==\n", chLine );
133 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
136 if( chLine[0] ==
'#')
141 char *chTemp = strtok(chLine,
" \t\n");
142 while( chTemp != NULL )
144 CSTemp.push_back( atof(chTemp) );
145 chTemp = strtok(NULL,
" \t\n");
151 fprintf(
ioQQQ,
" HeCollidSetup could not find line in CS temperatures in he1_cs.dat.\n");
161 for(
long ipHi=1; ipHi < numLevs; ++ipHi )
164 for(
long ipLo=0; ipLo<ipHi; ++ipLo )
173 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
177 if( (chLine[0] ==
' ') || (chLine[0]==
'\n') )
179 if( chLine[0] !=
'#')
185 ipLo = (long)
FFmtRead(chLine,&j,
sizeof(chLine),&lgEOL);
186 ipHi = (long)
FFmtRead(chLine,&j,
sizeof(chLine),&lgEOL);
194 for(
long i=0; i<3; ++i )
196 if( (chTemp =
strchr_s( chTemp,
'\t' )) == NULL )
198 fprintf(
ioQQQ,
" HeCollidSetup could not init cs\n" );
204 for(
unsigned i=0; i<
CSTemp.size(); ++i )
207 if( (chTemp =
strchr_s( chTemp,
'\t' )) == NULL )
209 fprintf(
ioQQQ,
" HeCollidSetup could not scan cs, current indices: %li %li\n", ipHi, ipLo );
213 sscanf( chTemp ,
"%le" , &a );
236 const char *where =
" ";
248 cs =
AtomCSInterp( nelem, ipHi , ipLo, &factor1, &where, Collider );
253 cs =
IonCSInterp( nelem, ipHi , ipLo, &factor1, &where, Collider );
275 enum {DEBUG_LOC=
false};
280 fprintf(
ioQQQ,
"%li\t%li\t%li\t-\t%li\t%li\t%li\t%.2e\t%s\n",
286 return MAX2(cs, 1.e-10f);
359 ASSERT( *factor1 == -1.f );
369 *factor1 = (2.f*((
realnum)ipLo-3.f)+1.f) / 9.f;
379 *factor1 = (2.f*((
realnum)ipHi-3.f)+1.f) / 9.f;
396 cs =
HeCS[ipHi][ipLo][0];
413 ASSERT( (flow >= 0.f) && (flow <= 1.f) );
415 cs =
HeCS[ipHi][ipLo][ipArray] * (1.f-flow) +
416 HeCS[ipHi][ipLo][ipArray+1] * flow;
438 ASSERT( *factor1 == -1.f );
497 *factor1 = (2.f*((
realnum)ipLo-3.f)+1.f) / 9.f;
503 *factor1 = (2.f*((
realnum)ipHi-3.f)+1.f) / 9.f;
513 ASSERT( *factor1 == -1.f );
561 cs = (
realnum)pow( 10. , -1.45*x + 6.75);
566 cs = (
realnum)pow( 10. , -3.33*x+15.15);
572 cs = (
realnum)pow( 10. , -2.3*x+10.3);
599 *factor1 = (2.f*((
realnum)ipLo-3.f)+1.f) / 9.f;
605 *factor1 = (2.f*((
realnum)ipHi-3.f)+1.f) / 9.f;
665 cs = 0.25f/
POW2(nelem+1.f);
668 cs = 0.4f/
POW2(nelem+1.f);
671 cs = 0.15f/
POW2(nelem+1.f);
674 cs = 0.45f/
POW2(nelem+1.f);
677 cs = 0.75f/
POW2(nelem+1.f);
680 cs = 1.3f/
POW2(nelem+1.f);
694 cs = 2.75f/
POW2(nelem+1.f);
697 cs = 60.f/
POW2(nelem+1.f);
700 cs = 180.f/
POW2(nelem+1.f);
703 cs = 300.f/
POW2(nelem+1.f);
706 cs = 5.8f/
POW2(nelem+1.f);
720 cs = 0.56f/
POW2(nelem+1.f);
723 cs = 1.74f/
POW2(nelem+1.f);
726 cs = 2.81f/
POW2(nelem+1.f);
729 cs = 190.f/
POW2(nelem+1.f);
743 cs = 8.1f/
POW2(nelem+1.f);
746 cs = 8.2f/
POW2(nelem+1.f);
749 cs = 3.9f/
POW2(nelem+1.f);
763 cs = 30.f/
POW2(nelem+1.f);
766 cs = 11.7f/
POW2(nelem+1.f);
790 ASSERT( *factor1 == -1.f );
848 *factor1 = (2.f*((
realnum)ipHi-3.f)+1.f) / 9.f;
917 if(
iso_sp[ipISO][nelem].trans(ipHi,ipLo).ipCont() <= 0 )
941 coll_str = S62.
sum( 0., 1., func );
942 coll_str += S62.
sum( 1., 10., func );
950 double stat_weight,
double I_energy_eV )
954 double betaone, zeta_of_betaone, cs2;
955 double Dubya, proj_energy;
971 proj_energy += deltaE;
972 Dubya = 0.5*(2.*proj_energy-deltaE);
977 ASSERT( I_energy_eV > 0. );
978 ASSERT( osc_strength > 0. );
981 zOverB2 = 0.5*
POW2(Dubya/deltaE)*deltaE/I_energy_eV/osc_strength;
987 betaone = sqrt( 1./zOverB2 );
989 else if( zOverB2 < 0.54 )
992 betaone = (1./3.)*(log(
PI)-log(zOverB2)+1.28);
996 betaone += 0.5*(log(
PI)-log(zOverB2));
1002 long ip_zOverB2 = 0;
1003 double zetaOVERbeta2[101] = {
1004 1.030E+02,9.840E+01,9.402E+01,8.983E+01,8.583E+01,8.200E+01,7.835E+01,7.485E+01,
1005 7.151E+01,6.832E+01,6.527E+01,6.236E+01,5.957E+01,5.691E+01,5.436E+01,5.193E+01,
1006 4.961E+01,4.738E+01,4.526E+01,4.323E+01,4.129E+01,3.943E+01,3.766E+01,3.596E+01,
1007 3.434E+01,3.279E+01,3.131E+01,2.989E+01,2.854E+01,2.724E+01,2.601E+01,2.482E+01,
1008 2.369E+01,2.261E+01,2.158E+01,2.059E+01,1.964E+01,1.874E+01,1.787E+01,1.705E+01,
1009 1.626E+01,1.550E+01,1.478E+01,1.409E+01,1.343E+01,1.280E+01,1.219E+01,1.162E+01,
1010 1.107E+01,1.054E+01,1.004E+01,9.554E+00,9.094E+00,8.655E+00,8.234E+00,7.833E+00,
1011 7.449E+00,7.082E+00,6.732E+00,6.397E+00,6.078E+00,5.772E+00,5.481E+00,5.202E+00,
1012 4.937E+00,4.683E+00,4.441E+00,4.210E+00,3.989E+00,3.779E+00,3.578E+00,3.387E+00,
1013 3.204E+00,3.031E+00,2.865E+00,2.707E+00,2.557E+00,2.414E+00,2.277E+00,2.148E+00,
1014 2.024E+00,1.907E+00,1.795E+00,1.689E+00,1.589E+00,1.493E+00,1.402E+00,1.316E+00,
1015 1.235E+00,1.157E+00,1.084E+00,1.015E+00,9.491E-01,8.870E-01,8.283E-01,7.729E-01,
1016 7.206E-01,6.712E-01,6.247E-01,5.808E-01,5.396E-01};
1018 ASSERT( zOverB2 >= zetaOVERbeta2[100] );
1021 for(
long i=0; i< 100; ++i )
1023 if( ( zOverB2 < zetaOVERbeta2[i] ) && ( zOverB2 >= zetaOVERbeta2[i+1] ) )
1031 ASSERT( (ip_zOverB2 >=0) && (ip_zOverB2 < 100) );
1033 betaone = (zOverB2 - zetaOVERbeta2[ip_zOverB2]) /
1034 (zetaOVERbeta2[ip_zOverB2+1] - zetaOVERbeta2[ip_zOverB2]) *
1035 (pow(10., ((
double)ip_zOverB2+1.)/100. - 1.) - pow(10., ((
double)ip_zOverB2)/100. - 1.)) +
1036 pow(10., (
double)ip_zOverB2/100. - 1.);
1040 zeta_of_betaone = zOverB2 *
POW2(betaone);
1049 cross_section *= 8. * (I_energy_eV/deltaE) * osc_strength * (I_energy_eV/proj_energy);
1054 integrand = exp( -1.*(proj_energy-deltaE)*
EVDEGK/temp ) * coll_str;
1062 double target_charge,
1071 TwoLogDebye, TwoLogRc1,
1073 bestfactor, factorpart,
1074 reduced_mass, reduced_mass_2_emass,
1100 TwoLogRc1 = 10.95 + log10(
phycon.
te * tau * tau / reduced_mass_2_emass );
1106 TwoLogRc2 = 2. * log10( 1.12 *
H_BAR * v / deltaE );
1112 Dnl =
POW2( ChargIncoming / target_charge) * 6. *
POW2( (
double)n) *
1113 (
POW2((
double)n) -
POW2((
double)l) - l - 1);
1118 factorpart = (11.54 + log10(
phycon.
te / Dnl / reduced_mass_2_emass ) );
1120 if( (factor1 = factorpart + TwoLogDebye) <= 0.)
1122 if( (factor2 = factorpart + TwoLogRc1) <= 0.)
1126 bestfactor =
MIN2(factor1,factor2);
1128 ASSERT( bestfactor > 0. );
1131 if( bestfactor > 100. )
1137 rate = 9.93e-6 * sqrt( reduced_mass_2_emass ) * Dnl /
phycon.
sqrte * bestfactor;
1153 cs = rate / (
COLL_CONST * pow(reduced_mass_2_emass, -1.5) ) *
1210 coll_str = VF01_E.
sum( 0.0, 6.0, func );
1222 coll_str = VF01_E.
sum( 0.0, 1.0, func );
1223 coll_str += VF01_E.
sum( 1.0, 10.0, func );
1229STATIC double collision_strength_VF01(
long ipISO,
long nelem,
long n,
long l,
long lp,
long s,
long Collider,
double ColliderCharge,
double temp,
double velOrEner,
bool lgParamIsRedVel )
1231 double cross_section, coll_str, RMSv, aveRadius, reduced_vel, E_Proj_Ryd;
1232 double ConstantFactors, reduced_mass, CSIntegral, stat_weight;
1233 double quantum_defect1, quantum_defect2, omega_qd1, omega_qd2, omega_qd;
1234 double reduced_b_max, reduced_b_min, alphamax, alphamin, step, alpha1 ;
1244 stat_weight =
iso_sp[ipISO][nelem].
st[ipLo].g();
1257 ASSERT( reduced_mass > 0. );
1262 ASSERT( aveRadius < 1.e-4 );
1275 if( lgParamIsRedVel )
1278 reduced_vel = velOrEner;
1287 E_Proj_Ryd = velOrEner;
1292 ASSERT( reduced_vel > 1.e-10 );
1293 ASSERT( reduced_vel < 1.e10 );
1300 ASSERT( reduced_b_min > 1.e-10 );
1301 ASSERT( reduced_b_min < 1.e10 );
1311 quantum_defect1 = (double)n- (
double)nelem/sqrt(
iso_sp[ipISO][nelem].fb[ipLo].xIsoLevNIonRyd);
1312 quantum_defect2 = (double)n- (
double)nelem/sqrt(
iso_sp[ipISO][nelem].fb[ipHi].xIsoLevNIonRyd);
1315 ASSERT( fabs(quantum_defect1) < 1.0 );
1316 ASSERT( fabs(quantum_defect1) > 0.0 );
1317 ASSERT( fabs(quantum_defect2) < 1.0 );
1318 ASSERT( fabs(quantum_defect2) > 0.0 );
1321 omega_qd1 = fabs( 5.* quantum_defect1 * (1.-0.6*
POW2((
double)l/(
double)n)) /
POW3( (
double)n ) / (
double)l );
1323 omega_qd2 = fabs( 5.* quantum_defect2 * (1.-0.6*
POW2((
double)lp/(
double)n)) /
POW3( (
double)n ) / (
double)lp );
1325 omega_qd = 0.5*( omega_qd1 + omega_qd2 );
1329 reduced_b_max = sqrt( 1.5 *
ColliderCharge * n / omega_qd )/aveRadius;
1335 reduced_b_max =
MAX2( reduced_b_max, reduced_b_min );
1336 ASSERT( reduced_b_max > 0. );
1344 func.
an = aveRadius;
1346 func.
bmax = reduced_b_max*aveRadius;
1355 alphamin =
MAX2( alphamin, 1.e-30 );
1356 alphamax =
MAX2( alphamax, 1.e-20 );
1360 if( alphamax > alphamin )
1363 step = (alphamax - alphamin)/5.;
1365 CSIntegral += VF01_alpha.
sum( alpha1, alpha1+step, func );
1366 CSIntegral += VF01_alpha.
sum( alpha1+step, alpha1+4.*step, func );
1382 double integrand, deltaPhi, b;
1386 ASSERT( alpha >= 1.e-30 );
1395 deltaPhi = -1.*
PI + 2.*asin(b/bmax);
1401 integrand = 1./alpha/alpha/alpha;
1410 double cosU1, cosU2, sinU1, sinU2, cosChiOver2, sinChiOver2, cosChi, A, B;
1417 cosU1 = 2.*
POW2((
double)l/(
double)n) - 1.;
1418 cosU2 = 2.*
POW2((
double)lp/(
double)n) - 1.;
1420 sinU1 = sqrt( 1. - cosU1*cosU1 );
1421 sinU2 = sqrt( 1. - cosU2*cosU2 );
1424 cosChiOver2 = (1. + alpha*alpha*cos( sqrt(1.+alpha*alpha) * deltaPhi ) )/(1.+alpha*alpha);
1425 sinChiOver2 = sqrt( 1. - cosChiOver2*cosChiOver2 );
1426 cosChi = 2. *
POW2( cosChiOver2 ) - 1.;
1430 if( -1.*cosU2 - cosChi < 0. )
1437 ASSERT( sinChiOver2 > 0. );
1438 ASSERT( sinChiOver2*sinChiOver2 >
POW2((
double)lp/(
double)n) );
1441 probability = (double)lp/(
POW2((
double)n)*sinChiOver2*sqrt(
POW2(sinChiOver2) -
POW2((
double)lp/(
double)n) ) );
1446 double OneMinusCosChi = 1. - cosChi;
1448 if( OneMinusCosChi == 0. )
1450 double hold = sin( deltaPhi / 2. );
1452 OneMinusCosChi = 8. * alpha * alpha *
POW2( hold );
1455 if( OneMinusCosChi == 0. )
1462 A = (cosU1*cosU2 - sinU1*sinU2 - cosChi)/OneMinusCosChi;
1463 B = (cosU1*cosU2 + sinU1*sinU2 - cosChi)/OneMinusCosChi;
1476 probability = 2.*lp/(
PI* n*n*
POW2( sinChiOver2 ));
1480 probability *=
ellpk( -A/(B-A) );
1481 probability /= sqrt( B - A );
1485 probability *=
ellpk( A/B );
1486 probability /= sqrt( B );
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)
const char * strchr_s(const char *s, int c)
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
NORETURN void TotalInsanity(void)
#define DEBUG_ENTRY(funcname)
double sum(double min, double max, Integrand func)
realnum EnergyErg() const
EmissionList::reference Emis() const
void reserve(size_type i1)
double operator()(double proj_energy_overKT)
double operator()(double EOverKT)
double operator()(double alpha)
TransitionProxy trans(const long ipHi, const long ipLo)
multi_arr< long, 3 > QuantumNumbers2Index
bool lgCS_therm_ave[NISO]
bool lgColl_l_mixing[NISO]
bool lgCS_Vrinceanu[NISO]
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
STATIC double L_mix_integrand_VF01(long n, long l, long lp, double bmax, double red_vel, double an, double ColliderCharge, double alpha)
STATIC double S62_Therm_ave_coll_str(double proj_energy_overKT, long nelem, long Collider, double deltaE, double osc_strength, double temp, double stat_weight, double I_energy_eV)
STATIC double StarkCollTransProb_VF01(long int n, long int l, long int lp, double alpha, double deltaPhi)
realnum HeCSInterp(long int nelem, long int ipHi, long int ipLo, long int Collider)
realnum IonCSInterp(long nelem, long ipHi, long ipLo, realnum *factor1, const char **where, long Collider)
double CS_l_mixing_VF01(long int ipISO, long int nelem, long int n, long int l, long int lp, long int s, double temp, long int Collider)
static const double ColliderCharge[4]
double CS_l_mixing_S62(long ipISO, long nelem, long ipLo, long ipHi, double temp, long Collider)
multi_arr< realnum, 3 > HeCS
double CS_l_mixing_PS64(long nelem, double tau, double target_charge, long n, long l, double gHi, long Collider)
realnum AtomCSInterp(long int nelem, long int ipHi, long int ipLo, realnum *factor1, const char **where, long int Collider)
static const double ColliderMass[4]
STATIC double collision_strength_VF01(long ipISO, long nelem, long n, long l, long lp, long s, long Collider, double ColliderCharge, double temp, double velOrEner, bool lgParamIsRedVel)
STATIC double cross_section(double EgammaRyd, double EthRyd, long nelem, long n, long l, long s)
double CS_VS80(long int ipISO, long int nelem, long int ipHi, long int ipLo, double Aul, double temp, long int Collider)
t_iso_sp iso_sp[NISO][LIMELM]
double ConvCrossSect2CollStr(double CrsSectCM2, double gLo, double E_ProjectileRyd, double reduced_mass_grams)
UNUSED const double H_BAR
UNUSED const double TRANS_PROB_CONST
UNUSED const double BOHR_RADIUS_CM
UNUSED const double BOLTZMANN
UNUSED const double ELECTRON_MASS
UNUSED const double EN1RYD
UNUSED const double EVRYD
UNUSED const double EN1EV
UNUSED const double PROTON_MASS
UNUSED const double EVDEGK
UNUSED const double ATOMIC_MASS_UNIT
UNUSED const double COLL_CONST
UNUSED const double ELEM_CHARGE_ESU
UNUSED const double WAVNRYD
UNUSED const double TE1RYD
realnum AtomicWeight[LIMELM]
double bessel_k0(double x)
double bessel_k1(double x)