aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> 2021-09-24 10:03:51 -0700
committerGravatar GitHub <noreply@github.com> 2021-09-24 10:03:51 -0700
commite1c1c8bac405069440bfa393dfb7197a6be3ffbc (patch)
tree51ebcc33091f8920fc9ab65df99de0ccd7ef404b /Source/Particles/PhysicalParticleContainer.cpp
parent129a533e3b899eaf62a49e9c1f6a47f5cfda9465 (diff)
downloadWarpX-e1c1c8bac405069440bfa393dfb7197a6be3ffbc.tar.gz
WarpX-e1c1c8bac405069440bfa393dfb7197a6be3ffbc.tar.zst
WarpX-e1c1c8bac405069440bfa393dfb7197a6be3ffbc.zip
Stochastic particle reflection from absorbing domain boundaries (#2281)
* added tunable particle reflection from absorbing domain boundaries * extended picmi.py to allow setting boundary reflection coefficients and added a CI test for the reflection implementation * allow R(E) to be specified, except for embedded boundaries * changed approach for particle reflection, now the ParticleBoundaries object will hold the reflection coefficient; reflection from EBs not implemented * added functionality to reflect from EB; still needs to be tested for accuracy * added support for energy dependent reflection models for domain boundaries * fixed at least one issue causing CI fails - building reflection model parsers for not physical particle containers * switched reflection coefficients to be functions of the velocity component perpendicular to the boundary rather than energy * reverted initial work on reflecting from EBs * changed naming convention for new CI test for particle reflection * switched useMPI back to 1 in test * breaking changes while trying to sort out GPU issue * fixed issue with CUDA compilation - hopefully :) * various code improvements from PR review suggestions * fix of major issues * no need to parse the reflection models at every step * skip particles that are already flagged for removal in ApplyBoundaryConditions
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index 460293dc2..0369c6e54 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -291,6 +291,20 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp
#endif
}
+ // Read reflection models for absorbing boundaries; defaults to a zero
+ pp_species_name.query("reflection_model_xlo(E)", m_boundary_conditions.reflection_model_xlo_str);
+ pp_species_name.query("reflection_model_xhi(E)", m_boundary_conditions.reflection_model_xhi_str);
+ pp_species_name.query("reflection_model_ylo(E)", m_boundary_conditions.reflection_model_ylo_str);
+ pp_species_name.query("reflection_model_yhi(E)", m_boundary_conditions.reflection_model_yhi_str);
+ pp_species_name.query("reflection_model_zlo(E)", m_boundary_conditions.reflection_model_zlo_str);
+ pp_species_name.query("reflection_model_zhi(E)", m_boundary_conditions.reflection_model_zhi_str);
+ m_boundary_conditions.BuildReflectionModelParsers();
+
+ ParmParse pp_boundary("boundary");
+ bool flag = false;
+ pp_boundary.query("reflect_all_velocities", flag);
+ m_boundary_conditions.Set_reflect_all_velocities(flag);
+
// Get Galilean velocity
ParmParse pp_psatd("psatd");
bool use_default_v_galilean = false;