Closed fsciortino closed 2 years ago
Now I can run the code, but when I do it, in a few timesteps the density diverges and it is infinite. It is working for you? I have use the default setting in IMPRAD, default analytical profiles, default source (constant in time).
@fsciortino still, there is some bug in recycling when I set R = 0. Any value of R > 0 works. Do you know where could be this bug?
Another issue, if I need to vary a source during the inference, I will have to call the function 'setup_kin_profs_depts' or at least 'get_radial_source' in every iteration.
@odstrcilt I see the issue. I'm working on it. I'm going to clean up the particle conservation routine first, eliminate redundant use of xarray, and then move on from there.
Another issue, if I need to vary a source during the inference, I will have to call the function 'setup_kin_profs_depts' or at least 'get_radial_source' in every iteration.
@odstrcilt regarding this, I don't think that we can do much to improve this. Depending how what kind of source option you're interested in, I would recommend calling get_radial_source
at every iteration, or just changing self.src_core
via direct creation/interpolation of whatever source profile you have.
@fsciortino I have solved the issue with varying source in the IMPRAD GUI. If the source is 1D function, it will call source_utils.get_source_time_history in each iteration and multiply it with source_rad_prof in aurora class to get src_core. And for any source (including 2D), there is a new variable imp+'_source_scale', which will just scale asim.src_core by some number.
@fsciortino new issue, if the kinetics profiles are changing in time, particle conservation is not working. The recycling source will have to vary in time as well.
@odstrcilt OK, I updated rcl_rad_prof
to be time-dependent. I also merged some things from master into this branch -- I'm kind of worried that there may be something wrong in atomic.interp_atom_prof
at this point... Let me know how it looks to you.
@fsciortino I have found two issues with interpolation. If the grid was too fine, it has not detected the non-equal spacing and it was crashed during extrapolation. But else it works fine, I have compared it with RectBivariateSpline and the results are nearly exactly the same.
Merging since we seem to have resolved all the raised issues. Glad that we got this done, @odstrcilt !
This PR collects works to improve the way sources are handled in the Aurora forward model of particle transport.
Main objectives:
This is work in progress (WIP).