Commit graph

261 commits

Author SHA1 Message Date
2af10acd70 Issue with injecting current
Values were not right in 1D geometry. Fixed.
2024-10-13 13:32:57 +02:00
065bb1d13e Merge branch 'issue/injection2DCyl' into 'development'
Rework of injection of particles with a special focus in 2DCyl to ensure an homogeneous distribution.

See merge request JorgeGonz/fpakc!51
2024-07-11 16:51:42 +00:00
fb9d1ad837 Update moduleMesh2DCyl.f90
This is not needed.
2024-07-11 16:44:29 +00:00
152ae6b097 No longer needed
The correction in the node volume is no longer needed as now things are
being calculated right with the last change.

Still, at some point I should review the calculation of the node volume
in 2DCyl.
2024-07-11 18:19:26 +02:00
72dd3c9073 I think I have it
So the radius for the volume integral in the nodes has to be set with a
1/4 3/4 ratio to match the change in volume as the radius changes along
the volume.

This has a bigger impact close to the edge.

Still unsure if this is the "right" thing to do, but at least it works
okay (it seems).
2024-07-11 17:40:57 +02:00
bc8f205287 Clean-up!
Trying to reduce warnings and unused variables in the code. This should
not be in this branch.
2024-07-11 15:55:02 +02:00
d710cc5e66 Probes fixed!
This should've been commited in another branch, but I am taking
advantage of this to clean up the code a bit.
2024-07-11 15:52:13 +02:00
03f3b81811 Manual updated
The manual has been modified to account for the new particlePerEdge
option and to indicate that now when the flux is giving by a flux like
in the Am2 units, the real surface of the inject is used to scale it.
2024-07-11 15:31:01 +02:00
6d62807fb4 Remove testing 'print' statements
2DCyl still seems to have some problems but waiting for simulation.
2024-07-11 14:50:14 +02:00
96c563c146 Finally, some progress
I rewrote how particles are injected. Now the particles per edge and its
weight are calculated in the initialization. There is the possibility
for the user to select the particles per edge.

TODO: Write documentation for new feature.
TODO: Test in 2DCyl
2024-07-11 14:39:56 +02:00
e23fc2fc2c Small progress
I made some small changes to how things are calculated.

I have also discovered that the issue with different density when
changing injection is not related with the node volume but with the way
injection is carried out. When loading particles from a file, all
provide the same density regardless the cell (node) volume.

I am doing testing in 2DCart as it is easier to set up.
2024-07-11 11:21:38 +02:00
9d961bb85f Removing weight from edges
This parameter is no longer needed.

Also removing the cumulative sum of weights from the injection.
2024-07-10 21:57:22 +02:00
cb92462f36 New injection based on surface to all geometries.
WARNING: 3DCart still not working (too tired to calculate things and I'm
    not ussing it...)
2024-07-10 21:55:45 +02:00
d608639e77 Forgot to save
Sorry.
2024-07-09 22:05:16 +02:00
667a2ecd93 So, no idea...
Basically things do not work. I've added a correction to the node volume
in the axis which gives okays results but still this is not perfect. I
need to find a better way to do things.

Also, I've noticed that the density changes with the size of the cells,
which should not happen! I'vw to check this issue.
2024-07-09 21:57:32 +02:00
11831a973d Still not working
Trying to have a very simple volume per node assuming a rectangle and
the density at the axis it higher than it should (kinda like when using
the more accurate volume calculation).

This is still weird. I also suspect that the size of the first cell in
the axis will also affect this...
2024-07-09 21:25:30 +02:00
b36f9c2615 Shifting towards constant number of particles per edge
So now each edge has the same number of particles and the weight of each
particle is calculated based on the surface of each edge compared to the
total one.

Only in 2DCyl, still to extend to other geometries.

Not perfect constant density, but the issue might be the node volume.
2024-07-09 17:49:42 +02:00
fa23f9481a Issue with bibliography
Backup files are properly ignored now.
2024-07-07 14:40:26 +02:00
1f2ec8d82f New option for initial distribution of species
The number of particles per cell can be defined when giving an initial
distribution fora species. If not, the typical method of using the
species weight is used. This is particularly useful for cylindrical
coordinates in which very little particles might end up in the axis if a
constant weight is used.
2024-07-07 14:37:34 +02:00
5bc064d018 Some parallel issues
Forgot to check Gmsh2 format with new changes.

Cartesian coordinates were not calculating things properly.
2024-07-07 11:53:56 +02:00
626e970d82 Some progress
Fixed an issue with random integer numbers.
Cylindrical coordinates are not perfect yet:
  - Box (cylinder) with initial constant density loses particles at r =
    0
  - Injection density still low in r = 0
2024-07-06 19:14:44 +02:00
6b5ac16e4b Still working on it
No uniform density yet...
2024-07-06 10:12:03 +02:00
b972120ed5 Switching to variable particle weight
I have to change the injection of particles. Each edge will receive a
similar number of particles and their weight will change to have a
constant density based on the geometry.

Still testing.
2024-07-04 10:56:13 +02:00
6b78ae3738 Added an adhoc factor to correct injection
I think that the volume of the nodes is not being well calculated, maybe
we need a better volume calculation for this, using multiple points (as
it is done for K)
2024-07-03 22:04:28 +02:00
0471517526 Merge branch 'issue/injection' into 'development'
Change in injection to achieve uniform density of particles.

See merge request JorgeGonz/fpakc!50
2024-06-30 08:50:25 +00:00
e277fe6ddb PI is no needed here 2024-06-30 08:48:51 +00:00
59a322a4c7 Clean up
Fixing calculation of node volumes.
2024-06-30 10:46:05 +02:00
cd7bf66bd8 A workaround
The random position for edges in the axis is corrected so that there is
a more uniform charge density in the axis.

Still, things are not perfect and this is something to really look into
in the future.
2024-06-30 10:36:36 +02:00
4cadfe5367 Seems are a bit better
There is still less density in the axis. I don't find a reason why.
There must be a modification to the weight...
2024-06-29 22:22:10 +02:00
5386114d15 Cylindrical injection working better
Seems things are a bit better. Still, more cases are needed and still
not perfectly uniform...
2024-06-29 14:58:48 +02:00
6389c8ba2d Quick because food
Cartesian fixed now
2024-06-27 12:08:08 +02:00
0ce921a48c Merge branch 'issue/quadLocation' into 'development'
Issue with calculating coordinates in quads

See merge request JorgeGonz/fpakc!49
2024-06-26 13:14:22 +00:00
c6470819e8 Issue with calculating coordinates in quads
The third coordinate (unused) was causing some errors when it was
becomming too large.
2024-06-26 15:11:01 +02:00
62b8873786 Merge branch 'feature/Amps_per_m2' into 'development'
Implementing injection with current density

See merge request JorgeGonz/fpakc!48
2024-03-29 12:09:30 +00:00
d86b3a3417 Implementing injection with current density
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.
2024-03-28 09:45:46 +01:00
a3d7b38e3b Merge branch 'improve/secondaryElectronIonization' into 'development'
Improve ionization

See merge request JorgeGonz/fpakc!47
2023-11-24 09:34:30 +00:00
e41b448ef8 Different species for secondary electrons
The option to have a different species than the impacting electron for
secondary electrons from ionization is introduced.
2023-11-24 10:30:50 +01:00
4585390b50 Fixing issue
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.
2023-11-21 09:53:36 +01:00
5df81a79e4 Merge branch 'feature/CoulombLinear' into 'development'
First attempt at Coulomb collisions

See merge request JorgeGonz/fpakc!46
2023-07-16 12:47:58 +00:00
2e4b3c3d20 Update of user-manual
The user manual has been updated with a simple explanation on how to use
Coulomb Scattering.
2023-07-16 14:44:38 +02:00
e05c0d4635 Coulomb Scattering fully conservative
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.
2023-07-16 14:30:49 +02:00
c3a6f77ffc Combining ij - ji collisions
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.
2023-07-12 15:17:26 +02:00
28b2bf206a Added the possibility to have sub-steps
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.
2023-07-12 14:21:29 +02:00
a891360b7a Still unsure, but things fixed
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.
2023-07-12 11:38:12 +02:00
f63e34e266 Not fully conservative but works
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.
2023-07-11 18:55:20 +02:00
63fc2842be Small changes
Just some small changes to the code to improve its quality.

Nothing regarding conservation was done yet.
2023-07-11 11:22:19 +02:00
c45ffa5380 Dear various gods, finally...
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.
2023-07-11 09:58:50 +02:00
d75af4bda7 Trying to implement Lemos Coulomb Scatering
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.
2023-07-11 07:51:49 +02:00
a26dc04051 I hate Coulomb and his Scattering
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.
2023-07-07 16:36:31 +02:00
8d35123508 First Coulomb implementation that works
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.
2023-07-04 17:01:02 +02:00