Skip to content

Commit 62de74d

Browse files
committed
Update settings
1 parent 26c5f77 commit 62de74d

3 files changed

Lines changed: 40 additions & 11 deletions

File tree

data/TUDELFT_V3_KITE/vsm_settings_coarse.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ wings:
5050
spanwise_direction: [0.0, 1.0, 0.0] # Unit vector defining wingspan direction
5151
remove_nan: true # Remove NaN values from polar data
5252
use_prior_polar: true # Use previously computed polars if available
53+
billowing_angle: 5 # [deg] Half-angle of circular arc billowing
5354

5455
# Numerical method settings and convergence criteria
5556
solver_settings:

examples/billowing.jl

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ using DelimitedFiles
55

66
PLOT = true
77
USE_TEX = false
8-
BILLOWING_ANGLE = billowing_angle_from_percentage(5) # Half-angle of billowing arc [rad]
98

109
# Data paths (all within this repo)
1110
project_dir = dirname(dirname(pathof(VortexStepMethod)))
@@ -20,6 +19,23 @@ literature_paths = [
2019
joinpath(lit_dir, "python_alpha_sweep.csv"),
2120
joinpath(lit_dir, "windtunnel_alpha_sweep_beta_00_0_Poland_2025_Rey_5e5.csv"),
2221
]
22+
23+
# Load solver settings (coarse: 36 panels, matches 10-section geometry)
24+
settings_data = VortexStepMethod.YAML.load_file(
25+
joinpath(v3_dir, "vsm_settings_coarse.yaml"))
26+
condition_cfg = settings_data["condition"]
27+
solver_cfg = settings_data["solver_settings"]
28+
wing_cfg = settings_data["wings"][1]
29+
n_panels = wing_cfg["n_panels"]
30+
31+
# Read billowing angle from settings (degrees → radians, or from percentage)
32+
if haskey(wing_cfg, "billowing_percentage")
33+
BILLOWING_ANGLE = billowing_angle_from_percentage(
34+
wing_cfg["billowing_percentage"])
35+
else
36+
BILLOWING_ANGLE = deg2rad(get(wing_cfg, "billowing_angle", 0.0))
37+
end
38+
2339
labels = [
2440
"VSM flat",
2541
"VSM billowing $(round(Int, rad2deg(BILLOWING_ANGLE)))°",
@@ -29,13 +45,6 @@ labels = [
2945
"WindTunnel Re=5e5",
3046
]
3147

32-
# Load solver settings (coarse: 36 panels, matches 10-section geometry)
33-
settings_data = VortexStepMethod.YAML.load_file(
34-
joinpath(v3_dir, "vsm_settings_coarse.yaml"))
35-
condition_cfg = settings_data["condition"]
36-
solver_cfg = settings_data["solver_settings"]
37-
n_panels = settings_data["wings"][1]["n_panels"]
38-
3948
# Load coarse geometry (10 structural rib sections)
4049
geom_data = VortexStepMethod.YAML.load_file(
4150
joinpath(v3_dir, "aero_geometry_coarse_discretisation.yaml"))

src/settings.jl

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ Settings for a single wing, used within [`VSMSettings`](@ref).
3434
(default `true`)
3535
- `use_prior_polar`: Reuse prior refined/panel polar mapping on
3636
reinit/refine updates (default `false`)
37-
- `billowing_angle`: Half-angle of circular arc billowing in radians
38-
(default `0.0`; only used with `BILLOWING` distribution)
37+
- `billowing_angle`: Half-angle of circular arc billowing in degrees
38+
(default `0.0`; only used with `BILLOWING` distribution).
39+
Converted to radians internally.
40+
Mutually exclusive with `billowing_percentage`.
41+
- `billowing_percentage`: Percentage by which the chord is shorter than
42+
the minor arc (default `nothing`; converted to `billowing_angle`).
43+
Mutually exclusive with `billowing_angle`.
3944
"""
4045
@with_kw mutable struct WingSettings
4146
name::String = "main_wing"
@@ -173,7 +178,21 @@ function VSMSettings(filename; data_prefix=true)
173178
end
174179
wing.remove_nan = wing_data["remove_nan"]
175180
wing.use_prior_polar = get(wing_data, "use_prior_polar", false)
176-
wing.billowing_angle = get(wing_data, "billowing_angle", 0.0)
181+
182+
has_angle = haskey(wing_data, "billowing_angle")
183+
has_pct = haskey(wing_data, "billowing_percentage")
184+
if has_angle && has_pct
185+
throw(ArgumentError(
186+
"Wing '$(wing.name)': specify either " *
187+
"billowing_angle or billowing_percentage, " *
188+
"not both"))
189+
elseif has_pct
190+
wing.billowing_angle =
191+
billowing_angle_from_percentage(
192+
wing_data["billowing_percentage"])
193+
elseif has_angle
194+
wing.billowing_angle = deg2rad(wing_data["billowing_angle"])
195+
end
177196

178197
push!(vsm_settings.wings, wing)
179198
n_panels += wing.n_panels

0 commit comments

Comments
 (0)