D3DEnergetic / FIDASIM

A Neutral Beam and Fast-ion Diagnostic Modeling Suite
http://d3denergetic.github.io/FIDASIM/
Other
29 stars 19 forks source link

CFPD flux calculation - units issue #282

Open ajackson135 opened 3 months ago

ajackson135 commented 3 months ago

I am attempting to utilize the CFPD capability of the new FIDASIM to forward model the CFPD diagnostic on MAST-U. I have used a Lorentz orbit code to generate the sightline data required by FIDASIM. This code can also generate an estimate of the proton rate observed by the CFPD, separately from FIDASIM. To sanity check, I would like to generate the predicted observed proton rate with FIDASIM to compare to see if the two results broadly agree. The FIDASIM CFPD output file has the field 'flux', with the description "CFPD flux: flux(energy,chan)" and units "kHz". In order to get the total rate observed by a channel at the simulation time, the sum is taken across the energy axis, leaving rate(chan) in kHz.

My problem is that while the synthetic rate generated by the Lorentz orbit code over-predicts the experimental values by x1.5-2, the rate generated by the summed flux from FIDASIM over predicts by x5000-10000. Both codes are pulling from the same sightline and equilibrium data, so I am unsure where this large a discrepancy could have come from.

I thought that perhaps the unit field in the CFPD flux data was incorrectly set to "kHz", instead of "Hz". I do not know much about the way that the CFPD calculation is performed, but I looked into fidasim.f90, and I note that both the neutron and CFPD calculation utilise the get_dd_rate subroutine (with different values for tables%D_D%log_rate). I note that when the neutron rate is written out at line 4761 the units of theneutron%rate field are set to "neutrons/s", essentially 'Hz', not 'kHz'.

I know that there are different steps done after get_dd_rate for the neutron and on the CFPD data, but I could not see any explicit conversion factor making one (essentially) 'Hz' while the other is 'kHz'.

If anyone that has deeper knowledge of what is going on in the CFPD calculation could comment, I would be very appreciative.

heidbrin commented 3 months ago

Andrew, I think Alvin should check this since he did the actual programming but I suspect it is Hz rather than kHz. But that still leaves a discrepancy that's bigger than your other calculation.

William (Bill) Heidbrink Department of Physics and Astronomy University of California Irvine, CA 92697 949-824-5398 (office) 949-824-2174 (fax)

----- Original Message ----- From: "ajackson" @.> To: "D3DEnergetic/FIDASIM" @.> Cc: "Subscribed" @.***> Sent: Monday, September 2, 2024 10:00:21 AM Subject: [D3DEnergetic/FIDASIM] CFPD flux calculation - units issue (Issue #282)

I am attempting to utilize the CFPD capability of the new FIDASIM to forward model the CFPD diagnostic on MAST-U. I have used a Lorentz orbit code to generate the sightline data required by FIDASIM. This code can also generate an estimate of the proton rate observed by the CFPD, separately from FIDASIM. To sanity check, I would like to generate the predicted observed proton rate with FIDASIM to compare to see if the two results broadly agree. The FIDASIM CFPD output file has the field 'flux', with the description "CFPD flux: flux(energy,chan)" and units "kHz". In order to get the total rate observed by a channel at the simulation time, the sum is taken across the energy axis, leaving rate(chan) in kHz.

My problem is that while the synthetic rate generated by the Lorentz orbit code over-predicts the experimental values by x1.5-2, the rate generated by the summed flux from FIDASIM over predicts by x5000-10000. Both codes are pulling from the same sightline and equilibrium data, so I am unsure where this large a discrepancy could have come from.

I thought that perhaps the unit field in the CFPD flux data was incorrectly set to "kHz", instead of "Hz". I do not know much about the way that the CFPD calculation is performed, but I looked into fidasim.f90, and I note that both the neutron and CFPD calculation utilise the get_dd_rate subroutine (with different values for tables%D_D%log_rate). I note that when the neutron rate is written out at line 4761 the units of theneutron%rate field are set to "neutrons/s", essentially 'Hz', not 'kHz'.

I know that there are different steps done after get_dd_rate for the neutron and on the CFPD data, but I could not see any explicit conversion factor making one (essentially) 'Hz' while the other is 'kHz'.

If anyone that has deeper knowledge of what is going on in the CFPD calculation could comment, I would be very appreciative.

-- Reply to this email directly or view it on GitHub: https://github.com/D3DEnergetic/FIDASIM/issues/282 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

ajackson135 commented 3 months ago

Hi Bill,

Thanks for your response. Is Alvin still involved in the maintenance of FIDASIM? It would be good for me if he could give a definitive yes/no, but I am looking into the code with the assistance of his thesis/paper. I just don't want to miss some hidden conversion factor that is applied to the proton flux, but not the neutron rate!

As for the rest of the discrepancy, I still have to further analyse my results, but x5-10 is easier to approach than x5000-10000!

Regards, Andrew

ajackson135 commented 2 months ago

Additionally, when looking at such binned data, with the independent variable (energy) having units of eV, I would expect that the units of the dependent variable would be Hz/eV (or kHz/eV), rather than just Hz alone. In that case the correct operation to get the rate would be integrating the data, rather than just summing as I have done. Could I confirm that it should only be Hz (or kHz)?

alvin-garcia commented 2 months ago

@ajackson135,

Good catch, it's Hz, see below.

It's great to see users running the CFP code. I'm developing a new version of the code, it will be available online soon and it will include the correct units.

I'm curious to visualize the energy spectra for you're selected discharge and sightline array.

Counts (Flux) Definition

C ∝ R · κ · p_γ · T(Ω) · n_e · F

Where:

Dimensional Analysis

C = [Hz · 1 · 1 · cm² · 1/(cm²·dE·dp) · dE·dp·cm]
  = [Hz] (frequency)