You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/lit/howto.jl
+27-9
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,33 @@ using LaTeXStrings # hide
8
8
# How to work with airfoil geometry.
9
9
10
10
# ### Import Coordinates File
11
-
# You can specify the path consisting of the foil's coordinates to the `read_foil` function. The format for the coordinates file requires a header for the name in the first line of the file. A custom name can be provided by setting the optional `name` variable.
11
+
# You can specify the path consisting of the foil's coordinates to the `read_foil` function. The [Selig format](https://openvsp.org/wiki/doku.php?id=airfoilexport) for the coordinates file is followed, in which a header for the name in the first line of the file with the coordinates following from the second line are required. A custom name can be provided by setting the optional `name` variable.
12
12
13
13
## Airfoil coordinates file path
14
14
foilpath =string(@__DIR__, "/misc/s1223.dat")
15
15
16
+
# Note that, in this example, `@__DIR__` points to the Julia REPL's current working directory. Use the correct local path for the coordinates on your computer.
17
+
16
18
## Read coordinates file
17
-
my_foil =read_foil(foilpath;
18
-
name ="S1223"# To overwrite name in header
19
-
)
19
+
my_foil =read_foil(
20
+
foilpath; # Path to the airfoil coordinates file
21
+
name ="S1223"# To overwrite name in header
22
+
)
20
23
21
24
#
22
25
plot(xlabel =L"x", ylabel =L"y", aspect_ratio =1)
23
26
plot!(my_foil)
24
27
28
+
# !!! tip
29
+
# You can also import airfoil coordinates from the internet by using `FileIO`.
# The inviscid 3D analysis uses a vortex lattice method. The `WingMesh` type allows you to generate horseshoe elements easily.
198
211
wing_horsies =make_horseshoes(wing_mesh)
199
212
213
+
# !!! note
214
+
# You can also generate vortex ring elements by calling `make_vortex rings`.
215
+
200
216
# For multiple lifting surfaces, it is most convenient to define a single vector consisting of all the components' horseshoes using [ComponentArrays.jl](https://github.com/jonniedie/ComponentArrays.jl).
201
217
aircraft =ComponentVector(
202
218
wing = wing_horsies,
@@ -217,7 +233,7 @@ fs = Freestream(
217
233
218
234
## Define reference values
219
235
refs =References(
220
-
speed =10.0,
236
+
speed =150.0,
221
237
density =1.225,
222
238
viscosity =1.5e-5,
223
239
area =projected_area(wing),
@@ -226,11 +242,12 @@ refs = References(
226
242
location =mean_aerodynamic_center(wing)
227
243
)
228
244
229
-
# The vortex lattice analysis can be executed with the horseshoes, freestream condition, and reference values defined.
245
+
# The vortex lattice analysis can be executed with the vortex elements, freestream conditions, and reference values defined. An optional named argument is provided for enabling compressibility corrections at ``M > 0.3`` via the Prandtl-Glauert transformation.
230
246
231
247
## Solve system
232
248
system =solve_case(
233
249
aircraft, fs, refs;
250
+
compressible =true, # Compressibility corrections via Prandtl-Glauert transformation
234
251
print =true, # Prints the results for only the aircraft
235
252
print_components =true, # Prints the results for all components
# A Trefftz plane integration is performed to compute farfield forces.
261
278
#
262
279
# !!! note
263
-
# The farfield forces are usually more accurate compared to nearfield forces, as the components do not interact as in the evaluation of the Biot-Savart integrals for the latter.
280
+
# The farfield forces are usually more accurate compared to nearfield forces.
281
+
# (This is because the components do not interact as in the evaluation of the Biot-Savart integrals for the latter.)
264
282
#
265
283
# To obtain the nearfield coefficients of the components (in wind axes by definition):
# The derivatives of the aerodynamic coefficients with respect to the freestream values is obtained by automatic differentiation enabled by [ForwardDiff](https://github.com/JuliaDiff/ForwardDiff.jl). The following function evaluates the derivatives of the aerodynamic coefficients with respect to the freestream values. You can also optionally provide the axes for the reference frame of the coefficients.
300
+
# The derivatives of the aerodynamic coefficients with respect to the freestream values are obtained by automatic differentiation enabled by [ForwardDiff](https://github.com/JuliaDiff/ForwardDiff.jl). The following function evaluates the derivatives of the aerodynamic coefficients with respect to the freestream values. You can also optionally provide the axes for the reference frame of the coefficients.
283
301
dv_data =freestream_derivatives(
284
302
system,
285
303
print =true, # Prints the results for only the aircraft
Copy file name to clipboardexpand all lines: docs/lit/tutorials-airfoil.jl
+1-1
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ plot(
47
47
48
48
# ## Your First Doublet-Source Analysis
49
49
#
50
-
# Now we have an airfoil, and we would like to analyze its aerodynamic characteristics. The potential flow panel method for inviscid analyses of airfoils, which you may have studied in your course in aerodynamics, provides decent estimations of the lift generated by the airfoil.
50
+
# Now we have an airfoil, and we would like to analyze its aerodynamic characteristics. The potential flow panel method for inviscid analyses of airfoils, which you may have studied in your course on aerodynamics, provides decent estimations of the lift generated by the airfoil.
51
51
52
52
# Our analysis also requires boundary conditions, which is the freestream flow defined by a magnitude ``V_\infty`` and angle of attack ``\alpha``. We provide these to the analysis by defining variables and feeding them to a `Uniform2D` type, corresponding to uniform flow in 2 dimensions.
Copy file name to clipboardexpand all lines: docs/src/howto.md
+33-11
Original file line number
Diff line number
Diff line change
@@ -15,23 +15,40 @@ using LaTeXStrings # hide
15
15
How to work with airfoil geometry.
16
16
17
17
### Import Coordinates File
18
-
You can specify the path consisting of the foil's coordinates to the `read_foil` function. The format for the coordinates file requires a header for the name in the first line of the file. A custom name can be provided by setting the optional `name` variable.
18
+
You can specify the path consisting of the foil's coordinates to the `read_foil` function. The [Selig format](https://openvsp.org/wiki/doku.php?id=airfoilexport) for the coordinates file is followed, in which a header for the name in the first line of the file with the coordinates following from the second line are required. A custom name can be provided by setting the optional `name` variable.
19
19
20
20
````@example howto
21
21
# Airfoil coordinates file path
22
-
foilpath = string(@__DIR__, "/misc/s1223.dat")
22
+
foilpath = string(@__DIR__, "/misc/s1223.dat") #
23
+
````
24
+
25
+
Note that, in this example, `@__DIR__` points to the Julia REPL's current working directory. Use the correct local path for the coordinates on your computer.
A basic cosine interpolation functionality is provided for foils.
@@ -185,7 +202,7 @@ How to run a generic aerodynamic analysis on a conventional aircraft configurati
185
202
### Geometry
186
203
First we define the lifting surfaces. These can be a combination of `Wing` types constructed using the various methods available.
187
204
!!! warning "Alert"
188
-
Support for fuselages and control surfaces will be added soon.
205
+
Support for fuselages and control surfaces is in progress.
189
206
190
207
Horizontal tail
191
208
@@ -256,6 +273,9 @@ The inviscid 3D analysis uses a vortex lattice method. The `WingMesh` type allow
256
273
wing_horsies = make_horseshoes(wing_mesh)
257
274
````
258
275
276
+
!!! note
277
+
You can also generate vortex ring elements by calling `make_vortex rings`.
278
+
259
279
For multiple lifting surfaces, it is most convenient to define a single vector consisting of all the components' horseshoes using [ComponentArrays.jl](https://github.com/jonniedie/ComponentArrays.jl).
260
280
261
281
````@example howto
@@ -283,7 +303,7 @@ To define reference values, use the following `References` type.
283
303
````@example howto
284
304
# Define reference values
285
305
refs = References(
286
-
speed = 10.0,
306
+
speed = 150.0,
287
307
density = 1.225,
288
308
viscosity = 1.5e-5,
289
309
area = projected_area(wing),
@@ -293,12 +313,13 @@ refs = References(
293
313
)
294
314
````
295
315
296
-
The vortex lattice analysis can be executed with the horseshoes, freestream condition, and reference values defined.
316
+
The vortex lattice analysis can be executed with the vortex elements, freestream conditions, and reference values defined. An optional named argument is provided for enabling compressibility corrections at ``M > 0.3`` via the Prandtl-Glauert transformation.
297
317
298
318
````@example howto
299
319
# Solve system
300
320
system = solve_case(
301
321
aircraft, fs, refs;
322
+
compressible = true, # Compressibility corrections via Prandtl-Glauert transformation
302
323
print = true, # Prints the results for only the aircraft
303
324
print_components = true, # Prints the results for all components
A Trefftz plane integration is performed to compute farfield forces.
341
362
342
363
!!! note
343
-
The farfield forces are usually more accurate compared to nearfield forces, as the components do not interact as in the evaluation of the Biot-Savart integrals for the latter.
364
+
The farfield forces are usually more accurate compared to nearfield forces.
365
+
(This is because the components do not interact as in the evaluation of the Biot-Savart integrals for the latter.)
344
366
345
367
To obtain the nearfield coefficients of the components (in wind axes by definition):
346
368
@@ -354,7 +376,7 @@ Similarly for the farfield coefficients of the components.
354
376
ffs = farfield_coefficients(system)
355
377
````
356
378
357
-
You can access the values corresponding to the components by the name used in the `ComponentArray`constrution.
379
+
You can access the values corresponding to the components by the name used in the `ComponentArray`construction.
The derivatives of the aerodynamic coefficients with respect to the freestream values is obtained by automatic differentiation enabled by [ForwardDiff](https://github.com/JuliaDiff/ForwardDiff.jl). The following function evaluates the derivatives of the aerodynamic coefficients with respect to the freestream values. You can also optionally provide the axes for the reference frame of the coefficients.
399
+
The derivatives of the aerodynamic coefficients with respect to the freestream values are obtained by automatic differentiation enabled by [ForwardDiff](https://github.com/JuliaDiff/ForwardDiff.jl). The following function evaluates the derivatives of the aerodynamic coefficients with respect to the freestream values. You can also optionally provide the axes for the reference frame of the coefficients.
Copy file name to clipboardexpand all lines: docs/src/tutorials-airfoil.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ plot(
73
73
74
74
## Your First Doublet-Source Analysis
75
75
76
-
Now we have an airfoil, and we would like to analyze its aerodynamic characteristics. The potential flow panel method for inviscid analyses of airfoils, which you may have studied in your course in aerodynamics, provides decent estimations of the lift generated by the airfoil.
76
+
Now we have an airfoil, and we would like to analyze its aerodynamic characteristics. The potential flow panel method for inviscid analyses of airfoils, which you may have studied in your course on aerodynamics, provides decent estimations of the lift generated by the airfoil.
77
77
78
78
Our analysis also requires boundary conditions, which is the freestream flow defined by a magnitude ``V_\infty`` and angle of attack ``\alpha``. We provide these to the analysis by defining variables and feeding them to a `Uniform2D` type, corresponding to uniform flow in 2 dimensions.
0 commit comments