Skip to content

Commit ed5db49

Browse files
committed
Merge remote-tracking branch 'origin/allowing_more_polars_than_panels' into wing_groups_unify_wing
2 parents 4bacb8b + 26e1317 commit ed5db49

13 files changed

Lines changed: 414 additions & 224 deletions

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ The software presented here includes a couple of examples: a rectangular wing, a
1313

1414
This package was translated from the Python code version 1.0.0 available at https://github.com/ocayon/Vortex-Step-Method with some extensions as documented in [News.md](https://github.com/OpenSourceAWE/VortexStepMethod.jl/blob/main/NEWS.md).
1515

16+
Example output is shown in the figure below, where the aerodynamic predictions of the TU Delft V3 LEI kite obtained with the Julia and Python implementations of the VSM are compared against CFD simulations and wind tunnel measurements.
17+
18+
![Example output](docs/v3_example_output.png)
19+
1620
## Installation
1721
Install [Julia 1.10](https://ufechner7.github.io/2024/08/09/installing-julia-with-juliaup.html) or later,
1822
if you haven't already. On Linux, make sure that Python3 and Matplotlib are installed:
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
alpha,beta,CL,CD,CS
2-
1.02,0,0.2278625272194466,0.0490919571607997,-0.028991478200473
3-
4.02,0,0.4610104802890269,0.0516566817024969,-0.06116291297791359
4-
7.02,0,0.6748642166054709,0.0643789856608573,-0.09170612013580448
5-
10.02,0,0.8685945393341531,0.0841781647387978,-0.12014981939630065
6-
13.02,0,1.042518829707241,0.1099699784207837,-0.14632493718395287
7-
15.02,0,1.147266423064987,0.1293063892392999,-0.16260131332214534
8-
17.02,0,1.248363457881334,0.1505397278170317,-0.17819835351371366
9-
19.02,0,1.340909392696446,0.172443901716702,-0.19275273990602687
1+
alpha,beta,CL,CD
2+
1.02,0,0.2278625272194466,0.0490919571607997
3+
4.02,0,0.4610104802890269,0.0516566817024969
4+
7.02,0,0.6748642166054709,0.0643789856608573
5+
10.02,0,0.8685945393341531,0.0841781647387978
6+
13.02,0,1.042518829707241,0.1099699784207837
7+
15.02,0,1.147266423064987,0.1293063892392999
8+
17.02,0,1.248363457881334,0.1505397278170317
9+
19.02,0,1.340909392696446,0.172443901716702

docs/v3_example_output.png

407 KB
Loading

examples/V3_kite.jl

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ DEFORM = false
99

1010
project_dir = dirname(dirname(pathof(VortexStepMethod))) # Go up one level from src to project root#
1111
literature_paths = [
12-
joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results","CFD_RANS_Rey_5e5_Poland2025_alpha_sweep_beta_0_NoStruts.csv"),
13-
joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results","CFD_RANS_Rey_10e5_Poland2025_alpha_sweep_beta_0.csv"),
14-
joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results","python_alpha_sweep.csv"),
15-
joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results","windtunnel_alpha_sweep_beta_00_0_Poland_2025_Rey_5e5.csv"),
16-
]
17-
labels= [
18-
"Julia VSM 2D CFD PCHIP NF",
19-
"CFD RANS Re=5e5",
20-
"CFD RANS Re=10e5 (With Struts)",
21-
"Python VSM 2D CFD PCHIP NF Re=5e5",
22-
"Wind Tunnel Re=5e5 (With Struts)"
23-
]
12+
joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results", "CFD_RANS_Rey_5e5_Poland2025_alpha_sweep_beta_0_NoStruts.csv"),
13+
joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results", "CFD_RANS_Rey_10e5_Poland2025_alpha_sweep_beta_0.csv"),
14+
joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results", "python_alpha_sweep.csv"),
15+
joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results", "windtunnel_alpha_sweep_beta_00_0_Poland_2025_Rey_5e5.csv"),
16+
]
17+
labels = [
18+
"VSM Julia Re=5e5",
19+
"CFD Re=5e5",
20+
"CFD Re=10e5", #with struts
21+
"VSM Python Re=5e5",
22+
"WindTunnel Re=5e5" #with struts
23+
]
2424
beta_literature_paths = [
2525
joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results", "windtunnel_beta_sweep_alpha_07_4_Poland_2025_Rey_5e5.csv"),
2626
# joinpath(project_dir, "data", "TUDELFT_V3_KITE", "literature_results", "windtunnel_beta_sweep_alpha_12_5_Poland_2025_Rey_5e5.csv"),
@@ -99,7 +99,7 @@ fig1 = plot_combined_analysis(
9999
solver,
100100
body_aero,
101101
results;
102-
solver_label="VSM",
102+
labels=labels,
103103
literature_path_list=literature_paths,
104104
angle_range=range(-5, 25, length=31),
105105
angle_type="angle_of_attack",
@@ -224,7 +224,7 @@ function plot_polars(
224224
v_a=v_a,
225225
use_solve=use_solve
226226
)
227-
@info "polar sample (solver)" label=lbl first_cl=pd.cl[1] first_cd=pd.cd[1] first_cs=pd.cs[1] first_cmy=pd.cmy[1]
227+
@info "polar sample (solver)" label = lbl first_cl = pd.cl[1] first_cd = pd.cd[1] first_cs = pd.cs[1] first_cmy = pd.cmy[1]
228228
push!(polar_data_list, pd)
229229
re_tag = round(Int, first(pd.rey) * 1e-5)
230230
push!(labels_full, "$(lbl) Re=$(re_tag)e5")
@@ -245,12 +245,12 @@ function plot_polars(
245245
isnothing(angle_idx) && throw(ArgumentError(
246246
"Could not find angle column for angle_type='$angle_type' in literature file: $path"
247247
))
248-
cl_idx = findfirst(x -> occursin("cl", x), header)
249-
cd_idx = findfirst(x -> occursin("cd", x), header)
250-
cs_idx = findfirst(x -> occursin("cs", x), header)
251-
cmx_idx = findfirst(x -> occursin("cmx", x), header)
252-
cmy_idx = findfirst(x -> occursin("cmy", x), header)
253-
cmz_idx = findfirst(x -> occursin("cmz", x), header)
248+
cl_idx = findfirst(x -> occursin("cl", x), header)
249+
cd_idx = findfirst(x -> occursin("cd", x), header)
250+
cs_idx = findfirst(x -> occursin("cs", x), header)
251+
cmx_idx = findfirst(x -> occursin("cmx", x), header)
252+
cmy_idx = findfirst(x -> occursin("cmy", x), header)
253+
cmz_idx = findfirst(x -> occursin("cmz", x), header)
254254

255255
parse_col(col) = begin
256256
vals = Float64[]
@@ -267,12 +267,12 @@ function plot_polars(
267267
end
268268

269269
angle_col = parse_col(data[2:end, angle_idx])
270-
cl_col = parse_col(data[2:end, cl_idx])
271-
cd_col = parse_col(data[2:end, cd_idx])
272-
cs_col = cs_idx === nothing ? zeros(size(data, 1)-1) : parse_col(data[2:end, cs_idx])
273-
cmx_col = cmx_idx === nothing ? fill(NaN, size(data, 1)-1) : parse_col(data[2:end, cmx_idx])
274-
cmy_col = cmy_idx === nothing ? fill(NaN, size(data, 1)-1) : parse_col(data[2:end, cmy_idx])
275-
cmz_col = cmz_idx === nothing ? fill(NaN, size(data, 1)-1) : parse_col(data[2:end, cmz_idx])
270+
cl_col = parse_col(data[2:end, cl_idx])
271+
cd_col = parse_col(data[2:end, cd_idx])
272+
cs_col = cs_idx === nothing ? zeros(size(data, 1) - 1) : parse_col(data[2:end, cs_idx])
273+
cmx_col = cmx_idx === nothing ? fill(NaN, size(data, 1) - 1) : parse_col(data[2:end, cmx_idx])
274+
cmy_col = cmy_idx === nothing ? fill(NaN, size(data, 1) - 1) : parse_col(data[2:end, cmy_idx])
275+
cmz_col = cmz_idx === nothing ? fill(NaN, size(data, 1) - 1) : parse_col(data[2:end, cmz_idx])
276276

277277
push!(polar_data_list, (angle=angle_col, cl=cl_col, cd=cd_col, cs=cs_col, cmx=cmx_col, cmy=cmy_col, cmz=cmz_col, rey=fill(NaN, length(angle_col))))
278278
push!(labels_full, lbl)
@@ -281,17 +281,17 @@ function plot_polars(
281281
fig = Figure(size=fig_size)
282282
Label(fig[0, :], title; fontsize=20, font=:bold)
283283

284-
ax_cl = Axis(fig[1, 1], title="CL vs $angle_type [deg]", xlabel="$angle_type [deg]", ylabel="CL [-]")
285-
ax_cd = Axis(fig[1, 2], title="CD vs $angle_type [deg]", xlabel="$angle_type [deg]", ylabel="CD [-]")
286-
ax_cs = Axis(fig[1, 3], title="CS vs $angle_type [deg]", xlabel="$angle_type [deg]", ylabel="CS [-]")
284+
ax_cl = Axis(fig[1, 1], title="CL vs $angle_type [deg]", xlabel="$angle_type [deg]", ylabel="CL [-]")
285+
ax_cd = Axis(fig[1, 2], title="CD vs $angle_type [deg]", xlabel="$angle_type [deg]", ylabel="CD [-]")
286+
ax_cs = Axis(fig[1, 3], title="CS vs $angle_type [deg]", xlabel="$angle_type [deg]", ylabel="CS [-]")
287287
ax_cmx = Axis(fig[2, 1], title="CMx vs $angle_type [deg]", xlabel="$angle_type [deg]", ylabel="CMx [-]")
288288
ax_cmy = Axis(fig[2, 2], title="CMy vs $angle_type [deg]", xlabel="$angle_type [deg]", ylabel="CMy [-]")
289289
ax_cmz = Axis(fig[2, 3], title="CMz vs $angle_type [deg]", xlabel="$angle_type [deg]", ylabel="CMz [-]")
290290

291291
# Force truly equal columns independent of axis decoration sizes.
292-
colsize!(fig.layout, 1, Relative(1/3))
293-
colsize!(fig.layout, 2, Relative(1/3))
294-
colsize!(fig.layout, 3, Relative(1/3))
292+
colsize!(fig.layout, 1, Relative(1 / 3))
293+
colsize!(fig.layout, 2, Relative(1 / 3))
294+
colsize!(fig.layout, 3, Relative(1 / 3))
295295

296296
# Keep the inner plotting rectangles aligned as well.
297297
for ax in (ax_cl, ax_cd, ax_cs, ax_cmx, ax_cmy, ax_cmz)

0 commit comments

Comments
 (0)