Commit graph

135 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
7b7a5c45ca Small improvement
Very small improvement in performance.

Still, partialDer takes too long to compute.
Trying to find ways to improve it.
2023-01-06 15:18:04 +01:00
ba272de4e3 DOES NOT COMPILE: Break
Small break of changing functions.
Still some geometries to change.
2023-01-06 12:16:54 +01:00
7f6afd6a87 Mark_1
First thing that I am kinda happy with.

Still some things to improve but at least push is good.
2023-01-05 22:43:51 +01:00
15d64f3e68 Passing nNodes as argument
It seems that this improves results as passing the size of the arrays as
an argument is better than getting it from self.
2023-01-05 21:22:13 +01:00
6f24b5f1f6 Small changes before trying something big
I think that creating arrays with self%nNodes takes a lot of time.
I'm trying now to pass the number of nodes as argument.
2023-01-05 20:32:45 +01:00
26bd73597d Small improvement for 2DCyl
Nothing important, but overhead in dPsi has been reduced.
2023-01-05 18:47:33 +01:00
2486ef6316 Reduction in pushing
Reduction in 10-20% of time spend in pushing in 2DCyl thanks to
rewriting fPsi and dPsi.
2023-01-05 16:47:13 +01:00
0db76083ec fPsi no longer allocates memory
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)
2023-01-01 12:12:06 +01:00
8199a228c8 Locks for particle lists are now inside the type.
The lock of a particle list is no longer an external variable, it is now
part of the type.

New procedures have been added to set and unset the lock.
2022-12-31 11:22:02 +01:00
d9a1869564 Reorganization of solver
I started grouping similar modules in subfolders to ease the expansion
process.
2022-12-24 12:59:23 +01:00
a8bea6102f Final commit for volume nodes
1D Rad is fixed.

Still there might be an issue with the triangles in 2D Cyl.
2022-12-24 11:41:12 +01:00
dd1fca3fee Fix for node volume
An issue in the node volume calculation in cylindrical coordinates was
found. This was causing wrong conservation of current. Still to test
with ALPHIE_Grid case.

Still to check triangular element.
Still to theck 1D radial geometry
2022-12-20 15:51:43 +01:00
5509332980 Output of standard deviation
The output for the standard deviation (still Gmsh2 only) was added.

Change in the output routines to reduce code repetition.
2022-12-15 11:40:24 +01:00
c5c4cbefbf Output ready
Output for Gmsh2 ready.

Unfortunatly, code repetition was required.
2022-12-14 18:30:14 +01:00
2ee58b6b77 Small change to ionization boundary
Very small change in formats to better account the ionization processes.
Minimum impact in results.
2022-12-12 17:36:10 +01:00
924ba4e20e Alphie grid case and issues
Output for the example ALPHIE_Grid.

Found an issue when multiple injections were used with species with
different time steps.

Modification to the way to compute the ionization boundary:
  The maximum number of ionizations is computed by eRel/eThreshold
  (relative energy / threshold of ionization)
  For each possible ionization, the probability of ionization is
  computed based on the density of neutrals, cross section and effective
  time divided by the number of maximum ionizations.
  If an ionization takes place, the ionization energy is substracted
  from the relative energy.
2022-12-11 22:39:28 +01:00
ae8aa9075e Change in calculation of reduced mass and relative energy
Now reduced mass and relative energy are calculated on the fly per
collision.
2022-12-09 09:54:44 +01:00
23e2fe9bae I'm dying with hay fever but I have to commit
I'm feeling awful but I have work in my desktop that I need to commit so
I can work with my laptop while I'm at the IEPC 2022 in Boston.
2022-06-10 16:07:14 +02:00
cbb5fe0bf2 Merge branch 'feature/collisionPairs' into feature/electromagnetic
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.
2022-04-23 20:48:34 +02:00
4e9514876e Number of collisions per collision 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.
2022-04-23 19:00:33 +02:00
78a97ed7a0 Improve to collisions
Improvement into the collision model to better compute number of
particles collisions.
2022-04-23 18:57:27 +02:00
8006f9d768 First EM pusher
First implementation of Electromagnetic pusher.

Some testing is still required.

Documentation needs to be upgraded to match the changes in this branch.
2022-04-09 08:57:06 +02:00
5b5dadce39 Restructuring the geometry and pushers
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.
2022-04-08 19:06:12 +02:00
b6a7eb9ced Adding a time step for collisions
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.
2021-06-15 10:40:13 +02:00
9af3429395 Issue with random position in volumes
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.
2021-05-24 12:37:16 +02:00
35bd61fda9 Common scatter subroutine
All subroutines of scattering particle properties to the nodes of a
volume have been converged into one in moduleMesh.
2021-04-21 23:40:58 +02:00
027b346a84 Copy input files to output folder
After reading the input, the code copies the JSON input file but the
mesh(es) to the output directory.
2021-04-21 16:01:01 +02:00
dee860e37b Implementation of initial iteration.
An initial simulation time can be provided in the input file. This is
useful when restarting a simulation from a previous file. If no
initial time is provided, the value 0 is used.
2021-04-17 10:45:52 +02:00