Skip to content

Commit

Permalink
Made same changes for langmuir probes as well.
Browse files Browse the repository at this point in the history
add_langmuir_probes! and compute_langmuir_probes now take an additional
argument n_e_gsi to allow changing teh grid subset index to refer to
for edge profiles data in case B2.5 grid has been moved.
  • Loading branch information
anchal-physics committed Mar 20, 2024
1 parent ed94510 commit 03971a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/langmuir_probes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ function compute_langmuir_probes(
ids::IMASDD.dd;
ne_noise::Union{Noise, Nothing}=nothing,
te_noise::Union{Noise, Nothing}=nothing,
n_e_gsi::Int=5,
)
epggd = ids.edge_profiles.ggd
nt = length(epggd)
fix_ep_grid_ggd_idx = length(ids.edge_profiles.grid_ggd) == 1
ep_grid_ggd = ids.edge_profiles.grid_ggd[1]
# Using -5 for now to use the SOLPS edge profile grid only
TPS_mats_all_cells = get_TPS_mats(ep_grid_ggd, -5)
TPS_mats_all_cells = get_TPS_mats(ep_grid_ggd, n_e_gsi)
# Get the edge profile interpolation functions
ep_n_e = interp(epggd[1].electrons.density, TPS_mats_all_cells, 5)
ep_t_e = interp(epggd[1].electrons.temperature, TPS_mats_all_cells, 5)
ep_n_e = interp(epggd[1].electrons.density, TPS_mats_all_cells, n_e_gsi)
ep_t_e = interp(epggd[1].electrons.temperature, TPS_mats_all_cells, n_e_gsi)

# Initialize langmuir probe data
init_data!.(ids.langmuir_probes.embedded, nt)
Expand All @@ -46,10 +46,11 @@ function compute_langmuir_probes(
if !fix_ep_grid_ggd_idx && ii > 1
# If grid_ggd is evolving with time, update boundaries
ep_grid_ggd = ids.edge_profiles.grid_ggd[ii]
TPS_mats_all_cells = get_TPS_mats(ep_grid_ggd, -5)
TPS_mats_all_cells = get_TPS_mats(ep_grid_ggd, n_e_gsi)
# Update the edge profile interpolation functions
ep_n_e = interp(epggd[ii].electrons.density, TPS_mats_all_cells, 5)
ep_t_e = interp(epggd[ii].electrons.temperature, TPS_mats_all_cells, 5)
ep_n_e = interp(epggd[ii].electrons.density, TPS_mats_all_cells, n_e_gsi)
ep_t_e =
interp(epggd[ii].electrons.temperature, TPS_mats_all_cells, n_e_gsi)
end

for emb_lp ids.langmuir_probes.embedded
Expand Down
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ if args["langmuir_probes"]
add_langmuir_probes!(
"$(@__DIR__)/../src/default_langmuir_probes.json",
ids;
ne_noise,
ne_noise=ne_noise,
n_e_gsi=-5,
)
# Just checking if the function runs through for now
for lp ids.langmuir_probes.embedded
Expand Down

0 comments on commit 03971a4

Please sign in to comment.