ORNL-Fusion / aorsa

All ORders Spectral Algorithm (The Original)
MIT License
10 stars 2 forks source link

Interpreting AORSA results #33

Closed AreWeDreaming closed 1 year ago

AreWeDreaming commented 4 years ago

Dear AORSA community, Not really an issue, but I would like a second opinion on my AORSA results. I attached a pdf of the absolute values of the electric field and the kx, ky mode amplitude plot from the aorsa2d.ps. The result is very different from my GENRAY and COMSOL calculations and I am not sure whether this is due to the lack of resolution in the x direction or something else. Any pointers would be much appreciated! With kind regards Severin AORSA_E_abs.pdf Resolution_AORSA.pdf aorsa2d.txt

ntsujii commented 4 years ago

Dear Severin,

I am Naoto Tsujii, used to work for Miklos at MIT (now at the University of Tokyo). I usually just glance through the conversation here, but couldn't resist to respond for this one.

For AORSA vs COMSOL, AORSA is likely to be more accurate since it includes the hot plasma effects. Although the hot plasma version of Stix "P" may be included in FEM, this requires iteration and I assume that is not done in the COMSOL result you mentioned. Perpendicular stuff is much harder and no one has done this correctly in a realistic 2D geometry. AORSA has this all correctly implemented.

AORSA vs GENRAY is a bit trickier. I would think ray-tracing can give a reasonable answer for the plot you sent. If simulated properly, AORSA has the diffraction effects, so it is more correct. You need to make sure both AORSA and GENRAY use the same model (the same number of cyclotron harmonics). Your AORSA solution may be showing spurious modes below the midplane. You need to check how these modes are being excited and tune the resolution/filtering parameters accordingly.

Naoto

AreWeDreaming commented 4 years ago

Hi Naoto, Thank you for the comments! You are right COMSOL is cold plasma, but as far as I know, so is GENRAY. Also, Cornwall (Lao) got a decent agreement between GENRAY, COMSOL, and AORSA. So I guess it is the spurious modes that cause the trouble? There is the damping variable, which I adjusted from 500 to 700 since I get wavenumbers up to 650/m from the cold plasma dispersion relation for this plasma. I guess the value of damping has to be smaller than the largest resolved wave number on my grid to be effective?

I can always just increase the number of radial modes again, and rerun, but I want to make sure that this will be the right approach. We are looking at 50k CPU hours now, without any ion damping or current drive calculation. So I am a little hesitant, about increasing the grid size further.

Another question that I have is, that from the looks of Resolution_AORSA.pdf it seems like I can reduce the number of vertical mode numbers. But, on the other hand, I expect a lot more vertical propagation from the helicon wave than I get in my current result (see my COMSOL result attached). So I am not sure whether this is a good idea. COMSOL_E_abs.pdf With kind regards Severin

ntsujii commented 4 years ago

Although I know you have many good people to help you...

You should probably keep the resolution and first make sure you are exciting the same mode since the field pattern in front of the antenna (above midplane?) already looks very different. Look at the wavenumber and polarization in the proximity of the antenna, and compare them against GENRAY (or even just an analytic solution to local dispersion).

Regarding hot plasma effects, I remember John using the finite temperature option in GENRAY long time ago that showed the finite temperature effect on wave PROPAGATION can actually be appreciable. The option is not widely used, and honestly, I do not know about the details. Cornwall may know more about it?

Anyway, you would probably want to try to figure out whether you are launching the same wave with different codes before increasing the problem size.

Naoto

cornwalllau commented 4 years ago

Lots of good points about the physics. I agree with Naoto it could be a good idea to try different dispersion relation in genray (tag is "id"). I've done that in the past for my case and it was not a significant difference but it's easy to do and worth checking again. I also agree the comparison of the AORSA perpendicular wavelengths and polarization with analytical dispersion relation or GENRAY near the antenna is again also pretty easy and good to do. The data is in Efield_2D.vtk. The appropriate scalar names are E_alpha, E_beta, and E_b.

If these things don't check out, it is worth double checking the inputs again given that you already had reproduced one of my cases earlier if I recall?

If these things check out reasonably, we can move onto trickier stuff. Can you also check to see the wavenumber convergence for E_beta and E_b and not only E_alpha? If it looks good in those directions too, I would reduce damping as you suggested and try again. I seen cases where the damping does make a difference. delta0 is also another option to modify for the numerical damping. If the wavenumber convergence looks poor, you may have to instead increase damping. I'm hoping is the former; I think I have had successful core only helicon cases with damping = 0.

jcwright77 commented 4 years ago

There are many DR options in GENRAY including cold plasma, bonoli LH hot plasma (keeps higher order kperp) and full hot plasma (all bessel fns, etc). I’d suggest the last one (id-=6?) for HHFW to get the damping right also.

-john

On Sep 8, 2020, at 7:36 PM, ntsujii notifications@github.com wrote:

Although I know you have many good people to help you...

You should probably keep the resolution and first make sure you are exciting the same mode since the field pattern in front of the antenna (above midplane?) already looks very different. Look at the wavenumber and polarization in the proximity of the antenna, and compare them against GENRAY (or even just an analytic solution to local dispersion).

Regarding hot plasma effects, I remember John using the finite temperature option in GENRAY long time ago that showed the finite temperature effect on wave PROPAGATION can actually be appreciable. The option is not widely used, and honestly, I do not know about the details. Cornwall may know more about it?

Anyway, you would probably want to try to figure out whether you are launching the same wave with different codes before increasing the problem size.

Naoto

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ORNL-Fusion/aorsa/issues/33#issuecomment-689190688, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7SLTLUS4EWIQRPPUGY6MTSE25WVANCNFSM4RALLCNA.

AreWeDreaming commented 3 years ago

Thank you all for the helpful suggestions. I turned out that the density in AORSA was wrong. I had some trouble initially because I supplied the electron temperature in eV instead of keV. While debugging this I reduced the density by a factor of 3 to 2.e19 m^-3, which I forgot to undo, once I had sorted out the electron temperature problem.

Unfortunately, fixing this raised new issues. It seems to me like AORSA is putting the antenna in the wrong place. I switched GENRAY from id = 2 (cold plasma) to id=6 as John suggested (only small changes in the ray trajectory overall). You can see attached the comparison between GENRAY and AORSA. I marked the artificial helicon antenna at the launch point of the rays from GENRAY. As you can see this point is wildly different from where the power originates in AORSA (see GENRAY_vs_AORSA.pdf). Aside from the misplaced antenna it actually seems we have again pretty good agreement between GENRAY and AORSA.

To make sure that the highest electric field correlates indeed with the antenna currents I overlaid j_ant_y with Re_E_alpha in illustrator (see Re_E_alpha_w_j_ant.pdf).

I double-checked the AORSA input file (see aorsa2d.txt) and indeed I entered rant = 2.196 and `yant = 0.302' which is what shown in the comparison between GENRAY and AORSA.

Another issue is that AORSA bounces the power of the boundary which doesn't make much sense when the separatrix is the boundary. Is there any way to suppress this behavior?

What am I doing wrong this time?

Cheers Severin

P.S. Convergence is still not perfect either. See aorsa2d 89.pdf, aorsa2d 93.pdf, aorsa2d 85.pdf in case you are interested.

cornwalllau commented 3 years ago

Ok, this looks much better. Convergence isn't bad; I think that colorplot is in logscale in the ps plot if you are using it. GENRAY and AORSA agrees reasonably for the ray propagation.

Unfortunately, I don't know much we can do about the boundary condition on the LCFS right now without using the SOL, which had a lot of issues in the past. I don't think we should revisit that yet. Others may have suggestions. I seen this type of reflection in the past and sometimes got around it with a small change in the antenna location. Here, given that your antenna current location is wrong (see next paragraph), I will recommend trying this next.

This is again something that is not user friendly, but under the source file aorsa2dMain.F, you will see that if curved antenna .eqv .true., you should be using the keyword psiant and not rant to define your radial location. psiant = 1 at the LCRS as always. Try changing this number to your desired value and see if that works.

AreWeDreaming commented 3 years ago

Dear AORSA community, Thanks to Cornwall's help I have fixed the antenna problem. The result now looks very reasonable, but I am not certain about the convergence. Please find attached the absolute electric field for the new result. There is still a residual shift between GENRAY and AORSA, but I think this is due to different coordinate types used by GENRAY and AORSA, and an inconsistency in my scripts. E_abs.pdf

I also attached the log plot of the three spectra. E_x_spec.pdf E_y_spec.pdf E_b_spec.pdf I guess I might need a little more room in x? Or are these the sort of features one suppresses with damping? With kind regards Severin

dlg0 commented 3 years ago

Hi @AreWeDreaming , when referring to "are these the sort of features one suppresses with damping", what feature (in the E_abs.pdf plot) are you referring to? Or are you referring to the spectra?

AreWeDreaming commented 3 years ago

Oh sorry, I guess that was not very precise. The E_abs looks good to me, but the spectra of E_x and E_y are still at 10% of their maximum value near the negative x edge. This is what I am worried about.

dlg0 commented 3 years ago

Ah, I see. I would consider your case converged. One thing to keep in mind is that the spectra are global, and that it may very well be the case that if you did a local spectra around where the beam is it would be more converged, and that it is the fields at the boundaries causing the power out in the spectral lobes. AORSA never dealt with the boundaries in a particularly rigorous way (it only zeros the E field there - the LCFS in this case I think), and since this version does not support local variation in the damping (i think), the only way to reduce ringing at the edge is to turn up the global damping.

AreWeDreaming commented 3 years ago

Ok good to know. I'll make sure that the `damping' variable is slightly smaller than the largest k on the grid in the future. I think I still messed this up in this calculation.

Before I close this thread; would you like me to write up an FAQ for the things we discussed, or do you think this thread alone serves as a good documentation?

dlg0 commented 3 years ago

I think that what would be better than an FAQ, would be for you to create "issues" for all the problems you see. That way there is a list of things we can improve so we don't need to have obscure instructions - it should just be more intuitive.

It's been a while since I looked at how the damping is implemented in AORSA, but I thought it was on the time dependence, not the spatial dependence. How were you calculating the damping?

AreWeDreaming commented 3 years ago

Oh you are right. It looked to me like a upper limit for the wave number, since it is 500 in Cornwall's original file. In reality it is a damping factor that applies to all k > xkperp_cutoff. I put 650 instead of 500 so I doubt that did too much harm. Here is the documentation in the commented namelist:

real :: xkperp_cutoff = 0.75    ! fraction of xkperp above which the electron conductivity (sig3) 
                                                !  is enhanced to short out noise in E_parallel (default = 0.75)
real :: damping = 0.0     !  enhancement factor (default = 0.0) for the electron conductivity (sig3) 
                                      !  applied above the fractional value of xkperp (xkperp_cutoff) to 
                                      !  short out noise in E_parallel

But since this alters the conductivity tensor I would suppose this might mess up the calculation of the density perturbation. I'll turn that off in my next run to see if that changes things.

jcwright77 commented 3 years ago

What DR option are you using in genray? There is a full hot plasma dielectric which should be the correct one. It also looks like your ray initial conditions are quite equivalent to AORSA’s BC. -john

On Sep 14, 2020, at 3:23 PM, Severin Denk notifications@github.com wrote:

Dear AORSA community, Thanks to Cornwall's help I have fixed the antenna problem. The result now looks very reasonable, but I am not certain about the convergence. Please find attached the absolute electric field for the new result. There is still a residual shift between GENRAY and AORSA, but I think this is due to different coordinate types used by GENRAY and AORSA, and an inconsistency in my scripts. E_abs.pdf https://github.com/ORNL-Fusion/aorsa/files/5220511/E_abs.pdf I also attached the log plot of the three spectra. E_x_spec.pdf https://github.com/ORNL-Fusion/aorsa/files/5220518/E_x_spec.pdf E_y_spec.pdf https://github.com/ORNL-Fusion/aorsa/files/5220519/E_y_spec.pdf E_b_spec.pdf https://github.com/ORNL-Fusion/aorsa/files/5220517/E_b_spec.pdf I guess I might need a little more room in x? Or are these the sort of features one suppresses with damping? With kind regards Severin

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ORNL-Fusion/aorsa/issues/33#issuecomment-692262564, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7SLTLNSIH5S7DKDMBLK2TSFZUUFANCNFSM4RALLCNA.

AreWeDreaming commented 3 years ago

I am using id = 6 ! =6 hot non-relativistic plasma, Hermitian, Forest calc . I think the antenna got slightly shifted poloidally in AORSA. I moved the antenna inwards from sqrt(psi_norm) = 1.0 to 0.99 without adjusting the z-Coordinate. In GENRAY the starting point is given by rhopsi0(1:ngrill) initial small radius for wave front. So far I assumed this means rho poloidal. but now I am not sure anymore. It might depend on the variable indexrho for which I use 3, which seems to be consistent with the rho used in EFIT. Neither of those two options, allows me to get the first point of the GENRAY rays to align perfectly with the virtual antenna I draw using R,z coordinates. Attached you can find the AORSA/GENRAY comparison, for a rhopsi0 consistent with indexrho. The overlap between GENRAY and AORSA is better in this case, but the rays still start slightly outside of the antenna. E_abs_GENRAY_rhopsi0.pdf

jcwright77 commented 3 years ago

This new alignment is pretty good. Not worth more adjustment. It’s pretty clear that trajectories are the same.

-john

On Sep 14, 2020, at 7:07 PM, Severin Denk notifications@github.com wrote:

 I am using id = 6 ! =6 hot non-relativistic plasma, Hermitian, Forest calc . I think the antenna got slightly shifted poloidally in AORSA. I moved the antenna inwards from sqrt(psi_norm) = 1.0 to 0.99 without adjusting the z-Coordinate. In GENRAY the starting point is given by rhopsi0(1:ngrill) initial small radius for wave front. So far I assumed this means rho poloidal. but now I am not sure anymore. It might depend on the variable indexrho for which I use 3, which seems to be consistent with the rho used in EFIT. Neither of those two options, allows me to get the first point of the GENRAY rays to align perfectly with the virtual antenna I draw using R,z coordinates. Attached you can find the AORSA/GENRAY comparison, for a rhopsi0 consistent with indexrho. The overlap between GENRAY and AORSA is better in this case, but the rays still start slightly outside of the antenna. E_abs_GENRAY_rhopsi0.pdf

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

cornwalllau commented 3 years ago

This looks good to me too. You can try damping = 0 to see if it makes a difference. I would try wdot next to check current drive and power absorption profiles to genray.

qw8990032 commented 2 years ago

Hi @AreWeDreaming @dlg0 @ntsujii @cornwalllau @jcwright77 Does anyone tell me what happend? My problem is #45 . Tks!