diff --git a/src/modules/init/moduleInput.f90 b/src/modules/init/moduleInput.f90 index c8beb0f..6ac8318 100644 --- a/src/modules/init/moduleInput.f90 +++ b/src/modules/init/moduleInput.f90 @@ -155,7 +155,7 @@ MODULE moduleInput sigmaVrel_ref = PI*(r_ref+r_ref)**2*v_ref !reference cross section times velocity ELSE - sigmaVrel_ref = 0.D0 !Assume no collisions + sigmaVrel_ref = L_ref**2 * v_ref END IF diff --git a/src/modules/mesh/moduleMesh.f90 b/src/modules/mesh/moduleMesh.f90 index c23990a..03dd356 100644 --- a/src/modules/mesh/moduleMesh.f90 +++ b/src/modules/mesh/moduleMesh.f90 @@ -1016,7 +1016,7 @@ MODULE moduleMesh W = partTemp%part%v - velocity normW = NORM2(W) - IF (normW > 1.D-10) THEN + IF (normW < 1.D-12) THEN !If relative velocity is too low, skip collision and move to next particle partTemp => partTemp%next @@ -1055,6 +1055,7 @@ MODULE moduleMesh deltaV = dW(1)*e1 + dW(2)*(COS(rnd)*e2 + SIN(rnd)*e3) totalDeltaV_ij = totalDeltaV_ij + NORM2(deltaV) + !Change particle velocity partTemp%part%v = partTemp%part%v + deltaV @@ -1078,6 +1079,7 @@ MODULE moduleMesh normDeltaV = totalDeltaV_ij / REAL(cell%listPart_in(j)%amount) * & (coulombMatrix(k)%sp_i%weight*coulombMatrix(k)%sp_i%m) / & (coulombMatrix(k)%sp_j%weight*coulombMatrix(k)%sp_j%m) + !Loop over particles of species_j partTemp => cell%listPart_in(j)%head DO WHILE(ASSOCIATED(partTemp)) @@ -1090,7 +1092,7 @@ MODULE moduleMesh W = partTemp%part%v - velocity normW = NORM2(W) - IF (normW > 1.D-10) THEN + IF (normW < 1.D-12) THEN !If relative velocity is too low, skip collision and move to next particle partTemp => partTemp%next @@ -1111,7 +1113,7 @@ MODULE moduleMesh dW(2) = ABS(randomMaxwellian()*SQRT(delta_per_square*tauMin)) !Normalize with average exchange per particle - !TODO: This is a dirty trick, it should not be neccessary but I don't lnow why it is. + !TODO: This is a dirty trick to ensure conservation between species dW = normDeltaV*dW/NORM2(dW) !System of reference for the velocity change