Reworked Katrin Geometrics.

Added creation of T3+ clusters.
Added diss. recombination fo T3+ + e-
This commit is contained in:
Christian
2019-07-12 15:15:23 +02:00
parent 194d3eaf77
commit 6f288bb0c1
72 changed files with 811 additions and 589 deletions
+25 -25
View File
@@ -30,11 +30,11 @@ private:
void E_Mover_Boris::move(Particle *movePart, const double &macroSigma_m2) {
// Prepare detection for change of z direction for logging
double oldzDir = movePart->get_Speed_ms()[2] < 0 ? -1 : 1;
vec3 oldLoc_m = movePart->get_Location_m();
double oldzDir = movePart->get_v_ms()[2] < 0 ? -1 : 1;
vec3 oldLoc_m = movePart->get_x_m();
if (macroSigma_m2 == 0) { // If infinite movement distance let electron leave at only exit... Prob extremly faulty, but also impossible.
movePart->set_Location_m(Katrin_Geo::get_z_RW_m());
movePart->set_x_m(z_RW_m);
Logger->log(*movePart,oldLoc_m);
return;
}
@@ -44,7 +44,7 @@ void E_Mover_Boris::move(Particle *movePart, const double &macroSigma_m2) {
double traveledDistance_m = 0;
vec3 loc_m, E_Vm ,B_T;
while (traveledDistance_m < distance_m) {
loc_m = movePart->get_Location_m();
loc_m = movePart->get_x_m();
E_Vm = Katrin_Fields::getElField_Vm(loc_m);
B_T = Katrin_Fields::getMagField_T(loc_m);
@@ -63,21 +63,21 @@ void E_Mover_Boris::move(Particle *movePart, const double &macroSigma_m2) {
double E_Mover_Boris::doBoris_singleStep_m(Particle *movePart, const vec3 &E_Vm , const vec3 &B_T) {
double distance_m;
vec3 x_m = movePart->get_Location_m();
vec3 v_ms = movePart->get_Speed_ms();
vec3 x_m = movePart->get_x_m();
vec3 v_ms = movePart->get_v_ms();
x_m += dt_s/2 * v_ms;
distance_m = dt_s/2 * vec3Abs(v_ms);
distance_m = dt_s/2 * calc_vec3_abs(v_ms);
doBoris_speedChange(movePart, E_Vm , B_T);
x_m += dt_s/2 * v_ms;
distance_m += dt_s/2 * vec3Abs(v_ms);
movePart->set_Location_m(x_m);
distance_m += dt_s/2 * calc_vec3_abs(v_ms);
movePart->set_x_m(x_m);
return distance_m;
}
void E_Mover_Boris::doBoris_speedChange(Particle *movePart, const vec3 &E_Vm, const vec3 &B_T) {
double q_C = movePart->get_Charge_nat() * e_C;
double m_kg = movePart->get_Mass_eV() * e_C/c_ms/c_ms;
vec3 v_ms = movePart->get_Speed_ms();
double q_C = movePart->get_Z() * e_C;
double m_kg = movePart->get_m_eV() * e_C/c_ms/c_ms;
vec3 v_ms = movePart->get_v_ms();
vec3 t = q_C*dt_s/(2*m_kg) * B_T;
vec3 s = (2*t)/(1+dot(t,t));
@@ -85,39 +85,39 @@ void E_Mover_Boris::doBoris_speedChange(Particle *movePart, const vec3 &E_Vm, co
vec3 vPrime_ms = vMinus_ms + cross(vMinus_ms,t);
vec3 vPlus_ms = vMinus_ms + cross(vPrime_ms,s);
v_ms = vPlus_ms + q_C/m_kg*E_Vm*0.5*dt_s;
movePart->set_Speed_ms(v_ms);
movePart->set_v_ms(v_ms);
}
bool E_Mover_Boris::doBoris_WallInteraction(Particle *movePart) {
vec3 loc_m = movePart->get_Location_m();
double r_m = movePart->get_Radius_m();
if (loc_m[2]<=Katrin_Geo::get_z_RW_m()) { // Rear Wall Termination
vec3 newLoc_m = movePart->get_Location_m();
vec3 loc_m = movePart->get_x_m();
double r_m = movePart->get_r_m();
if (loc_m[2]<=z_RW_m) { // Rear Wall Termination
vec3 newLoc_m = movePart->get_x_m();
newLoc_m[2] = 0;
movePart->set_Location_m(newLoc_m);
movePart->set_x_m(newLoc_m);
return true;
}
if (r_m>=Katrin_Geo::get_radius_m()) { // WGTS Wall Termination
vec3 newLoc_m = movePart->get_Location_m();
if (r_m>=r_WGTS_m) { // WGTS Wall Termination
vec3 newLoc_m = movePart->get_x_m();
double z_m = newLoc_m[2];
newLoc_m[2] = 0;
newLoc_m = (Katrin_Geo::get_radius_m() * 1.01)/vec3Abs(newLoc_m) * newLoc_m; //1.01 to move Particle slightly out of WGTS
newLoc_m = (r_WGTS_m * 1.01)/calc_vec3_abs(newLoc_m) * newLoc_m; //1.01 to move Particle slightly out of WGTS
newLoc_m[2] = z_m;
return true;
}
if (loc_m[2]>=Katrin_Geo::get_z_WGTSend_m()) { // Spectrometer Reflection
movePart->set_Speed_ms( -1*(movePart->get_Speed_ms()) );
if (loc_m[2]>=z_WGTS_end_m) { // Spectrometer Reflection
movePart->set_v_ms( -1*(movePart->get_v_ms()) );
}
return false;
}
void E_Mover_Boris::doBoris_LogzDirChange(Particle *movePart, double *oldzDir, vec3 *oldLoc_m) {
double zDir = movePart->get_Speed_ms()[2] < 0 ? -1 : 1;
double zDir = movePart->get_v_ms()[2] < 0 ? -1 : 1;
if (*oldzDir != zDir) {
Logger->log(*movePart, *oldLoc_m);
Population->increase_density(*movePart, *oldLoc_m);
*oldzDir = zDir;
*oldLoc_m = movePart->get_Location_m();
*oldLoc_m = movePart->get_x_m();
}
return;
}