Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding triangular mesh from EIRENE #30

Merged
merged 6 commits into from
Mar 20, 2024
Merged

Adding triangular mesh from EIRENE #30

merged 6 commits into from
Mar 20, 2024

Conversation

anchal-physics
Copy link
Collaborator

@anchal-physics anchal-physics commented Mar 17, 2024

This PR will close #22

Basic framework is ready. We can read EIRENE files and them them to grid_ggd space and create following additional subsets:

5: all cells
-5: all standard B2 cells
-105: all Eirene triangular cells
-205: Eirene triangular cells that overlap with B2 cells

And same for nodes and edges with last index digita 1 and 2 instead of 5 as above.

B2 5_EIRENE_grid_together

Remaining to do:

  • -305: Eirene triangular cells that do not overlap with B2 cells (extension into far SOL)
  • Updating testing for this new feature. I need ideas for this part.

@anchal-physics anchal-physics added the enhancement New feature or request label Mar 17, 2024
@anchal-physics anchal-physics changed the title WIP: Adding triangular mesh from EIRENE Adding triangular mesh from EIRENE Mar 18, 2024
@anchal-physics
Copy link
Collaborator Author

This feature is ready for merge. I have included all tests I can think of. It is not possible to estimate before hand the number of common faces that EIRENE grid and B2.5 grid will have as they have different structure near the bottom edge in PFR region. It is possible to estimate the extra nodes added by EIRENE though, so I have added that as a test. The edge order of the triangular cells can be tested as well. Please let me know if there are any extra tests we can add at this stage. I think, we'll have to let people use this feature to find any bugs and tests that can find such bugs.

EIRENE grid can be loaded into edge_profiles.grid_ggd[1] now by
providing the set of three fort files (fort.33, fort.34, fort.35)
as keyword argument fort to solps2imas function.

First the code reads for.33 to add any additional nodes to the space.
The additional nodes all belong to grid extension outside the SOLPS
grid.

Then it reads fort.34 to add the triangular grid cells to the space and
the extra edges involved with them.

Then using fort.35, it conencts the triangular cells to their neighbours
and uses ix, iy index to create subset with index -205 which stores
EIRENE cells that overlap with B2.5 grid. Overlapping nodes and edges
are also stored by taking intersections in grid_subset indices -201 and
-202 respectively.

Minor additional changes:

* Moved convention of edge ordering from susbet_id.jl to solps2imas.jl
* Added tol argument to search_points function to allow matching of
nodes that are close to a given tolerance value. Default is 0, so by
default it looks for exact numerical match. This is useful since EIRENE
fort files keep node coordinates with 6 digits of precision only as
compared to SOLPS output files (13 digits)
Correct chosen_tri_edge_order has been identified from the sample
EIRENE files.

Added some verififcation tests for the EIRENE triangular mesh reading.
Still need to check some mismatch in common faces between EIRENE and
SOLPS in the PFR edge region.

Also now only as many ndoes and edges are being initialized as required
in the space. This gets rid of the extra initialization we have been
doing so far.
When EIRENE grid is added, the b2.5 grid is moved to negative
grid_subset_index. For example, all cells of b2.5 grid are now present
in grid_susbset with index -5. Thus, any quantities that are defined on
cells of b2.5 should refer ot -5 instead of 5.

This is implemented by providing an additional argument to the val_obj
function which is adictionary of grid_subset_index changes. If EIRENE
grid is added, we populate this dictionary to show that 1 => -1, 2 => -2
and 5 => -5. This way, the ggd values are correctly set.

Now the comment and hotfix in https://github.com/ProjectTorreyPines/SynthDiag.jl/blob/806f1beffa8e72948b36c821ca2d628c8cb3174f/src/interferometer.jl#L68
can be removed if we'll rely on this extended grid and not the one
that is generated in SD4SOLPS.
@anchal-physics anchal-physics merged commit d996011 into dev Mar 20, 2024
1 check passed
anchal-physics added a commit to ProjectTorreyPines/FusionSyntheticDiagnostics.jl that referenced this pull request Mar 20, 2024
Handle gsi change when extended grid displaced B2.5 grid

Merging as ProjectTorreyPines/SOLPS2imas.jl#30 as been merged.
anchal-physics added a commit to ProjectTorreyPines/SOLPS2ctrl.jl that referenced this pull request Mar 20, 2024
Adding option to specify cell subset index

Merging as ProjectTorreyPines/SOLPS2imas.jl#30 as been merged.
@eldond eldond deleted the tri_mesh_ext branch March 21, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Read the triangular mesh from Eirene
1 participant