-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add support for electron impact ionization in binary collisions (DSMC module) #5388
base: development
Are you sure you want to change the base?
Changes from all commits
7890b50
9b11492
1ac2c44
014fded
202fab0
f6a3d80
b291097
12a5de4
b5ebe92
c024977
cfc9a9b
d29b23f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,17 +15,36 @@ SplitAndScatterFunc::SplitAndScatterFunc (const std::string& collision_name, | |
{ | ||
const amrex::ParmParse pp_collision_name(collision_name); | ||
|
||
// Check if ionization is one of the scattering processes | ||
amrex::Vector<std::string> scattering_process_names; | ||
pp_collision_name.queryarr("scattering_processes", scattering_process_names); | ||
for (const auto& scattering_process : scattering_process_names) { | ||
if (scattering_process.find("excitation") != std::string::npos) { | ||
m_ionization_flag = true; | ||
} | ||
} | ||
|
||
if (m_collision_type == CollisionType::DSMC) | ||
{ | ||
// here we can add logic to deal with cases where products are created, | ||
// for example with impact ionization | ||
m_num_product_species = 2; | ||
m_num_products_host.push_back(1); | ||
m_num_products_host.push_back(1); | ||
if (m_ionization_flag) { | ||
// Product species include the ion | ||
// TODO: as an alternative, we could use the runtime attribute `ionization_level` for this species | ||
m_num_product_species = 3; | ||
m_num_products_host.push_back(2); // electron species: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I attempted to fit impact ionization within the DSMC framework, but I now realize that this is making the book keeping complicated: The amount of memory to be allocated (in To simplify things, here I will always allocate space for the ionized species and the new electron, but if the reaction is not impact ionization, I will set the ID of the ionized species and the new electron to invalid. |
||
// potentially 2 products per reaction: the scattered incoming electron, and the new electron from ionization | ||
m_num_products_host.push_back(1); | ||
m_num_products_host.push_back(1); // corresponds to the ionized species | ||
} else { | ||
m_num_product_species = 2; | ||
m_num_products_host.push_back(1); | ||
m_num_products_host.push_back(1); | ||
} | ||
|
||
#ifndef AMREX_USE_GPU | ||
// On CPU, the device vector can be filled immediately | ||
m_num_products_device.push_back(1); | ||
m_num_products_device.push_back(1); | ||
for (int i = 0; i < m_num_product_species; i++) { | ||
m_num_products_device.push_back(m_num_products_host[i]); | ||
} | ||
#endif | ||
} | ||
else | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to do the transform back to labframe for
e_u