Skip to content

Commit 9af1171

Browse files
committed
Merge branch 'main' into feat/xfoil
2 parents a353ebf + e7dde34 commit 9af1171

20 files changed

+499
-237
lines changed

.github/workflows/CI.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,26 @@ jobs:
6262
with:
6363
files: lcov.info
6464
token: ${{ secrets.CODECOV_TOKEN }}
65-
65+
docs:
66+
name: Documentation
67+
runs-on: ubuntu-latest
68+
timeout-minutes: 40
69+
steps:
70+
- name: Install matplotlib
71+
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get install -y python3-matplotlib; fi
72+
shell: bash
73+
- uses: actions/checkout@v4
74+
- uses: julia-actions/setup-julia@v2
75+
- uses: julia-actions/cache@v2
76+
- uses: julia-actions/julia-buildpkg@v1
77+
- uses: julia-actions/julia-docdeploy@v1
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
81+
- run: |
82+
julia --project=docs -e '
83+
using Documenter: DocMeta, doctest
84+
using VortexStepMethod
85+
DocMeta.setdocmeta!(VortexStepMethod, :DocTestSetup, :(using VortexStepMethod); recursive=true)
86+
doctest(VortexStepMethod)'
87+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ Manifest.toml
33
venv
44
results/TUDELFT_V3_LEI_KITE/polars/$C_L$ vs $C_D$.pdf
55
*.bin
6+
results/TUDELFT_V3_LEI_KITE/polars/tutorial_testing_stall_model_n_panels_54_distribution_split_provided.pdf
7+
docs/build/
68

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ This project is based on version 1.0 of the Python project [Vortex-Step-Method](
33

44
## Noteworthy Differences
55
- implemented in Julia, therefore about 20 times faster
6-
- an importer for `.obj` was added (see: #10)
6+
- an importer for `.obj` wing geometry files was added (see: [#10](https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl/issues/10))
7+
- a ram-air kite example was added
8+
- `Umag` was replaced with `v_a` as variable name for the norm of the apparent wind speed

Project.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
1919
SharedArrays = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
2020
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2121
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
22-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2322
Timers = "21f18d07-b854-4dab-86f0-c15a3821819a"
2423
Xfoil = "19641d66-a62d-11e8-2441-8f57a969a9c4"
2524

@@ -34,3 +33,10 @@ Measures = "0.3"
3433
NonlinearSolve = "4"
3534
StaticArrays = "1"
3635
Statistics = "1"
36+
37+
[extras]
38+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
39+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
40+
41+
[targets]
42+
test = ["Test", "Documenter"]

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33

44
# Simulation of a 3D airfoil using the Vortex Step Method
55

6-
The Vortex Step Method (VSM) is an enhanced lifting line method that improves upon the classic approach by solving the
7-
circulation system at the three-quarter chord position, among the most important details. This adjustment allows for
8-
more accurate calculations of lift and drag forces, particularly addressing the shortcomings in induced drag prediction.
6+
The Vortex Step Method (VSM) is an enhanced lifting line method that improves upon the classic approach by solving the circulation system at the three-quarter chord position, among the most important details. This adjustment allows for more accurate calculations of lift and drag forces, particularly addressing the shortcomings in induced drag prediction.
97
VSM is further refined by coupling it with 2D viscous airfoil polars, making it well-suited for complex geometries,
108
including low aspect ratio wings, as well as configurations with sweep, dihedral, and anhedral angles.
119

12-
The software presented here includes a couple of examples: a rectangular wing and a leading-edge inflatable kite.
10+
The software presented here includes a couple of examples: a rectangular wing, a leading-edge inflatable kite and a ram-air kite.
1311

14-
This package was translated from the Python code version 1.0.0 available at https://github.com/ocayon/Vortex-Step-Method .
12+
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/Albatross-Kite-Transport/VortexStepMethod.jl/blob/main/NEWS.md).
1513

1614
## Installation
1715
Install [Julia 1.10](https://ufechner7.github.io/2024/08/09/installing-julia-with-juliaup.html) or later,
@@ -78,7 +76,7 @@ Three kinds of input data is needed:
7876
- how many panels
7977
--> two sections make a panel.
8078

81-
There is no input file yet, the input has to be defined in the code.
79+
Apart from the wing geometry there is no input file yet, the input has to be defined in the code.
8280

8381
### Example for defining the required input:
8482
```julia
@@ -87,7 +85,7 @@ There is no input file yet, the input has to be defined in the code.
8785
n_panels = 20 # Number of panels
8886
span = 20.0 # Wing span [m]
8987
chord = 1.0 # Chord length [m]
90-
Umag = 20.0 # Magnitude of inflow velocity [m/s]
88+
v_a = 20.0 # Magnitude of inflow velocity [m/s]
9189
density = 1.225 # Air density [kg/m³]
9290
alpha_deg = 30.0 # Angle of attack [degrees]
9391
alpha = deg2rad(alpha_deg)
@@ -109,9 +107,10 @@ add_section!(wing,
109107
wa = WingAerodynamics([wing])
110108

111109
# Set inflow conditions
112-
vel_app = [cos(alpha), 0.0, sin(alpha)] .* Umag
110+
vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
113111
set_va!(wa, (vel_app, 0.0)) # Second parameter is yaw rate
114112
```
113+
It is possible to import the wing geometry using an `.obj` file as shown in the example `ram_air_kite.jl`.
115114

116115
Surfplan files can be converted to an input for `VortexStepMethod.jl` using the [SurfplanAdapter](https://github.com/jellepoland/SurfplanAdapter).
117116

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
VortexStepMethod = "ed3cd733-9f0f-46a9-93e0-89b8d4998dd9"

docs/make.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using VortexStepMethod
2+
using Pkg
3+
if ("TestEnv" keys(Pkg.project().dependencies))
4+
if ! ("Documents" keys(Pkg.project().dependencies))
5+
using TestEnv; TestEnv.activate()
6+
end
7+
end
8+
using Documenter
9+
10+
DocMeta.setdocmeta!(VortexStepMethod, :DocTestSetup, :(using VortexStepMethod); recursive=true)
11+
12+
makedocs(;
13+
modules=[VortexStepMethod],
14+
authors="Uwe Fechner <[email protected]>, Bart van de Lint <[email protected]> and contributors",
15+
sitename="VortexStepMethod.jl",
16+
checkdocs=:none,
17+
format = Documenter.HTML(prettyurls = haskey(ENV, "CI")),
18+
pages=[
19+
"Home" => "index.md",
20+
"Exported Functions" => "functions.md",
21+
],
22+
)
23+
24+
deploydocs(;
25+
repo="github.com/Albatross-Kite-Transport/VortexStepMethod.jl",
26+
devbranch="main",
27+
)

docs/src/functions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```@meta
2+
CurrentModule = VortexStepMethod
3+
```
4+
## Main Plotting Functions
5+
```@docs
6+
plot_geometry
7+
plot_distribution
8+
plot_polars
9+
```
10+
11+
## Helper Functions
12+
```@docs
13+
set_plot_style
14+
save_plot
15+
show_plot
16+
plot_line_segment!
17+
set_axes_equal!
18+
create_geometry_plot
19+
generate_polar_data
20+
```

docs/src/index.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
```@meta
2+
CurrentModule = VortexStepMethod
3+
```
4+
5+
# Simulation of a 3D airfoil using the Vortex Step Method
6+
7+
The Vortex Step Method (VSM) is an enhanced lifting line method that improves upon the classic approach by solving the circulation system at the three-quarter chord position, among the most important details. This adjustment allows for more accurate calculations of lift and drag forces, particularly addressing the shortcomings in induced drag prediction.
8+
VSM is further refined by coupling it with 2D viscous airfoil polars, making it well-suited for complex geometries,
9+
including low aspect ratio wings, as well as configurations with sweep, dihedral, and anhedral angles.
10+
11+
The software presented here includes a couple of examples: a rectangular wing, a leading-edge inflatable kite and a ram-air kite.
12+
13+
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/Albatross-Kite-Transport/VortexStepMethod.jl/blob/main/NEWS.md).
14+
15+
## Installation
16+
Install [Julia 1.10](https://ufechner7.github.io/2024/08/09/installing-julia-with-juliaup.html) or later,
17+
if you haven't already. On Linux, make sure that Python3, Matplotlib and LaTeX are installed:
18+
```
19+
sudo apt install python3-matplotlib
20+
sudo apt install texlive-full texlive-fonts-extra cm-super
21+
```
22+
23+
Before installing this software it is suggested to create a new project, for example like this:
24+
```bash
25+
mkdir test
26+
cd test
27+
julia --project=.
28+
```
29+
Then add VortexStepMethod from Julia's package manager, by typing:
30+
```julia
31+
using Pkg
32+
pkg"add https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl"
33+
```
34+
at the Julia prompt. You can run the unit tests with the command:
35+
```julia
36+
pkg"test VortexStepMethod"
37+
```
38+
39+
## Running the examples
40+
If you have git installed, check out this repo because it makes it easier to understand the code:
41+
```bash
42+
mkdir repos
43+
cd repos
44+
git clone https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl
45+
cd VortexStepMethod.jl
46+
```
47+
You can launch Julia with:
48+
```bash
49+
julia --project
50+
```
51+
or with:
52+
```bash
53+
./bin/run_julia
54+
```
55+
In Julia, first update the packages:
56+
```julia
57+
using Pkg
58+
Pkg.update()
59+
```
60+
and then you can execute the first example:
61+
```julia
62+
include("examples/rectangular_wing.jl")
63+
```
64+
To browse the code, it is suggested to use [VSCode](https://code.visualstudio.com/) with the Julia plugin.
65+
66+
## Input
67+
Three kinds of input data is needed:
68+
69+
- The wing geometry, defined by section:
70+
- rec wing two section, two point + polars
71+
- kite: model of polars included, n sections to define
72+
73+
- The airflow:
74+
- v_app vector
75+
76+
- The configuration:
77+
- how many panels
78+
--> two sections make a panel.
79+
80+
Apart from the wing geometry there is no input file yet, the input has to be defined in the code.
81+
82+
### Example for defining the required input:
83+
```julia
84+
85+
# Step 1: Define wing parameters
86+
n_panels = 20 # Number of panels
87+
span = 20.0 # Wing span [m]
88+
chord = 1.0 # Chord length [m]
89+
v_a = 20.0 # Magnitude of inflow velocity [m/s]
90+
density = 1.225 # Air density [kg/m³]
91+
alpha_deg = 30.0 # Angle of attack [degrees]
92+
alpha = deg2rad(alpha_deg)
93+
94+
# Step 2: Create wing geometry with linear panel distribution
95+
wing = Wing(n_panels, spanwise_panel_distribution="linear")
96+
97+
# Add wing sections - defining only tip sections with inviscid airfoil model
98+
add_section!(wing,
99+
[0.0, span/2, 0.0], # Left tip LE
100+
[chord, span/2, 0.0], # Left tip TE
101+
"inviscid")
102+
add_section!(wing,
103+
[0.0, -span/2, 0.0], # Right tip LE
104+
[chord, -span/2, 0.0], # Right tip TE
105+
"inviscid")
106+
107+
# Step 3: Initialize aerodynamics
108+
wa = WingAerodynamics([wing])
109+
110+
# Set inflow conditions
111+
vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
112+
set_va!(wa, (vel_app, 0.0)) # Second parameter is yaw rate
113+
```
114+
It is possible to import the wing geometry using an `.obj` file as shown in the example `ram_air_kite.jl`.
115+
116+
Surfplan files can be converted to an input for `VortexStepMethod.jl` using the [SurfplanAdapter](https://github.com/jellepoland/SurfplanAdapter).
117+
118+
## Output
119+
- CL, CD, CS (side force coefficient)
120+
- the spanwise distribution of forces
121+
--> moment coefficients (will be implemented in release 1.1)
122+
123+
## Citation
124+
If you use this project in your research, please consider citing it.
125+
Citation details can be found in the [CITATION.cff](https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl/blob/main/CITATION.cff) file included in this repository.
126+
127+
## License
128+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl/blob/main/LICENSE) file for details.
129+
130+
### Copyright
131+
Copyright (c) 2022 Oriol Cayon
132+
133+
Copyright (c) 2024 Oriol Cayon, Jelle Poland, TU Delft
134+
135+
Copyright (c) 2025 Oriol Cayon, Jelle Poland, Bart van de Lint
136+

examples/menu.jl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using REPL.TerminalMenus
2+
3+
options = ["rectangular_wing = include(\"rectangular_wing.jl\")",
4+
"ram_air_kite = include(\"ram_air_kite.jl\")",
5+
"stall_model = include(\"stall_model.jl\")",
6+
"quit"]
7+
8+
function example_menu()
9+
active = true
10+
while active
11+
menu = RadioMenu(options, pagesize=8)
12+
choice = request("\nChoose function to execute or `q` to quit: ", menu)
13+
14+
if choice != -1 && choice != length(options)
15+
eval(Meta.parse(options[choice]))
16+
else
17+
println("Left menu. Press <ctrl><d> to quit Julia!")
18+
active = false
19+
end
20+
end
21+
end
22+
23+
example_menu()

0 commit comments

Comments
 (0)