Skip to content

Commit 33d6d87

Browse files
committed
Merge branch 'main' into perf/cut-alloc
2 parents 3ac3739 + e24edc0 commit 33d6d87

File tree

6 files changed

+33
-33
lines changed

6 files changed

+33
-33
lines changed

src/body_aerodynamics.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Main structure for calculating aerodynamic properties of bodies.
66
# Fields
77
- panels::Vector{Panel}: Vector of Panel structs
88
- wings::Vector{AbstractWing}: a vector of wings; a body can have multiple wings
9-
- `_va`::Union{Nothing, Vector{Float64}, Tuple{Vector{Float64}, Float64}}: A vector of the apparent wind speed,
9+
- `_va`::Union{Nothing, Vector{Float64}, Tuple{MVec3, Float64}}: A vector of the apparent wind speed,
1010
or a tuple of the v_a vector and yaw rate (rad/s).
1111
- `gamma_distribution`::Union{Nothing, Vector{Float64}}: unclear, please defined
1212
- `alpha_uncorrected`::Union{Nothing, Vector{Float64}}: unclear, please define
@@ -16,7 +16,7 @@ Main structure for calculating aerodynamic properties of bodies.
1616
mutable struct BodyAerodynamics
1717
panels::Vector{Panel}
1818
wings::Vector{AbstractWing} # can be a vector of Wings, or of KiteWings
19-
_va::Union{Nothing, Vector{Float64}, Tuple{Vector{Float64}, Float64}}
19+
_va::Union{Nothing, Vector{Float64}, Tuple{MVec3, Float64}}
2020
gamma_distribution::Union{Nothing, Vector{Float64}}
2121
alpha_uncorrected::Union{Nothing, Vector{Float64}}
2222
alpha_corrected::Union{Nothing, Vector{Float64}}
@@ -108,20 +108,20 @@ end
108108
Structure to hold calculated panel properties.
109109
110110
# Fields
111-
- `aero_centers`::Vector{PosVector}
112-
- `control_points`::Vector{PosVector}
113-
- `bound_points_1`::Vector{PosVector}
114-
- `bound_points_2`::Vector{PosVector}
111+
- `aero_centers`::Vector{MVec3}
112+
- `control_points`::Vector{MVec3}
113+
- `bound_points_1`::Vector{MVec3}
114+
- `bound_points_2`::Vector{MVec3}
115115
- `x_airf`::Vector{Vector{Float64}}: unclear, please define
116116
- `y_airf`::Vector{Vector{Float64}}: unclear, please define
117117
- `z_airf`::Vector{Vector{Float64}}: unclear, please define
118118
119119
"""
120120
struct PanelProperties
121-
aero_centers::Vector{PosVector}
122-
control_points::Vector{PosVector}
123-
bound_points_1::Vector{PosVector}
124-
bound_points_2::Vector{PosVector}
121+
aero_centers::Vector{MVec3}
122+
control_points::Vector{MVec3}
123+
bound_points_1::Vector{MVec3}
124+
bound_points_2::Vector{MVec3}
125125
x_airf::Vector{Vector{Float64}}
126126
y_airf::Vector{Vector{Float64}}
127127
z_airf::Vector{Vector{Float64}}

src/filament.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ end
152152
Represents a semi-infinite vortex filament.
153153
"""
154154
struct SemiInfiniteFilament <: Filament
155-
x1::Vector{Float64} # Starting point
156-
direction::Vector{Float64} # Direction vector
157-
vel_mag::Float64 # Velocity magnitude
155+
x1::MVec3 # Starting point
156+
direction::MVec3 # Direction vector
157+
vel_mag::Float64 # Velocity magnitude
158158
filament_direction::Int64 # Direction indicator (-1 or 1)
159159
end
160160

src/kite_geometry.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Represents a curved wing that inherits from Wing with additional geometric prope
177177
- All fields from Wing:
178178
- `n_panels::Int`: Number of panels in aerodynamic mesh
179179
- `spanwise_panel_distribution::Symbol`: Panel distribution type
180-
- `spanwise_direction::Vector{Float64}`: Wing span direction vector
180+
- `spanwise_direction::MVec3`: Wing span direction vector
181181
- `sections::Vector{Section}`: List of wing sections
182182
- Additional fields:
183183
- `center_of_mass::Vector{Float64}`: Center of mass coordinates
@@ -190,7 +190,7 @@ Same as Wing
190190
mutable struct KiteWing <: AbstractWing
191191
n_panels::Int64
192192
spanwise_panel_distribution::Symbol
193-
spanwise_direction::Vector{Float64}
193+
spanwise_direction::MVec3
194194
sections::Vector{Section}
195195

196196
# Additional fields for KiteWing

src/panel.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Represents a panel in a vortex step method simulation.
1111
- `TE_point_2::Vector{MVec3}`: Second trailing edge point
1212
- `LE_point_2::Vector{MVec3}`: Second leading edge point
1313
- `chord::Float64`: Panel chord length
14-
- `va::Vector{Float64}`: Panel velocity
14+
- `va::Union{Nothing, MVec3}`: Panel velocity
1515
- `corner_points::Matrix{Float64}`: Panel corner points
1616
- `aero_model::Symbol`: Aerodynamic model type
1717
- `aerodynamic_center::Vector{Float64}`: Panel aerodynamic center
@@ -30,7 +30,7 @@ mutable struct Panel
3030
TE_point_2::MVec3
3131
LE_point_2::MVec3
3232
chord::Float64
33-
va::Union{Nothing,MVec3}
33+
va::Union{Nothing, MVec3}
3434
corner_points::Matrix{Float64}
3535
aero_model::Symbol
3636
cl_coefficients::Vector{Float64}

src/solver.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ struct Solver
2424
is_only_f_and_gamma_output::Bool
2525

2626
function Solver(;
27-
aerodynamic_model_type::Symbol=:VSM,
28-
density::Float64=1.225,
29-
max_iterations::Int64=1500,
30-
allowed_error::Float64=1e-5,
31-
tol_reference_error::Float64=0.001,
32-
relaxation_factor::Float64=0.03,
33-
is_with_artificial_damping::Bool=false,
27+
aerodynamic_model_type::Symbol = :VSM,
28+
density::Float64 = 1.225,
29+
max_iterations::Int64 = 1500,
30+
allowed_error::Float64 = 1e-5,
31+
tol_reference_error::Float64 = 0.001,
32+
relaxation_factor::Float64 = 0.03,
33+
is_with_artificial_damping::Bool = false,
3434
artificial_damping::NamedTuple{(:k2, :k4), Tuple{Float64, Float64}}=(k2=0.1, k4=0.0),
3535
type_initial_gamma_distribution::Symbol=:elliptic,
36-
core_radius_fraction::Float64=1e-20,
37-
mu::Float64=1.81e-5,
38-
is_only_f_and_gamma_output::Bool=false
36+
core_radius_fraction::Float64 = 1e-20,
37+
mu::Float64 = 1.81e-5, # TODO do not use magic constants
38+
is_only_f_and_gamma_output::Bool = false
3939
)
4040
new(
4141
aerodynamic_model_type,

src/wing_geometry.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
Represents a wing section with leading edge, trailing edge, and aerodynamic properties.
66
77
# Fields
8-
- `LE_point::Vector{Float64}`: Leading edge point coordinates
9-
- `TE_point::Vector{Float64}`: Trailing edge point coordinates
8+
- `LE_point::MVec3`: Leading edge point coordinates
9+
- `TE_point::MVec3`: Trailing edge point coordinates
1010
- `aero_input::Vector{Any}`: Aerodynamic input data for the section:
1111
- `("inviscid")`: Inviscid aerodynamics
1212
- `("polar_data", [alpha_column,CL_column,CD_column,CM_column])`: Polar data aerodynamics
1313
- `("lei_airfoil_breukels", [d_tube,camber])`: LEI airfoil with Breukels parameters
1414
"""
1515
struct Section{T}
16-
LE_point::Vector{Float64}
17-
TE_point::Vector{Float64}
16+
LE_point::MVec3
17+
TE_point::MVec3
1818
aero_input::T
1919

2020
function Section(
21-
LE_point::Vector{Float64},
22-
TE_point::Vector{Float64},
21+
LE_point::PosVector,
22+
TE_point::PosVector,
2323
aero_input::T
2424
) where T
2525
new{T}(LE_point, TE_point, aero_input)

0 commit comments

Comments
 (0)