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

Make 2D visualizations for core_profiles #9

Open
eldond opened this issue Sep 20, 2023 · 2 comments
Open

Make 2D visualizations for core_profiles #9

eldond opened this issue Sep 20, 2023 · 2 comments

Comments

@eldond
Copy link
Contributor

eldond commented Sep 20, 2023

The 1D core profile has to be projected to 2D R,Z space. SD4SOLPS.core_profile_2d() can be used for this purpose, although importing it from SD4SOLPS when GGDUtils is imported by SD4SOLPS might be a problem. Maybe the function needs to be moved to GGDUtils? Or maybe this particular plot belongs in SD4SOLPS instead of in GGDUtils?

@anchal-physics
Copy link
Collaborator

I agree, we need to move SD4SOLPS.core_profile_2d() to GGDUtils (along with a helper function check_rho_1d or we can copy this small functionality inside core_profile_2d() to break dependence).

With this reorganzation, we can keep all interpolating codes in GGDUtils.jl/interpolations.jl

With a deeper look, core_profile_2d is really a general interpolation from (r,z) coordinates to rho_n 1d with last line special implementation for a core_profile. The real work of core_profile creation is happening anyway in extrapolate_core function in SD4SOLPS.jl/supersize_profile.jl.

In the end, it would be nice to have an overloaded interp function such that:

get_edge_profile_n_e = interp(dd.edge_profiles.ggd[1].electrons.density, dd.edge_profiles.grid_ggd[1].space[1])

returns a callable function get_edge_profile_n_e (r, z) that uses SOLPS data for getting electron density anywhere.

rz2rho = interp(dd.equilibirum.time_slice[1])

returns a callable function rz2rho(r, z) that returns rho value at a given (r, z) using equilibrium data for a chosen time_slice.

Finally, assuming core_profile data has been filled using SD4SOLPS.extrapolate_core, we can use

get_core_profile_n_e = interp(dd.core_profiles.profiles_1d[1].electrons.density)

returns a callable function get_core_profile_n_e(rho) that provides electron density for given rho.
or

get_core_profile_n_e = interp(dd.core_profiles.profiles_1d[1].electrons.density, rz2rho)

returns a callable function get_core_profile_n_e(r, z) that provides electron density at given (r, z). Note that we can even overload get_core_profile_n_e using this method.
We can also use the same rz2rho for other core_profile .


P.S. Maybe a new issue should be created for this while reserving this space for core_profile visualization.

@eldond
Copy link
Contributor Author

eldond commented Oct 3, 2023

I agree with your design/reorganization logic. Open new issues as needed to keep track of ideas or just implement them at your discretion.

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

No branches or pull requests

2 participants