@@ -2,6 +2,8 @@ using Revise
22using LinearAlgebra
33using ControlPlots
44using VortexStepMethod
5+ using StaticArrays
6+ using BenchmarkTools
57
68# Step 1: Define wing parameters
79n_panels = 20 # Number of panels
@@ -36,20 +38,19 @@ set_va!(wa, (vel_app, 0.0)) # Second parameter is yaw rate
3638vsm_solver = Solver (aerodynamic_model_type= " VSM" )
3739
3840# Benchmark setup
39- velocity_induced = zeros (3 )
40- tempvel = zeros (3 )
41+ velocity_induced = @MVector zeros (3 ) # StaticArraysCore.MVector{3, Float64}
42+ tempvel = @MVector zeros (3 ) # StaticArraysCore.MVector{3, Float64}
4143panel = wa. panels[1 ]
42- ep = [0.25 , 9.5 , 0.0 ]
43- evaluation_point_on_bound = true
44- va_norm = 20.0
45- va_unit = [0.8660254037844387 , 0.0 , 0.4999999999999999 ]
46- core_radius_fraction = 1.0e-20
47- gamma = 1.0
44+ ep = @MVector [0.25 , 9.5 , 0.0 ] # StaticArraysCore.MVector{3, Float64}
45+ evaluation_point_on_bound = true # Bool
46+ va_norm = 20.0 # Float64
47+ va_unit = @MVector [0.8660254037844387 , 0.0 , 0.4999999999999999 ] # StaticArraysCore.MVector{3, Float64}
48+ core_radius_fraction = 1.0e-20 # Float64
49+ gamma = 1.0 # Float64
4850
49- # Create work vectors tuple
50- work_vectors = ntuple (_ -> zeros (3 ), 10 )
51+ # Create work vectors tuple of MVector{3, Float64}
52+ work_vectors = ntuple (_ -> @MVector ( zeros (3 )) , 10 ) # NTuple{10, StaticArraysCore.MVector{3, Float64}}
5153
52- using BenchmarkTools
5354@btime VortexStepMethod. calculate_velocity_induced_single_ring_semiinfinite! (
5455 $ velocity_induced,
5556 $ tempvel,
@@ -63,7 +64,20 @@ using BenchmarkTools
6364 $ work_vectors
6465)
6566
66- U_2D = zeros (3 )
67+ @btime VortexStepMethod. calculate_velocity_induced_single_ring_semiinfinite! (
68+ velocity_induced,
69+ tempvel,
70+ panel. filaments,
71+ ep,
72+ evaluation_point_on_bound,
73+ va_norm,
74+ va_unit,
75+ gamma,
76+ core_radius_fraction,
77+ work_vectors
78+ )
79+
80+ U_2D = @MVector zeros (3 ) # StaticArraysCore.MVector{3, Float64}
6781
6882@btime VortexStepMethod. calculate_velocity_induced_bound_2D! (
6983 $ U_2D,
@@ -72,4 +86,12 @@ U_2D = zeros(3)
7286 $ work_vectors
7387)
7488
75- nothing
89+ # model = "VSM"
90+ # va_norm_array = zeros(wa.n_panels)
91+ # va_unit_array = zeros(wa.n_panels, 3)
92+ # @time VortexStepMethod.calculate_AIC_matrices!(wa, model,
93+ # core_radius_fraction,
94+ # va_norm_array,
95+ # va_unit_array)
96+
97+ nothing
0 commit comments