Skip to content

Commit a14efd3

Browse files
authored
Merge pull request #51 from byuflowlab/dev
Dev
2 parents ae5beba + b846935 commit a14efd3

File tree

82 files changed

+734
-11537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+734
-11537
lines changed

README.md

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -163,32 +163,32 @@ See the following publications for an in-depth dive into the theory and validati
163163

164164
### Examples
165165

166-
**Propeller:** [[Tutorial](https://flow.byu.edu/FLOWUnsteady/examples/propeller-J040)] [Validation]
166+
**Propeller:** [[Tutorial](https://flow.byu.edu/FLOWUnsteady/examples/propeller-J040)] [[Validation](https://flow.byu.edu/FLOWUnsteady/theory/validation/#Propeller)]
167167

168168
<p align="center"> <a href="https://www.youtube.com/watch?v=lUIytQybCpQ&hd=1"> <img src="http://edoalvar2.groups.et.byu.net/public/FLOWUnsteady/youtube-prop.png" alt="youtube.com/watch?v=lUIytQybCpQ" style="width:70%"> </a> </p>
169169

170170

171-
**Rotor in Hover:** [[Tutorial](https://flow.byu.edu/FLOWUnsteady/examples/rotorhover-aero)] [Validation]
171+
**Rotor in Hover:** [[Tutorial](https://flow.byu.edu/FLOWUnsteady/examples/rotorhover-aero)] [[Validation](https://flow.byu.edu/FLOWUnsteady/theory/validation/#Rotor)]
172172

173173
<p align="center"> <a href="https://www.youtube.com/watch?v=u9SgYbYhPpU&hd=1"> <img src="http://edoalvar2.groups.et.byu.net/public/FLOWUnsteady/youtube-hover.png" alt="youtube.com/watch?v=u9SgYbYhPpU" style="width:70%"> </a> </p>
174174

175175

176-
**Blown Wing:** [[Tutorial](https://flow.byu.edu/FLOWUnsteady/examples/blownwing-aero)] [Validation]
176+
**Blown Wing:** [[Tutorial](https://flow.byu.edu/FLOWUnsteady/examples/blownwing-aero)] [[Validation](https://flow.byu.edu/FLOWUnsteady/theory/validation/#Rotor-Wing-Interactions)]
177177

178178
<p align="center">
179179
<img src="http://edoalvar2.groups.et.byu.net/public/FLOWUnsteady/prowimhtp-wvol34-cropped00.jpg" alt="img" style="width:100%">
180180
</p>
181181

182182
<p><br></p>
183183

184-
**Airborne-Wind-Energy Aircraft:** [Validation] [[Video](https://www.youtube.com/watch?v=iFM3B4_N2Ls)]
184+
**Airborne-Wind-Energy Aircraft:** [[Video](https://www.youtube.com/watch?v=iFM3B4_N2Ls)]
185185

186186
<p align="left">
187187
<img src="http://edoalvar2.groups.et.byu.net/public/FLOWUnsteady/circular-fdom-top02.jpg" alt="img" style="width:75%">
188188
</p>
189189

190190

191-
**eVTOL Transition:** [Tutorial] [[Video 1](https://www.youtube.com/watch?v=-6aR37Z6hig)] [[Video 2](https://www.youtube.com/watch?v=d__wNtRIBY8)]
191+
**eVTOL Transition:** [[Tutorial](https://flow.byu.edu/FLOWUnsteady/examples/vahana-vehicle/)]
192192

193193
Mid-fidelity
194194
<p align="center"> <a href="https://www.youtube.com/watch?v=d__wNtRIBY8&hd=1"> <img src="http://edoalvar2.groups.et.byu.net/public/FLOWUnsteady/youtube-vahanamid.png" alt="youtube.com/watch?v=d__wNtRIBY8" style="width:70%"> </a> </p>
@@ -197,7 +197,7 @@ High-fidelity
197197
<p align="center"> <a href="https://www.youtube.com/watch?v=-6aR37Z6hig&hd=1"> <img src="http://edoalvar2.groups.et.byu.net/public/FLOWUnsteady/youtube-vahanahi.png" alt="youtube.com/watch?v=-6aR37Z6hig" style="width:70%"> </a> </p>
198198

199199

200-
**Aeroacoustic Noise:** [[Tutorial](https://flow.byu.edu/FLOWUnsteady/examples/rotorhover-acoustics)] [Validation]
200+
**Aeroacoustic Noise:** [[Tutorial](https://flow.byu.edu/FLOWUnsteady/examples/rotorhover-acoustics)] [[Validation](https://flow.byu.edu/FLOWUnsteady/theory/validation/#Rotor)]
201201

202202
<p align="center">
203203
<img src="http://edoalvar2.groups.et.byu.net/public/FLOWUnsteady/cfdnoise_ningdji_multi_005D_03_20.gif" alt="Vid" style="width:60%"/>
@@ -237,16 +237,3 @@ If the issue still persists, please
237237
* Main developer : Eduardo J. Alvarez ([edoalvarez.com](https://www.edoalvarez.com/))
238238
* Created : Sep 2017
239239
* License : MIT License
240-
241-
**TODO**
242-
* [ ] README
243-
* [ ] Add links to examples in README
244-
* [ ] Theory
245-
* [ ] Add a validations section compiling all validation studies
246-
* [ ] List of publications
247-
* [ ] Test installation instructions on MacOS and native Windows
248-
* [ ] Examples
249-
* [ ] Vahana
250-
* [ ] Bring fidelity down, list parameters for high fidelity
251-
* [ ] Post processing: fluid domain?
252-
* [ ] Add analytics

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include("src/generate_examples.jl")
1616

1717
makedocs(
1818
sitename = "FLOWUnsteady",
19-
format = Documenter.HTML(;
19+
format = Documenter.HTML(; analytics = "G-B7CBF7WC7L",
2020
sidebar_sitename = false,
2121
assets = ["assets/favicon.ico"],
2222
collapselevel = 1

docs/src/api/flowunsteady-monitor.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ FLOWUnsteady.generate_aerodynamicforce_parasiticdrag
6363
FLOWUnsteady.calc_aerodynamicforce_unsteady
6464
```
6565

66-
## Wake Treatment
66+
## [Wake Treatment](@id waketreatmentapi)
6767
Since the full set of state variables is passed to `extra_runtime_function`,
6868
this function can also be used to alter the simulation on the fly.
6969
In some circumstances it is desirable to be able to remove or modify particles,
@@ -84,13 +84,13 @@ monitor_states = uns.generate_monitor_statevariables()
8484
monitor_enstrophy = uns.generate_monitor_enstrophy()
8585

8686
# Monitor pipeline
87-
monitors(args...; optargs...) = monitor_states(args...; optargs...) || monitor_enstrophy(args...; optargs...)
87+
monitors = uns.concatenate(monitor_states, monitor_enstrophy)
8888

8989
# Define wake treatment
9090
wake_treatment = uns.remove_particles_sphere(1.0, 1; Xoff=zeros(3))
9191

9292
# Extra runtime function pipeline
93-
extra_runtime_function(args...; optargs...) = monitors(args...; optargs...) || wake_treatment(args...; optargs...)
93+
extra_runtime_function = uns.concatenate(monitors, wake_treatment)
9494

9595
```
9696
Then pass this pipeline to the simulation as

docs/src/examples/blownwing-asm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Actuator Surface Model
1+
# [Actuator Surface Model](@id asm)
22

33
The aerodynamic solution computed in [the first section](@ref blownwingaero)
44
was intended to be a mid-low fidelity simulation, which modeled the wing

docs/src/examples/rotorhover-aero.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ particles (right).
521521
high-fidelity simulation.
522522

523523

524-
In [examples/rotorhover/rotorhover_postprocess.jl](https://github.com/byuflowlab/FLOWUnsteady/blob/master/examples/rotorhover/rotorhover_postprocess.jl)
524+
In [examples/rotorhover/rotorhover_postprocessing.jl](https://github.com/byuflowlab/FLOWUnsteady/blob/master/examples/rotorhover/rotorhover_postprocessing.jl)
525525
we show how to postprocess the simulations to compare ``C_T`` and blade
526526
loading to experimental data by Zawodny *et al*.[^1] and a URANS simulation
527527
(STAR-CCM+) by Schenk[^2]:

docs/src/examples/vahana-monitor.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ function generate_monitor_vahana(vehicle, rho, RPMref, nsteps, save_path, Vinf;
8484
nsteps;
8585
save_path=save_path,
8686
run_name=monitor_name,
87-
figname=monitor_name)
87+
figname=monitor_name,
88+
save_init_plots=false)
8889
push!(monitors, rotors_monitor)
8990
end
9091

docs/src/examples/vahana-run.md

Lines changed: 83 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# [Run Simulation](@id vahanarun)
22

3+
A mid fidelity resolution makes the computational cost
4+
tractable and possible to be run the full maneuver (30 seconds of real time)
5+
overnight on a laptop computer.
6+
This is a video of the full maneuver in mid fidelity:
7+
38
```@raw html
49
<div style="position:relative;padding-top:50%;">
510
<iframe style="position:absolute;left:0;top:0;height:80%;width:72%;"
@@ -10,6 +15,51 @@
1015
</div>
1116
```
1217

18+
With a finer temporal and spatial resolution, it becomes impractical to resolve
19+
the entire maneuver, and instead we recommend simulating one fragment of
20+
the maneuver at a time.
21+
For instance, here is a high-fidelity simulation of the transition from
22+
hover to cruise:
23+
24+
```@raw html
25+
<div style="position:relative;padding-top:50%;">
26+
<iframe style="position:absolute;left:0;top:0;height:80%;width:72%;"
27+
src="https://www.youtube.com/embed/-6aR37Z6hig?hd=1"
28+
title="YouTube video player" frameborder="0"
29+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
30+
allowfullscreen></iframe>
31+
</div>
32+
```
33+
34+
As a reference, here are the parameters that we have used for the mid and high
35+
fidelity simulations:
36+
37+
38+
| Parameter | Mid fidelity | High fidelity | Description |
39+
| :-------: | :----------: | :-----------: | :---------- |
40+
| `n_factor`| `1` | `4` | Factor that controls the level of discretization of wings and blade surfaces |
41+
| `nsteps` | `4*5400` | `8*5400` | Time steps for the entire maneuver |
42+
| `t_start` | `0` | `0.20*ttot` | (s) start simulation at this point in time |
43+
| `t_quit` | `ttot` | `0.30*ttot` | (s) end imulation at this point in time |
44+
| `lambda_vpm` | `2.125` | `1.5*2.125` | VPM core overlap |
45+
| `vlm_vortexsheet` | `false` | `true` | Whether to spread the wing surface vorticity as a vortex sheet |
46+
| `vpm_integration` | `vpm.euler` | `vpm.rungekutta3` | VPM time integration scheme |
47+
48+
49+
```@raw html
50+
<br>
51+
```
52+
53+
Along the way, in this simulation we exemplify the following advanced features:
54+
* Defining a variable pitch for rotors between hover and cruise
55+
* Using the [actuator surface model](@ref asm) for wing surfaces
56+
* Defining a [wake treatment](@ref waketreatmentapi) that speeds up the
57+
simulation by removing particles that can be neglected
58+
59+
```@raw html
60+
<br>
61+
```
62+
1363

1464
```julia
1565
#=##############################################################################
@@ -26,30 +76,33 @@
2676
* License : MIT
2777
=###############################################################################
2878

79+
80+
2981
import FLOWUnsteady as uns
3082
import FLOWUnsteady: vlm, vpm, gt, Im
3183

32-
include(joinpath(uns.examples_path, "vahana_vehicle.jl"))
33-
include(joinpath(uns.examples_path, "vahana_maneuver.jl"))
34-
include(joinpath(uns.examples_path, "vahana_monitor.jl"))
84+
include(joinpath(uns.examples_path, "vahana", "vahana_vehicle.jl"))
85+
include(joinpath(uns.examples_path, "vahana", "vahana_maneuver.jl"))
86+
include(joinpath(uns.examples_path, "vahana", "vahana_monitor.jl"))
3587

36-
run_name = "vahana-example" # Name of this simulation
37-
save_path = run_name # Where to save this simulation
88+
run_name = "vahana" # Name of this simulation
89+
save_path = "vahana-example" # Where to save this simulation
3890
paraview = true # Whether to visualize with Paraview
3991

4092
# ----------------- GEOMETRY PARAMETERS ----------------------------------------
41-
n_factor = 4 # Discretization factor
93+
n_factor = 1 # Discretization factor
4294
add_wings = true # Whether to include wings
4395
add_rotors = true # Whether to include rotors
4496

97+
# Reference lengths
4598
R = 0.75 # (m) reference blade radius
4699
b = 5.86 # (m) reference wing span
47100
chord = b/7.4 # (m) reference wing chord
48101
thickness = 0.04*chord # (m) reference wing thickness
49102

50103
# ----------------- SIMULATION PARAMETERS --------------------------------------
51104
# Maneuver settings
52-
Vcruise = 30.0 # (m/s) cruise speed (reference)
105+
Vcruise = 15.0 # (m/s) cruise speed (reference)
53106
RPMh_w = 600.0 # RPM of main-wing rotors in hover (reference)
54107
ttot = 30.0 # (s) total time to perform maneuver
55108

@@ -62,10 +115,10 @@ mu = 1.81e-5 # (kg/ms) air dynamic viscosity
62115

63116
# NOTE: Use these parameters to start and end the simulation at any arbitrary
64117
# point along the eVTOL maneuver (tstart=0 and tquit=ttot will simulate
65-
# the entire maneuver, tstart=0.25*ttot will start it in the middle of
118+
# the entire maneuver, tstart=0.20*ttot will start it at the beginning of
66119
# the hover->cruise transition)
67-
tstart = 0.25*ttot # (s) start the simulation at this point in time
68-
tquit = 0.35*ttot # (s) end the simulation at this point in time
120+
tstart = 0.00*ttot # (s) start simulation at this point in time
121+
tquit = 1.00*ttot # (s) end simulation at this point in time
69122

70123
start_kinmaneuver = true # If true, it starts the maneuver with the
71124
# velocity and angles of tstart.
@@ -78,7 +131,7 @@ VehicleType = uns.UVLMVehicle # Unsteady solver
78131
# VehicleType = uns.QVLMVehicle # Quasi-steady solver
79132

80133
# Time parameters
81-
nsteps = 2*4*5400 # Time steps for entire maneuver
134+
nsteps = 4*5400 # Time steps for entire maneuver
82135
dt = ttot/nsteps # (s) time step
83136

84137
# VPM particle shedding
@@ -91,26 +144,26 @@ unsteady_shedcrit = 0.001 # Shed unsteady loading whenever cir
91144
# Regularization of embedded vorticity
92145
sigma_vlm_surf = b/400 # VLM-on-VPM smoothing radius
93146
sigma_rotor_surf= R/20 # Rotor-on-VPM smoothing radius
94-
lambda_vpm = 1.2*2.125 # VPM core overlap
147+
lambda_vpm = 2.125 # VPM core overlap
95148
# VPM smoothing radius
96-
sigma_vpm_overwrite = lambda_vpm * (2*pi*RPMh_w/60*R + Vcruise)*dt / p_per_step
97-
sigmafactor_vpmonvlm= 1 # Shrink particles by this factor when
149+
sigma_vpm_overwrite = lambda_vpm * (2*pi*RPMh_w/60*R + Vcruise)*dt / p_per_step
150+
sigmafactor_vpmonvlm = 1 # Shrink particles by this factor when
98151
# calculating VPM-on-VLM/Rotor induced velocities
99152

100-
vlm_vortexsheet = true # Whether to spread the wing circulation as a vortex sheet
101-
vlm_vortexsheet_overlap = 2.125 # Overlap of the particles that make the vortex sheet
102-
vlm_vortexsheet_distribution = uns.g_pressure # Distribution of the vortex sheet
153+
# Rotor solver
154+
vlm_rlx = 0.2 # VLM relaxation <-- this also applied to rotors
155+
hubtiploss_correction = vlm.hubtiploss_correction_prandtl # Hub and tip correction
156+
157+
# Wing solver: actuator surface model (ASM)
158+
vlm_vortexsheet = false # Whether to spread the wing surface vorticity as a vortex sheet (activates ASM)
159+
vlm_vortexsheet_overlap = 2.125 # Overlap of the particles that make the vortex sheet
160+
vlm_vortexsheet_distribution= uns.g_pressure# Distribution of the vortex sheet
103161
# vlm_vortexsheet_sigma_tbv = thickness*chord / 100 # Size of particles in trailing bound vortices
104-
vlm_vortexsheet_sigma_tbv = sigma_vpm_overwrite
162+
vlm_vortexsheet_sigma_tbv = sigma_vpm_overwrite
105163
# How many particles to preallocate for the vortex sheet
106164
vlm_vortexsheet_maxstaticparticle = vlm_vortexsheet==false ? nothing : 6000000
107165

108-
# Rotor solver
109-
vlm_rlx = 0.2 # VLM relaxation <-- this also applied to rotors
110-
hubtiploss_correction = vlm.hubtiploss_correction_prandtl # Hub and tip correction
111-
112-
113-
# Wing solver
166+
# Wing solver: force calculation
114167
KJforce_type = "regular" # KJ force evaluated at middle of bound vortices_vortexsheet also true)
115168
include_trailingboundvortex = false # Include trailing bound vortices in force calculations
116169

@@ -124,14 +177,14 @@ wing_polar_file = "xf-n0012-il-500000-n5.csv" # Airfoil polar for
124177

125178

126179
# VPM solver
127-
vpm_integration = vpm.rungekutta3 # VPM temporal integration scheme
128-
# vpm_integration = vpm.euler
180+
# vpm_integration = vpm.rungekutta3 # VPM temporal integration scheme
181+
vpm_integration = vpm.euler
129182

130183
vpm_viscous = vpm.Inviscid() # VPM viscous diffusion scheme
131184
# vpm_viscous = vpm.CoreSpreading(-1, -1, vpm.zeta_fmm; beta=100.0, itmax=20, tol=1e-1)
132185

133-
# vpm_SFS = vpm.SFS_none # VPM LES subfilter-scale model
134-
vpm_SFS = vpm.DynamicSFS(vpm.Estr_fmm, vpm.pseudo3level_positive;
186+
# vpm_SFS = vpm.SFS_none # VPM LES subfilter-scale model
187+
vpm_SFS = vpm.DynamicSFS(vpm.Estr_fmm, vpm.pseudo3level_positive;
135188
alpha=0.999, maxC=1.0,
136189
clippings=[vpm.clipping_backscatter],
137190
controls=[vpm.control_directional, vpm.control_magnitude])
@@ -180,9 +233,9 @@ simulation = uns.Simulation(vehicle, maneuver, Vref, RPMref, ttot;
180233
Vinit=Vinit, Winit=Winit, t=tstart);
181234

182235
# Maximum number of particles (for pre-allocating memory)
183-
max_particles = ceil(Int, (nsteps+2)*(2*vlm.get_m(vehicle.vlm_system)+1)*p_per_step)
236+
max_particles = ceil(Int, (nsteps+2)*(2*vlm.get_m(vehicle.wake_system)*(p_per_step+1) + p_per_step) )
184237
max_particles = tquit != Inf ? ceil(Int, max_particles*(tquit-tstart)/ttot) : max_particles
185-
max_particles = min(30000000, max_particles)
238+
max_particles = min(10000000, max_particles)
186239
max_particles = VehicleType==uns.QVLMVehicle ? 10000 : max_particles
187240

188241

@@ -389,6 +442,5 @@ uns.run_simulation(simulation, nsteps;
389442
save_path=save_path,
390443
run_name=run_name,
391444
save_wopwopin=true, # <--- Generates input files for PSU-WOPWOP noise analysis
392-
save_code=splitdir(@__FILE__)[1]
393445
);
394446
```

docs/src/examples/vahana-vehicle.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,15 +597,15 @@ function generate_vahana_vehicle(;
597597

598598
# System solved through VLM solver
599599
vlm_system_m = vlm.WingSystem()
600+
vlm.addwing(vlm_system_m, "letL", winglet_L)
601+
vlm.addwing(vlm_system_m, "L", wing_L)
600602
vlm.addwing(vlm_system_m, "middle", wing_md)
601603
vlm.addwing(vlm_system_m, "R", wing_R)
602604
vlm.addwing(vlm_system_m, "letR", winglet_R)
603-
vlm.addwing(vlm_system_m, "L", wing_L)
604-
vlm.addwing(vlm_system_m, "letL", winglet_L)
605605

606606
vlm_system_t = vlm.WingSystem()
607-
vlm.addwing(vlm_system_t, "R", twing_R)
608607
vlm.addwing(vlm_system_t, "L", twing_L)
608+
vlm.addwing(vlm_system_t, "R", twing_R)
609609

610610
vlm_system = vlm.WingSystem()
611611
if add_wings

docs/src/generate_examples_blownwing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ end
140140
open(joinpath(output_path, output_name*"-asm.md"), "w") do fout
141141

142142
println(fout, """
143-
# Actuator Surface Model
143+
# [Actuator Surface Model](@id asm)
144144
145145
The aerodynamic solution computed in [the first section](@ref blownwingaero)
146146
was intended to be a mid-low fidelity simulation, which modeled the wing

docs/src/generate_examples_rotorhover.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ open(joinpath(output_path, output_name*"-aero.md"), "w") do fout
195195
high-fidelity simulation.
196196
197197
198-
In [examples/rotorhover/rotorhover_postprocess.jl](https://github.com/byuflowlab/FLOWUnsteady/blob/master/examples/rotorhover/rotorhover_postprocess.jl)
198+
In [examples/rotorhover/rotorhover_postprocessing.jl](https://github.com/byuflowlab/FLOWUnsteady/blob/master/examples/rotorhover/rotorhover_postprocessing.jl)
199199
we show how to postprocess the simulations to compare ``C_T`` and blade
200200
loading to experimental data by Zawodny *et al*.[^1] and a URANS simulation
201201
(STAR-CCM+) by Schenk[^2]:

0 commit comments

Comments
 (0)