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

GetBcyl Issue in FIELDLINES #141

Closed
WillT22 opened this issue Oct 18, 2021 · 9 comments
Closed

GetBcyl Issue in FIELDLINES #141

WillT22 opened this issue Oct 18, 2021 · 9 comments
Assignees

Comments

@WillT22
Copy link

WillT22 commented Oct 18, 2021

When running previously successful simulations on FIELDLINES, I am now running into an initialization loop error. Attached is the error file when run on NoMachine. The error looks to be with GetBcyl specifically.
NX_error.txt

@zhucaoxiang
Copy link
Collaborator

@WillT22 From the source, the error probably indicates that a point isoutside the VMEC domain.

               ! The GetBcyl Routine returns -3 if cyl2flx thinks s>1
               ! however, if cyl2flx fails to converge then s may be
               ! greater than 1 but cyl2flux won't throw the -3 code.
               ! In this case GetBcyl returns br,bphi,bz = 0.  So
               ! bphi == 0 or ier ==-3 indicate that a point is
               ! outside the VMEC domain.
 ERROR in GetBcyl Detected
 R,PHI,Z   1.7075000000000000        1.6755161285400391       0.60000000000000009
 br,bphi,bz,myworkid   7.9050503334599447E-323   6.9257608337865693E-310   6.9257608337865693E-310           6

@WillT22 WillT22 changed the title GetBcyl Issue in Fieldlines GetBcyl Issue in FIELDLINES Oct 22, 2021
@zhucaoxiang
Copy link
Collaborator

This might be also related to #142 and can be merged if so.

@lazersos
Copy link
Collaborator

lazersos commented Nov 4, 2021

When running previously successful simulations on FIELDLINES, I am now running into an initialization loop error. Attached is the error file when run on NoMachine. The error looks to be with GetBcyl specifically. NX_error.txt

@WillT22 Can you upload the VMEC wout file? I'd like to check this against the #142 issue as @zhucaoxiang suggests.

@WillT22
Copy link
Author

WillT22 commented Nov 4, 2021

@lazersos Here you go. Let me know if you need anything else.

wout_fb_original.txt

@lazersos
Copy link
Collaborator

lazersos commented Nov 5, 2021

Running this equilibrium through my routine, the issue at the axis appears a bit differently.
image

Most likely your error is due to your choice of grid size. Adjust NR or NZ slightly and see if the error goes away. GetBCyl relies on an inverse look-up which can fail sometimes for highly cusped equilibria such as the one you supplied.

@WillT22
Copy link
Author

WillT22 commented Nov 29, 2021

For the NR and the NZ parameters, I was using 201 divisions which is the number provided in the example on the VMECwiki. I have adjusted these values down to 180 and up to 220 individually and together in the FIELDLINES input file on a simulation that ran before this issue arose. All tests yielded the same error as shown above.

@lazersos
Copy link
Collaborator

@WillT22 Can you upload the input file (assume it's fixed boundary). I'd like to run this case. Also please post your command for running FIELDLINES.

I suspect what you're running into is an edge related issue which arrises for strongly cusped equilibria. The fix for the axis problem will most likely also provide improvements for the edge.

Unfortunately, I'm busy with hardware from now till Christmas so I don't think I'll have much time to work on this.

@WillT22
Copy link
Author

WillT22 commented Dec 3, 2021

@lazerso Here is the input file and the .batch file I use to run in FIELDLINES modified for the fixed boundary condition whenever you can get to it.

fixed_boundary_input.zip

@lazersos
Copy link
Collaborator

Sorry, took a while for me to get back to this. Here are the issues I see

  1. You're running a field line diffusion calculation but provide no vacuum field source (coils or mgrid). This is not possible.
  2. You PHIMAX is 2pi but for an NFP stellarator should be 2pi/NFP unless you're attempting to calculate error field response. But then you need many more NPHI planes.
  3. I ran what you provided on the Lazerson branch and found no issue.

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

No branches or pull requests

3 participants