Skip to content

Commit 01351a6

Browse files
committed
add mwe_03.jl
1 parent 19cc815 commit 01351a6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

mwes/mwe_03.jl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# fix allocations of this array comprehension:
2+
# y = [panel.control_point[2] for panel in body_aero.panels]
3+
4+
using VortexStepMethod
5+
6+
7+
# Step 1: Define wing parameters
8+
n_panels = 20 # Number of panels
9+
span = 20.0 # Wing span [m]
10+
chord = 1.0 # Chord length [m]
11+
v_a = 20.0 # Magnitude of inflow velocity [m/s]
12+
density = 1.225 # Air density [kg/m³]
13+
alpha_deg = 30.0 # Angle of attack [degrees]
14+
alpha = deg2rad(alpha_deg)
15+
16+
# Step 2: Create wing geometry with linear panel distribution
17+
wing = Wing(n_panels, spanwise_panel_distribution=LINEAR)
18+
19+
# Add wing sections - defining only tip sections with inviscid airfoil model
20+
add_section!(wing,
21+
[0.0, span/2, 0.0], # Left tip LE
22+
[chord, span/2, 0.0], # Left tip TE
23+
INVISCID)
24+
add_section!(wing,
25+
[0.0, -span/2, 0.0], # Right tip LE
26+
[chord, -span/2, 0.0], # Right tip TE
27+
INVISCID)
28+
29+
# Step 3: Initialize aerodynamics
30+
body_aero = BodyAerodynamics([wing])
31+
32+
y = [panel.control_point[2] for panel in body_aero.panels]
33+
@allocated y = [panel.control_point[2] for panel in body_aero.panels]

0 commit comments

Comments
 (0)