aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles
diff options
context:
space:
mode:
authorGravatar Yinjian Zhao <yinjianzhao@lbl.gov> 2019-11-24 13:17:19 -0700
committerGravatar Yinjian Zhao <yinjianzhao@lbl.gov> 2019-11-24 13:17:19 -0700
commit070efb5ea43ae636d7360302ff90ae43b81edbcc (patch)
treeceaaab840b3a99dcdc6294f2095ccf1ba161ccc6 /Source/Particles
parentd1325a618e8b1aa3dd355d1b4cd4a84683e19bfe (diff)
downloadWarpX-070efb5ea43ae636d7360302ff90ae43b81edbcc.tar.gz
WarpX-070efb5ea43ae636d7360302ff90ae43b81edbcc.tar.zst
WarpX-070efb5ea43ae636d7360302ff90ae43b81edbcc.zip
Modified ElasticCollisionPerez.H to make it better.
Diffstat (limited to 'Source/Particles')
-rw-r--r--Source/Particles/Collision/ElasticCollisionPerez.H12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Particles/Collision/ElasticCollisionPerez.H b/Source/Particles/Collision/ElasticCollisionPerez.H
index 8c6434262..ddfd93d59 100644
--- a/Source/Particles/Collision/ElasticCollisionPerez.H
+++ b/Source/Particles/Collision/ElasticCollisionPerez.H
@@ -22,7 +22,7 @@
* dt is the time step length between two collision calls.
* L is the Coulomb log and will be used if greater than zero,
* otherwise will be computed.
- * V is the volume of the corresponding cell.
+ * dV is the volume of the corresponding cell.
*/
template <typename T_index, typename T_R>
@@ -37,7 +37,7 @@ void ElasticCollisionPerez (
T_R const q1, T_R const q2,
T_R const m1, T_R const m2,
T_R const T1, T_R const T2,
- T_R const dt, T_R const L, T_R const V)
+ T_R const dt, T_R const L, T_R const dV)
{
T_R constexpr inv_c2 = 1./(PhysConst::c*PhysConst::c);
@@ -46,7 +46,7 @@ void ElasticCollisionPerez (
// get local T1t and T2t
T_R T1t; T_R T2t;
- if ( T1 <= 0. )
+ if ( T1 <= 0. && L <= 0. )
{
T_R vx = 0.; T_R vy = 0.;
T_R vz = 0.; T_R vs = 0.;
@@ -71,7 +71,7 @@ void ElasticCollisionPerez (
}
}
else { T1t = T1; }
- if ( T2 <= 0. )
+ if ( T2 <= 0. && L <= 0. )
{
T_R vx = 0.; T_R vy = 0.;
T_R vz = 0.; T_R vs = 0.;
@@ -103,7 +103,7 @@ void ElasticCollisionPerez (
T_R n12 = 0.;
for (int i1=I1s; i1<I1e; ++i1) { n1 += w1[ I1[i1] ]; }
for (int i2=I2s; i2<I2e; ++i2) { n2 += w2[ I2[i2] ]; }
- n1 = n1 / V; n2 = n2 / V;
+ n1 = n1 / dV; n2 = n2 / dV;
{
int i1 = I1s; int i2 = I2s;
for (int k = 0; k < amrex::max(NI1,NI2); ++k)
@@ -112,7 +112,7 @@ void ElasticCollisionPerez (
++i1; if ( i1 == I1e ) { i1 = I1s; }
++i2; if ( i2 == I2e ) { i2 = I2s; }
}
- n12 = n12 / V;
+ n12 = n12 / dV;
}
// compute Debye length lmdD