Skip to content

Commit a568136

Browse files
author
Arjit Seth
authored
Merge pull request #132 from GodotMisogi/develop
Version 0.4.5: Added ring vortices for vortex lattice analysis and other minor bugfixes
2 parents d73c5af + 90b9a28 commit a568136

37 files changed

+1231
-789
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AeroFuse"
22
uuid = "477c59f4-51f5-487f-bf1e-8db39645b227"
33
authors = ["GodotMisogi <[email protected]>"]
4-
version = "0.4.4"
4+
version = "0.4.5"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ If you use AeroFuse in your research, please cite the following until any releva
6161
author = {Arjit Seth, Rhea P. Liem},
6262
title = {AeroFuse},
6363
url = {https://github.com/GodotMisogi/AeroFuse},
64-
version = {0.4.4},
65-
date = {2023-03-14},
64+
version = {0.4.5},
65+
date = {2023-03-20},
6666
}
6767
```

docs/Project.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
44
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
5+
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
56
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
67
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
78
PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5"

docs/lit/howto.jl

+27-9
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,33 @@ using LaTeXStrings # hide
88
# How to work with airfoil geometry.
99

1010
# ### 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.
1212

1313
## Airfoil coordinates file path
1414
foilpath = string(@__DIR__, "/misc/s1223.dat")
1515

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+
1618
## 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+
)
2023

2124
#
2225
plot(xlabel = L"x", ylabel = L"y", aspect_ratio = 1)
2326
plot!(my_foil)
2427

28+
# !!! tip
29+
# You can also import airfoil coordinates from the internet by using `FileIO`.
30+
31+
## Read coordinates from an internet address.
32+
using FileIO
33+
34+
online_foil = read_foil(download("https://m-selig.ae.illinois.edu/ads/coord/s1210.dat"))
35+
36+
plot!(online_foil)
37+
2538
# ### Interpolate and Process Coordinates
2639

2740
# A basic cosine interpolation functionality is provided for foils.
@@ -141,7 +154,7 @@ print_info(wing, "My Wing")
141154
# ### Geometry
142155
# First we define the lifting surfaces. These can be a combination of `Wing` types constructed using the various methods available.
143156
# !!! warning "Alert"
144-
# Support for fuselages and control surfaces will be added soon.
157+
# Support for fuselages and control surfaces is in progress.
145158

146159
# Horizontal tail
147160
htail = WingSection(
@@ -197,6 +210,9 @@ vtail_mesh = WingMesh(vtail, [10], 5); # Vertical tail
197210
# The inviscid 3D analysis uses a vortex lattice method. The `WingMesh` type allows you to generate horseshoe elements easily.
198211
wing_horsies = make_horseshoes(wing_mesh)
199212

213+
# !!! note
214+
# You can also generate vortex ring elements by calling `make_vortex rings`.
215+
200216
# 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).
201217
aircraft = ComponentVector(
202218
wing = wing_horsies,
@@ -217,7 +233,7 @@ fs = Freestream(
217233

218234
## Define reference values
219235
refs = References(
220-
speed = 10.0,
236+
speed = 150.0,
221237
density = 1.225,
222238
viscosity = 1.5e-5,
223239
area = projected_area(wing),
@@ -226,11 +242,12 @@ refs = References(
226242
location = mean_aerodynamic_center(wing)
227243
)
228244

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.
230246

231247
## Solve system
232248
system = solve_case(
233249
aircraft, fs, refs;
250+
compressible = true, # Compressibility corrections via Prandtl-Glauert transformation
234251
print = true, # Prints the results for only the aircraft
235252
print_components = true, # Prints the results for all components
236253
)
@@ -260,7 +277,8 @@ Fs, Ms = surface_dynamics(system; axes = ax)
260277
# A Trefftz plane integration is performed to compute farfield forces.
261278
#
262279
# !!! 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.)
264282
#
265283
# To obtain the nearfield coefficients of the components (in wind axes by definition):
266284
nfs = nearfield_coefficients(system)
@@ -279,7 +297,7 @@ print_coefficients(nfs.wing, ffs.wing, :wing)
279297
print_coefficients(nf, ff, :aircraft)
280298

281299
# ## Aerodynamic Stability Analyses
282-
# 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.
283301
dv_data = freestream_derivatives(
284302
system,
285303
print = true, # Prints the results for only the aircraft

docs/lit/tutorials-airfoil.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ plot(
4747

4848
# ## Your First Doublet-Source Analysis
4949
#
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.
5151

5252
# 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.
5353
V = 1.0

docs/make.jl

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ makedocs(
5555
analytics = "UA-89998292-1"
5656
# highlightjs = "theme/highlight.js",
5757
),
58+
checkdocs = :exports,
5859
)
5960

6061
## Deployment

docs/src/assets/VortexLattice.svg

+3-3
Loading

docs/src/howto.md

+33-11
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,40 @@ using LaTeXStrings # hide
1515
How to work with airfoil geometry.
1616

1717
### 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.
1919

2020
````@example howto
2121
# 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.
2326

27+
````@example howto
2428
# Read coordinates file
25-
my_foil = read_foil(foilpath;
26-
name = "S1223" # To overwrite name in header
27-
)
29+
my_foil = read_foil(
30+
foilpath; # Path to the airfoil coordinates file
31+
name = "S1223" # To overwrite name in header
32+
)
2833
````
2934

3035
````@example howto
3136
plot(xlabel = L"x", ylabel = L"y", aspect_ratio = 1)
3237
plot!(my_foil)
3338
````
3439

40+
!!! tip
41+
You can also import airfoil coordinates from the internet by directly specifying the URL to a file.
42+
43+
````@example howto
44+
# Read coordinates from an internet address.
45+
using FileIO
46+
47+
online_foil = read_foil(download("https://m-selig.ae.illinois.edu/ads/coord/s1210.dat"))
48+
49+
plot!(online_foil)
50+
````
51+
3552
### Interpolate and Process Coordinates
3653

3754
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
185202
### Geometry
186203
First we define the lifting surfaces. These can be a combination of `Wing` types constructed using the various methods available.
187204
!!! warning "Alert"
188-
Support for fuselages and control surfaces will be added soon.
205+
Support for fuselages and control surfaces is in progress.
189206

190207
Horizontal tail
191208

@@ -256,6 +273,9 @@ The inviscid 3D analysis uses a vortex lattice method. The `WingMesh` type allow
256273
wing_horsies = make_horseshoes(wing_mesh)
257274
````
258275

276+
!!! note
277+
You can also generate vortex ring elements by calling `make_vortex rings`.
278+
259279
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).
260280

261281
````@example howto
@@ -283,7 +303,7 @@ To define reference values, use the following `References` type.
283303
````@example howto
284304
# Define reference values
285305
refs = References(
286-
speed = 10.0,
306+
speed = 150.0,
287307
density = 1.225,
288308
viscosity = 1.5e-5,
289309
area = projected_area(wing),
@@ -293,12 +313,13 @@ refs = References(
293313
)
294314
````
295315

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.
297317

298318
````@example howto
299319
# Solve system
300320
system = solve_case(
301321
aircraft, fs, refs;
322+
compressible = true, # Compressibility corrections via Prandtl-Glauert transformation
302323
print = true, # Prints the results for only the aircraft
303324
print_components = true, # Prints the results for all components
304325
)
@@ -340,7 +361,8 @@ Fs, Ms = surface_dynamics(system; axes = ax)
340361
A Trefftz plane integration is performed to compute farfield forces.
341362

342363
!!! 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.)
344366

345367
To obtain the nearfield coefficients of the components (in wind axes by definition):
346368

@@ -354,7 +376,7 @@ Similarly for the farfield coefficients of the components.
354376
ffs = farfield_coefficients(system)
355377
````
356378

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.
358380

359381
````@example howto
360382
@show (nfs.wing, ffs.wing)
@@ -374,7 +396,7 @@ print_coefficients(nf, ff, :aircraft)
374396
````
375397

376398
## Aerodynamic Stability Analyses
377-
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.
378400

379401
````@example howto
380402
dv_data = freestream_derivatives(

docs/src/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ If you use AeroFuse in your research, please cite the following until any releva
5353
author = {Arjit Seth, Rhea P. Liem},
5454
title = {AeroFuse},
5555
url = {https://github.com/GodotMisogi/AeroFuse},
56-
version = {0.4.4},
57-
date = {2023-03-14},
56+
version = {0.4.5},
57+
date = {2023-03-20},
5858
}
5959
```
6060

docs/src/tutorials-airfoil.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ plot(
7373

7474
## Your First Doublet-Source Analysis
7575

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.
7777

7878
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.
7979

0 commit comments

Comments
 (0)