Skip to content

Commit edb55e3

Browse files
authored
Merge pull request #10 from suavecode/feature-new_tutorials
Analysis Tutorial
2 parents 6f7d8cb + df2ca5a commit edb55e3

File tree

2 files changed

+82
-44
lines changed

2 files changed

+82
-44
lines changed

tutorials.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<h3>Tutorials</h3>
7272
<ul class="links">
7373
<li><a href="tutorials/B737.html">Boeing 737-800</a></li>
74-
<li><a href="tutorials/Concorde.html">Concorde</a></li>
74+
<li><a href="tutorials/Concorde.html">Creating a New Aero Analysis</a></li>
7575
<li><a href="tutorials/Solar.html">Solar UAV</a></li>
7676
<li><a href="tutorials/PRD.html">Payload Range Diagram</a></li>
7777
<li><a href="tutorials/turbofan.html">Turbofan Network</a></li>

tutorials/Concorde.html

+81-43
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
-->
77
<html>
88
<head>
9-
<title>Concorde - SUAVE Tutorial</title>
9+
<title>Creating and Using a New Analysis</title>
1010
<meta charset="utf-8" />
1111
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
1212
<link rel="stylesheet" href="https://suave.stanford.edu/assets/css/main.css" />
13+
<link href="https://suave.stanford.edu/assets/css/prism.css" rel="stylesheet" />
1314

1415
<!-- Global site tag (gtag.js) - Google Analytics -->
1516
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-132339206-1"></script>
@@ -67,72 +68,109 @@
6768
<!-- Content -->
6869

6970
<article>
70-
<h2 id="concorde-tutorial">Concorde Tutorial</h2>
71+
<header>
72+
<h2>Creating and Using a New Analysis</h2>
73+
</header>
7174

72-
<p>This tutorial gives an overview of changes made to the setup to evaluate a supersonic mission.</p>
75+
<p>This tutorial is designed to provide the information needed to modify a SUAVE aerodynamic analysis and create new ones. Many of the items discussed here also apply to other analysis types within SUAVE. For this tutorial, the Concorde is used to demonstrate switching the aerodynamic analysis to one that can handle supersonic conditions.</p>
7376

74-
<h3 id="aerodynamics-module">Aerodynamics Module:</h3>
77+
<h3 id="running-the-tutorial-file">Baseline Aerodynamic Analysis</h3>
78+
79+
<p>The basic aerodynamic analysis used in SUAVE is called Fidelity_Zero. It is based on a mix of low fidelity physical and empirical methods, similar to what you might find in a typical conceptual design textbook. This is what is used for the 737 in the previous tutorial, and is specified in the analysis settings:</p>
80+
81+
<pre class="highlight_code"><code class="language-python">def base_analysis(vehicle):
82+
...
83+
# ------------------------------------------------------------------
84+
# Aerodynamics Analysis
85+
aerodynamics = SUAVE.Analyses.Aerodynamics.Fidelity_Zero()
86+
aerodynamics.geometry = vehicle
87+
analyses.append(aerodynamics)
88+
...
89+
</pre></code><p></p>
90+
<p>In the SUAVE code structure, the analysis is broken into two sections. One is what you see above, which is the analysis class. The other is the individual methods that are used in the analysis class, which are stored in separate Methods folders. The purpose of splitting them is to make it easier for the different analysis classes to share methods. We will start with an explanation of the individual bits of the analysis class in the file trunk/Analyses/Aerodynamics/Fidelity_Zero.py.</p>
7591

76-
<p>To allow aerodynamic calculations in supersonic flight, we use the zero fidelity supersonic module. This is quite easy to swap with the subsonic zero fidelity model. This model and the zero fidelity subsonic module are in the same directory, so they can be switched by changing a single line in the analysis section:</p>
92+
<p>The first section is the imports. These are mix of standard imports and a few specific items needed for the analysis. They are described individually as they appear in the body of the class. The first function in the fidelity zero class is __defaults__. This contains the primary functionality as it sets the default settings and the methods that will be used to compute aerodynamics.</p>
7793

78-
<div class="highlight_code"><div class="highlight_code"><pre><code>aerodynamics = SUAVE.Analyses.Aerodynamics.Fidelity_Zero()
79-
</code></pre></div></div>
94+
<p>The settings begin as below:</p>
8095

81-
<p>to</p>
96+
<pre class="highlight_code"><code class="language-python"># correction factors
97+
settings = self.settings
98+
settings.fuselage_lift_correction = 1.14
99+
settings.trim_drag_correction_factor = 1.02
100+
settings.wing_parasite_drag_form_factor = 1.1
101+
</pre></code><p></p>
102+
<p>self.settings is inherited from the base Markup class and therefore is not redefined. Instead, these values and several more are added. Items in this group control how the aerodynamic methods operate. Variables that are set to None typically mean that a method specific default will be used instead. For example, span efficiency controls whether or not a blanket span efficiency is used to override the drag output for the vortex lattice method.</p>
103+
104+
<p>The next group builds the evaluation procedure. It is constructed as a set of processes which include a number of functions from the methods group. The Process class is essentially a container for all the functions added to it, and will evaluate those functions in the order they are added. Another process can also be added instead of a function, as is initially done with compute.drag.parasite. There is also a special type of process class called Process_Geometry, which will iterate through the vehicle geometry and apply the submethod to all components in the specified group. Altogether, this code block creates a process for lift and drag and sets up the analysis to run the relevant methods in the order shown (however they are not run as we step through this code block). self.process.compute is a process itself as well.</p>
82105

83-
<div class="highlight_code"><div class="highlight_code"><pre><code>aerodynamics = SUAVE.Analyses.Aerodynamics.Supersonic_Zero()
84-
</code></pre></div></div>
85-
<p>The supersonic aerodynamics module can still handle the subsonic portions of the flight.</p>
106+
<div class="highlight_code"><div class="highlight_code"><pre class="highlight_code"><code class="language-python"># build the evaluation process
107+
compute = self.process.compute
86108

87-
<h3 id="wing-additions">Wing Additions:</h3>
109+
compute.lift = Process()
88110

89-
<p>Some of the calculations are changed to account for different properties that are not automatically captured in the model.</p>
111+
compute.lift.inviscid_wings = Vortex_Lattice()
112+
compute.lift.vortex = SUAVE.Methods.skip
113+
compute.lift.fuselage = Common.Lift.fuselage_correction
114+
compute.lift.total = Common.Lift.aircraft_total
90115

91-
<ul>
92-
<li>Vortex lift is set to true. This causes the vortex lift module to add a CL increment to the aircraft.</li>
93-
<li>High Mach is set to true. This changes the way that high subsonic compressibility drag is calculated and brings it more in line with Concorde behavior.</li>
94-
</ul>
116+
compute.drag = Process()
117+
compute.drag.parasite = Process()
118+
compute.drag.parasite.wings = Process_Geometry('wings')
119+
compute.drag.parasite.wings.wing = Common.Drag.parasite_drag_wing
120+
compute.drag.parasite.fuselages = Process_Geometry('fuselages')
121+
compute.drag.parasite.fuselages.fuselage = Common.Drag.parasite_drag_fuselage
122+
compute.drag.parasite.propulsors = Process_Geometry('propulsors')
123+
</div></div></pre></code><p></p>
95124

96-
<div class="highlight_code"><div class="highlight_code"><pre><code> wing.vortex_lift = True
97-
</code></pre></div></div>
125+
<p>The other function in this class is the initialize function. This allows a surrogate of the lift model to be built. A surrogate is often used here in order to avoid the time required to evaluate the vortex lattice every time the aerodynamic analysis is called.</p>
98126

99-
<div class="highlight_code"><div class="highlight_code"><pre><code> wing.high_mach = True
100-
</code></pre></div></div>
127+
<h3 id="main">Changes for Supersonic Analysis</h3>
128+
<p>The next question is how to change this analysis class to allow for calculations in supersonic conditions. For this, we switch over to the Supersonic_Zero class and examine the differences. Generally, changes that are required are updates to the settings and changes in which methods are used. The primary settings additions that are needed for this analysis type are those that control the transonic drag rise and wave drag scaling.</p>
129+
<div class="highlight_code"><div class="highlight_code"><pre class="highlight_code"><code class="language-python"># this multiplier is used to determine the volume wave drag at the peak Mach number
130+
# by multiplying the volume wave drag at the end drag rise Mach number
131+
settings.peak_mach_number = 1.04
132+
settings.cross_sectional_area_calculation_type = 'Fixed'
133+
# 'Fixed' means that the area is not able to vary with Mach number, so the number at the desired cruise condition should
134+
# be used
135+
# 'OpenVSP' is a desired future possibility. This would allow the cross sectional area to vary with Mach number, but is
136+
# much more computationally intensive.
137+
settings.volume_wave_drag_scaling = 3.7 # 1.8-2.2 are given as typical for an SST, but 3.7 was found to be more accurate
138+
# This may be due to added propulsion effects
139+
settings.fuselage_parasite_drag_begin_blend_mach = 0.91
140+
settings.fuselage_parasite_drag_end_blend_mach = 0.99
141+
</div></div></pre></code><p></p>
101142

102-
<p>Note also that Concorde does not have a horizontal tail, so this is not included in the vehicle setup.</p>
143+
<p>For the methods, a subset must be swapped. Two groups of methods are imported this time. The first is designated as Common, which is the same group as was used in Fidelity_Zero. The second is designated as Methods, and contains methods specific to the supersonic case. These new methods replace their subsonic-only variants. Once all of these methods have been replaced, the new analysis class is ready.</p>
103144

104-
<h3 id="turbojet-module">Turbojet Module:</h3>
145+
<p>In order for the new analysis class and any new methods created to function properly, they must also be added to the relevant __init__.py files that link together SUAVE as a library. This requires adding a line to trunk/Analyses/Aerodynamics/__init__.py:</p>
105146

106-
<p>Since Concorde has a diverging nozzle that allows for supersonic outflow, a modified turbojet is used that can account for this. This turbojet component is again switched out with a single line.</p>
147+
<div class="highlight_code"><div class="highlight_code"><pre class="highlight_code"><code class="language-python">from .Supersonic_Zero import Supersonic_Zero
148+
</div></div></pre></code><p></p>
107149

108-
<div class="highlight_code"><div class="highlight_code"><pre><code>nozzle = SUAVE.Components.Energy.Converters.Supersonic_Nozzle()
109-
</code></pre></div></div>
150+
<p>and to trunk/Methods/Aerodynamics/__init__.py:</p>
110151

111-
<p>instead of</p>
152+
<div class="highlight_code"><div class="highlight_code"><pre class="highlight_code"><code class="language-python">from . import Supersonic_Zero</div></div></pre></code><p></p>
112153

113-
<div class="highlight_code"><div class="highlight_code"><pre><code>nozzle = SUAVE.Components.Energy.Converters.Expansion_Nozzle()
114-
</code></pre></div></div>
154+
<p>New files must also be created for the supersonic methods folder structure, which can be found as trunk/Methods/Aerodynamics/Supersonic_Zero/__init__.py, trunk/Methods/Aerodynamics/Supersonic_Zero/Lift/__init__.py, and trunk/Methods/Aerodynamics/Supersonic_Zero/Lift/__init__.py.</p>
115155

116-
<h3 id="mission-segments">Mission Segments:</h3>
156+
<p>Once all of the files are ready, a couple modifications are needed in the vehicle and analysis setup. These can be seen the tut_concorde.py tutorial file. First, to switch the analysis type used, we replace</p>
117157

118-
<p>The mission typically flown by Concorde calls for mission segments that are not utilized in the Boeing 737 case. These are Mach number dependent, and require different inputs from the segments previously given. The new mission segments are linear Mach constant rate (climb and descent). Both require a starting and ending Mach number, which will vary linearly in time over the descent. For an example, check the third climb segment:</p>
158+
<div class="highlight_code"><div class="highlight_code"><pre class="highlight_code"><code class="language-python">aerodynamics = SUAVE.Analyses.Aerodynamics.Fidelity_Zero()</div></div></pre></code><p></p>
119159

120-
<div class="highlight_code"><div class="highlight_code"><pre><code>segment = Segments.Climb.Linear_Mach_Constant_Rate(base_segment)
121-
segment.tag = "climb_3"
160+
<p>with</p>
122161

123-
segment.analyses.extend( analyses.cruise )
162+
<div class="highlight_code"><div class="highlight_code"><pre class="highlight_code"><code class="language-python">aerodynamics = SUAVE.Analyses.Aerodynamics.Supersonic_Zero()</div></div></pre></code><p></p>
124163

125-
segment.altitude_end = 7.60 * Units.km
126-
segment.mach_start = 0.64
127-
segment.mach_end = 1.0
128-
segment.climb_rate = 5.05 * Units['m/s']
129-
</code></pre></div></div>
164+
<p>Then, to use the special analysis capabilities, a couple settings are added to the main wing:</p>
130165

131-
<h3 id="takeoff-and-landing-configuration">Takeoff and Landing Configuration</h3>
166+
<div class="highlight_code"><div class="highlight_code"><pre class="highlight_code"><code class="language-python">wing.vortex_lift = True
167+
wing.high_mach = True
168+
</div></div></pre></code><p></p>
132169

133-
<p>Since Concorde does not have flaps or slats, specific takeoff and landing configurations are not used.</p>
170+
<p>This turns on the vortex lift correction at low speeds and changes the compressibility equations at high subsonic speeds to better match Concorde-type behavior.</p>
134171

135-
<br>
172+
<p>You can run the tut_concorde.py tutorial file to see the results of these changes. If you have any more questions on how to modify the aerodynamic analyses or any other types of analyses, please let us know on our forum.</p>
173+
<br>
136174
</article>
137175

138176
</div>
@@ -189,6 +227,6 @@ <h3>External Links</h3>
189227
<script src="assets/js/breakpoints.min.js"></script>
190228
<script src="assets/js/util.js"></script>
191229
<script src="assets/js/main.js"></script>
192-
230+
<script src="https://suave.stanford.edu/assets/js/prism.js"></script>
193231
</body>
194232
</html>

0 commit comments

Comments
 (0)