Commit graph

357 commits

Author SHA1 Message Date
f4448d9e7a Fixed segmentation fault in Coulomb collisions
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.
2023-03-12 17:02:12 +01:00
a70788b95d Fix an issue with compilation
Copy paste error. Now the code compiles.
2023-03-08 19:42:15 +01:00
fe94615a27 First conservative implementation of Coulomb
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.
2023-03-08 16:37:45 +01:00
f8af7a8dae No progress in fixing Coulomb collisions with mass ratio
I am starting to think that the only fix is to reduce the time step, but
that is too harsh.
2023-03-07 10:10:54 +01:00
6113ac3305 Correction with conservation
Now the method is much better in conserving total energy.
However, still there is an issue with collisions between species of
dispaprate mass.
2023-03-06 16:16:17 +01:00
601103105f First attempt at Coulomb collisions
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.
2023-02-24 21:46:01 +01:00
7579d165ad Merge branch 'improve/probes' into 'development'
Probes were not working properly

See merge request JorgeGonz/fpakc!44
2023-02-23 12:45:38 +00:00
386ddd82dd Probes in 0 iteration
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.
2023-02-23 13:36:31 +01:00
2ee6c1764e Probes were not working properly
Issue in the output of probes and in the detection of particles inside
the velocity grid.
2023-02-23 08:18:46 +01:00
e7ae4e13ff Merge branch 'issue/lapack' into 'development'
Issue with -llapack option

See merge request JorgeGonz/fpakc!43
2023-02-17 12:05:39 +00:00
acc8505485 Issue with -llapack option
Some versions of gfortran (in the foss framework) were having issues
with the -llpack flag, so it is disables as OpenBLAS takes the work.
2023-02-17 13:03:22 +01:00
ee16de3f86 Merge branch 'issue/gmsh2FileName' into 'development'
Incorrect file name in Gmsh2 output

See merge request JorgeGonz/fpakc!42
2023-02-17 11:54:13 +00:00
8237aa90e9 Incorrect file name in Gmsh2 output
The file with the EMField was being writteng with the wrong name.
Quantities inside were correct.
2023-02-17 12:48:23 +01:00
e51348ae41 Merge branch 'issue/findCell' into 'development'
Returning to previous version of moduleMesh.f90

See merge request JorgeGonz/fpakc!41
2023-02-10 17:54:49 +00:00
4e9a592982 Returning to previous version of moduleMesh.f90
Having initialization in some variables was causing issues in 1D
geometry, so I reverted the file to one working.
2023-02-10 18:53:19 +01:00
167e25e276 Merge branch 'feature/writeGitCommit' into 'development'
Adds the commit to the output folder

See merge request JorgeGonz/fpakc!40
2023-02-09 15:50:36 +00:00
60477481dd Adds the commit to the output folder
I thought it will be a good idea to write the commit into the output
folder to better track the code version responsible for the results.
2023-02-09 16:48:49 +01:00
f815c8f192 Merge branch 'issue/particlesStuck' into 'development'
Issue in connectivity between Quad elements

See merge request JorgeGonz/fpakc!39
2023-02-09 15:29:34 +00:00
de1d4567f3 Issue for particles in quad cell
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.
2023-02-09 15:32:04 +01:00
f86641110c Issue in connectivity between Quad elements
For unstructured meshes, the quad elements where not being propertly
connected as not all possibilities were tested. This should be fixed
now.
2023-02-09 12:15:18 +01:00
de2aad02d1 Merge branch 'feature/vtk' into 'development'
Implementation of vtu file format for mesh reading and output

See merge request JorgeGonz/fpakc!38
2023-02-07 15:11:16 +00:00
2c55913501 First version of vtu file format
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).
2023-02-07 16:02:36 +01:00
e9ac9bdd80 Finishing implementation of vtu mesh format
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.
2023-02-07 15:19:13 +01:00
ba2b5bc6f3 Fixed issue with initial velocity
The problem was that the number of values for velocity was numNodes and
not 3*numNodes.
2023-02-07 09:43:28 +01:00
515e5c7744 Fix an issue and starting to read information from .vtu initial files
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.
2023-02-06 19:54:54 +01:00
a22099ee87 Improvement to vtu read subroutine
Some improvements to reduce code repetition when reading vtu mesh.
2023-02-06 19:18:04 +01:00
402dac9068 Update to the manual for .vtu
Manual has been updated to account for new vtu option in the mesh
format.
2023-02-05 21:44:09 +01:00
e3eeb97f48 First working version!
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.
2023-02-05 21:33:03 +01:00
43a7421795 Creating of nodes and edges in .vtu format
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...
2023-02-05 19:35:49 +01:00
7b470b7f58 Subroutines to read .vtu information
All subroutines to read .vtu information is ready.

Now it is time to create the input and generate a mesh for fpakc.
2023-02-05 18:32:38 +01:00
63fd8fdb91 New functions to read VTU
Added a few functions to read .vtu meshes.

Output in .vtu changed to output data in 6 columns (seems to be the
    standard.)
2023-02-05 16:23:37 +01:00
f5be04587a First step towards reading .vtu mesh
Just setting up the required functions.
2023-02-04 15:41:13 +01:00
6706c5dd1c Average is written in .vtu
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.
2023-02-04 15:20:36 +01:00
f1c0c5755f Collisions and EM field in .vtu
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
2023-02-04 12:31:33 +01:00
ceab516a5b Correction on collection file
The extension of the collection file has to be .pvd so that ParaView
properly reads it.
2023-02-04 08:54:36 +01:00
aca84d6312 First output in VTU format
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
2023-02-03 20:14:53 +01:00
318f686051 Merge branch 'issue/forgotPrint' into 'development'
Forgot to remove some print statements

See merge request JorgeGonz/fpakc!37
2023-02-03 14:12:30 +00:00
6c34dd8a05 Forgot to remove some print statements
It is okay now. Sorry.
2023-02-03 15:11:36 +01:00
e3e87eeb9f Merge branch 'feature/injectionNormal' into 'development'
Injection of particles from surfaces direction

See merge request JorgeGonz/fpakc!36
2023-02-03 14:07:32 +00:00
bc2c29092a Injection of particles from surfaces direction
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.
2023-02-03 14:03:22 +01:00
3646474d3d Merge branch 'issue/ionizationBoundaryCell' into 'development'
Fix an issue in assigning cells in ionization Boundary

See merge request JorgeGonz/fpakc!35
2023-02-03 09:54:58 +00:00
a0dfc55a69 Fix an issue in assigning cells in ionization Boundary
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.
2023-02-03 10:52:49 +01:00
d36b2db342 Merge branch 'issue/electricFieldGather' into 'development'
Incorrect tau in electrostatic pushers

See merge request JorgeGonz/fpakc!34
2023-01-13 14:38:09 +00:00
cca57d5ab0 Incorrect tau in electrostatic pushers
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.
2023-01-13 15:32:25 +01:00
d8eb2c2c58 Merge branch 'improvement/performance' into 'development'
Performance improvement.

See merge request JorgeGonz/fpakc!33
2023-01-07 17:47:29 +00:00
7ce1b7a4dd Reducing overhead when no collisions are present
Particles are added to lists only if there are MCC collisions. Hopefully
this will reduce overhead when OpenMP is used and no collisions are
active.
2023-01-07 12:12:37 +01:00
1c5b887a6d Small bugfix when testing examples
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.
2023-01-07 10:47:18 +01:00
22dff9ed69 Small style correction 2023-01-06 22:36:55 +01:00
600480f5d5 Reduce overhead of probes
I noticed that doProbes was causing some overhead even if no probes were
being used. Now it should be fixed.
2023-01-06 21:37:26 +01:00
746c5bea09 First step of performance improvement
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
2023-01-06 21:02:54 +01:00