Skip to content

Commit 2c3e2d3

Browse files
authored
Merge branch 'main' into feat/kite-obj
2 parents d0429f7 + 5c187fc commit 2c3e2d3

File tree

16 files changed

+515
-344
lines changed

16 files changed

+515
-344
lines changed

.github/workflows/CI.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ jobs:
3434
arch: x64
3535
version: 1
3636
steps:
37+
- name: Install matplotlib
38+
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get install -y python3-matplotlib; fi
39+
shell: bash
40+
- name: Install LaTeX
41+
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get -qq install texlive-full texlive-fonts-extra cm-super; fi
42+
shell: bash
3743
- uses: actions/checkout@v4
3844
- uses: julia-actions/setup-julia@v2
3945
with:

CITATION.cff

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
cff-version: 0.1.0
1+
cff-version: 1.2.0
22
message: "If you are using this software, please cite it as shown below."
33
authors:
4-
-
5-
family-names: "Cayon"
4+
- family-names: "Cayon"
65
given-names: "Oriol"
76
orcid: "https://orcid.org/0000-0002-2065-8673"
8-
family-names: "Poland"
7+
- family-names: "Poland"
98
given-names: "Jelle Agatho Wilhelm"
109
orcid: "https://orcid.org/0000-0003-3164-5648"
11-
title: "VortexStepMethod"
10+
title: "VortexStepMethod.jl"
1211
keywords:
13-
- Airborne Wind Energy
14-
version: 0.1.0
12+
- Airborne Wind Energy, AWE, AWES, Vortex step methods
13+
version: 1.0.0
1514
# doi: "11.1111/11111"
1615
# date-released: YYYY-MM-DD
1716
license: MIT
18-
url: "https://github.com/ocayon/Vortex-Step-Method"
17+
url: "https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl"
1918
preferred-citation:
2019
type: article
2120
authors:
@@ -31,4 +30,3 @@ preferred-citation:
3130
issue: 7
3231
volume: 16
3332
year: 2023
34-
article-number: 3061

Project.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,24 @@ version = "0.1.0"
66
[deps]
77
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
88
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
9+
ControlPlots = "23c2ee80-7a9e-4350-b264-8e670f12517c"
910
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
1011
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
1112
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
1213
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1314
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1415
Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
1516
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
16-
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1717
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1818
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1919
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
20+
21+
[compat]
22+
ControlPlots = "0.2.5"
23+
Measures = "0.3"
24+
StaticArrays = "1"
25+
Statistics = "1"
26+
DelimitedFiles = "1"
27+
BenchmarkTools = "1"
28+
LaTeXStrings = "1"
29+
Colors = "0.13"

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
[![Build Status](https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl/actions/workflows/CI.yml?query=branch%3Amain)
1+
[![Build Status](https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl/actions/workflows/CI.yml?query=branch%3Amain) [![Coverage](https://codecov.io/gh/Albatross-Kite-Transport/VortexStepMethod.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/Albatross-Kite-Transport/VortexStepMethod.jl)
22

3-
# Simulation of a Kite using the Vortex Step Method
3+
4+
# Simulation of a 3D airfoil using the Vortex Step Method
45

56
The Vortex Step Method (VSM) is an enhanced lifting line method that improves upon the classic approach by solving the
67
circulation system at the three-quarter chord position, among the most important details. This adjustment allows for
@@ -111,12 +112,12 @@ vel_app = [cos(alpha), 0.0, sin(alpha)] .* Umag
111112
set_va!(wa, (vel_app, 0.0)) # Second parameter is yaw rate
112113
```
113114

114-
Surfplan output file can be converted to an input for the vortex step method with a tool that is in this repo.
115+
Surfplan files can be converted to an input for `VortexStepMethod.jl` using the [SurfplanAdapter](https://github.com/jellepoland/SurfplanAdapter).
115116

116117
## Output
117118
- CL, CD, CS (side force coefficient)
118119
- the spanwise distribution of forces
119-
--> moment coefficients (not yet implemented)
120+
--> moment coefficients (will be implemented in release 1.1)
120121

121122
## Citation
122123
If you use this project in your research, please consider citing it.
@@ -130,4 +131,4 @@ Copyright (c) 2022 Oriol Cayon
130131

131132
Copyright (c) 2024 Oriol Cayon, Jelle Poland, TU Delft
132133

133-
Copyright (c) 2025 Oriol Cayon, Jelle Poland, Bart van de Lint
134+
Copyright (c) 2025 Oriol Cayon, Jelle Poland, Bart van de Lint

docs/geometry.png

180 KB
Loading

examples/rectangular_wing.jl

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using LinearAlgebra
2-
using Plots
2+
using ControlPlots
33
using VortexStepMethod
44

55
# Step 1: Define wing parameters
@@ -55,36 +55,33 @@ println("Projected area = $(round(results_vsm["projected_area"], digits=4)) m²"
5555
# Step 6: Plot geometry
5656
plot_geometry(
5757
wa,
58-
"rectangular_wing_geometry";
58+
"Rectangular_wing_geometry";
5959
data_type=".pdf",
6060
save_path=".",
6161
is_save=false,
6262
is_show=true,
6363
)
64+
nothing
6465

65-
# # Step 7: Plot spanwise distributions
66-
# y_coordinates = [panel.aerodynamic_center[2] for panel in wa.panels]
66+
# Step 7: Plot spanwise distributions
67+
y_coordinates = [panel.aerodynamic_center[2] for panel in wa.panels]
6768

68-
# plot_distribution(
69-
# [y_coordinates, y_coordinates],
70-
# [results_vsm, results_llt],
71-
# ["VSM", "LLT"],
72-
# title="Spanwise Distributions"
73-
# )
74-
75-
# # Step 8: Plot polar curves
76-
# angle_range = range(0, 20, 20)
77-
# plot_polars(
78-
# [llt_solver, vsm_solver],
79-
# [wa, wa],
80-
# ["LLT", "VSM"],
81-
# angle_range=angle_range,
82-
# angle_type="angle_of_attack",
83-
# Umag=Umag,
84-
# title="Rectangular Wing Polars"
85-
# )
69+
plot_distribution(
70+
[y_coordinates, y_coordinates],
71+
[results_vsm, results_llt],
72+
["VSM", "LLT"],
73+
title="Spanwise Distributions"
74+
)
8675

87-
# Save plots if needed
88-
# savefig("geometry.pdf")
89-
# savefig("distributions.pdf")
90-
# savefig("polars.pdf")
76+
# Step 8: Plot polar curves
77+
angle_range = range(0, 20, 20)
78+
plot_polars(
79+
[llt_solver, vsm_solver],
80+
[wa, wa],
81+
["LLT", "VSM"],
82+
angle_range=angle_range,
83+
angle_type="angle_of_attack",
84+
Umag=Umag,
85+
title="Rectangular Wing Polars"
86+
)
87+
nothing

examples/testing_stall_model.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ using VortexStepMethod
33
using CSV
44
using DataFrames
55
using LinearAlgebra
6-
using Plots
76

87
# Find root directory
98
root_dir = dirname(@__DIR__)
572 KB
Binary file not shown.

src/VortexStepMethod.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using Logging
66
using Statistics
77
using Colors
88
using DelimitedFiles
9-
using Plots
9+
using ControlPlots
1010
using Measures
1111
using LaTeXStrings
1212
using NonlinearSolve
@@ -20,6 +20,7 @@ export calculate_results, solve_circulation_distribution
2020
export add_section!, set_va!
2121
export calculate_span, calculate_projected_area
2222
export plot_wing, plot_circulation_distribution, plot_geometry, plot_distribution, plot_polars
23+
export show_plot, save_plot
2324

2425
"""
2526
const MVec3 = MVector{3, Float64}
@@ -33,8 +34,8 @@ const MVec3 = MVector{3, Float64}
3334
3435
Position vector, either a `MVec3` or a `Vector` for use in function signatures.
3536
"""
36-
const PosVector=Union{MVec3, Vector}
37-
const VelVector=Union{MVec3, Vector}
37+
const PosVector=Union{MVec3, Vector, SizedVector{3, Float64, Vector{Float64}}}
38+
const VelVector=Union{MVec3, Vector, SizedVector{3, Float64, Vector{Float64}}}
3839

3940
abstract type AbstractWing end
4041

src/color_palette.jl

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -69,41 +69,37 @@ end
6969
7070
Set the default style for plots using LaTeX.
7171
"""
72-
function set_plot_style()
73-
default(
74-
fontfamily="Computer Modern",
75-
titlefontsize=14,
76-
guidefontsize=12,
77-
tickfontsize=10,
78-
legendfontsize=10,
79-
linewidth=1,
80-
markersize=6,
81-
size=(600, 400),
82-
grid=true,
83-
gridstyle=:dash,
84-
gridcolor=:gray,
85-
gridalpha=0.3
86-
)
87-
88-
# LaTeX settings if using PGFPlotsX backend
89-
if backend() isa PGFPlotsX
90-
pgfplotsx(
91-
tex_output_standalone=true,
92-
pdf_engine="pdflatex",
93-
latex_engine="pdflatex"
94-
)
95-
end
72+
function set_plot_style(titel_size=16)
73+
# plt.style.use('seaborn-whitegrid')
74+
# plt.style.use("seaborn-v0_8-whitegrid")
75+
rcParams = plt.PyDict(plt.matplotlib."rcParams")
76+
rcParams["text.usetex"] = true
77+
rcParams["font.family"] = "serif"
78+
rcParams["font.serif"] = ["Computer Modern Roman"]
79+
rcParams["axes.titlesize"] = titel_size
80+
# rcParams["axes.ymargin"] = 0.1
81+
rcParams["axes.labelsize"] = 12
82+
rcParams["axes.linewidth"] = 1
83+
rcParams["lines.linewidth"] = 1
84+
rcParams["lines.markersize"] = 6
85+
rcParams["xtick.labelsize"] = 10
86+
rcParams["ytick.labelsize"] = 10
87+
rcParams["legend.fontsize"] = 10
88+
rcParams["figure.titlesize"] = 16
89+
rcParams["pgf.texsystem"] = "pdflatex" # Use pdflatex
90+
rcParams["pgf.rcfonts"] = false
91+
rcParams["figure.figsize"] = (10, 6) # Default figure size
9692
end
9793

98-
"""
99-
apply_palette!(p::Plots.Plot, colors::Vector{String})
94+
# """
95+
# apply_palette!(p::Plots.Plot, colors::Vector{String})
10096

101-
Apply the color palette to a plot.
102-
"""
103-
function apply_palette!(p::Plots.Plot, colors::Vector{String})
104-
for (i, series) in enumerate(p.series_list)
105-
color_name = colors[mod1(i, length(colors))]
106-
series.plotattributes[:linecolor] = get_color(color_name)
107-
end
108-
return p
109-
end
97+
# Apply the color palette to a plot.
98+
# """
99+
# function apply_palette!(p::Plots.Plot, colors::Vector{String})
100+
# for (i, series) in enumerate(p.series_list)
101+
# color_name = colors[mod1(i, length(colors))]
102+
# series.plotattributes[:linecolor] = get_color(color_name)
103+
# end
104+
# return p
105+
# end

0 commit comments

Comments
 (0)