Skip to content

Commit 70b5282

Browse files
committed
Add Documenter docu
1 parent 02d219d commit 70b5282

File tree

7 files changed

+204
-3
lines changed

7 files changed

+204
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ Manifest.toml
22
.vscode/settings.json
33
venv
44
results/TUDELFT_V3_LEI_KITE/polars/tutorial_testing_stall_model_n_panels_54_distribution_split_provided.pdf
5+
docs/build/

Project.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
1616
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
1717
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1818
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
19-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2019

2120
[compat]
2221
BenchmarkTools = "1"
@@ -29,3 +28,10 @@ Measures = "0.3"
2928
NonlinearSolve = "4"
3029
StaticArrays = "1"
3130
Statistics = "1"
31+
32+
[extras]
33+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
34+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
35+
36+
[targets]
37+
test = ["Test", "Documenter"]

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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
repo="https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl/blob/{commit}{path}#{line}",
16+
sitename="VortexStepMethod.jl",
17+
checkdocs=:none,
18+
format=Documenter.HTML(;
19+
prettyurls=get(ENV, "CI", "false") == "true",
20+
canonical="https://github.com/Albatross-Kite-Transport/VortexStepMethod.jl",
21+
assets=String[],
22+
),
23+
pages=[
24+
"Home" => "index.md",
25+
"Exported Functions" => "functions.md",
26+
],
27+
)
28+
29+
deploydocs(;
30+
repo="github.com/Albatross-Kite-Transport/VortexStepMethod.jl",
31+
devbranch="main",
32+
)

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+

src/plotting.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Set the default style for plots using LaTeX.
66
77
# Arguments:
8-
- `titel_size: size of the plot title in points (default: 16)
8+
- `titel_size`: size of the plot title in points (default: 16)
99
"""
1010
function set_plot_style(titel_size=16)
1111
rcParams = plt.PyDict(plt.matplotlib."rcParams")
@@ -112,12 +112,15 @@ function plot_line_segment!(ax, segment, color, label; width=3)
112112
end
113113

114114
"""
115-
set_axes_equal!(ax)
115+
set_axes_equal!(ax; zoom=1.8)
116116
117117
Set 3D plot axes to equal scale.
118118
119119
# Arguments
120120
- ax: 3D plot axis
121+
122+
# Keyword arguments
123+
zoom: zoom factor (default: 1.8)
121124
"""
122125
function set_axes_equal!(ax; zoom=1.8)
123126
x_lims = ax.get_xlim3d() ./ zoom

0 commit comments

Comments
 (0)