Skip to content

Commit 8754b6d

Browse files
authored
Merge pull request #368 from OpenSourceAWE/agent/348-breaking-rename-the-public-apparent-wind
BREAKING: name the public apparent wind va, va_vec and va_dist, with no deprecation aliases
2 parents abb751e + c2f1fa3 commit 8754b6d

47 files changed

Lines changed: 300 additions & 272 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: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- `stability_derivatives` gives the force and moment coefficients and their derivatives
88
with respect to angle of attack and sideslip, and `trim_angle` the angles of attack at
99
which `CMy` changes sign, with the slope that says whether each trim is stable.
10-
- `apparent_wind(alpha, beta, wind_speed)` gives the body-frame inflow vector at an angle
10+
- `apparent_wind(alpha, beta, va)` gives the body-frame inflow vector at an angle
1111
of attack and sideslip, as `set_va!(body_aero, settings)` sets it.
1212
- `Solver(settings)` and `Solver(n_panels, n_unrefined_sections)` build a solver without
1313
a `BodyAerodynamics`; keyword arguments override the settings.
@@ -30,6 +30,19 @@
3030
- BREAKING: `ObjAdapter.center_to_com!`, `calculate_inertia_tensor` and
3131
`calc_inertia_y_rotation` are removed. Mesh mass properties are computed by
3232
SymbolicAWEModels, which reads the mesh with `read_faces`.
33+
- BREAKING: the apparent wind is `va` for the speed [m/s], `va_vec` for the 3-vector and
34+
`va_dist` / `va_vec_dist` per panel, and the old names error:
35+
- `body_aero.va` becomes `body_aero.va_vec`, and `va=` becomes `va_vec=` in
36+
`BodyAerodynamics(...)` and `reinit!`.
37+
- `Panel.va` becomes `Panel.va_vec`, and `SemiInfiniteFilament.vel_mag` becomes `va`.
38+
- On `VSMSolution`, `_va_dist` becomes `va_vec_dist` and `va_unrefined_dist` becomes
39+
`va_vec_unrefined_dist`.
40+
- `v_a_dist` on `BodyAerodynamics` and `solver.lr` becomes `v_rel_dist`, and
41+
`solver.br.va_norm_dist` becomes `va_dist`.
42+
- The `linearize` keyword `va_idxs` becomes `va_vec_idxs`, the `calculate_results` key
43+
`"va_ref"` becomes `"va_ref_vec"`, and the `plot_polars` / `plot_combined_analysis`
44+
keyword `v_a` becomes `va`.
45+
- The settings keys `condition.wind_speed` and `airfoil.v_app` become `va`.
3346
- Requires Julia 1.12 or 1.13; 1.10 and 1.11 keep resolving v5.1.1.
3447
- The Makie `plot!` methods for a `Panel` or a `BodyAerodynamics` return a
3548
`Vector{Makie.AbstractPlot}` instead of a `Vector{Any}`; for a `BodyAerodynamics`

data/TUDELFT_V3_KITE/vsm_settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# Define the flight state for the aerodynamic analysis
3636
condition:
37-
wind_speed: 2.82 # [m/s] Free stream velocity magnitude
37+
va: 2.82 # [m/s] apparent wind speed
3838
alpha: 7.4 # [°] Angle of attack (pitch angle relative to flow)
3939
beta: 0.0 # [°] Sideslip angle (yaw angle relative to flow)
4040
yaw_rate: 0.0 # [°/s] Yaw rate (for dynamic analysis, 0 for static)

data/TUDELFT_V3_KITE/vsm_settings_coarse.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Define the flight state for the aerodynamic analysis
3838
condition:
39-
wind_speed: 10.0 # [m/s] Free stream velocity magnitude
39+
va: 10.0 # [m/s] apparent wind speed
4040
alpha: 0.0 # [°] Angle of attack (pitch angle relative to flow)
4141
beta: 0.0 # [°] Sideslip angle (yaw angle relative to flow)
4242
yaw_rate: 0.0 # [°/s] Yaw rate (for dynamic analysis, 0 for static)

data/pyramid_model/vsm_settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# Define the flight state for the aerodynamic analysis
3636
condition:
37-
wind_speed: 10.0 # [m/s] Free stream velocity magnitude
37+
va: 10.0 # [m/s] apparent wind speed
3838
alpha: 5.0 # [°] Angle of attack (pitch angle relative to flow)
3939
beta: 0.0 # [°] Sideslip angle (yaw angle relative to flow)
4040
yaw_rate: 0.0 # [°/s] Yaw rate (for dynamic analysis, 0 for static)

docs/src/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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=va,
121+
va=va,
122122
title="Rectangular Wing",
123123
is_show=true,
124124
)

docs/src/settings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ values shown are those defaults, and the docstrings linked below carry the rest.
2929

3030
```yaml
3131
condition:
32-
wind_speed: 10.0 # free-stream velocity magnitude [m/s]
32+
va: 10.0 # apparent wind speed [m/s]
3333
alpha: 5.0 # angle of attack [°]
3434
beta: 0.0 # sideslip angle [°]
3535
yaw_rate: 0.0 # turn rate about the body z axis [°/s]
@@ -67,7 +67,7 @@ wings:
6767
delta_range: [-40, 10, 40] # flap-deflection sweep [°]; null for no flap sweep
6868
# angles off the reference angle a live polar is re-solved at [°]
6969
live_offsets: [-12, -9, -6, -3, 0, 3, 6, 9, 12]
70-
v_app: 25.0 # apparent wind the Reynolds number is taken at [m/s]
70+
va: 25.0 # apparent wind the Reynolds number is taken at [m/s]
7171
chord_ref: 1.0 # reference (maximum panel) chord [m]
7272
table_format: arrow # per-node table format: csv or arrow
7373

@@ -111,4 +111,4 @@ One block answers for both the tables a mesh is sliced into and the live polars
111111
deformed section is re-solved on, so the two cannot be generated at different
112112
transition settings or off different networks. [`alpha_range`](@ref),
113113
[`delta_range`](@ref) and [`reynolds`](@ref) turn the sweeps and the
114-
`density * v_app * chord_ref / mu` reference into what the polar generator takes.
114+
`density * va * chord_ref / mu` reference into what the polar generator takes.

examples/V3_kite.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ labels = [solver_labels;
9494
"WindTunnel Re=5e5"]] #with struts
9595
beta_labels = [solver_labels; ["Wind Tunnel Re=5e5 beta sweep alpha=7.4"]]
9696

97-
wind_speed = settings.condition.wind_speed
97+
va = settings.condition.va
9898
angle_of_attack_deg = settings.condition.alpha
9999
sideslip_deg = settings.condition.beta
100100
yaw_rate = settings.condition.yaw_rate
@@ -111,7 +111,7 @@ PLOT && plot_polars(
111111
angle_type="angle_of_attack",
112112
angle_of_attack=angle_of_attack_deg,
113113
side_slip=sideslip_deg,
114-
v_a=wind_speed,
114+
va=va,
115115
title="$(wing.n_panels)_panels_$(wing.spanwise_distribution)_from_yaml_settings",
116116
save_path=OUTPUT_DIR,
117117
is_save=false || SAVE_ALL,
@@ -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))_va_$(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(va, digits=1))",
145145
save_path=OUTPUT_DIR,
146146
is_save=false || SAVE_ALL,
147147
is_show=true,
@@ -158,7 +158,7 @@ PLOT && plot_polars(
158158
angle_type="side_slip",
159159
angle_of_attack=angle_of_attack_deg,
160160
side_slip=sideslip_deg,
161-
v_a=wind_speed,
161+
va=va,
162162
title="beta sweep",
163163
show_moments=true,
164164
save_path=OUTPUT_DIR,

examples/V3_neuralfoil.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ fig = plot_polars(
109109
"Wind tunnel (Poland 2025)"];
110110
literature_path_list=literature_paths,
111111
angle_range,
112-
v_a=va,
112+
va=va,
113113
title="TU Delft V3 Kite: CFD vs NeuralFoil (Re=$RE)",
114114
is_save=false,
115115
)

examples/billowing.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ solver_flat = Solver(settings; reference_point=[0.422646, 0.0, 9.3667])
8383
solver_bill = Solver(settings; reference_point=[0.422646, 0.0, 9.3667])
8484

8585
# --- Set flight conditions ---
86-
wind_speed = settings.condition.wind_speed
86+
va = settings.condition.va
8787
angle_of_attack_deg = 10.0
8888
sideslip_deg = settings.condition.beta
8989

9090
α0 = deg2rad(angle_of_attack_deg)
9191
β0 = deg2rad(sideslip_deg)
92-
va_vec = apparent_wind(α0, β0, wind_speed)
92+
va_vec = apparent_wind(α0, β0, va)
9393
set_va!(body_aero_flat, va_vec)
9494
set_va!(body_aero_bill, va_vec)
9595

@@ -141,7 +141,7 @@ if PLOT
141141
angle_type="angle_of_attack",
142142
angle_of_attack=angle_of_attack_deg,
143143
side_slip=sideslip_deg,
144-
v_a=wind_speed,
144+
va=va,
145145
title="V3 Kite flat vs billowing $(BILLOWING_PCT)%",
146146
save_path=OUTPUT_DIR,
147147
is_save=false || SAVE_ALL,

examples/linearize_check.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ va_vec_b_0 = apparent_wind(aoa_rad, side_slip, va)
3939
omega_b_0 = zeros(3)
4040
theta_0 = zeros(n_unrefined)
4141

42-
theta_idxs = 1:n_unrefined
43-
va_idxs = (n_unrefined + 1):(n_unrefined + 3)
44-
omega_idxs = (n_unrefined + 4):(n_unrefined + 6)
45-
y0 = [theta_0; va_vec_b_0; omega_b_0]
42+
theta_idxs = 1:n_unrefined
43+
va_vec_idxs = (n_unrefined + 1):(n_unrefined + 3)
44+
omega_idxs = (n_unrefined + 4):(n_unrefined + 6)
45+
y0 = [theta_0; va_vec_b_0; omega_b_0]
4646

4747
@info "Computing FiniteDiff Jacobian …"
4848
t_fd = @elapsed begin
4949
jac_fd, x0_fd, conv_fd = linearize(
5050
solver, body_aero, y0;
51-
theta_idxs, va_idxs, omega_idxs,
51+
theta_idxs, va_vec_idxs, omega_idxs,
5252
aero_coeffs=true,
5353
backend=AutoFiniteDiff(absstep=1e-5, relstep=1e-5),
5454
)
@@ -59,7 +59,7 @@ conv_fd || @warn "FiniteDiff linearize did not converge at operating point"
5959
t_fwd = @elapsed begin
6060
jac_fwd, x0_fwd, conv_fwd = linearize(
6161
solver, body_aero, y0;
62-
theta_idxs, va_idxs, omega_idxs,
62+
theta_idxs, va_vec_idxs, omega_idxs,
6363
aero_coeffs=true,
6464
backend=AutoForwardDiff(),
6565
)
@@ -105,7 +105,7 @@ last_theta = fill(NaN, n_unrefined)
105105

106106
function solve_at!(y)
107107
theta = y[theta_idxs]
108-
va_vec = y[va_idxs]
108+
va_vec = y[va_vec_idxs]
109109
omega = y[omega_idxs]
110110
if !all(theta .== last_theta)
111111
unrefined_deform!(wing, theta, nothing; smooth=false)

0 commit comments

Comments
 (0)