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

Using TPS interpolation to get midplane profile #53

Merged
merged 1 commit into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/supersize_profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using IMASDD: IMASDD
using Interpolations: Interpolations
using GGDUtils:
GGDUtils, get_grid_subset, add_subset_element!, get_subset_boundary,
project_prop_on_subset!, get_subset_centers
project_prop_on_subset!, get_subset_centers, get_TPS_mats
using PolygonOps: PolygonOps
using JSON: JSON

Expand Down Expand Up @@ -61,8 +61,8 @@ function extrapolate_core(edge_rho, edge_quantity, rho_output)
gmid = -abs(gf) / 4.0
rmid = rf / 2.0
rped_enforce = rf - 0.08
gped_enforce = rf + (gmid - gf) / (rmid - rf) * rped_enforce
gped_max = maximum(grad) / 10.0
gped_enforce = gf + (gmid - gf) / (rmid - rf) * rped_enforce
gped_max = maximum(grad) / 2.0
gped_enforce = minimum([abs(gped_enforce), abs(gped_max)]) * sign(gf)

gg = [0, gmid, gped_enforce, gf]
Expand Down Expand Up @@ -172,6 +172,7 @@ function fill_in_extrapolated_core_profile!(
if length(dd.core_profiles.profiles_1d) < nt
resize!(dd.core_profiles.profiles_1d, nt)
end
TPS_mats = get_TPS_mats(grid_ggd, cell_subset_idx)
for it ∈ 1:nt
tags = split(quantity_name, ".")
quantity_str = dd.edge_profiles.ggd[it]
Expand All @@ -184,7 +185,7 @@ function fill_in_extrapolated_core_profile!(
cell_subset,
midplane_subset,
space;
interp_method=:KDTree,
TPS_mats=TPS_mats,
)
# Now quantity is at the outboard midplane

Expand Down