aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2022-03-10 13:21:32 -0800
committerGravatar GitHub <noreply@github.com> 2022-03-10 13:21:32 -0800
commit96cefab7f9ad96159908f49bdf788ff8ad6f7ac3 (patch)
treeccb018ec45979b55e63e5f63a775360d36ed1eab /Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp
parentda837aaffd1d2fbce14a6bea4a3a38331a56df72 (diff)
downloadWarpX-96cefab7f9ad96159908f49bdf788ff8ad6f7ac3.tar.gz
WarpX-96cefab7f9ad96159908f49bdf788ff8ad6f7ac3.tar.zst
WarpX-96cefab7f9ad96159908f49bdf788ff8ad6f7ac3.zip
Clean up the use of ndt for collisions (#2944)
* Clean up the use of ndt for collisions * Update BackgroundStopping to match changes
Diffstat (limited to 'Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp')
-rw-r--r--Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp b/Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp
index 615fb9418..a7cc00be5 100644
--- a/Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp
+++ b/Source/Particles/Collision/BackgroundMCC/BackgroundMCCCollision.cpp
@@ -181,14 +181,11 @@ BackgroundMCCCollision::get_nu_max(amrex::Vector<MCCProcess> const& mcc_processe
}
void
-BackgroundMCCCollision::doCollisions (amrex::Real cur_time, MultiParticleContainer* mypc)
+BackgroundMCCCollision::doCollisions (amrex::Real cur_time, amrex::Real dt, MultiParticleContainer* mypc)
{
WARPX_PROFILE("BackgroundMCCCollision::doCollisions()");
using namespace amrex::literals;
- const amrex::Real dt = WarpX::GetInstance().getdt(0);
- if ( int(std::floor(cur_time/dt)) % m_ndt != 0 ) return;
-
auto& species1 = mypc->GetParticleContainerFromName(m_species_names[0]);
// this is a very ugly hack to have species2 be a reference and be
// defined in the scope of doCollisions
@@ -205,7 +202,7 @@ BackgroundMCCCollision::doCollisions (amrex::Real cur_time, MultiParticleContain
m_nu_max = get_nu_max(m_scattering_processes);
// calculate total collision probability
- auto coll_n = m_nu_max * m_ndt * dt;
+ auto coll_n = m_nu_max * dt;
m_total_collision_prob = 1.0_rt - std::exp(-coll_n);
// dt has to be small enough that a linear expansion of the collision
@@ -220,7 +217,7 @@ BackgroundMCCCollision::doCollisions (amrex::Real cur_time, MultiParticleContain
m_nu_max_ioniz = get_nu_max(m_ionization_processes);
// calculate total ionization probability
- auto coll_n_ioniz = m_nu_max_ioniz * m_ndt * dt;
+ auto coll_n_ioniz = m_nu_max_ioniz * dt;
m_total_collision_prob_ioniz = 1.0_rt - std::exp(-coll_n_ioniz);
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(coll_n_ioniz < 0.1_rt,