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

Interferometer #9

Merged
merged 10 commits into from
Oct 10, 2023
Merged

Interferometer #9

merged 10 commits into from
Oct 10, 2023

Conversation

anchal-physics
Copy link
Collaborator

Added interferometer that uses extrapolated core profile and thin plate smoothed edge profile electron density data to generate outputs.

Using QuadGK, a simple line integration of electron density is added.
However, no test has been added and this has not been tested yet but
the workflow would more or less remain teh same. Also note that for
line average density, currently the total path length is used while
we want to average by path length in plasma.
* Added a test but it fails due to a bug in SD4SOLPS
* Converted default_interferometer.yml to json
* Added gridspacedesc.yml in samples
* Fixed Project.toml
Utilizing the new ∈ operator from GGDUtils.jl, now using
core_profile_2d for getting values inside core region and using
GGDUtils.interp for getting values inside SOLPS grid outside of core
region. Everywhere else, teh electron density is assumed to be zero.

Chord length inside core is also measured using the same functionality.

However, the implementation is very slow. It takes about 4s to integrate
electron density along a chord for each time step . This is not
acceptable. I'll look deeper into what is causing the slow down and fix
it.
Using the new core profile interpolation function that returns an
inteprolating function instead of values at specific points. This
helped increase the speed of the code such that for relative tolerance
of 10 minutes, most integrations finish withing 10 seconds. However,
the horizontal line of sight chord is taking longer.

The major reason for slow speed of numerical integration is the presence
of peaks that require a lot of fine resolution function calls by quadGK
to reach to the desired relative tolerance. These peaks are naturally
present in the data and we can not do much about it.

There is bit of commented code in this commit where I tried to use multi
processing using threads but that is returning negative inegrated
electron density and is not really speeding up the performance, so I
have commented it out. Maybe in future this can be done more efficiently
* Most changes were required in GGDUtils for making interpolations
and projection faster.
* The main change in interferometer.jl was to reuse the calculations
as much as possible.
* I also tried calculating the integrated electron density in each
segment of chord (where each segment is either in edge profile or in
core profile) but this was slower than the current method of simply
integrating over the whole chord and using ∈ to find the relevant
function to use for interpolation.
* I have left the other method as commented out code right now. Will
clean up in next commit to store this work as well.
@anchal-physics anchal-physics merged commit 57e864d into dev Oct 10, 2023
1 check passed
@anchal-physics anchal-physics mentioned this pull request Nov 16, 2023
4 tasks
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

Successfully merging this pull request may close these issues.

1 participant