@@ -16,18 +16,21 @@ aerodynamics using VSM and LLT. We'll cover the following steps:
1616
1717First, install Julia and set up the examples environment as explained in the
1818section [ Running the examples as developer] ( @ref ) . Then launch Julia:
19+
1920``` bash
2021julia --project=examples
2122```
2223
2324#### Step 1: Importing the necessary libraries:
25+
2426``` julia
2527julia> using LinearAlgebra
2628julia> using GLMakie
2729julia> using VortexStepMethod
2830```
2931
3032#### Step 2: Define wing parameters
33+
3134``` julia
3235julia> n_panels = 20 # Number of panels
3336julia> span = 20.0 # Wing span [m]
@@ -38,11 +41,13 @@ julia> alpha = deg2rad(alpha_deg)
3841```
3942
4043#### Step 3: Create wing geometry with linear panel distribution
44+
4145``` julia
4246julia> wing = Wing (n_panels, spanwise_distribution= LINEAR)
4347```
4448
4549##### Add wing sections - defining only tip sections with inviscid airfoil model
50+
4651``` julia
4752julia> add_section! (wing,
4853 [0.0 , span/ 2 , 0.0 ], # Left tip LE
@@ -55,36 +60,43 @@ julia> add_section!(wing,
5560```
5661
5762##### Refine the mesh
63+
5864``` julia
5965julia> refine! (wing)
6066```
6167
6268#### Step 4: Initialize aerodynamics
69+
6370``` julia
6471julia> body_aero = BodyAerodynamics ([wing])
6572```
73+
6674We need to pass here an array of wing objects, because a body can have
6775multiple wings.
6876
6977###### Set inflow conditions
78+
7079``` julia
7180julia> vel_app = [cos (alpha), 0.0 , sin (alpha)] .* v_a
7281julia> set_va! (body_aero, vel_app, [0 , 0 , 0.1 ])
7382```
7483
7584#### Step 5: Initialize solvers for both LLT and VSM methods
85+
7686``` julia
7787julia> llt_solver = Solver (body_aero; aerodynamic_model_type= LLT)
7888julia> vsm_solver = Solver (body_aero; aerodynamic_model_type= VSM)
7989```
8090
8191#### Step 6: Solve using both methods
92+
8293``` julia
8394julia> results_llt = solve (llt_solver, body_aero)
8495julia> results_vsm = solve (vsm_solver, body_aero)
8596```
8697
8798##### Print results comparison
99+
88100``` julia
89101julia> println (" \n Lifting Line Theory Results:" )
90102julia> println (" CL = $(round (results_llt[" cl" ], digits= 4 )) " )
@@ -96,6 +108,7 @@ julia> println("Projected area = $(round(results_vsm["projected_area"], digits=4
96108```
97109
98110#### Step 7: Plot combined analysis
111+
99112``` julia
100113julia> angle_range = range (0 , 20 , 20 )
101114julia> plot_combined_analysis (
@@ -112,13 +125,22 @@ julia> plot_combined_analysis(
112125```
113126
114127## More examples
115- From the examples environment (` julia --project=examples ` ), you can execute
128+ After launching Julia with (` jl ` ), you can execute
116129more examples by typing:
130+
117131``` julia
118132julia> include (" examples/menu.jl" )
119133```
120- You should see the following menu:
134+
135+ or, you prefer to use the ControlPlots library:
136+
137+ ``` julia
138+ julia> include (" examples_cp/menu_cp.jl" )
121139```
140+
141+ You should see the following menu:
142+
143+ ``` text
122144Choose function to execute or `q` to quit:
123145 > V3_kite = include("V3_kite.jl")
124146 billowing = include("billowing.jl")
@@ -130,5 +152,6 @@ Choose function to execute or `q` to quit:
130152 cleanup = include("cleanup.jl")
131153 quit
132154```
155+
133156You can select one of the examples using the ` <UP> ` and ` <DOWN> ` keys.
134157Press ` <ENTER> ` to run the selected example.
0 commit comments