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

Stellarator symmetry available for testing #46

Open
zhucaoxiang opened this issue Jan 22, 2020 · 10 comments
Open

Stellarator symmetry available for testing #46

zhucaoxiang opened this issue Jan 22, 2020 · 10 comments

Comments

@zhucaoxiang
Copy link
Collaborator

For a long time, FOCUS ignores periodicity and stellarator symmetry, as the computation speed was never an issue and generally, FOCUS results followed periodicity and stellarator symmetry if the target plasma does. I implemented the periodicity some time ago. A recent presentation by J. Schmitt indicates that finite asymmetry in coils may cause sizable differences in Boozer harmonics. The results motivate me to really consider finishing the stellarator symmetry.

Now the new function is ready for testing in the branch symmetry. Anyone who is interested should take a look. I will merge it into develop (and master) after the recent pull request is merged.

Some key points:

  • It is developed based on the develop branch, which means it has the ability to specify a secondary limiter surface by using limiter_surf when using coil-surface separation. More details can be checked Separate plasma surface with limiter surface for coil-surface separation AND stellarator symmetry #42.
  • The main change is to enable stellarator symmetry while re-implementing the periodicity.
  • *.focus file for coil parameters now has a slightly different I/O. An additional parameter symm will be read to indicate the symmetry property of this particular coil. Old executables can still read this new format, but the new executable cannot read old formats.
# coil_type  coil_symm   coil_name
   1  2  Mod_001   
# Nseg        current         Ifree         Length         Lfree  target_length
 128  1.009791754928605E+06     1  8.670505423971651E+00     1  5.000000000000000E+00
  • Re-implement the calculation of minimum coil-coil distance, but might need further checkings.
  • Add an output for calculating surface averaged Bn error.
  • Bug fixes.

There is a detailed developing note available at https://princetonuniversity.github.io/FOCUS/notes/FOCUS_stellarator_symmetry_and_periodicity.html. Please take a look. Some key information: Section 1.4 How to use, Section 3 Summary.

Please feel free to test and report issues.

@lazersos
Copy link
Collaborator

Compiling at MPCDF on Draco I found one compilation bug

mpiifort -c -r8 -O3 -ip -o diagnos_r.o diagnos_m.F90  -I/mpcdf/soft/SLE_12_SP4/packages/haswell/hdf5/intel_18_0_5-impi_2018_4/1.10.5/include -L/mpcdf/soft/SLE_12_SP4/packages/haswell/hdf5/intel_18_0_5-impi_2018_4/1.10.5/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lpthread -lz -lm
diagnos_m.F90(156): error #6404: This name does not have a type, and must have an explicit type.   [NPC]
           Npc = 1
-----------^
compilation aborted for diagnos_m.F90 (code 1)
Makefile:84: recipe for target 'diagnos_r.o' failed
make: *** [diagnos_r.o] Error 1

@zhucaoxiang
Copy link
Collaborator Author

@lazersos Good catch. I changed that part after my test and didn't see the compilation error. I have pushed a fix.

@lazersos
Copy link
Collaborator

OK compiles now on Draco at MPCDF. Thanks.

@lazersos
Copy link
Collaborator

This really needs to work with coil_type=3 for it to be useful for me.

@zhucaoxiang
Copy link
Collaborator Author

The symmetry should work with cil_type =3, but the toroidal flux doesn't, as the vector potential of an infinite wire is infinite.

@lazersos
Copy link
Collaborator

lazersos commented Jan 22, 2020

There's an error check which prevents using cil_type=3.

@zhucaoxiang
Copy link
Collaborator Author

Yes, because I realize that right now using the vector potential can only handle the Fourier coils. You can mute then if you really want the inaccurate evaluation of toroidal flux.

@zhucaoxiang
Copy link
Collaborator Author

@lazersos I think I misunderstood you. I thought the error check you were talking about was in torflux. I found I had a typo on error checking inrdcoil. I just fixed it and you can use coil_type=3, as long as not using toroidal flux.

@zhucaoxiang
Copy link
Collaborator Author

A kind remind: please DO NOT optimize non-periodic (non-symmetric) coils with (IsSymmetric=1,2). It will change the coil locally to reduce the field error and gives you an un-physical result.

For example, I optimized the PF(VF) coils for LHD. When using IsSymmetric=1,2, I got very good field error on that particular (half) period. However, the PF coils were titled and the field error at other periods that are not evaluated is much higher.

Blue: correct coils; red: titled coils using IsSymmetric=1
image

Field error in the full torus from the above red coils, only the first period was used to minimize Bn error.
Bnormal error

@zhucaoxiang
Copy link
Collaborator Author

I am going to merge the branch symmetry into develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants