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%;"
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#= ##############################################################################
2676 * License : MIT
2777=# # #############################################################################
2878
79+
80+
2981import FLOWUnsteady as uns
3082import 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
3890paraview = true # Whether to visualize with Paraview
3991
4092# ----------------- GEOMETRY PARAMETERS ----------------------------------------
41- n_factor = 4 # Discretization factor
93+ n_factor = 1 # Discretization factor
4294add_wings = true # Whether to include wings
4395add_rotors = true # Whether to include rotors
4496
97+ # Reference lengths
4598R = 0.75 # (m) reference blade radius
4699b = 5.86 # (m) reference wing span
47100chord = b/ 7.4 # (m) reference wing chord
48101thickness = 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)
53106RPMh_w = 600.0 # RPM of main-wing rotors in hover (reference)
54107ttot = 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
70123start_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
82135dt = 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
92145sigma_vlm_surf = b/ 400 # VLM-on-VPM smoothing radius
93146sigma_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
106164vlm_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
114167KJforce_type = " regular" # KJ force evaluated at middle of bound vortices_vortexsheet also true)
115168include_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
130183vpm_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) )
184237max_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)
186239max_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```
0 commit comments