Skip to content
Open
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
9 changes: 9 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
status:
project:
default:
target: auto
threshold: 0%
patch:
default:
target: 70%
32 changes: 21 additions & 11 deletions docs/src/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ calculate_span
calculate_projected_area
```

## Surface-pressure (Cp) tables
The Cp table types and IO live in the core package; the generation of Cp tables
(from XFoil/NeuralFoil) lives in `AirfoilAero`.
## Surface aero (contour + Cp + cf) tables
The per-section surface aero table type and its loader live in the core package; the
generation and CSV/dat writing (from XFoil/NeuralFoil) live in `AirfoilAero`.
```@docs
CpData
CpPolar
read_cp_data
write_cp_data
cp_distribution
delta_cp
SectionAero
section_surface
read_section_aero
```

## Airfoil aerodynamics (AirfoilAero)
Expand Down Expand Up @@ -47,7 +44,10 @@ neuralfoil_aero
generate_aero_matrices
generate_polar_from_coordinates
generate_polar_from_dat
generate_cp_polar
generate_airfoil_aero
generate_section_aero
generate_airfoils
write_section_aero
```

## OBJ mesh conversion (ObjAdapter)
Expand All @@ -59,12 +59,22 @@ CurrentModule = VortexStepMethod.ObjAdapter
```
```@docs
obj_to_yaml
generate_section_polars
write_yaml
perpendicular_sections
plot_airfoils
plot_slices_3d
```

## Surfplan conversion (SurfplanAdapter)
These live in the `SurfplanAdapter` submodule of `VortexStepMethod`, which converts the
output of the (Python) SurfplanAdapter export into the native, VSM-loadable YAML/CSV
geometry format. Load it with `using VortexStepMethod.SurfplanAdapter`.
```@meta
CurrentModule = VortexStepMethod.SurfplanAdapter
```
```@docs
surfplan_to_aero_yaml
```
```@meta
CurrentModule = VortexStepMethod
```
Expand Down
19 changes: 12 additions & 7 deletions docs/src/private_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ update_panel_properties!
build_interps
panel_interp_types
reinit!(wing::AbstractWing)
reinit!(panel::Panel, section_1::Section, section_2::Section, aero_center, control_point, bound_point_1, bound_point_2, x_airf, y_airf, z_airf, delta, vec, spanwise_direction)
rotated_te
calculate_filaments_for_plotting
```
Expand All @@ -54,6 +55,7 @@ unrefined_deform!
deform!
compute_refined_panel_mapping!
compute_refined_section_interpolation!
copy_sections
copy_sections_to_refined!
_apply_refined_section_thetas!
_panel_thetas_to_section_thetas!
Expand All @@ -74,15 +76,15 @@ calculate_new_aero_data
assemble_polar_matrix
load_matrix_polar_data
read_aero_matrix
write_aero_matrix
read_dat
read_node_table
interpolate_matrix_nans!
remove_vector_nans
generate_polar_data
extract_literature_polar_data
parse_literature_column
interpolate_cp_to_refined!
prepare_cp_output!
validate_cp_sections
interpolate_section_aero_to_refined!
validate_section_aero
```

### Examples
Expand Down Expand Up @@ -115,9 +117,7 @@ flood_outside
trace_level_set
largest_linking_gap
resample_arc
resample_x
smooth_turning!
split_surfaces
```

### NeuralFoil network
Expand All @@ -143,7 +143,11 @@ read_dat_coordinates
write_dat
write_polar_csv
write_polar_matrix_csv
fill_slice_nans!
write_aero_matrix
write_node_table
flat_plate_cf
neuralfoil_contour_solution
fill_node_nans!
```

## OBJ mesh conversion (ObjAdapter)
Expand Down Expand Up @@ -183,6 +187,7 @@ set_axes_equal_makie!
map_airfoil_3d
fitted_airfoil_3d
generated_slices
airfoil_skin_geometry
Makie.plot!(ax, panel::VortexStepMethod.Panel)
Makie.plot!(ax, body::VortexStepMethod.BodyAerodynamics)
Makie.plot!(body::VortexStepMethod.BodyAerodynamics)
Expand Down
42 changes: 13 additions & 29 deletions examples/V3_neuralfoil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ fig_slices_3d = plot_slices_3d(OBJ_PATH; n_slices=N_SLICES, rotation=ROTATION,
n_bins=N_BINS, wrap_method=WRAP)
GLMakie.save("V3_slices_3d.png", fig_slices_3d)

# Generate per-slice NeuralFoil polars from the shrink-wrapped sections. XFoil is also
# supported (pass `solver=XFoilSolver(...)`) but its panel method does not converge on
# the V3's thin, tube-nosed membrane airfoils, so NeuralFoil is used here.
println("Generating NeuralFoil polars from OBJ mesh...")
generate_section_polars(OBJ_PATH, POLARS_DIR; n_slices=N_SLICES, Re=RE,
rotation=ROTATION, n_bins=N_BINS, wrap_method=WRAP,
solver=NF_SOLVER, delta_range=DELTA_RANGE, verbose=true)
# `obj_to_yaml` generates the whole aero geometry from the OBJ: shape (.dat), polar CSV,
# and Cp/cf tables plus a geometry.yaml. XFoil (`aero_solver=XFoilSolver(...)`) also works
# but doesn't converge on the V3's concave slices (the sharp corner behind the leading
# edge), so NeuralFoil is used here.
println("Generating V3 aero geometry from OBJ (obj_to_yaml)...")
gen_dir = joinpath("data", "TUDELFT_V3_KITE", "generated_neuralfoil")
nf_yaml = obj_to_yaml(OBJ_PATH, gen_dir; n_sections=N_SLICES, Re=RE,
rotation=ROTATION, wrap_method=WRAP, aero_solver=NF_SOLVER, verbose=true)

# Flight conditions
v_a = 10.0
Expand All @@ -82,29 +83,12 @@ body_cfd = BodyAerodynamics([wing_cfd])
VortexStepMethod.reinit!(body_cfd)
solver_cfd = Solver(body_cfd, settings_cfd)

# Build a wing whose every airfoil points at a generated POLAR_VECTORS CSV under
# `polars_subdir`. Repoints a copy of the awesIO geometry and loads it as a normal
# uniform POLAR_VECTORS wing — no manual section surgery needed.
using YAML
yaml_path = joinpath("data", "TUDELFT_V3_KITE", "aero_geometry.yaml")
function build_polar_wing(polars_subdir, out_name)
geom = YAML.load_file(yaml_path)
for (i, airfoil) in enumerate(geom["wing_airfoils"]["data"])
airfoil[2] = "polars"
airfoil[3] = Dict("csv_file_path" => "$polars_subdir/$i.csv")
end
out_yaml = joinpath("data", "TUDELFT_V3_KITE", out_name)
write_yaml(out_yaml, geom)
wing = Wing(out_yaml; n_panels=50, spanwise_distribution=LINEAR)
refine!(wing)
body = BodyAerodynamics([wing])
VortexStepMethod.reinit!(body)
s = Solver(body, settings_cfd)
return s, body
end

println("Creating wing with NeuralFoil polars...")
solver_nf, body_nf = build_polar_wing("polars_neuralfoil", "aero_geometry_neuralfoil.yaml")
wing_nf = Wing(nf_yaml; n_panels=50, spanwise_distribution=LINEAR)
refine!(wing_nf)
body_nf = BodyAerodynamics([wing_nf])
VortexStepMethod.reinit!(body_nf)
solver_nf = Solver(body_nf, settings_cfd)

# Compare CFD-polar and NeuralFoil-polar wings against published references
# (Poland 2025 RANS CFD and wind tunnel). `plot_polars` sweeps each solver over the
Expand Down
Loading
Loading