D3DEnergetic / FIDASIM

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

Store velocity vectors in a reservoir #184

Closed lstagner closed 4 years ago

lstagner commented 4 years ago

This PR implements storing the neutral particle velocity vectors that pass through each cell. When calculating cx rates the cross sections are averaged over the velocities passing through the cell for each species.

This change makes it easier to support multiple beams/beamlets, calculating FIDA-halo, and mixed species support.

This is a breaking PR as it changes the neutrals.h5 file format to accommodate the particle reservoir. The file is now as follows

[runid]_neutrals.h5
    |-full
        |- amu # mass of the neutral species
        |- nlevel # number of energy levels in neutrals
        |- dens # neutral density
        |- reservoir
            |- v    # neutral particle velocity (3, k, nx, ny ,nz)
            |- w   # neutral particle weight (k, nx, ny, nz)
            |- n    # Number of neutrals seen by the cell (nx,ny,nz)
            |- k    # size of the reservoir
    |-half
...
lstagner commented 4 years ago

I did a comparison for a D3D Main Ion CER case. Biggest difference is that the new reservoir sampling sees more low energy photons in the halo. @shaunhaskey

DCX: dcx

HALO: halo

shaunhaskey commented 4 years ago

@lstagner I fit the output spectra with a Gaussian like I usually do for calculating the apparent main-ion signals. As expected based on the plots from @lstagner, there is minimal change between the versions.

Selection_594