Skip to content

Commit 63b1c00

Browse files
authored
Start documenting the structs and types (#50)
* add docu for some struct types * more types documented * minor improvements
1 parent 23ebc3a commit 63b1c00

File tree

7 files changed

+70
-17
lines changed

7 files changed

+70
-17
lines changed

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ makedocs(;
1818
pages=[
1919
"Home" => "index.md",
2020
"Exported Functions" => "functions.md",
21+
"Exported Types" => "types.md",
2122
],
2223
)
2324

docs/src/types.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
```@meta
2+
CurrentModule = VortexStepMethod
3+
```
4+
## Basic Vectors
5+
```@docs
6+
MVec3
7+
PosVector
8+
VelVector
9+
```
10+
11+
## Wing Geometry, Panel and Aerodynamics
12+
```@docs
13+
Section
14+
Wing
15+
BoundFilament
16+
Panel
17+
PanelProperties
18+
WingAerodynamics
19+
```

src/VortexStepMethod.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ const MVec3 = MVector{3, Float64}
3838
Position vector, either a `MVec3` or a `Vector` for use in function signatures.
3939
"""
4040
const PosVector=Union{MVec3, Vector, SizedVector{3, Float64, Vector{Float64}}}
41+
42+
"""
43+
const VelVector=Union{MVec3, Vector}
44+
45+
Velocity vector, either a `MVec3` or a `Vector` for use in function signatures.
46+
"""
4147
const VelVector=Union{MVec3, Vector, SizedVector{3, Float64, Vector{Float64}}}
4248

4349
abstract type AbstractWing end

src/filament.jl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@ const NU = 1.48e-5 # Kinematic viscosity of air
1212
BoundFilament
1313
1414
Represents a bound vortex filament defined by two points.
15+
16+
# Fields
17+
- x1::MVec3: First point
18+
- x2::MVec3: Second point
19+
- length: Filament length
20+
- r0::MVec3: Vector from x1 to x2
1521
"""
1622
struct BoundFilament <: Filament
17-
x1::Vector{Float64} # First point
18-
x2::Vector{Float64} # Second point
19-
length::Float64 # Filament length
20-
r0::Vector{Float64} # Vector from x1 to x2
23+
x1::MVec3 # First point
24+
x2::MVec3 # Second point
25+
length::Float64 # Filament length
26+
r0::MVec3 # Vector from x1 to x2
2127

2228
function BoundFilament(x1::PosVector, x2::PosVector)
2329
new(x1, x2, norm(x2 - x1), x2 - x1)

src/panel.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ using LinearAlgebra
66
Represents a panel in a vortex step method simulation.
77
88
# Fields
9-
- `TE_point_1::Vector{Float64}`: First trailing edge point
10-
- `LE_point_1::Vector{Float64}`: First leading edge point
11-
- `TE_point_2::Vector{Float64}`: Second trailing edge point
12-
- `LE_point_2::Vector{Float64}`: Second leading edge point
9+
- `TE_point_1::MVec3`: First trailing edge point
10+
- `LE_point_1::MVec3`: First leading edge point
11+
- `TE_point_2::Vector{MVec3}`: Second trailing edge point
12+
- `LE_point_2::Vector{MVec3}`: Second leading edge point
1313
- `chord::Float64`: Panel chord length
1414
- `va::Union{Nothing,Vector{Float64}}`: Panel velocity
1515
- `corner_points::Matrix{Float64}`: Panel corner points
1616
- `aero_model::String`: Aerodynamic model type
1717
- `aerodynamic_center::Vector{Float64}`: Panel aerodynamic center
18-
- `control_point::Vector{Float64}`: Panel control point
19-
- `bound_point_1::Vector{Float64}`: First bound point
20-
- `bound_point_2::Vector{Float64}`: Second bound point
21-
- `x_airf::Vector{Float64}`: Unit vector perpendicular to chord line
22-
- `y_airf::Vector{Float64}`: Unit vector parallel to chord line
23-
- `z_airf::Vector{Float64}`: Unit vector in spanwise direction
18+
- `control_point::Vector{MVec3}`: Panel control point
19+
- `bound_point_1::Vector{MVec3}`: First bound point
20+
- `bound_point_2::Vector{MVec3}`: Second bound point
21+
- `x_airf::MVec3`: Unit vector perpendicular to chord line
22+
- `y_airf::MVec3`: Unit vector parallel to chord line
23+
- `z_airf::MVec3`: Unit vector in spanwise direction
2424
- `width::Float64`: Panel width
2525
- `filaments::Vector{BoundFilament}`: Panel filaments
2626
"""

src/wing_aerodynamics.jl

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33
WingAerodynamics
44
55
Main structure for calculating aerodynamic properties of wings.
6+
7+
# Fields
8+
- panels::Vector{Panel}: Vector of Panel structs
9+
- n_panels::Int64: number of panels
10+
- wings::Vector{AbstractWing}: a vector of wings; but why more than one?
11+
- `_va`::Union{Nothing, Vector{Float64}, Tuple{Vector{Float64}, Float64}}: A vector of the apparent wind speed,
12+
or a tuple of the v_a vector and yaw rate (rad/s).
13+
- ` gamma_distribution`::Union{Nothing, Vector{Float64}}: unclear, please defined
14+
- `alpha_uncorrected`::Union{Nothing, Vector{Float64}}: unclear, please define
15+
- `alpha_corrected`::Union{Nothing, Vector{Float64}}: unclear, please define
16+
- `stall_angle_list`::Vector{Float64}: unclear, please define
617
"""
718
mutable struct WingAerodynamics
819
panels::Vector{Panel}
9-
n_panels::Int
10-
wings::Vector{AbstractWing}
20+
n_panels::Int64 # TODO: Why is this needed? Just use length(panels)
21+
wings::Vector{AbstractWing} # TODO: Why not a concrete type? And why a vector?
1122
_va::Union{Nothing, Vector{Float64}, Tuple{Vector{Float64}, Float64}}
1223
gamma_distribution::Union{Nothing, Vector{Float64}}
1324
alpha_uncorrected::Union{Nothing, Vector{Float64}}
@@ -96,6 +107,16 @@ end
96107
PanelProperties
97108
98109
Structure to hold calculated panel properties.
110+
111+
# Fields
112+
- `aero_centers`::Vector{PosVector}
113+
- `control_points`::Vector{PosVector}
114+
- `bound_points_1`::Vector{PosVector}
115+
- `bound_points_2`::Vector{PosVector}
116+
- `x_airf`::Vector{Vector{Float64}}: unclear, please define
117+
- `y_airf`::Vector{Vector{Float64}}: unclear, please define
118+
- `z_airf`::Vector{Vector{Float64}}: unclear, please define
119+
99120
"""
100121
struct PanelProperties
101122
aero_centers::Vector{PosVector}

src/wing_geometry.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Represents a wing composed of multiple sections with aerodynamic properties.
4040
# Distribution types
4141
- "linear": Linear distribution
4242
- "cosine": Cosine distribution
43-
- "cosine_van_Garrel": van Garrel cosine distribution
43+
- "`cosine_van_Garrel`": van Garrel cosine distribution
4444
- "split_provided": Split provided sections
4545
- "unchanged": Keep original sections
4646
"""

0 commit comments

Comments
 (0)