Skip to content

Store coil fields for GS solve#36

Open
bclyons12 wants to merge 5 commits intomasterfrom
store_coils
Open

Store coil fields for GS solve#36
bclyons12 wants to merge 5 commits intomasterfrom
store_coils

Conversation

@bclyons12
Copy link
Copy Markdown
Collaborator

@bclyons12 bclyons12 commented Jun 18, 2021

Store the poloidal flux from each (real) PF coil in separate fields, so that they don't need to be recomputed at each time step. This has some awkwardness/hacky coding with respect to the coil currents, since we only save one poloidal field per physical coil, but still save a current per filament, so it needs to get summed up. That could be simplified, but this works as is.

Timing Test for GS solver with resistive wall & PF coils

DIII-D case (18 coils)

Old method: ~168 s
New method: ~100 s [9 s to store, 91 s to iterate]

KSTAR case (74 coils)

Old method: ~191 s
New method: ~87 s [21 s to store, 66 s to iterate]

@bclyons12
Copy link
Copy Markdown
Collaborator Author

@nferraro This currently works and the RMP regression test with igs_store_coils=1 passes, but it's much slower than the old method for a large number of coils. Any idea why? Too much memory access? My instinct is that it should be much faster than having to compute the Green's function for every coil at every point in space each GS iteration.

@bclyons12
Copy link
Copy Markdown
Collaborator Author

b2a8245 sped things up by ~33%, but still much too slow

@bclyons12
Copy link
Copy Markdown
Collaborator Author

It's because I'm storing a field for each filament, which is a very large number. I'm working on a change to store one per real coil.

@bclyons12 bclyons12 changed the title WIP: Store coil fields for GS solve Store coil fields for GS solve Jun 18, 2021
@bclyons12
Copy link
Copy Markdown
Collaborator Author

db5e684 makes the GS solver faster than the original. See top comment for more info.

@bclyons12
Copy link
Copy Markdown
Collaborator Author

@sjardin You may be interested in this.

@changliu777 changliu777 force-pushed the master branch 2 times, most recently from 844e5f3 to 99aead8 Compare September 21, 2021 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant