@@ -2,6 +2,37 @@ using VortexStepMethod
22using ControlPlots
33using Test
44
5+ function result_vsm ()
6+ # Step 1: Define wing parameters
7+ n_panels = 20 # Number of panels
8+ span = 20.0 # Wing span [m]
9+ chord = 1.0 # Chord length [m]
10+ Umag = 20.0 # Magnitude of inflow velocity [m/s]
11+ density = 1.225 # Air density [kg/m³]
12+ alpha_deg = 30.0 # Angle of attack [degrees]
13+ alpha = deg2rad (alpha_deg)
14+
15+ # Step 2: Create wing geometry with linear panel distribution
16+ wing = Wing (n_panels, spanwise_panel_distribution= " linear" )
17+
18+ # Add wing sections - defining only tip sections with inviscid airfoil model
19+ add_section! (wing,
20+ [0.0 , span/ 2 , 0.0 ], # Left tip LE
21+ [chord, span/ 2 , 0.0 ], # Left tip TE
22+ " inviscid" )
23+ add_section! (wing,
24+ [0.0 , - span/ 2 , 0.0 ], # Right tip LE
25+ [chord, - span/ 2 , 0.0 ], # Right tip TE
26+ " inviscid" )
27+
28+ # Step 3: Initialize aerodynamics
29+ wa = WingAerodynamics ([wing])
30+ # Set inflow conditions
31+ vel_app = [cos (alpha), 0.0 , sin (alpha)] .* Umag
32+ set_va! (wa, (vel_app, 0.0 )) # Second parameter is yaw rate
33+ wa
34+ end
35+
536plt. ioff ()
637@testset " Plotting" begin
738 fig = plt. figure (figsize= (14 , 14 ))
@@ -12,5 +43,22 @@ plt.ioff()
1243 @test isfile (" /tmp/plot.pdf" )
1344 rm (" /tmp/plot.pdf" )
1445 show_plot (fig)
46+ wa = result_vsm ()
47+ fig = plot_geometry (
48+ wa,
49+ " Rectangular_wing_geometry" ;
50+ data_type= " .pdf" ,
51+ save_path= " /tmp" ,
52+ is_save= true ,
53+ is_show= false )
54+ @test fig isa plt. PyPlot. Figure
55+ @test isfile (" /tmp/Rectangular_wing_geometry_angled_view.pdf" )
56+ rm (" /tmp/Rectangular_wing_geometry_angled_view.pdf" )
57+ @test isfile (" /tmp/Rectangular_wing_geometry_front_view.pdf" )
58+ rm (" /tmp/Rectangular_wing_geometry_front_view.pdf" )
59+ @test isfile (" /tmp/Rectangular_wing_geometry_side_view.pdf" )
60+ rm (" /tmp/Rectangular_wing_geometry_side_view.pdf" )
61+ @test isfile (" /tmp/Rectangular_wing_geometry_top_view.pdf" )
62+ rm (" /tmp/Rectangular_wing_geometry_top_view.pdf" )
1563end
1664plt. ion ()
0 commit comments