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

Generate an extended GGD mesh using the equilibrium psi(R,Z) and existing mesh. #8

Open
4 of 5 tasks
eldond opened this issue Sep 18, 2023 · 5 comments
Open
4 of 5 tasks
Assignees

Comments

@eldond
Copy link
Contributor

eldond commented Sep 18, 2023

Here's the best idea I've come up with so far:

  • Identify the last two rows of cells that border the SOL
  • Identify the spacing between mesh faces in psi_N by comparing cells to psi(R,Z) in equilibrium (gEQDSK required)
  • Trace additional contours of psi_N in the SOL to provide some of the mesh edges (x aligned faces).
  • Find the gradient of psi_N and use it to extend the y-aligned faces.
    • The immediate application does not need this gradient tracing to be perfect, although future uses might appreciate having a neat grid.
    • The cells next to the divertor will shift from being psi_N gradient aligned to wall aligned at some point, because the wall doesn't have to be (and will work better if it isn't) aligned to be normal to the psi_N contours. In this case, I don't know the best way to connect the surfaces, but making them normal to psi_N should prevent weird collisions, at least, even if it does place a kink at the edge.
  • Handle cells that reach the wall.
    • Perhaps start by extending the mesh until it overfills the bore of the device, then deleting cells that are completely blocked by the limiting surface, then editing the cells that intersect the surface. These cells could have more than four vertices, such that part of the cell's boundary is defined by the rectilinear mesh and the other part is by its intersection with the wall.
    • If we have to go out so far that we reach the edge of the psi grid, then we'll get funny cells that way, too, although they'll almost certainly be a non-issue in the end because they should be blocked; the psi grid should overfill the bore of the device.

20230918_085010

@eldond
Copy link
Contributor Author

eldond commented Sep 21, 2023

I think the best way to enter the extension is with different subsets.

@anchal-physics
Copy link
Collaborator

I propose the following:

  • We create subsets with indices -1 to -6 by copying them from subsets with indices 1 to 6.
  • We add all new nodes, edges, and cells to the same space.
  • We update subsets 1 to 6 with the extension to remain compatible with the IMAS directives.
  • We add new subsets at -2xx indices for describing extended mesh parts.
    • -201 for all nodes in the extended mesh (including the boundary nodes common with SOLPS mesh)
    • -202 for all edges between nodes in -201
    • -203 for all x-aligned edges in the extended mesh (maybe hard to define, optional)
    • -204 for all y-aligned edges in the extended mesh (maybe hard to define, optional)
    • -205 for all cells in the extended mesh

@eldond
Copy link
Contributor Author

eldond commented Sep 21, 2023

Oh, good idea. So 5 is all cells, -5 is all cells prior to modification, and -205 is all cells that were added. If I got that right, then I think we have a plan.

@eldond
Copy link
Contributor Author

eldond commented Sep 29, 2023

Ugh, this plan is going to run into trouble when we hit the secondary X-point. Single null SOLPS meshes just end at the secondary separatrix. So how to do it?

  1. Do it right and make a real double null mesh. This is hard. We might as well move to SOLPS wide grids and require that. Huge effort. Way beyond the scope of this crappy little extension tool. So, no. That's a different project.
  2. dumb idea # 1: simple connection through secondary PFR
    1. find the secondary X-point
    2. trace a curve from the X-point into the SOL on both sides, following steepest descent (so should be halfway between the branches of the separatrix and cutting right through the middle of the X)
    3. find intersections of the chosen contour levels with the cut through the X-point
    4. for each pair of points on the same contour level but opposite sides of the X-point, connect them with two line segments that go up into the PFR and make a right angle.
      - Why? The right angle and jog into the PFR will avoid unwanted collisions. The extension to the PFR will fill in that area. Two line segments with a right angle are a lot easier than making up some pretty curve, although I guess a semi-circle would be okay, too.
    5. complete the mesh by drawing line segments out from the points mentioned above but 90 from the first set of line segments. So each point of intersection of a contour with the line through the X-point will have two segments extending from it, 90 degrees apart, and shooting up into the PFR.
      - Can this go wrong if the curve through the X-point is too curvy? Yes. If the X-point-cutting-curve bends so much that it becomes tangent to the point-point connectors, the system breaks. Could solve this by just finding the angle of the line through the x-point near the x-point (still from steepest descent) and extrapolating it straight into the SOL as a straight line and not following the gradient anymore.
      - A set of semi-circles centered on the curve through the X-point wouldn't have this problem.

Image

Image

@eldond
Copy link
Contributor Author

eldond commented Oct 2, 2023

It's been suggested that a simple square mesh might be enough.

@eldond eldond self-assigned this Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants