WARNING: This current denstiy will be multiplied by the reference
length, no the surface area that is being used for injection!
New units in the injection of particles 'Am2' to inject a density
current. Manual has been modified accordingly.
Reference parameters are now also printed in the case folder.
Fixing an issue with reading tables led me to other issues with
collisions that I think are fixed right now. I am testing with the 1D
ionization model for ALPHIE and things seems to be working properly.
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.
Probes are now written at the 0 iteration.
Additionally, and this shouldn't be done, some small changes to the quad
elements. This should be done in a separate commit, but I'm lazy.
Due to a high convergence value (1.0e-2) in phy2logQuad (variable conv),
particles were being stuck in some elements, reaching a segmentation
fault. The new limit (1.0e-4) should avoid this.
After some testing and making things a bit better and more general, I am
quite happy with the implementation of vtu and it seems that it is
working (at least as good as Gmsh2).
There are some procedures that might be useful for other XML-like
formats that might be moved in the future to the common module (I am
thinking right now in the implementation of a general format like
XDMF3).
I have tested all geometries and cases and all seem to work perfectly
with .vtu meshes.
Input and output works great, starting from a previous case also works.
Everything I was able to test is okay.
Still, what I want to do is to change a few things in the output (e.g.,
change OUTPUT prefix to Step) and try to improve reading gmsh meshes
to make them more compact as vtu is now.
For some reason the connectivity for collision meshes was not being
properly assigned.
Also, the first subroutine to read information from .vtu files as
initial states has been added.
It is currently giving wrong results.
First complete implementation of .vtu format.
Still a lot of things to improve but right now fpakc can read a vtu mesh
and write the output in vtu.
Still to test:
Multiple geometries.
Double mesh.
Moving forward making vtu an independent format.
Now fpakc can generate nodes and edges from vtu input.
Next step is cells.
Some minor corrections in gmsh2 format to unify statements.
The reading of meshes needs a good overhaul.
Testing all geometries with vtu is gonna be fun...
The average of the species properties can be written now in .vtu format.
No .pvd file is provided as no time series is generated.
Still to do:
Read a .vtu mesh.
Improve gmsh format to use more common functions.
The collisions and EM field information is now available in .vtu files.
A collection file .pvd is provided per dataset for time-dependent
plotting.
Still to do:
Write average quantities in .vtu
Read mesh from .vtu
Testing new VTU format.
For now, species information is ALWAYS output in .vtu (to test, this will
be an independent format in the future).
A .pvd file is produced to do time-series.
Still to implement other outputs (electromagnetic, average,
collisions...)
Still to implement reading a mesh from .vtu file
Now, if no normal is provided to an injection in the input file, the
velocity direction of the particles is chosen to be the surface normal.
This allows to inject particles from curves, corners... without having
to provide a direction or declaring multiple injections.
This assigns the correct random cell when a particle is created from the
ionization boundary.
Also, the number of possible ionizations is reduced by one if there is a
suscesful ionization. This has no impact on the results.
During the improve performant step, an error in the electrostatic
pushers was introduced, resulting in these using the minimum time step
and not the species time step when calculating the acceleration.
While testing the examples distributed with the code, a few errors were
found and fixed, mostly related with the K matrix in 1D geometry and
reading values from initial conditions for species.