Skip to content

Commit 9d9027a

Browse files
authored
Merge pull request #89 from cibinjoseph/vsp
OpenVSP geometry import feature
2 parents a829829 + 32ebeee commit 9d9027a

19 files changed

+25859
-17
lines changed

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "FLOWUnsteady"
22
uuid = "b491798d-ac6e-455f-a27c-49c10bb0a666"
33
authors = ["Eduardo J. Alvarez <Edo.AlvarezR@gmail.com> and contributors"]
4-
version = "3.2.1"
4+
version = "3.3.0"
55

66
[deps]
77
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
@@ -17,13 +17,14 @@ FLOWVPM = "6e19019d-7c31-4940-9d16-c3f15dfe6020"
1717
FLOWVLM = "1a3ff0be-0410-4572-aa62-b496bdd1f33b"
1818
FLOWNoise = "d27480ee-285d-533b-ae3d-5018956ae0bc"
1919
BPM = "f91b385c-3ede-44c9-92c8-2a04f762ef2f"
20+
VSPGeom = "9b3f6a95-fce2-4bc5-94a2-f99b39986ea6"
2021

2122
[compat]
2223
julia = "1.6"
2324
GeometricTools = "2.1.6"
2425
FLOWVPM = "3.0.1"
2526
FLOWVLM = "2.1.2"
26-
FLOWNoise = "2.3.1"
27+
FLOWNoise = "2.3.2"
2728
BPM = "2.0.1"
2829

2930
[extras]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ over long distances with minimal numerical dissipation.
4848
The rVPM uses particles to discretize the Navier-Stokes equations, with the
4949
particles representing radial basis functions that construct a continuous
5050
vorticity/velocity field. The basis functions become the LES filter, providing a
51-
variable filter width and spatial adaption as the particles are convected and
51+
variable filter width and spatial adaptation as the particles are convected and
5252
stretched by the velocity field. The local evolution of the filter width
53-
provides an extra degree of freedom to reinforce conservations laws, which makes
53+
provides an extra degree of freedom to reinforce conservation laws, which makes
5454
the reformulated VPM numerically stable (overcoming the numerical issues that
5555
plague the classic VPM).
5656

docs/make.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ makedocs(
5555
"examples/vahana-vehicle.md",
5656
"examples/vahana-maneuver.md",
5757
"examples/vahana-monitor.md",
58-
"examples/vahana-run.md",
58+
"examples/vahana-run.md"
5959
],
60+
"examples/openvsp-aircraft.md"
6061
],
6162
"Visualization" => "visualization.md",
6263
"Theory" => [
@@ -69,7 +70,8 @@ makedocs(
6970
"(1) Vehicle Definition" => [
7071
"api/flowunsteady-vehicle-types.md",
7172
"api/flowunsteady-vehicle-components.md",
72-
"api/flowunsteady-vehicle-asm.md"
73+
"api/flowunsteady-vehicle-asm.md",
74+
"api/flowunsteady-openvsp.md"
7375
],
7476
"api/flowunsteady-maneuver.md",
7577
"api/flowunsteady-simulation.md",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# [Importing OpenVSP geometry](@id openvsp_import)
2+
3+
```@docs
4+
FLOWUnsteady.read_degengeom
5+
FLOWUnsteady.import_vsp
6+
```
119 KB
Loading
165 KB
Loading
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# OpenVSP Geometry
2+
3+
In this example, we import an aircraft model created in OpenVSP into the FLOWUnsteady environment. The `aircraft.vsp3` file used here is available in the folder [`examples/aircraft-vsp/`](https://github.com/byuflowlab/FLOWUnsteady/tree/master/examples) in the FLOWUnsteady GitHub repo.
4+
5+
After creating the aircraft geometry in OpenVSP, we write out a DegenGeom file using the tab Analysis > DegenGeom as shown below. This creates a CSV file that contains all the components of the aircraft geometry.
6+
7+
![DegenGeom](assets/DegenGeom.png)
8+
9+
Let's import the geometry into Julia using the [`FLOWUnsteady.read_degengeom`](@ref) function and inspect it.
10+
```@example inspect
11+
import FLOWUnsteady as uns
12+
13+
geom_path = joinpath(uns.examples_path, "aircraft-vsp", "aircraft.csv")
14+
comp = uns.read_degengeom(geom_path);
15+
16+
for i in 1:length(comp)
17+
println("$i. $(comp[i].name)")
18+
end
19+
```
20+
21+
Now that we have a good idea about the index of the components in the geometry, we can use them in FLOWUnsteady using the function [`FLOWUnsteady.import_vsp`](@ref). The following example script imports the OpenVSP geometry, creates FLOWUnsteady data structures and writes it out to a vtk file. The geometry can be used with the FLOWUnsteady solver by following one of the previous examples.
22+
23+
```julia
24+
#=##############################################################################
25+
# DESCRIPTION
26+
Import of OpenVSP geometry into FLOWUnsteady
27+
28+
# AUTHORSHIP
29+
* Author : Cibin Joseph
30+
* Email : cibinjoseph92@gmail.com
31+
* Created : Aug 2023
32+
* Last updated : Aug 2023
33+
* License : MIT
34+
=###############################################################################
35+
36+
import FLOWUnsteady as uns
37+
38+
run_name = "aircraft-vsp" # Name of this simulation
39+
save_path = run_name # Where to save this simulation
40+
41+
# Path to DegenGeom file
42+
geom_path = joinpath(uns.examples_path, "aircraft-vsp", "aircraft.csv")
43+
44+
Vinf(X, t) = [1.0, 0.0, 0.0] # Freestream function
45+
46+
# ----------------- 1) VEHICLE DEFINITION --------------------------------------
47+
println("Importing geometry...")
48+
49+
# Import VSP Components from DegenGeom file
50+
comp = uns.read_degengeom(geom_path);
51+
52+
fuselage = uns.import_vsp(comp[1])
53+
wingL = uns.import_vsp(comp[2])
54+
wingR = uns.import_vsp(comp[2]; flip_y=true)
55+
basefuse = uns.import_vsp(comp[4])
56+
horstabL = uns.import_vsp(comp[5])
57+
horstabR = uns.import_vsp(comp[5]; flip_y=true)
58+
verstab = uns.import_vsp(comp[7])
59+
60+
println("Generating vehicle...")
61+
62+
# Generate vehicle
63+
system = uns.vlm.WingSystem() # System of all FLOWVLM objects
64+
uns.vlm.addwing(system, "WingL", wingL)
65+
uns.vlm.addwing(system, "WingR", wingR)
66+
uns.vlm.addwing(system, "HorStabL", horstabL)
67+
uns.vlm.addwing(system, "HorStabR", horstabR)
68+
uns.vlm.addwing(system, "VerStab", verstab)
69+
70+
fuse_grid = uns.gt.MultiGrid(3)
71+
uns.gt.addgrid(fuse_grid, "Fuselage", fuselage)
72+
73+
basefuse_grid = uns.gt.MultiGrid(3)
74+
uns.gt.addgrid(basefuse_grid, "BaseFuse", basefuse)
75+
76+
grids = [fuse_grid, basefuse_grid]
77+
78+
vlm_system = system # System solved through VLM solver
79+
wake_system = system # System that will shed a VPM wake
80+
81+
vehicle = uns.VLMVehicle( system;
82+
vlm_system=vlm_system,
83+
wake_system=wake_system,
84+
grids=grids
85+
);
86+
87+
# ----------------- EXPORT GEOMETRY --------------------------------------------
88+
if isdir(save_path); rm(save_path, recursive=true, force=true); end
89+
mkdir(save_path)
90+
91+
uns.vlm.setVinf(system, Vinf)
92+
str = uns.save_vtk(vehicle, run_name; path=save_path)
93+
94+
# Open up geometry in ParaView
95+
str = joinpath(save_path, str)
96+
run(`paraview -data=$(str)`)
97+
```
98+
99+
![Paraview](assets/aircraft-paraview.png)

docs/src/examples/rotorhover-aero.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ vpm_SFS = vpm.SFS_none # VPM LES subfilter-scale model
219219
# vpm_SFS = vpm.DynamicSFS(vpm.Estr_fmm, vpm.pseudo3level_positive;
220220
# alpha=0.999, rlxf=0.005, minC=0, maxC=1
221221
# clippings=[vpm.clipping_backscatter],
222-
# controls=[control_sigmasensor],
222+
# controls=[vpm.control_sigmasensor],
223223
# )
224224

225225
# NOTE: In most practical situations, open rotors operate at a Reynolds number
@@ -419,7 +419,7 @@ uns.run_simulation(simulation, nsteps;
419419
omit_shedding=omit_shedding,
420420
extra_runtime_function=runtime_function,
421421
# ----- RESTART OPTIONS -----------------
422-
restart_file=restart_file,
422+
restart_vpmfile=restart_file,
423423
# ----- OUTPUT OPTIONS ------------------
424424
save_path=save_path,
425425
run_name=run_name,

docs/src/examples/rotorhover-quasisteady.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ simply changing the following parameter in
55
[the aero solution](@ref rotorhoveraero):
66
```julia
77
VehicleType = uns.QVLMVehicle
8+
n = 50 # <---- For some reason PSU-WOPWOP breaks with less blade elements
89
```
910
and this parameter when [calling PSU-WOPWOP](@ref rotorhovernoise):
1011
```julia

docs/src/generate_examples_rotorhover.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ open(joinpath(output_path, output_name*"-quasisteady.md"), "w") do fout
511511
[the aero solution](@ref rotorhoveraero):
512512
```julia
513513
VehicleType = uns.QVLMVehicle
514+
n = 50 # <---- For some reason PSU-WOPWOP breaks with less blade elements
514515
```
515516
and this parameter when [calling PSU-WOPWOP](@ref rotorhovernoise):
516517
```julia

0 commit comments

Comments
 (0)