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 a separate factor for NFP to calculate umbilic configurations #819

Draft
wants to merge 142 commits into
base: master
Choose a base branch
from

Conversation

rahulgaur104
Copy link
Collaborator

@rahulgaur104 rahulgaur104 commented Jan 9, 2024

An umbilic torus is a 3D shape with a continuous sharp edge that goes around three times toroidally before meeting itself. This shape can be thought of as a stellarator with a rational field period because the cross-section is only exactly identical (each sharp point completes a full poloidal rotation) after three toroidal turns.

Practically, these configurations are useful for resonant divertor design and simplifies divertor placement.

The objective of this PR is to add an additional factor that adds an integer NFP_umbilic_factor so that NFP -> NFP/NFP_umbilic_factor and make sure that the code runs without any issues.

To create an umbilic edge, we take the boundary of the stellarator and a 3D umbilic curve on the boundary and vary both the curve and the surface to obtain a stellarator that resembles an umbilic-torus-like shape.

@rahulgaur104 rahulgaur104 marked this pull request as draft January 9, 2024 14:22
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

flake8

desc/geometry/core.py|120 col 89| line too long (107 > 88 characters)
desc/geometry/core.py|367 col 89| line too long (107 > 88 characters)
desc/geometry/core.py|416 col 89| line too long (109 > 88 characters)

desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/equilibrium/equilibrium.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
…ourier function, correct bug in Equilibrium NFP_umbilic_factor property def
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
@rahulgaur104 rahulgaur104 changed the title Rg/nfp fac Adding a separate factor for NFP to calculate umbilic configurations rg/NFP_fac Adding a separate factor for NFP to calculate umbilic configurations Jan 9, 2024
@rahulgaur104 rahulgaur104 changed the title rg/NFP_fac Adding a separate factor for NFP to calculate umbilic configurations Adding a separate factor for NFP to calculate umbilic configurations Jan 9, 2024
desc/basis.py Outdated Show resolved Hide resolved
nodes,
Index[:, 2],
nodes[:, 2] % (2 * np.pi / (self.NFP / self.NFP_umbilic_factor)),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you construct the grid, it's fine to give nodes $\zeta \in [0, 2\pi / \text{NFP})$ or with the duplicate endpoint $\zeta \in [0, 2\pi / \text{NFP}]$. This change you have made is correct to ensure that still works with $\text{NFP} = \text{rational NFP}$. However, don't expect this logic to be sufficient to give correct behavior if you construct a grid with nodes $\zeta \in [0, 2\pi]$ when $\text{NFP} \neq 1$.

desc/grid.py Show resolved Hide resolved
desc/grid.py Outdated Show resolved Hide resolved
@@ -958,6 +985,9 @@ def _create_nodes( # noqa: C901
Toroidal grid resolution.
NFP : int
Number of field periods (Default = 1).
NFP_umbilic_factor : float
Rational number of the form 1/integer with integer>=1.
This is needed for the umbilic torus design.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked the earlier description more

desc/grid.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 51.72414% with 98 lines in your changes missing coverage. Please review.

Project coverage is 95.01%. Comparing base (b1900b3) to head (90f0cf8).

Files Patch % Lines
desc/objectives/_geometry.py 13.51% 96 Missing ⚠️
desc/geometry/curve.py 93.75% 1 Missing ⚠️
desc/objectives/normalization.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #819      +/-   ##
==========================================
- Coverage   95.42%   95.01%   -0.41%     
==========================================
  Files          89       89              
  Lines       22434    22578     +144     
==========================================
+ Hits        21407    21453      +46     
- Misses       1027     1125      +98     
Files Coverage Δ
desc/basis.py 98.20% <100.00%> (+0.01%) ⬆️
desc/coils.py 97.26% <100.00%> (+<0.01%) ⬆️
desc/compat.py 83.96% <100.00%> (ø)
desc/equilibrium/equilibrium.py 95.71% <100.00%> (ø)
desc/examples/__init__.py 100.00% <100.00%> (ø)
desc/geometry/core.py 91.82% <100.00%> (+0.16%) ⬆️
desc/geometry/surface.py 96.85% <100.00%> (+<0.01%) ⬆️
desc/grid.py 92.98% <100.00%> (+0.08%) ⬆️
desc/io/hdf5_io.py 81.96% <ø> (ø)
desc/io/optimizable_io.py 86.30% <ø> (ø)
... and 9 more

rahulgaur104 and others added 6 commits August 22, 2024 06:48
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

None yet

4 participants