Skip to content

Commit d90015c

Browse files
committed
working test bench
1 parent 7f1d958 commit d90015c

File tree

3 files changed

+229
-113
lines changed

3 files changed

+229
-113
lines changed

examples/code_bench.jl

Lines changed: 56 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
3535
set_va!(body_aero, (vel_app, 0.0)) # Second parameter is yaw rate
3636

3737
# Step 4: Initialize solvers for both LLT and VSM methods
38-
vsm_solver = Solver(aerodynamic_model_type="VSM")
38+
vsm_solver = Solver(aerodynamic_model_type=:VSM)
3939

4040
# Benchmark setup
4141
velocity_induced = @MVector zeros(3) # StaticArraysCore.MVector{3, Float64}
@@ -51,50 +51,50 @@ gamma = 1.0 # Float64
5151
# Create work vectors tuple of MVector{3, Float64}
5252
work_vectors = ntuple(_ -> @MVector(zeros(3)), 10) # NTuple{10, StaticArraysCore.MVector{3, Float64}}
5353

54-
# @btime VortexStepMethod.calculate_velocity_induced_single_ring_semiinfinite!(
55-
# $velocity_induced,
56-
# $tempvel,
57-
# $panel.filaments,
58-
# $ep,
59-
# $evaluation_point_on_bound,
60-
# $va_norm,
61-
# $va_unit,
62-
# $gamma,
63-
# $core_radius_fraction,
64-
# $work_vectors
65-
# )
66-
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}
81-
82-
# @btime VortexStepMethod.calculate_velocity_induced_bound_2D!(
83-
# $U_2D,
84-
# $panel,
85-
# $ep,
86-
# $work_vectors
87-
# )
88-
89-
# model = "VSM"
90-
# n_panels = length(body_aero.panels)
91-
# va_norm_array = zeros(n_panels)
92-
# va_unit_array = zeros(n_panels, 3)
93-
# @btime VortexStepMethod.calculate_AIC_matrices!(
94-
# $body_aero, model,
95-
# $core_radius_fraction,
96-
# $va_norm_array,
97-
# $va_unit_array)
54+
@btime VortexStepMethod.calculate_velocity_induced_single_ring_semiinfinite!(
55+
$velocity_induced,
56+
$tempvel,
57+
$panel.filaments,
58+
$ep,
59+
$evaluation_point_on_bound,
60+
$va_norm,
61+
$va_unit,
62+
$gamma,
63+
$core_radius_fraction,
64+
$work_vectors
65+
)
66+
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}
81+
82+
@btime VortexStepMethod.calculate_velocity_induced_bound_2D!(
83+
$U_2D,
84+
$panel,
85+
$ep,
86+
$work_vectors
87+
)
88+
89+
model = :VSM
90+
n_panels = length(body_aero.panels)
91+
va_norm_array = zeros(n_panels)
92+
va_unit_array = zeros(n_panels, 3)
93+
@btime VortexStepMethod.calculate_AIC_matrices!(
94+
$body_aero, model,
95+
$core_radius_fraction,
96+
$va_norm_array,
97+
$va_unit_array)
9898

9999
n_panels = length(body_aero.panels)
100100
gamma_new = zeros(n_panels)
@@ -114,32 +114,18 @@ for (i, panel) in enumerate(body_aero.panels)
114114
z_airf_array[i, :] .= panel.z_airf
115115
end
116116

117-
# # Benchmark gamma_loop
118-
# @btime VortexStepMethod.gamma_loop(
119-
# $vsm_solver,
120-
# $body_aero,
121-
# $gamma_new,
122-
# $va_array,
123-
# $chord_array,
124-
# $x_airf_array,
125-
# $y_airf_array,
126-
# $z_airf_array,
127-
# $body_aero.panels,
128-
# $relaxation_factor;
129-
# log = false
130-
# )
131117
# Benchmark gamma_loop
132-
@time VortexStepMethod.gamma_loop(
133-
vsm_solver,
134-
body_aero,
135-
gamma_new,
136-
va_array,
137-
chord_array,
138-
x_airf_array,
139-
y_airf_array,
140-
z_airf_array,
141-
body_aero.panels,
142-
relaxation_factor;
118+
@btime VortexStepMethod.gamma_loop(
119+
$vsm_solver,
120+
$body_aero,
121+
$gamma_new,
122+
$va_array,
123+
$chord_array,
124+
$x_airf_array,
125+
$y_airf_array,
126+
$z_airf_array,
127+
$body_aero.panels,
128+
$relaxation_factor;
143129
log = false
144130
)
145131

examples/rectangular_wing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a
3434
set_va!(wa, (vel_app, 0.0)) # Second parameter is yaw rate
3535

3636
# Step 4: Initialize solvers for both LLT and VSM methods
37-
llt_solver = Solver(aerodynamic_model_type="LLT")
38-
vsm_solver = Solver(aerodynamic_model_type="VSM")
37+
llt_solver = Solver(aerodynamic_model_type=:LLT)
38+
vsm_solver = Solver(aerodynamic_model_type=:VSM)
3939

4040
# Step 5: Solve using both methods
4141
@time results_llt = solve(llt_solver, wa)

0 commit comments

Comments
 (0)