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 369 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 boundary characterized by a closed torus 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 may simplify 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
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
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/geometry/core.py Outdated Show resolved Hide resolved
desc/basis.py Outdated Show resolved Hide resolved
desc/basis.py Outdated Show resolved Hide resolved
desc/basis.py Outdated Show resolved Hide resolved
desc/compute/utils.py Outdated Show resolved Hide resolved
desc/plotting.py Outdated Show resolved Hide resolved
desc/plotting.py Outdated Show resolved Hide resolved
desc/plotting.py Outdated Show resolved Hide resolved
desc/plotting.py Outdated Show resolved Hide resolved
@PlasmaControl PlasmaControl deleted a comment from github-actions bot Jan 30, 2024
@PlasmaControl PlasmaControl deleted a comment from github-actions bot Jan 30, 2024
@PlasmaControl PlasmaControl deleted a comment from github-actions bot Jan 30, 2024
@PlasmaControl PlasmaControl deleted a comment from github-actions bot Jan 30, 2024
@PlasmaControl PlasmaControl deleted a comment from github-actions bot Jan 30, 2024
@PlasmaControl PlasmaControl deleted a comment from github-actions bot Jan 30, 2024
@PlasmaControl PlasmaControl deleted a comment from github-actions bot Jan 30, 2024
desc/compute/utils.py Outdated Show resolved Hide resolved
desc/geometry/surface.py Outdated Show resolved Hide resolved
desc/plotting.py Outdated Show resolved Hide resolved
desc/plotting.py Outdated Show resolved Hide resolved
desc/geometry/surface.py Outdated Show resolved Hide resolved
desc/plotting.py Outdated Show resolved Hide resolved
desc/plotting.py Outdated Show resolved Hide resolved
@dpanici
Copy link
Collaborator

dpanici commented May 1, 2024

#844 will help with this

@@ -64,6 +64,8 @@ class Equilibrium(IOAble, Optimizable):
total toroidal flux (in Webers) within LCFS. Default 1.0
NFP : int (optional)
number of field periods Default ``surface.NFP`` or 1
NFP_umbilic_factor : int (optional)
field period prefactor Default ``surface.NFP_umbilic_factor`` or 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not a very good description, I would say "integer dividing the field period, such that the effective field period is NFP/NFP_umbilic_factor" or something.

Also out of curiosity, would this work with NFP that is not equal to one?

== axis_NFP_umbilic_factor
),
ValueError,
"Unequal number of umbilic field period factors for equilibrium "
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should just be "unequal umbilici field period prefactor" or something, not number of

@@ -554,6 +602,9 @@ def change_resolution(
Toroidal real space grid resolution.
NFP : int
Number of field periods.
NFP_umbilic_factor : float
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this not supposed to be an integer still?

self.N_grid,
self.NFP,
NFP_umbilic_factor=self.NFP_umbilic_factor,
)
data0d = compute_fun(
Copy link
Collaborator

Choose a reason for hiding this comment

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

have you checked if quantities like volume are correct when the prefactor is used?

@@ -29,6 +29,9 @@ class FourierRZCurve(Curve):
Mode numbers associated with Z_n, If not given defaults to [-n:n]].
NFP : int
Number of field periods.
NFP_umbilic_factor : float
Copy link
Collaborator

Choose a reason for hiding this comment

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

again this is an integer right? not a float?

@dpanici
Copy link
Collaborator

dpanici commented Sep 25, 2024

I think the objective you added makes sense, it tries to align the alpha=0 field line with the umbilic curve. Something I am not sure of is, do your curves have a given helicity to them? that is, as phi increases do they move clockwise/counterclockwise poloidally? might have to make sure that if they do, that it is consistent with the helicity of the equilibrium field as determined by the sign of iota

@rahulgaur104
Copy link
Collaborator Author

rahulgaur104 commented Sep 25, 2024

I think the objective you added makes sense, it tries to align the alpha=0 field line with the umbilic curve. Something I am not sure of is, do your curves have a given helicity to them? that is, as phi increases do they move clockwise/counterclockwise poloidally? might have to make sure that if they do, that it is consistent with the helicity of the equilibrium field as determined by the sign of iota

Excellent question! Yes, there can be a sign issue but helicity of the curve = |curve.NFP/curve.NFP_umbilic_factor|. The sign decides clockwise/anticlockwise. I think the sign should be the same as the sign of iota.
The way the surface and the curve are initialized, the curve corresponds to alpha = 0.
Here's what I get for a 3/5 umbilic curve.

3-5-umbilic-fieldline

The objective tries to align the field line (red line) with the umbilic curve (blue line)

@rahulgaur104 rahulgaur104 changed the base branch from master to ripple September 28, 2024 14:41
@rahulgaur104 rahulgaur104 changed the base branch from ripple to master October 18, 2024 07:00
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.

5 participants