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.
Finalysing first step of performance improvement focusing on reducing
iteration CPU time by improving calculation of basic element functions,
which took a lot of the CPU time
I noticed that phy2logquad had a lot of overhead. Trying to reducing it
by simplifying calls to fPsi, dPsi and such.
The function for fPsi has been made so no memory is allocated and works
under the assumption that the input array has the right size (1:numNodes)
Merging branches and fixing a number of important issues:
- Initial particles were not being assigned to the list of particles.
- List of particles was being erased every iteration, even if species
was not pushed.
These caused issues with the calculation of collisions when a species
was frozen.
Now, things should work properly. All particles are properly added to
the volume list and the list is erased ONLY if the species has been
updated.
I hope that collisions are now properly accounted for per species pair.
Now the number of collisions is calculated per species pair. This allows
that the randomly particles selected for collisions do not have
collisions assigned.
First implementation of Electromagnetic pusher.
Some testing is still required.
Documentation needs to be upgraded to match the changes in this branch.
The geometry and push structure has been reworked to allow eassy adding
new pushers.
Documentation not updated yet.
Baseline for merging Cartesian pushers into one.
A new option has been added in which MCC are computed with its own time
step.
If no time is provided, then the minimum time step of the simulation is
employed.
Fixed an issue in which the position in triangular an thetrahedron
elements were not correctly being computed.
Other minor issues fixed:
- Units in input file now do not use '/'.
- Collisions accuratly conserve momentum.
- Minor improvements in mass calculation in collisions.
Implementation of the 0D grid to test collisional processes.
An OMP_LOCK was added to the nodes to properly write perform the
scattering (it is weird that multiple threads work in the same node at
the same time, but in 0D happens everytime).
Added a new case to test the 0D geometry.
User Manual updated with the new options.
easy to use a file from a previous run without processing it into a
plain text file.
Although the previous method presented some updates for 1D small cases,
this is quite easy to do with any type of simulations and, in the
future, with different mesh formats.
Documentation updated properly.
3D Cartesian geometry also tested.
Documentation updated properly.
Added weighting probability in the injection of particles.
Unification of boundary conditions into one file.
Some changes to input file for reference cases. This should have been
done in another branch but I wanto to commit to save progress and I
don't want to deal with tswitching branches right now, I'm very busy
watching Futurama.
In each iteration, number of collisions are calculate as a REAL variable
(collFrac) and stored in each cell. The number of collisions is
calculated as FLOOR(collFrac) and, if it is >1 collisions are computed
as usual. Per each collision calculated, 1.0 is removed from collFrac
Possibility to input initial species distributions (density, velocity
and temperature) via an input file for each species.
New moduleRandom includes function to generate random numbers in
different ways (still uses) the implicit RANDOM_NUMBER().
Now collisions can have a different time step.
Added species name to output names as it was starting to get confusing
in Gmsh for multiple species.
Output filenames adapted to match any number of iterations.
A boundary condition for each species must be indicated in the case
file.
This opens the door to use boundary conditions with different parameters
(for example, a wall temperature, coefficients for reflection or
absorption...)
The examples included with the code have been updated accordently.
Maxwellian and Diract Delta distributions have been implemented.
The input for injection of particles should be rewritten to allow more
clear input file.