@@ -9,9 +9,9 @@ Struct for storing the solution of the [solve!](@ref) function. Must contain all
99- cl_array::Vector{Float64}: Lift coefficients of the panels [-]
1010- cd_array::Vector{Float64}: Drag coefficients of the panels [-]
1111- cm_array::Vector{Float64}: Pitching moment coefficients of the panels [-]
12- - panel_lift::Matrix {Float64}: Lift force of the panels [N]
13- - panel_drag::Matrix {Float64}: Drag force of the panels [N]
14- - panel_moment::Matrix {Float64}: Pitching moment around the spanwise vector of the panels [Nm]
12+ - panel_lift::Vector {Float64}: Lift force of the panels [N]
13+ - panel_drag::Vector {Float64}: Drag force of the panels [N]
14+ - panel_moment::Vector {Float64}: Pitching moment around the spanwise vector of the panels [Nm]
1515- `f_body_3D`::Matrix{Float64}: Matrix of the aerodynamic forces (x, y, z vectors) [N]
1616- `m_body_3D`::Matrix{Float64}: Matrix of the aerodynamic moments [Nm]
1717- `gamma_distribution`::Union{Nothing, Vector{Float64}}: Vector containing the panel circulations.
@@ -25,19 +25,19 @@ Struct for storing the solution of the [solve!](@ref) function. Must contain all
2525"""
2626@with_kw mutable struct VSMSolution{P}
2727 # ## private vectors of solve_base!
28- x_airf_array :: Matrix{Float64} = zeros (P, 3 )
29- y_airf_array :: Matrix{Float64} = zeros (P, 3 )
30- z_airf_array :: Matrix{Float64} = zeros (P, 3 )
31- va_array :: Matrix{Float64} = zeros (P, 3 )
32- chord_array :: Vector{Float64} = zeros (P)
33- # ##
28+ _x_airf_array :: Matrix{Float64} = zeros (P, 3 )
29+ _y_airf_array :: Matrix{Float64} = zeros (P, 3 )
30+ _z_airf_array :: Matrix{Float64} = zeros (P, 3 )
31+ _va_array :: Matrix{Float64} = zeros (P, 3 )
32+ _chord_array :: Vector{Float64} = zeros (P)
33+ # ## end of private vectors
3434 panel_width_array:: Vector{Float64} = zeros (P)
3535 cl_array:: Vector{Float64} = zeros (P)
3636 cd_array:: Vector{Float64} = zeros (P)
3737 cm_array:: Vector{Float64} = zeros (P)
38- panel_lift:: Matrix {Float64} = zeros (P, 1 )
39- panel_drag:: Matrix {Float64} = zeros (P, 1 )
40- panel_moment:: Matrix {Float64} = zeros (P, 1 )
38+ panel_lift:: Vector {Float64} = zeros (P)
39+ panel_drag:: Vector {Float64} = zeros (P)
40+ panel_moment:: Vector {Float64} = zeros (P)
4141 f_body_3D:: Matrix{Float64} = zeros (3 , P)
4242 m_body_3D:: Matrix{Float64} = zeros (3 , P)
4343 gamma_distribution:: Union{Nothing, Vector{Float64}} = nothing
@@ -199,9 +199,9 @@ function solve!(solver::Solver, body_aero::BodyAerodynamics, gamma_distribution=
199199 panel_moment = solver. sol. panel_moment
200200
201201 # Compute using fused broadcasting (no intermediate allocations)
202- @. lift = cl_array * 0.5 * density * v_a_array^ 2 * solver. sol. chord_array
203- @. drag = cd_array * 0.5 * density * v_a_array^ 2 * solver. sol. chord_array
204- @. panel_moment = cm_array * 0.5 * density * v_a_array^ 2 * solver. sol. chord_array
202+ @. lift = cl_array * 0.5 * density * v_a_array^ 2 * solver. sol. _chord_array
203+ @. drag = cd_array * 0.5 * density * v_a_array^ 2 * solver. sol. _chord_array
204+ @. panel_moment = cm_array * 0.5 * density * v_a_array^ 2 * solver. sol. _chord_array
205205
206206 # Calculate alpha corrections based on model type
207207 if aerodynamic_model_type == VSM # 64 bytes
@@ -210,9 +210,9 @@ function solve!(solver::Solver, body_aero::BodyAerodynamics, gamma_distribution=
210210 body_aero,
211211 gamma_new,
212212 solver. core_radius_fraction,
213- solver. sol. z_airf_array ,
214- solver. sol. x_airf_array ,
215- solver. sol. va_array ,
213+ solver. sol. _z_airf_array ,
214+ solver. sol. _x_airf_array ,
215+ solver. sol. _va_array ,
216216 solver. br. va_norm_array,
217217 solver. br. va_unit_array
218218 )
@@ -337,11 +337,11 @@ function solve(solver::Solver, body_aero::BodyAerodynamics, gamma_distribution=n
337337 solver. mu,
338338 solver. lr. alpha_array,
339339 solver. lr. v_a_array,
340- solver. sol. chord_array ,
341- solver. sol. x_airf_array ,
342- solver. sol. y_airf_array ,
343- solver. sol. z_airf_array ,
344- solver. sol. va_array ,
340+ solver. sol. _chord_array ,
341+ solver. sol. _x_airf_array ,
342+ solver. sol. _y_airf_array ,
343+ solver. sol. _z_airf_array ,
344+ solver. sol. _va_array ,
345345 solver. br. va_norm_array,
346346 solver. br. va_unit_array,
347347 body_aero. panels,
@@ -368,31 +368,31 @@ function solve_base!(solver::Solver, body_aero::BodyAerodynamics, gamma_distribu
368368 relaxation_factor = solver. relaxation_factor
369369
370370 # Clear arrays
371- solver. sol. x_airf_array .= 0
372- solver. sol. y_airf_array .= 0
373- solver. sol. z_airf_array .= 0
374- solver. sol. va_array .= 0
375- solver. sol. chord_array .= 0
371+ solver. sol. _x_airf_array .= 0
372+ solver. sol. _y_airf_array .= 0
373+ solver. sol. _z_airf_array .= 0
374+ solver. sol. _va_array .= 0
375+ solver. sol. _chord_array .= 0
376376
377377 # Fill arrays from panels
378378 for (i, panel) in enumerate (panels)
379- solver. sol. x_airf_array [i, :] .= panel. x_airf
380- solver. sol. y_airf_array [i, :] .= panel. y_airf
381- solver. sol. z_airf_array [i, :] .= panel. z_airf
382- solver. sol. va_array [i, :] .= panel. va
383- solver. sol. chord_array [i] = panel. chord
379+ solver. sol. _x_airf_array [i, :] .= panel. x_airf
380+ solver. sol. _y_airf_array [i, :] .= panel. y_airf
381+ solver. sol. _z_airf_array [i, :] .= panel. z_airf
382+ solver. sol. _va_array [i, :] .= panel. va
383+ solver. sol. _chord_array [i] = panel. chord
384384 end
385385
386386 # Calculate unit vectors
387- calc_norm_array! (solver. br. va_norm_array, solver. sol. va_array )
388- solver. br. va_unit_array .= solver. sol. va_array ./ solver. br. va_norm_array
387+ calc_norm_array! (solver. br. va_norm_array, solver. sol. _va_array )
388+ solver. br. va_unit_array .= solver. sol. _va_array ./ solver. br. va_norm_array
389389
390390 # Calculate AIC matrices
391391 calculate_AIC_matrices! (body_aero, solver. aerodynamic_model_type, solver. core_radius_fraction, solver. br. va_norm_array,
392392 solver. br. va_unit_array)
393393
394394 # Initialize gamma distribution
395- gamma_initial = cache_base[1 ][solver. sol. chord_array ]
395+ gamma_initial = cache_base[1 ][solver. sol. _chord_array ]
396396 if isnothing (gamma_distribution)
397397 if solver. type_initial_gamma_distribution == ELLIPTIC
398398 calculate_circulation_distribution_elliptical_wing (gamma_initial, body_aero)
@@ -433,11 +433,11 @@ function gamma_loop!(
433433 relaxation_factor:: Float64 ;
434434 log:: Bool = true
435435)
436- va_array = solver. sol. va_array
437- chord_array = solver. sol. chord_array
438- x_airf_array = solver. sol. x_airf_array
439- y_airf_array = solver. sol. y_airf_array
440- z_airf_array = solver. sol. z_airf_array
436+ va_array = solver. sol. _va_array
437+ chord_array = solver. sol. _chord_array
438+ x_airf_array = solver. sol. _x_airf_array
439+ y_airf_array = solver. sol. _y_airf_array
440+ z_airf_array = solver. sol. _z_airf_array
441441 solver. lr. converged = false
442442 n_panels = length (body_aero. panels)
443443 solver. lr. alpha_array .= body_aero. alpha_array
0 commit comments