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

combine coils #525

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

combine coils #525

wants to merge 3 commits into from

Conversation

TimSlendebroek
Copy link
Contributor

@TimSlendebroek TimSlendebroek commented Mar 8, 2024

torrin's pf_active file

example run:

ini,act = FUSE.case_parameters(:ITER;init_from=:ods);

ini.equilibrium.boundary_from = :MXH_params
R0 = 6.2
Z0 = 0.4
ϵ = 0.32
κ = 1.8
δ = 0.485
ζ = -0.09583
ini.equilibrium.MXH_params = [
    R0, Z0, ϵ, κ, 0.00337,
    0.15912, -0.05842, -0.04573, 0.00694, 0.00614, 0.00183,
    asin(δ), -ζ, -0.05597, -0.01655, 0.00204, 0.00306]

dd = IMAS.dd()
FUSE.init(dd,ini,act);
pop!(dd.pf_active.coil)
pop!(dd.pf_active.coil)
FUSE.ActorEquilibrium(dd,act;ip_from=:pulse_schedule)
# FUSE.ActorPFactive(dd,act;do_plot=true);
p = plot(dd.equilibrium;cx=true)
plot!(dd.build)
display(plot!(dd.pf_active))
#    

torrin's pf_active file
Comment on lines -2417 to +538
"identifier": "VS3U"
"identifier": "VS3U",
"name": "Upper Vertical Stabilization Coil (VSU)",
"resistance": 0.0057
},
{
"name": "Lower Vertical Stabilization Coil (VSL)",
"current_limit_max": [
[
10000.0
]
],
"element": [
{
"name": "SSMIC Conductor - OFE Copper",
"turns_with_sign": 1.0,
"geometry": {
"annulus": {
"radius_outer": 0.023,
"r": 7.5505580644830905,
"z": -2.500017876541186,
"radius_inner": 0.01695
"radius_inner": 0.01695,
"radius_outer": 0.023,
"z": -2.500017876541186
},
"geometry_type": 5
},
"identifier": "VS3L1"
"identifier": "VS3L1",
"name": "SSMIC Conductor - OFE Copper",
"turns_with_sign": 1.0
},
{
"name": "SSMIC Conductor - OFE Copper",
"turns_with_sign": 1.0,
"geometry": {
"annulus": {
"radius_outer": 0.023,
"r": 7.496332809419729,
"z": -2.541098411866157,
"radius_inner": 0.01695
"radius_inner": 0.01695,
"radius_outer": 0.023,
"z": -2.541098411866157
},
"geometry_type": 5
},
"identifier": "VS3L2"
"identifier": "VS3L2",
"name": "SSMIC Conductor - OFE Copper",
"turns_with_sign": 1.0
},
{
"name": "SSMIC Conductor - OFE Copper",
"turns_with_sign": 1.0,
"geometry": {
"annulus": {
"radius_outer": 0.023,
"r": 7.511397459955538,
"z": -2.4493172573717077,
"radius_inner": 0.01695
"radius_inner": 0.01695,
"radius_outer": 0.023,
"z": -2.4493172573717077
},
"geometry_type": 5
},
"identifier": "VS3L3"
"identifier": "VS3L3",
"name": "SSMIC Conductor - OFE Copper",
"turns_with_sign": 1.0
},
{
"name": "SSMIC Conductor - OFE Copper",
"turns_with_sign": 1.0,
"geometry": {
"annulus": {
"radius_outer": 0.023,
"r": 7.456657713145448,
"z": -2.490061122639074,
"radius_inner": 0.01695
"radius_inner": 0.01695,
"radius_outer": 0.023,
"z": -2.490061122639074
},
"geometry_type": 5
},
"identifier": "VS3L4"
"identifier": "VS3L4",
"name": "SSMIC Conductor - OFE Copper",
"turns_with_sign": 1.0
}
],
"resistance": 0.00791,
"identifier": "VS3L"
"identifier": "VS3L",
"name": "Lower Vertical Stabilization Coil (VSL)",
"resistance": 0.00791
}
Copy link

Choose a reason for hiding this comment

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

FUSE is probably better off without having the vertical stabilization coils in there by default since they shouldn't be used for shaping, but maybe you want to keep them for other applications?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@orso82 can you tag these vertical stabilization coils as :stability coil instead of :shaping ?

Copy link
Member

Choose a reason for hiding this comment

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

yeah, right now FUSE can automatically differentiate and tags coils that are used for :shaping and/or :flux. We need to think of a way to automatically tag vertical stability coils... perhaps the combination of being small, of :annulus geometry, and with few turns?

Choose a reason for hiding this comment

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

The annulus type is probably particular to how ITER describes these and not universal for VS coils. A small number of turns could be a better way to distinguish them, but may not be universal either. A combination of that and the distance to the plasma (or center of the vessel) on the outboard side could be that

Copy link
Member

Choose a reason for hiding this comment

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

I think trying to tag that automatically will be tough. DIII-D, for example, uses the same coils for shaping and stability. You probably just want them user-specified and you have a separate actor that operates on the vertical-stability coils.

@orso82
Copy link
Member

orso82 commented Mar 11, 2024

@torrinba can you please explain what has changed with this pf_active for ITER?

Looking at the diff https://github.com/ProjectTorreyPines/FUSE.jl/pull/525/files I see a whole bunch of fields being deleted.

@torrinba
Copy link

torrinba commented Mar 11, 2024

The primary change here is to link the middle CS coils (CS1U and CS1L, now separate elements in CS1). This is not part of ITER's MD, but was communicated to us by @anandhimank as the way the coils will be installed

Since that changes the number and names of pf_active.coil it messes up the circuit and other fields. Rather than going in and trying to fix all of those, I just deleted them. My understanding was that the coils are all that FUSE is using. It should be possible to fix the others when combining the coils, but I don't have any experience with those entries so I'm not sure I would get it all correct.

@orso82
Copy link
Member

orso82 commented Mar 11, 2024

Rather than hacking this in, we should support how IMAS defines the power-supply of the coils. This will be important for replicating DIII-D results, where the patch-panel links currents in different coils. Thoughts?

@torrinba
Copy link

torrinba commented Mar 11, 2024

For sure, if there is a more correct solution for how the coils are controlled either with the circuit or supply entries that would be a better way to go (assuming the MD has that correct). I don't understand what the difference between 2 separate coil entries with the same circuit/supply or 2 elements in the same coil would be, but I agree that we should follow whatever would be most correct. Please help set this up in FUSE

I don't think any of that is setup for DIII-D with the omas machine mappings though so further work would be required there as well

@orso82
Copy link
Member

orso82 commented Mar 11, 2024

@torrinba the way I understand it, circuit links supply to coil. To begin with, I think all we care about is circuit[:].connections to define what coils have the same current.

Bringing in @bclyons12 into the conversation.

Here is what the data structure looks like
image

@torrinba
Copy link

The latest ITER MD, defines 14 coils, 8 circuits, and 14 supplies in the pf_active IDS. So I'm not sure that works out as simply as we're hoping, but you're probably correct it should be used to control the coils. Hopefully someone can figure that out or explain it to us

Here's the HDF5 ODS version directly from ITER: (only zipped to allow the GitHub upload)
pf_active_ods.zip

@orso82
Copy link
Member

orso82 commented Mar 13, 2024

ping @anandhimank

@anandhimank
Copy link

The DINA scenario given to me from the ITER PCS group assume the following: Total of 14 coils named, 'CS3U', 'CS2U','CS1U', 'CS1L', 'CS2L', 'CS3L', 'PF1 ', 'PF2 ', 'PF3 ', 'PF4 ', 'PF5 ', 'PF6 ', 'VS3U', 'VS3L' with the circuit connections as follows: [1 2 3 3 4 5 6 7 8 9 10 11 -12 12], meaning 'CS1U', 'CS1L', are in series and 'VS3U', 'VS3L' are in anti-series. I am also attaching the data file, you may want to take a look at the CS/PF coil currents and Voltages for more details in the excel file
data_with_eqdsk.xlsx

@orso82
Copy link
Member

orso82 commented Mar 13, 2024

@bclyons12 we now give a list of coils to VaccumFields, and all those are treated as indepedent.

I see three ways forward.

  1. we have VacuumFields accept also a circuit's vector
  2. we just pass the whole pf_active to VaccumFields and have the circuit's logic implemented there
  3. we build a new AbstractCoil type that handles coils connections internally, leaving VacuumFields untouched
    What do you think?

@bclyons12
Copy link
Member

I think 2 or 3 makes the most sense. Either we work with the dd directly and parse the information from there (as we already do for coils with elements) or we make a new AbstractCoil. I assume that the key component here is that the coils/turn is constant across the coils.

@orso82
Copy link
Member

orso82 commented Mar 19, 2024

I am reluctant to merge this PR, since I don't think combining coils in the data structure is the right way to go.

As we think about how to best implement the circuits logic in VacuumFields, I'd suggest that this hack is done when the DatabaseGenerator is run. @TimSlendebroek could you please generalize the DatabaseGenerator study to accept a user-defined function, which then @torrinba can use to hack the merged coil configuration for his purposes?

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