// // ionization.cpp // mc_electron // // Created by Christian Reiling on 15.01.19. // Copyright © 2019 Christian Reiling. All rights reserved. // #include "electron.hpp" /* Ionization: Following Differential and total cross sections for ionization of helium and hydrogen by electrons M. E. Rudd 1991 Physical Review A Volume 44 Number3 */ double Electron::get_ionSigma_m2(blitz::TinyVector speedT2_ms) { blitz::TinyVector speedLab_ms = v_ms - speedT2_ms; double T_eV = calc_Ekin_eV_from_speed(calc_vecAbs(speedLab_ms), m_eV); double t = T_eV/ionET2_eV; double N = ZT2; //for tritium-molecule if (T_eV speedT2_ms, int newId, ranlib::Uniform *rngUni) { blitz::TinyVector speedOffset_ms = speedT2_ms; blitz::TinyVector speedLab_ms = v_ms - speedOffset_ms; double T_eV = calc_Ekin_eV_from_speed(calc_vecAbs(speedLab_ms), m_eV); if (T_eV < ionET2_eV) { // Problem when calculating interaction probability and interaction with different speeds, if unlucky, cut off speedT2_ms speedOffset_ms = 0; speedLab_ms = v_ms - speedOffset_ms; T_eV = calc_Ekin_eV_from_speed(calc_vecAbs(v_ms), m_eV); } if (T_eV < ionET2_eV) { throw ("Electron::do_Ionization: Ekin_eV < EIonT2_eV."); } double W_eV = roll_ionW_eV(T_eV, rngUni); double E1_eV = T_eV-ionET2_eV - W_eV; double phi1 = rngUni->random()*2*pi; double phi2 = phi1-pi; double theta1 = roll_IonTheta1(T_eV, W_eV, rngUni); double theta2 = roll_IonTheta2(T_eV, W_eV, rngUni); double v1Absnew_ms = calc_Speed_from_Ekin_eV(E1_eV, m_eV); double v2Absnew_ms = calc_Speed_from_Ekin_eV(W_eV, m_eV); blitz::TinyVector P1newDir, P2newDir, v1New_ms, v2New_ms ; P1newDir = calc_Newdirection(v_ms, theta1, phi1); P2newDir = calc_Newdirection(v_ms, theta2, phi2); v1New_ms = v1Absnew_ms*P1newDir + speedOffset_ms; v2New_ms = v2Absnew_ms*P2newDir + speedOffset_ms; setSpeed_ms(v1New_ms); Electron eNew = Electron(x_m, v2New_ms, newId, getId()); // Follow Ions... . return(eNew); } double Electron::roll_ionW_eV(double T_eV, ranlib::Uniform *rngUni) { double pmax, Wmin_eV, Wmax_eV, Wcan_eV,eta1,eta2; //pmax = get_ionSigma_m2(); // pmax = calc_ionS_m2(2)*1.06*2; Wmin_eV = 0; Wmax_eV = T_eV-ionET2_eV; do { eta1 = rngUni->random(); eta2 = rngUni->random(); Wcan_eV = Wmin_eV + eta1*(Wmax_eV - Wmin_eV); } while(eta2*pmax > calc_ionSDCS_m2eV(T_eV, Wcan_eV)); if (Wcan_eV < (T_eV-ionET2_eV)/2) { return(Wcan_eV); } else { return((T_eV-ionET2_eV) - Wcan_eV); } return(Wcan_eV); } double Electron::calc_ionSDCS_m2eV(double T_eV, double W_eV) { double t = T_eV/ionET2_eV; double w = W_eV/ionET2_eV; double N = 2; return(calc_ionS_m2(N)*calc_ionF(t)*calc_ionf1(w,t)/ionET2_eV); } double Electron::calc_ionS_m2(double N) { return (4*pi*N*pow(rBohr_m*ERyd_eV/ionET2_eV,2)); } double Electron::calc_ionf1(double t, double w) { return ( pow(w+1,-ionN) + pow(t-w,-ionN)-pow((w+1)*(t-w),-ionN/2) ); } double Electron::calc_iong1(double t) { return ( (1-pow(t,1-ionN))/(ionN-1) - pow(2/(t+1),ionN/2)*(1-pow(t,1-ionN/2))/(ionN-2) ); } double Electron::calc_ionF(double t) { return ((ionA1*log(t) + ionA2 + ionA3/t)/t); } double Electron::roll_IonTheta1(double T_eV, double W_eV, ranlib::Uniform *rngUni) { double theta1; if (W_eV > 100) { double numerator = W_eV/T_eV; double denominator = (1-W_eV / T_eV)*(T_eV/(2*m_eV)) + 1; theta1 = asin(sqrt(numerator/denominator)); } else { theta1 = rngUni->random()*pi/4; } return (theta1); } double Electron::roll_IonTheta2(double T_eV, double W_eV, ranlib::Uniform *rngUni) { double theta2; if (W_eV > 200) { double numerator = 1- W_eV/T_eV; double denominator = 1 + W_eV/(2*m_eV); theta2 = asin(sqrt(numerator/denominator)); } else if (W_eV >= 50) { double decider = rngUni->random(); if (decider < 0.9) { theta2 = 1 + rngUni->random() * pi/4 + pi/4; } else { theta2 = rngUni->random() * pi; } } else { theta2 = rngUni->random() * pi; } return(theta2); } /* DDCS double Electron::ranIonTheta(double T_eV, double W_eV, ranlib::Uniform *rngUni) { double pmax,thetaMin, thetaMax, thetaCan,eta1,eta2; pmax = ionSigmadW_m2eV(T_eV, W_eV); thetaMin = 0; thetaMax = pi; do { eta1 = rngUni->random(); eta2 = rngUni->random(); thetaCan = thetaMin + eta1*(thetaMax - thetaMin); } while(eta2*pmax > ionSigmadWdTheta_m2eV(T_eV, W_eV, thetaCan)); return(thetaCan); } double Electron::ionSigmadWdTheta_m2eV(double T_eV, double W_eV, double theta) { double t = T_eV/ionET2_eV; double w = W_eV/ionET2_eV; double N = 2; return( ionG1(t, w, theta, N)*( ionfbe(t,w,theta)+ionG4(t,w)*ionfb(theta) ) ); } double Electron::ionG1(double t, double w, double theta,double N) { double numerator = calc_ionS_m2(N)*calc_ionF(t)*calc_ionf1(t,w)/ionET2_eV; double denominator = iongbe(t,w)+ionG4(t,w)*iongb; return (numerator/denominator); } double Electron::ionG2(double t, double w) { return( pow(w+1/t,0.5) ); } double Electron::ionG3(double t, double w) { return ( ionBeta*sqrt((1-pow(ionG2(t,w),2))/w) ); } double Electron::ionG4(double t, double w) { return ( ionGamma*pow(1-w/t,3)/t/(w+1) ); } double Electron::ionfbe(double t, double w, double theta) { double a = pow( (cos(theta)-ionG2(t,w))/ionG3(t,w) , 2 ); return ( 1/(1+ a) ); } double Electron::ionfb(double theta) { double a = pow( (cos(theta)+1)/ionG5 , 2 ); return ( 1/(1+ a) ); } double Electron::iongbe(double t, double w) { double atan1, atan2; atan1 = atan( (1-ionG2(t,w))/ionG3(t,w) ); atan2 = atan( (1+ionG2(t,w))/ionG3(t,w) ); return( 2*pi*ionG3(t,w)*(atan1 + atan2) ); } */