Coulomb scattering is now fully conservative thanks to the method in
lemos2009small.
The trick was to conserve the momentum and energy of ALL particles
involved in the scattering in each cell.
The substeps in Coulomb collisions have been removed as they are no
longer necessary.
Still some issues with e-i, but I don't know right now.
In an attempt to make the operator fully conservarive I have combined ij
and ji collisions (when i/=j).
Now the matter is to find a way that makes this conserve momentum and
energy for intraspecies.
Now per each Coulomb collision process there is the possibility to do
sub-steps. This helps in improving accuracy without reducing the time
step of the problem.
There was an issue with the calculation of theta and phi for the
rotation from W to C. This was causing some velocities not being
correct.
Now the angles are properly computed. Still unsure about the e-i
collisions as they seem to be quite small. Probably a numerical issue
with the mass ratios still exists.
The code is still not fully conservative in intra-species collisions
(small error) but at least now is working.
I have to test species with different weight.
I have to implement a fully conservation for intra-species.
I had to go back to sherlock2008montecarlo to properly understand the
change in frame of reference and how to translate that into the code.
The language there is clear and understandable for a dumb person like
me.
Now I have a Coulomb linear operator that at least works.
However, still not fully 100% conservative, need to fix this with a
correction for intra-species collisions.
I skip gym today because I was unable to focus on other things than
this.
I was having tones of issues with the previous implementation. I think
the problem was the velocity vector and how it was returning to the
normal reference frame.
I hope this new implementation works better.
I found no way to ensure conservation in the linear Coulomb operator.
Thus, now two collisions have to be declared if sp_i /= sp_j: collision
ij and collision ji.
This does not conserve energy so please use under your own risk, like
everything else.
Still, I think something is wrong with this implementation and I'm
really tired.
After fixing all possible divisions by zero I was able to find in the
Coulomb collision I think that this is a first working implementation of
a Coulomb operator based on moments.
Still to test a few things, modify the manual but I would say that I'm
satisfiyed right now. This operator won't be used that often but maybe
improving efficiency is still needed.
In the future a binary operator is required to be able to study cases
out of Maxwellian equilibrium.
I was having a lot of issues trying to get quasi-neutrality with the
injection of electrons and ions. Main issue was a definition of the
direction of injection. This should be fixed now (tested in 1D).
Added a definition for Half-Maxwellian velocity distribution.
WARNING: I'm still not happy at all about the definition of the
direction of injection and the velocity definition to be in that
direction so I might change it at some point (for example take into
account the sign of each direction in the thermal part of the velocity)
When the relative velocity between a charged particle and the background
for Coulomb collisions (W in the code) was low, there was a
segmentation fault. This is fixed now as if the norm of the relative
velocity (normW) in the code is too low, no collision is applied.
I am doing a trick in which I ensure that energy is conserved for
Coulomb collisions. This was not happening and what an issue for
different mass ratios. Still, this can cause an issue on getting the
right relaxation rates, still necessary to check it.
First attemp for Coulomb collisions based on the moments distribtuions.
Still the method is not done and far from being complete but input
options and basic math are implemented.