Skip to content

obj_to_yaml shrink-wraps twice, degenerating the Kulfan fit for a fifth of the SK100 sections #293

Description

@1-Bort-1

obj_to_yaml wraps each slice and then hands the wrapped contour to generate_airfoils, which wraps it a second time. On the SK100 the second wrap degenerates the Kulfan fit for about ten of the 45 sections, writing .dat files whose coordinates are at 1e4 scale instead of 0..1.

The path, on v5.0.0:

  • src/obj_adapter/obj_to_yaml.jl:221x_fit, y_fit = shrink_wrap(sec.x_airfoil, sec.y_airfoil, wrap_method), so x_fit/y_fit are already wrapped, with the caller's configured wrap_method.
  • src/obj_adapter/obj_to_yaml.jl:237 passes those as x_fit/y_fit into generate_airfoils.
  • src/airfoil_aero/geometry_gen.jl:45generate_airfoil_aero(aero_solver, af.x_fit, af.y_fit; ...), which is the (solver, x::Vector, y::Vector) method.
  • src/airfoil_aero/section_aero_gen.jl:59 — that method's whole job is xw, yw = shrink_wrap(x, y, ShrinkWrap()) before fitting. Second wrap, and with a default ShrinkWrap() rather than the wrap_method the caller chose, so a configured wrap is silently discarded either way.

The (x::Vector, y::Vector) method is documented as the convenience that wraps a raw slice ("wrap the cloud with shrink_wrap first when fitting a raw slice"), so the defect is the call site handing it something already wrapped rather than the method itself.

How it shows up

Downstream in BeyondTheSim.jl every coupled model build fails on the tables this writes:

AeroPressure wing 1: max surface-node→point distance is 35776.8× the local chord

with the corrupt sections identifiable directly from the generated contours — airfoils/9.dat, 10.dat, 16.dat, 27.dat, 37.dat and others carry coordinates around 1e4 where the clean ones are 0..1.

Reproduced in isolation

Calling generate_airfoils on single SK100 sections with the double wrap corrupts sections {17, 21, 23, 25}. Feeding the same sections' raw contour instead — one wrap, inside generate_airfoil_aero — gives clean, consistent output for all 45, with cp/cf node counts of 239 throughout. Solver settings held fixed across both (NeuralFoil, Re=1.015e7, alpha -15:3:90°, delta ±40°, n_crit=4, xtr=0.05, table_format=:arrow).

What I would do

Pass the raw sec.x_airfoil/sec.y_airfoil to generate_airfoils and let generate_airfoil_aero do the single wrap, or keep the pre-wrapped contour and fit it through the KulfanParameters method that does not wrap. Whichever way, the configured wrap_method should be the one that runs.

Found while getting the SK100 crosswind sweep to build in 1-Bart-1/BeyondTheSim.jl#7; the tables are gitignored there, so nothing depends on the local workaround.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions