Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Unreleased

### Fixed

- `plot_slices_3d` on a generated output directory draws the deflected contour for
every deflection that was generated, not just positive whole degrees. It built its
own `_d<degrees>.dat` filename tag instead of the `delta_suffix` one the files were
written under, which spells a minus sign `m` and a decimal point `p`, so
`delta=-10` or `delta=2.5` found no `.dat` and drew nothing.

## VortexStepMethod v5.1.0 2026-09-11

### Added
Expand Down
13 changes: 5 additions & 8 deletions ext/VortexStepMethodMakieExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1601,8 +1601,7 @@ their written `.dat` airfoils — raw slice, wrap, and the `delta`-degree deform
when it was generated — assembled for
[`plot_slices_3d`](@ref VortexStepMethod.ObjAdapter.plot_slices_3d). Nothing is
re-sliced or re-wrapped; only the Kulfan fits of the stored coordinates are
recomputed (via
`fit_pts`), exactly as the polar pipeline fits them.
recomputed (via `fit_pts`), exactly as the polar pipeline fits them.
"""
function generated_slices(out_dir, delta, fit_pts)
geom = VortexStepMethod.YAML.load_file(joinpath(out_dir, "geometry.yaml"))
Expand All @@ -1611,8 +1610,7 @@ function generated_slices(out_dir, delta, fit_pts)
les = [Float64.(r[2:4]) for r in rows]
tes = [Float64.(r[5:7]) for r in rows]
n = length(rows)
deg = round(float(delta); digits=1)
tag = "_d" * (deg == round(deg) ? string(Int(deg)) : string(deg)) * ".dat"
tag = "_$(AirfoilAero.delta_suffix(deg2rad(delta))).dat"
skipped_deltas = String[]
slices = map(1:n) do i
id = rows[i][1]
Expand All @@ -1630,7 +1628,7 @@ function generated_slices(out_dir, delta, fit_pts)
xd, yd = found ? AirfoilAero.read_dat_coordinates(dpath) :
(Float64[], Float64[])
if isempty(xd)
push!(skipped_deltas, basename(dpath) *
push!(skipped_deltas, relpath(dpath, out_dir) *
(found ? ": no finite coordinates" : ": no such file"))
else
def3d = map_airfoil_3d(les[i], tes[i], tangent, xd, yd)
Expand All @@ -1642,9 +1640,8 @@ function generated_slices(out_dir, delta, fit_pts)
wrap3d=map_airfoil_3d(les[i], tes[i], tangent, xw, yw), def3d, d2)
end
isempty(skipped_deltas) ||
@warn "Skipping the delta=$(delta)° overlay for" *
" $(join(skipped_deltas, ", ")); generated deflections are named" *
" airfoils/<i>_d<degrees>.dat, and a blank one is a deflection the 2D" *
@warn "Skipping the delta=$(delta)° overlay in $out_dir for" *
" $(join(skipped_deltas, ", ")); a blank one is a deflection the 2D" *
" solver converged at no angle."
return slices, reduce(hcat, les), reduce(hcat, tes)
end
Expand Down
12 changes: 12 additions & 0 deletions test/plotting/test_plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,18 @@ end
@test_nowarn Makie.plot!(ax_lw, plain_body; border_linewidth=3.0)
end

@testset "generated_slices reads the deflected .dat under its generated name" begin
gen_dir, _ = ram_air_matrix_dir(; n_sections=4,
alpha_range=deg2rad.(-1:1.0:1), delta_range=deg2rad.(-1:1.0:1))
fit_pts(x, y) = Point2f.(x, y)

for delta in (-1.0, 1.0)
slices, _, _ = @test_nowarn makie_ext.generated_slices(gen_dir, delta, fit_pts)
@test all(s -> !isempty(s.d2.def), slices)
@test all(s -> s.def3d !== nothing, slices)
end
end

@testset "Audit slices (Makie)" begin
# An all-NaN deflected .dat reads as empty; here a header-only file stands in.
gen_dir, _ = ram_air_matrix_dir(; n_sections=4,
Expand Down
Loading