Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9e2834a
reduce allocations more
1-Bart-1 Feb 21, 2025
7b1c098
add dat file
1-Bart-1 Feb 21, 2025
3ff8bc3
Merge branch 'main' into perf/cut-alloc
1-Bart-1 Feb 22, 2025
605f8f3
add bench file
1-Bart-1 Feb 22, 2025
aaca68f
improve test
1-Bart-1 Feb 22, 2025
20baa8f
Merge branch 'main' into perf/cut-alloc
1-Bart-1 Feb 22, 2025
650bf72
rename Umag to v_a
1-Bart-1 Feb 22, 2025
0ab5152
cant remove calculate_velocity_induced_single_ring_semiinfinite! allocs
1-Bart-1 Feb 22, 2025
7e2bdbc
two non-allocating functions in code_bench
1-Bart-1 Feb 22, 2025
74f68d4
add simple script for alloc testing
1-Bart-1 Feb 22, 2025
9bdea5e
fix calculations
1-Bart-1 Feb 22, 2025
7a0a093
three non-allocating functions
1-Bart-1 Feb 23, 2025
786b2dc
make tests pass again
1-Bart-1 Feb 23, 2025
7317bc4
non-allocating gamma loop
1-Bart-1 Feb 23, 2025
b9868eb
Merge branch 'main' into perf/cut-alloc
1-Bart-1 Feb 23, 2025
08c47f3
more efficient polars
1-Bart-1 Feb 23, 2025
96b1b0c
use symbols instead of strings
1-Bart-1 Feb 23, 2025
d518482
switch to Symbol
1-Bart-1 Feb 24, 2025
7f1d958
tests pass again
1-Bart-1 Feb 24, 2025
d90015c
working test bench
1-Bart-1 Feb 24, 2025
3ac3739
make tests and examples work
1-Bart-1 Feb 24, 2025
33d6d87
Merge branch 'main' into perf/cut-alloc
1-Bart-1 Feb 24, 2025
49abcf2
remove unused dependency
1-Bart-1 Feb 24, 2025
1421cfe
add bench.jl
ufechner7 Feb 24, 2025
2ebe896
add bench to the menu
ufechner7 Feb 24, 2025
9c9d9d9
less output
ufechner7 Feb 24, 2025
60b2a97
fix comment
ufechner7 Feb 24, 2025
9be0dd9
add plot option to example
1-Bart-1 Feb 24, 2025
0528f54
Merge branch 'perf/cut-alloc' of https://github.com/Albatross-Kite-Tr…
1-Bart-1 Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ results/TUDELFT_V3_LEI_KITE/polars/$C_L$ vs $C_D$.pdf
*.bin
results/TUDELFT_V3_LEI_KITE/polars/tutorial_testing_stall_model_n_panels_54_distribution_split_provided.pdf
docs/build/

12 changes: 7 additions & 5 deletions examples/ram_air_kite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ end
using CSV
using DataFrames

plot = true

# Create wing geometry
wing = KiteWing("data/ram_air_kite_body.obj", "data/ram_air_kite_foil.dat")
body_aero = BodyAerodynamics([wing])

# Create solvers
VSM = Solver(
aerodynamic_model_type="VSM",
aerodynamic_model_type=:VSM,
is_with_artificial_damping=false
)
VSM_with_stall_correction = Solver(
aerodynamic_model_type="VSM",
aerodynamic_model_type=:VSM,
is_with_artificial_damping=true
)

Expand All @@ -36,7 +38,7 @@ vel_app = [
body_aero.va = vel_app

# Plotting geometry
plot_geometry(
plot && plot_geometry(
body_aero,
"";
data_type=".svg",
Expand All @@ -53,7 +55,7 @@ plot_geometry(

CAD_y_coordinates = [panel.aerodynamic_center[2] for panel in body_aero.panels]

plot_distribution(
plot && plot_distribution(
[CAD_y_coordinates],
[results],
["VSM"];
Expand All @@ -63,7 +65,7 @@ plot_distribution(
is_show=true
)

plot_polars(
plot && plot_polars(
[VSM],
[body_aero],
[
Expand Down
18 changes: 10 additions & 8 deletions examples/rectangular_wing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ using LinearAlgebra
using ControlPlots
using VortexStepMethod

plot = true

# Step 1: Define wing parameters
n_panels = 20 # Number of panels
span = 20.0 # Wing span [m]
Expand All @@ -12,17 +14,17 @@ alpha_deg = 30.0 # Angle of attack [degrees]
alpha = deg2rad(alpha_deg)

# Step 2: Create wing geometry with linear panel distribution
wing = Wing(n_panels, spanwise_panel_distribution="linear")
wing = Wing(n_panels, spanwise_panel_distribution=:linear)

# Add wing sections - defining only tip sections with inviscid airfoil model
add_section!(wing,
[0.0, span/2, 0.0], # Left tip LE
[chord, span/2, 0.0], # Left tip TE
"inviscid")
:inviscid)
add_section!(wing,
[0.0, -span/2, 0.0], # Right tip LE
[chord, -span/2, 0.0], # Right tip TE
"inviscid")
:inviscid)

# Step 3: Initialize aerodynamics
wa = BodyAerodynamics([wing])
Expand All @@ -32,8 +34,8 @@ vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
set_va!(wa, (vel_app, 0.0)) # Second parameter is yaw rate

# Step 4: Initialize solvers for both LLT and VSM methods
llt_solver = Solver(aerodynamic_model_type="LLT")
vsm_solver = Solver(aerodynamic_model_type="VSM")
llt_solver = Solver(aerodynamic_model_type=:LLT)
vsm_solver = Solver(aerodynamic_model_type=:VSM)

# Step 5: Solve using both methods
@time results_llt = solve(llt_solver, wa)
Expand All @@ -53,7 +55,7 @@ println("CD = $(round(results_vsm["cd"], digits=4))")
println("Projected area = $(round(results_vsm["projected_area"], digits=4)) m²")

# Step 6: Plot geometry
plot_geometry(
plot && plot_geometry(
wa,
"Rectangular_wing_geometry";
data_type=".pdf",
Expand All @@ -66,7 +68,7 @@ nothing
# Step 7: Plot spanwise distributions
y_coordinates = [panel.aerodynamic_center[2] for panel in wa.panels]

plot_distribution(
plot && plot_distribution(
[y_coordinates, y_coordinates],
[results_vsm, results_llt],
["VSM", "LLT"],
Expand All @@ -75,7 +77,7 @@ plot_distribution(

# Step 8: Plot polar curves
angle_range = range(0, 20, 20)
plot_polars(
plot && plot_polars(
[llt_solver, vsm_solver],
[wa, wa],
["LLT", "VSM"];
Expand Down
30 changes: 15 additions & 15 deletions examples/stall_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mkpath(save_folder)

# Defining discretisation
n_panels = 54
spanwise_panel_distribution = "split_provided"
spanwise_panel_distribution = :split_provided

# Load rib data from CSV
csv_file_path = joinpath(
Expand All @@ -30,7 +30,7 @@ rib_list = []
for row in eachrow(df)
LE = [row.LE_x, row.LE_y, row.LE_z]
TE = [row.TE_x, row.TE_y, row.TE_z]
push!(rib_list, (LE, TE, ("lei_airfoil_breukels", [row.d_tube, row.camber])))
push!(rib_list, (LE, TE, (:lei_airfoil_breukels, [row.d_tube, row.camber])))
end

# Create wing geometry
Expand All @@ -42,11 +42,11 @@ body_aero_CAD_19ribs = BodyAerodynamics([CAD_wing])

# Create solvers
VSM = Solver(
aerodynamic_model_type="VSM",
aerodynamic_model_type=:VSM,
is_with_artificial_damping=false
)
VSM_with_stall_correction = Solver(
aerodynamic_model_type="VSM",
aerodynamic_model_type=:VSM,
is_with_artificial_damping=true
)

Expand All @@ -63,17 +63,17 @@ vel_app = [
] * v_a
body_aero_CAD_19ribs.va = vel_app

# # Plotting geometry
# plot_geometry(
# body_aero_CAD_19ribs,
# "";
# data_type=".svg",
# save_path="",
# is_save=false,
# is_show=true,
# view_elevation=15,
# view_azimuth=-120
# )
# Plotting geometry
plot_geometry(
body_aero_CAD_19ribs,
"";
data_type=".svg",
save_path="",
is_save=false,
is_show=true,
view_elevation=15,
view_azimuth=-120
)

# Solving and plotting distributions
results = solve(VSM, body_aero_CAD_19ribs)
Expand Down
1 change: 1 addition & 0 deletions src/VortexStepMethod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using NonlinearSolve
using Interpolations: linear_interpolation, Line, Extrapolation
using Serialization
using SharedArrays
using BenchmarkTools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to use BenchmarkTools in the package itself?


# Export public interface
export Wing, Section, KiteWing
Expand Down
Loading
Loading