Reduction of Reduction of rdf by recombination..
This commit is contained in:
@@ -26,11 +26,8 @@ public:
|
||||
inline InteractionOut T2IT2_Cluster::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
vec3 vLab_ms = interPart->get_v_ms() - v2_ms;
|
||||
//vec3 v1_ms = roll_uniform_direction(rngUni) * calc_vec3_abs(vLab_ms) + v2_ms;
|
||||
//Particle TNew = Particle_Builder::create_T(loc_m, v1_ms, -1, interPart->get_Id());
|
||||
Particle T3New = Particle_Builder::create_T3I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
vec3 v_ms = interPart->get_v_ms();
|
||||
Particle T3New = Particle_Builder::create_T3I(loc_m, v_ms, -1, interPart->get_Id());
|
||||
|
||||
//InterOut.add_new_particle(TNew);
|
||||
InterOut.add_new_particle(T3New);
|
||||
|
||||
@@ -30,8 +30,8 @@ protected:
|
||||
inline InteractionOut T2Ie_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
/*double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);*/
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ public:
|
||||
inline InteractionOut T3IT2_RadAsc::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
Particle T5INew = Particle_Builder::create_T5I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
vec3 v_ms = interPart->get_v_ms();
|
||||
Particle T5INew = Particle_Builder::create_T5I(loc_m, v_ms, -1, interPart->get_Id());
|
||||
|
||||
InterOut.add_new_particle(T5INew);
|
||||
InterOut.set_delete_current(true);
|
||||
|
||||
@@ -29,8 +29,8 @@ public:
|
||||
inline InteractionOut T3IT2_TerAsc::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
Particle T5INew = Particle_Builder::create_T5I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
vec3 v_ms = interPart->get_v_ms();
|
||||
Particle T5INew = Particle_Builder::create_T5I(loc_m, v_ms, -1, interPart->get_Id());
|
||||
|
||||
InterOut.add_new_particle(T5INew);
|
||||
InterOut.set_delete_current(true);
|
||||
|
||||
@@ -31,8 +31,8 @@ inline InteractionOut T3Ie_DissExc::do_Interaction (Particle *interPart) {
|
||||
vec3 vTI_ms = interPart->get_v_ms();
|
||||
Particle TI = Particle_Builder::create_TI(loc_m, vTI_ms, -1, interPart->get_Id());
|
||||
res.add_new_particle(TI);
|
||||
/*double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(loc_m, E_eV);*/
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(loc_m, E_eV);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ protected:
|
||||
inline InteractionOut T3Ie_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
/*double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);*/
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ inline InteractionOut T5Ie_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
|
||||
//double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
//Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
||||
double E_eV = calc_E_eV_from_v_ms(Population->roll_v_ms(interPart->get_x_m()), me_eV); // should be computed properly using chances.
|
||||
Population->decrease_denisty(interPart->get_x_m(), E_eV);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ public:
|
||||
inline InteractionOut TIT2_RadAsc::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
Particle T3INew = Particle_Builder::create_T3I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
vec3 v_ms = interPart->get_v_ms();
|
||||
Particle T3INew = Particle_Builder::create_T3I(loc_m, v_ms, -1, interPart->get_Id());
|
||||
|
||||
InterOut.add_new_particle(T3INew);
|
||||
InterOut.set_delete_current(true);
|
||||
|
||||
@@ -29,8 +29,8 @@ public:
|
||||
inline InteractionOut TIT2_TerAsc::do_Interaction (Particle *interPart) {
|
||||
InteractionOut InterOut;
|
||||
vec3 loc_m = interPart->get_x_m();
|
||||
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
||||
Particle T3INew = Particle_Builder::create_T3I(loc_m, v2_ms, -1, interPart->get_Id());
|
||||
vec3 v_ms = interPart->get_v_ms();
|
||||
Particle T3INew = Particle_Builder::create_T3I(loc_m, v_ms, -1, interPart->get_Id());
|
||||
|
||||
InterOut.add_new_particle(T3INew);
|
||||
InterOut.set_delete_current(true);
|
||||
|
||||
@@ -70,7 +70,7 @@ inline double TI_e_Interaction_Base::calc_microSigma_m2(const double &E2_eV, con
|
||||
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
||||
return get_microSigma_m2(E_eV);
|
||||
};
|
||||
return integrate(integrand, 0., pi, INT_N_INTPOINTS, simpson())/pi;
|
||||
return integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,13 +52,13 @@ inline double TI_thermal_binary_Interaction_Base::calc_microSigma_m2(const doubl
|
||||
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
||||
return Population->get_v_pdf(v2_ms)*get_microSigma_m2(E_eV)/pi;
|
||||
};
|
||||
return double_simpson_integrate(integrand, 0., 3*v_therm, 0., pi, 50, 50); // 3*v_therm equals 99% of the integral
|
||||
return double_simpson_integrate(integrand, 0., 3*v_therm, 0., pi, INT_N, INT_N); // 3*v_therm equals 99% of the integral
|
||||
/* // Integration over theta
|
||||
auto integrand = [&](double theta) {
|
||||
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v_therm,2) - 2*v1_ms*v_therm*cos(theta)) * pow(c_ms, -2);
|
||||
return get_microSigma_m2(E_eV);
|
||||
};
|
||||
return integrate(integrand, 0., pi, INT_N_INTPOINTS, simpson())/pi;
|
||||
return integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ inline double TI_thermal_tenary_Interaction_Base::calc_microSigma_divbyn_m2(cons
|
||||
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v_therm,2) - 2*v1_ms*v_therm*cos(theta)) * pow(c_ms, -2);
|
||||
return get_microSigma_m2(E_eV);
|
||||
};
|
||||
return integrate(integrand, 0., pi, INT_N_INTPOINTS, simpson())/pi;
|
||||
return integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||
}
|
||||
|
||||
class TI_thermal_tenary_Precomputed_Interaction_Base : public TI_thermal_tenary_Interaction_Base { // Precomputed Interactions of electrons with thermal Populations
|
||||
|
||||
@@ -54,7 +54,7 @@ constant reduction_tot_front = 5e-4;
|
||||
constant reduction_tot_rear = 5e-4;
|
||||
|
||||
// For interaction integration
|
||||
const int INT_N_INTPOINTS = load_parameter("INT_N_INTPOINTS"); // Number of points for theta integration
|
||||
const int INT_N = load_parameter("INT_N"); // Number of points for theta integration
|
||||
const double INT_PRE_START = load_parameter("INT_PRE_START"); // Start energy for precomputed cross sections
|
||||
const double INT_PRE_END = load_parameter("INT_PRE_END"); // End energy for precomputed cross sections
|
||||
const int INT_PRE_N = load_parameter("INT_PRE_N"); //Number of points for precomputed cross sections
|
||||
|
||||
@@ -30,7 +30,7 @@ inline InteractionOut eT2I_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
//std::cout<<"eT2I:\t"<<*interPart<<"\n";
|
||||
//Population->decrease_denisty(interPart->get_x_m(), 0);
|
||||
Population->decrease_denisty(interPart->get_x_m(), 0);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ inline InteractionOut eT3I_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
res.set_delete_current(true);
|
||||
//std::cout<<"eT3I:\t"<<*interPart<<"\n";
|
||||
//Population->decrease_denisty(interPart->get_x_m(), 0);
|
||||
Population->decrease_denisty(interPart->get_x_m(), 0);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ inline InteractionOut eT5I_Recombination::do_Interaction (Particle *interPart) {
|
||||
InteractionOut res;
|
||||
//std::cout<<"eT5I:\t"<<*interPart<<"\n";
|
||||
res.set_delete_current(true);
|
||||
//Population->decrease_denisty(interPart->get_x_m(), 0);
|
||||
Population->decrease_denisty(interPart->get_x_m(), 0);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ inline double e_kinetic_Interaction_Base::calc_microSigma_m2(const double &E_eV,
|
||||
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
||||
return get_microSigma_m2(E_eV);
|
||||
};
|
||||
return integrate(integrand, 0., pi, INT_N_INTPOINTS, simpson())/pi;
|
||||
return integrate(integrand, 0., pi, INT_N, simpson())/pi;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,13 +59,13 @@ inline double e_thermal_Interaction_Base::calc_microSigma_m2(const double &E_eV)
|
||||
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2);
|
||||
return Population->get_v_pdf(v2_ms)*get_microSigma_m2(E_eV)/pi;
|
||||
};
|
||||
return double_simpson_integrate(integrand, 0., 3*v_therm, 0., pi, 50, 50); // 3*v_therm equals 99% of the integral
|
||||
return double_simpson_integrate(integrand, 0., 3*v_therm, 0., pi, INT_N, INT_N); // 3*v_therm equals 99% of the integral
|
||||
/* // Integration over theta
|
||||
auto integrand = [&](double theta) {
|
||||
double E_eV = m1_eV/2 * (pow(v1_ms,2) + pow(v_therm,2) - 2*v1_ms*v_therm*cos(theta)) * pow(c_ms, -2);
|
||||
return get_microSigma_m2(E_eV)/pi;
|
||||
};
|
||||
return integrate(integrand, 0., pi, INT_N_INTPOINTS, simpson());*/
|
||||
return integrate(integrand, 0., pi, INT_N, simpson());*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class Kinetic_Population : public Population_Base, private RNG_Base {
|
||||
double m_eV;
|
||||
|
||||
public:
|
||||
Kinetic_Population(species this_species, Timer *timer, UniRNG *rngUni, NormalRNG *rngNormal, int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV);
|
||||
Kinetic_Population(species this_species, Timer *timer, UniRNG *rngUni, NormalRNG *rngNormal, int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV, double E_max_eV);
|
||||
|
||||
void increase_density (const Particle &upPart, const vec3 &oldLoc_m);
|
||||
void decrease_denisty (const vec3 &loc_m, const double &E_eV);
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
inline Kinetic_Population::Kinetic_Population(species this_species, Timer *timer, UniRNG *rngUni, NormalRNG *rngNormal, int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV) : Population_Base(this_species), RNG_Base(rngUni, rngNormal), container(num_z_bins, num_r_bins, num_phi_bins, num_E_bins, E_min_eV) {
|
||||
inline Kinetic_Population::Kinetic_Population(species this_species, Timer *timer, UniRNG *rngUni, NormalRNG *rngNormal, int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV, double E_max_eV) : Population_Base(this_species), RNG_Base(rngUni, rngNormal), container(num_z_bins, num_r_bins, num_phi_bins, num_E_bins, E_min_eV, E_max_eV) {
|
||||
this->timer = timer;
|
||||
m_eV = get_species_mass(this_species);
|
||||
};
|
||||
|
||||
@@ -18,6 +18,7 @@ const int Population_Builder::POP_N_PHI = load_parameter("POP_N_PHI");
|
||||
const int Population_Builder::POP_N_Z = load_parameter("POP_N_Z");
|
||||
const int Population_Builder::POP_N_E = load_parameter("POP_N_E");
|
||||
const double Population_Builder::POP_E_START = load_parameter("POP_E_START");
|
||||
const double Population_Builder::POP_E_END = load_parameter("POP_E_END");
|
||||
|
||||
const double Population_Builder::wgtsTemp_K = load_parameter("TEMP");
|
||||
const int Population_Builder::v_flow = load_parameter("T2_VELO");
|
||||
@@ -28,7 +29,7 @@ Population_Manager Population_Builder::build(Timer *timer,UniRNG *rngUni, Normal
|
||||
int num_r_bins = POP_N_R;
|
||||
int num_phi_bins = POP_N_PHI;
|
||||
int num_E_bins = POP_N_E;
|
||||
Populations.add(new Kinetic_Population(electron, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins, POP_E_START));
|
||||
Populations.add(new Kinetic_Population(electron, timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins, num_E_bins, POP_E_START, POP_E_END));
|
||||
|
||||
if (v_flow == -1) {
|
||||
Populations.add(new Thermal_Population(tritium, new WGTS_Kinematics(mT_eV, wgtsTemp_K, rngUni, rngNormal), timer, rngUni, rngNormal, num_z_bins, num_r_bins, num_phi_bins));
|
||||
|
||||
@@ -21,6 +21,7 @@ class Population_Builder {
|
||||
static const int POP_N_Z;
|
||||
static const int POP_N_E;
|
||||
static const double POP_E_START;
|
||||
static const double POP_E_END;
|
||||
static const double wgtsTemp_K;
|
||||
static const int v_flow;
|
||||
public:
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
using namespace std;
|
||||
|
||||
|
||||
Population_Container::Population_Container(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV) {
|
||||
init_scales(num_z_bins, num_r_bins, num_phi_bins, num_E_bins, E_min_eV);
|
||||
Population_Container::Population_Container(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV, double E_max_eV) {
|
||||
init_scales(num_z_bins, num_r_bins, num_phi_bins, num_E_bins, E_min_eV, E_max_eV);
|
||||
init_bin_offsets();
|
||||
init_content_arrays();
|
||||
init_size_array();
|
||||
}
|
||||
|
||||
Population_Container::Population_Container(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins) : Population_Container(num_z_bins, num_r_bins, num_phi_bins, num_E_bins, 1e-7) {}
|
||||
Population_Container::Population_Container(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins) : Population_Container(num_z_bins, num_r_bins, num_phi_bins, num_E_bins, 1e-7, 2e4) {}
|
||||
|
||||
Population_Container::~Population_Container() {
|
||||
delete[] cum_times_s;
|
||||
@@ -52,11 +52,11 @@ Population_Container &Population_Container::operator=(const Population_Container
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Population_Container::init_scales(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV) {
|
||||
void Population_Container::init_scales(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV, double E_max_eV) {
|
||||
scales.z = Lin_Scale(z_RW_m, z_WGTS_end_m, num_z_bins);
|
||||
scales.r = Lin_Scale(0,r_WGTS_m, num_r_bins);
|
||||
scales.phi = Lin_Scale(0, 2*pi, num_phi_bins);
|
||||
E_scale = Log_Scale(E_min_eV, scale_end, num_E_bins);
|
||||
E_scale = Log_Scale(E_min_eV, E_max_eV, num_E_bins);
|
||||
}
|
||||
|
||||
void Population_Container::init_bin_offsets() {
|
||||
|
||||
@@ -54,13 +54,13 @@ class Population_Container {
|
||||
double *size_data_m3;
|
||||
|
||||
public:
|
||||
Population_Container(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV);
|
||||
Population_Container(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV, double E_max_eV);
|
||||
Population_Container(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins);
|
||||
~Population_Container();
|
||||
Population_Container(const Population_Container& other);
|
||||
Population_Container& operator=(const Population_Container& other);
|
||||
private:
|
||||
void init_scales(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV);
|
||||
void init_scales(int num_z_bins, int num_r_bins, int num_phi_bins, int num_E_bins, double E_min_eV, double E_max_eV);
|
||||
void init_bin_offsets();
|
||||
void init_content_arrays();
|
||||
void init_size_array();
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
this->wgtsTemp_K = wgtsTemp_K;
|
||||
this->rngUni = rngUni;
|
||||
this->rngNormal = rngNormal;
|
||||
v_thermal = sqrt(2*kb_eVK*30/m_eV)*c_ms; // most probable speed sqrt(2*kb*T/m)
|
||||
v_thermal = sqrt(2*kb_eVK*wgtsTemp_K/m_eV)*c_ms; // most probable speed sqrt(2*kb*T/m)
|
||||
};
|
||||
|
||||
vec3 get_v_ms(const vec3&loc_m) {return roll_v_thermal_ms() + get_v_offset_ms(loc_m);}
|
||||
|
||||
Reference in New Issue
Block a user