Skip to content

Commit fa5c3d6

Browse files
authored
Merge branch 'main' into agent/275-section-slicing-spreads-stations-by-lead
2 parents 1fe72b9 + 7724c0d commit fa5c3d6

46 files changed

Lines changed: 997 additions & 695 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
## Unreleased
44

5+
### Added
6+
7+
- `set_va!(body_aero, va_vec, omega; reference_point)` turns the body about
8+
`reference_point` [m] instead of the origin. The point is stored on
9+
`BodyAerodynamics`, starts at the origin, and is kept by later `set_va!`, `reinit!`
10+
and `linearize` calls until it is given again.
11+
- Spanwise-flow viscous drag correction (Gaunaa et al. 2024,
12+
doi:10.1088/1742-6596/2767/2/022068): each section gets a drag increment and a force
13+
along its span from the flow across it, in `solve!`, `solve` and `linearize`. Opt-in
14+
via `is_with_viscous_drag_correction` (default `false`) on the solver settings.
15+
- `plot_section_polars(body_aero; panels, alphas, delta)` draws cl, cd and cm against α
16+
per panel through `calculate_cl`/`calculate_cd`/`calculate_cm`, for every aero model
17+
and at flap deflection `delta`, in one figure instead of one coefficient per call.
18+
- `linearize` takes a `BodyAerodynamics` with more than one wing; `theta_idxs` and
19+
`delta_idxs` then run over the unrefined sections of all wings in order.
20+
521
### Changed
622

723
- Requires Julia 1.12 or 1.13; 1.10 and 1.11 keep resolving v5.1.1.
@@ -18,8 +34,15 @@
1834

1935
### Fixed
2036

37+
- `set_va!(body_aero, settings)` applies `condition.yaw_rate` as a turn rate about the
38+
body z axis; it was read from the settings file and ignored.
2139
- The `VSMSolution` docstring gives `lift_dist`, `drag_dist` and `panel_moment_dist` in
2240
the per-unit-span units they hold, [N/m] and [Nm/m], instead of [N] and [Nm].
41+
- Inside its vortex core, `velocity_3D_trailing_vortex!` induces an azimuthal velocity
42+
instead of a radial one. Only points within the millimetre-scale Oseen core of a
43+
panel's chordwise trailing segment were affected.
44+
- With `artificial_damping` on, an iteration whose circulation is already smooth no longer
45+
re-applies the previous iteration's damping correction.
2346

2447
## VortexStepMethod v5.1.1 2026-09-12
2548

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Three kinds of input data is needed:
8989
- kite wing: model of polars included, n sections to define
9090

9191
- The airflow and turn rate:
92-
- `v_app` vector and `omega` (turn rate) vector in Kite Body (KB) reference frame
92+
- `va_vec` vector and `omega` (turn rate) vector in Kite Body (KB) reference frame
9393

9494
- The configuration:
9595
- how many panels
@@ -106,7 +106,7 @@ A whole run — the flight condition, each wing and the solver — is configured
106106
n_panels = 20 # Number of panels
107107
span = 20.0 # Wing span [m]
108108
chord = 1.0 # Chord length [m]
109-
v_a = 20.0 # Magnitude of inflow velocity [m/s]
109+
va = 20.0 # Magnitude of inflow velocity [m/s]
110110
density = 1.225 # Air density [kg/m³]
111111
alpha_deg = 30.0 # Angle of attack [degrees]
112112
alpha = deg2rad(alpha_deg)
@@ -131,8 +131,8 @@ refine!(wing)
131131
body_aero = BodyAerodynamics([wing])
132132

133133
# Set inflow conditions
134-
vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
135-
set_va!(body_aero, vel_app)
134+
va_vec = [cos(alpha), 0.0, sin(alpha)] .* va
135+
set_va!(body_aero, va_vec)
136136
```
137137
It is possible to import the wing geometry using an `.obj` file as shown in the example `ram_air_kite.jl`. During the import the polars are calculated automatically using XFoil. This approach is valid for rigid wings and ram-air kites, but not for leading edge inflatable kites.
138138

docs/src/examples.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ julia> using VortexStepMethod
3535
julia> n_panels = 20 # Number of panels
3636
julia> span = 20.0 # Wing span [m]
3737
julia> chord = 1.0 # Chord length [m]
38-
julia> v_a = 20.0 # Magnitude of inflow velocity [m/s]
38+
julia> va = 20.0 # Magnitude of inflow velocity [m/s]
3939
julia> alpha_deg = 30.0 # Angle of attack [degrees]
4040
julia> alpha = deg2rad(alpha_deg)
4141
```
@@ -77,8 +77,8 @@ multiple wings.
7777
###### Set inflow conditions
7878

7979
```julia
80-
julia> vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
81-
julia> set_va!(body_aero, vel_app, [0, 0, 0.1])
80+
julia> va_vec = [cos(alpha), 0.0, sin(alpha)] .* va
81+
julia> set_va!(body_aero, va_vec, [0, 0, 0.1])
8282
```
8383

8484
#### Step 5: Initialize solvers for both LLT and VSM methods
@@ -118,7 +118,7 @@ julia> plot_combined_analysis(
118118
solver_label=["LLT", "VSM"],
119119
angle_range=angle_range,
120120
angle_type="angle_of_attack",
121-
v_a=v_a,
121+
v_a=va,
122122
title="Rectangular Wing",
123123
is_show=true,
124124
)

docs/src/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Three kinds of input data is needed:
9494
- kite wing: model of polars included, n sections to define
9595

9696
- The airflow and turn rate:
97-
- `v_app` vector and `omega` (turn rate) vector in Kite Body (KB) reference frame
97+
- `va_vec` vector and `omega` (turn rate) vector in Kite Body (KB) reference frame
9898

9999
- The configuration:
100100
- how many panels
@@ -112,7 +112,7 @@ A whole run — the flight condition, each wing and the solver — is configured
112112
n_panels = 20 # Number of panels
113113
span = 20.0 # Wing span [m]
114114
chord = 1.0 # Chord length [m]
115-
v_a = 20.0 # Magnitude of inflow velocity [m/s]
115+
va = 20.0 # Magnitude of inflow velocity [m/s]
116116
density = 1.225 # Air density [kg/m³]
117117
alpha_deg = 30.0 # Angle of attack [degrees]
118118
alpha = deg2rad(alpha_deg)
@@ -137,8 +137,8 @@ refine!(wing)
137137
body_aero = BodyAerodynamics([wing])
138138

139139
# Set inflow conditions
140-
vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
141-
set_va!(body_aero, vel_app)
140+
va_vec = [cos(alpha), 0.0, sin(alpha)] .* va
141+
set_va!(body_aero, va_vec)
142142
```
143143

144144
It is possible to import the wing geometry using an `.obj` file as shown in the example `ram_air_kite.jl`. During the import the polars are calculated automatically, using NeuralFoil by default or XFoil as a viscous cross-check. This approach is valid for rigid wings and ram-air kites, but not for leading edge inflatable kites. See [From CAD mesh to aerodynamic model](@ref) for the full pipeline.

docs/src/private_functions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ effective_alpha
5252
panel_inflow
5353
dynamic_pressure
5454
flow_curvature_cm
55+
spanwise_flow_drag
5556
panel_force_directions
5657
panel_moment
5758
panel_couple_force
@@ -62,6 +63,7 @@ panel_loads
6263
```@docs
6364
velocity_3D_bound_vortex!
6465
velocity_3D_trailing_vortex!
66+
velocity_3D_vortex_segment!
6567
velocity_3D_trailing_vortex_semiinfinite!
6668
calculate_velocity_induced_bound_2D!
6769
calculate_velocity_induced_single_ring_semiinfinite!
@@ -82,6 +84,7 @@ calculate_filaments_for_plotting
8284
### Mesh refinement and billowing
8385
```@docs
8486
unrefined_deform!
87+
unrefined_section_range
8588
deform!
8689
compute_refined_panel_mapping!
8790
compute_refined_section_interpolation!
@@ -273,6 +276,7 @@ panel_contour
273276
panel_normal
274277
plate_hinge_local
275278
panel_plate_geometry
279+
panel_polar_curves
276280
PLATE_FACES
277281
Makie.plot!(ax, panel::VortexStepMethod.Panel)
278282
Makie.plot!(ax, body::VortexStepMethod.BodyAerodynamics)

docs/src/reference_frames.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
### Introduction
44
Reference frames are needed for following purposes:
55
- for creating a CAD model of the wing (or the wings)
6-
- for defining the apparent wind speed vector $v_a$
6+
- for defining the apparent wind speed vector `va_vec`
77
- for calculating the lift and drag and side force coefficients
88
- for calculating the resulting forces and moments
99

@@ -30,6 +30,6 @@ The turn rates $\mathrm{omega} = [\mathrm{omega_x}, \mathrm{omega_y} ,\mathrm{om
3030

3131
## Input and output
3232
- when running a simulation, the turnrate of the kite must be provided on each time step
33-
- the apparent wind speed vector `v_a` is defined in the **KB** reference frame
33+
- the apparent wind speed vector `va_vec` is defined in the **KB** reference frame
3434
- the resulting forces are defined in the **KB** reference frame
3535
- the **CL**, **CD**, **CS** and the resulting moments and moment coefficients are defined in the **KB** reference frame

docs/src/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ condition:
3232
wind_speed: 10.0 # free-stream velocity magnitude [m/s]
3333
alpha: 5.0 # angle of attack [°]
3434
beta: 0.0 # sideslip angle [°]
35-
yaw_rate: 0.0 # yaw rate [°/s]
35+
yaw_rate: 0.0 # turn rate about the body z axis [°/s]
3636

3737
wings:
3838
- name: main_wing # label the wing carries into plots and output

examples/V3_kite.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ PLOT && plot_distribution(
141141
[body_y_coordinates],
142142
[results],
143143
["VSM"];
144-
title="CAD_spanwise_distributions_alpha_$(round(angle_of_attack_deg, digits=1))_delta_$(round(sideslip_deg, digits=1))_yaw_$(round(yaw_rate, digits=1))_v_a_$(round(wind_speed, digits=1))",
144+
title="CAD_spanwise_distributions_alpha_$(round(angle_of_attack_deg, digits=1))_delta_$(round(sideslip_deg, digits=1))_yaw_$(round(yaw_rate, digits=1))_va_$(round(wind_speed, digits=1))",
145145
save_path=OUTPUT_DIR,
146146
is_save=false || SAVE_ALL,
147147
is_show=true,

examples/V3_neuralfoil.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ nf_yaml = obj_to_yaml(OBJ_PATH, gen_dir; n_sections=N_SLICES, Re=RE,
6969
rotation=ROTATION, wrap_method=WRAP, aero_solver=NF_SOLVER, verbose=true)
7070

7171
# Flight conditions
72-
v_a = 10.0
72+
va = 10.0
7373
angle_range = range(-5, 25, length=31)
7474

7575
# Load settings and create wing with CFD polars
@@ -105,7 +105,7 @@ fig = plot_polars(
105105
"Wind tunnel (Poland 2025)"];
106106
literature_path_list=literature_paths,
107107
angle_range,
108-
v_a,
108+
v_a=va,
109109
title="TU Delft V3 Kite: CFD vs NeuralFoil (Re=$RE)",
110110
is_save=false,
111111
)

examples/bench.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using VortexStepMethod: solve_base!
1212
n_panels = 20 # Number of panels
1313
span = 20.0 # Wing span [m]
1414
chord = 1.0 # Chord length [m]
15-
v_a = 20.0 # Magnitude of inflow velocity [m/s]
15+
va = 20.0 # Magnitude of inflow velocity [m/s]
1616
density = 1.225 # Air density [kg/m³]
1717
alpha_deg = 30.0 # Angle of attack [degrees]
1818
alpha = deg2rad(alpha_deg)
@@ -37,8 +37,8 @@ refine!(wing)
3737
body_aero = BodyAerodynamics([wing])
3838

3939
# Set inflow conditions
40-
vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
41-
set_va!(body_aero, vel_app)
40+
va_vec = [cos(alpha), 0.0, sin(alpha)] .* va
41+
set_va!(body_aero, va_vec)
4242

4343
# Step 4: Initialize solvers for both LLT and VSM methods
4444
llt_solver = Solver(body_aero; aerodynamic_model_type=LLT)
@@ -73,17 +73,17 @@ vsm_solver = Solver(
7373
)
7474

7575
# Setting velocity conditions
76-
v_a = 15.0
76+
va = 15.0
7777
aoa = 15.0
7878
side_slip = 0.0
7979
yaw_rate = 0.0
8080
aoa_rad = deg2rad(aoa)
81-
vel_app = [
81+
va_vec = [
8282
cos(aoa_rad) * cos(side_slip),
8383
sin(side_slip),
8484
sin(aoa_rad)
85-
] * v_a
86-
set_va!(body_aero, vel_app)
85+
] * va
86+
set_va!(body_aero, va_vec)
8787

8888
# Solving
8989
solve_base!(vsm_solver, body_aero, nothing)

0 commit comments

Comments
 (0)