程序代写代做代考 graph html go C The University of Queensland

The University of Queensland
School of Mechanical and Mining Engineering
MECH7101 Design of Experiments (2020) Assignment – Computer Experiment for Design
Introduction
The supersonic-combustion ramjet (a.k.a. SCramjet) is a suggested propulsion system for hypersonic flight within the atmosphere. To get sufficient thrust to fly at hypersonic speeds, the scramjet engine has to process most of the air that strikes the vehicle and run that air through its combustor and thrust nozzle. Because of this, the engine is fully integrated with the flight vehicle, not stuck out in the air flow as the turbofan engines for modern commercial aircraft. An air-breathing flight vehicle for hypersonic speeds looks much like a flying engine, as seen below in the pictures of the flight-test vehicle described in AIAA-Paper 1. The inlet, with its long compression surface, is a critical component of the engine. A poor inlet, with large losses, will turn your scramjet engine into a very effective hypersonic drag device.
The scramjet vehicle was attached to a ”flying laboratory” (shown schematically on the left) which was then attached to the front of a surface-to-air missile that propelled the whole kit to the nominal test flight condition. The scramjet vehicle is the pointed object on the left of the schematic figure and is small dark object in the middle of the photograph on the right.
In this assignment, you will perform a computational experiment to design your own scramjet inlet profile. An example flow field, displayed as pressure and Mach number images, is shown on the next page. We have abstracted only part of the vehicle and its flow field and, for the simulation, use a frame of reference that travels with the vehicle. We will also consider just a two-dimensional flow. In the photograph above, the vehicle will be flying to the left and, as a result, gas flow will be from left to right in the simulation images.
A uniform air flow enters the simulation domain at the left at supersonic, low-pressure and high-Mach-number conditions. This is coloured blue in the pressure flow field image
1R.T. Voland, A.H. Auslender, M.K. Smart, A.S. Roudakov, V.L. Semenov and V. Kopchenov (1999) CIAM/NASA Mach 6.5 scramjet flight and ground test. AIAA Paper 99-4848. This paper is available from the NASA Technical Reports Server (https://ntrs.nasa.gov)
1

and red in the Mach number image. At this point, you should spend a few minutes and go and watch Professor David Mee’s video descriptions of a scramjet engine configuration and of shock waves and flow in a scramjet inlet. These short video lectures are part of the UQxHYPERS301x online course as Sections 1.7.1v and 3.2.1. They are available on YouTube as
1. https://www.youtube.com/watch?v=8PtHmC-iuY8 and
2. https://www.youtube.com/watch?v=6CL96eAGBo4.
You need watch only the first 4 minutes (of 9 minutes) for the first video but the whole
of the second video is worth watching.
Note that the flow shown in the figures below is more subtle and complicated than the simple flow described in Prof. Mee’s video. In this assignment, we are going to consider a more sophisticated design that has a smoother compression ramp profile and has the potential for better performance. This will make the required flow analysis more compli- cated than can be done manually with simple shock-wave calculations, however, you have access to the Eilmer CFD code, as discussed in lecture. Also provided is an input script that sets up a model for the flow through your inlet design and command scripts that run a single flow simulation.
2

You will be able to run test flows for particular inlet profiles by editing a few parameters in the input script and then running the CFD code. Output from the CFD code includes several snapshots of the entire flow field (that may be used to make pretty pictures, as shown above) and a small profile file that contains enough data for you to compute the flow conditions at the end of the inlet compression.
We are going to fix most of the geometry of the inlet and constrain the length of the compression ramp. Your goal is to select values of the control parameters that set the shape of the ramp and location of the cowl, so that you achieve the correct pressure ratio through the inlet and least total-pressure loss. We choose to do the design for a flight Mach number of 4 and, using Figure 3 in Prof Michael Smart’s paper2, we see that the desirable value of static-pressure ratio through the inlet is 12. Also, from the tables in NACA Report 11353, the ratio of total pressure divided by static pressure is 152, for a Mach 4 flow.
The particular experimental procedure is for you to decide, however, we do like the Nelder- Mead nonlinear simplex method for deciding what values of the control parameters to set.
Tasks
1. Get familiar with Linux, enough to use the command line and be able to edit files. If you wish to run the flow simulations on your own computer, you will need a Linux environment on it. A good option for Windows computers is a virtual machine that runs Ubuntu Linux. Alternatively, you may just use the EAIT student server computer remote.labs.eait.uq.edu.au, which runs the CentOS 7 flavour of Linux. For more details, look at https://student.eait.uq.edu.au/infrastructure/remote-access/ssh.html
2. Browse the cfcfd.mechmining.uq.edu.au web site and read the introductory sec- tions of the Eilmer 4 Users’ Guide, them run the sharp-cone example discussed in the section on running your first simulation.
3. Using the files in the Appendices, run the Eilmer code for a set of inlet profiles with varying shape and cowl-tip position (point h). You will need to decide the test conditions, (i.e. the particular sets of values for the defining ramp shape and cowl position, for your experimental trials. These parameters and resulting profile are shown schematically in Appendix A. As mentioned above, we think that the Nelder-Mead method is a good way to proceed. Note that the input files are available in machine-readable form in the examples/eilmer/2D/ scramjet-inlet/manual/ subdirectory of the code repository.
4. You will also need to calculate the average static pressure and total pressure at the end of the inlet (points e to j) from the profile data extracted by the post- processing program. You might like to make yourself a function in Python, to render the summation less tedious.
2M.K. Smart (1999) Optimization of two-dimensional scramjet inlets. Journal of Aircraft Volume 36 Issue 2, pp430–433. The UQ library subscribes to this journal.
3Available from the NASA Technical Reports Server.
3

5. Tabulate all of your test parameters and the resulting static- and total-pressure averages. Remember that you are trying to determine the profile parameters that get the correct static pressure while maximizing total-pressure at the end of the inlet. An objective value can be a combination of these measures. If you are using the Nelder-Mead approach to determining which parameter values to set, you will notice that, as you approach the optimum, all of the objective values for your simplex will approach the same (good) value. You will need to decide when you have done enough test cases to be confident in your estimate of the optimum parameter values. Plot the objective value for each test condition against test-condition number, to show the progress of your iterative procedure.
6. Compare the performance of your best inlet profile with that of an equivalent straight ramp and zero cowl-tip angle. The equivalent straight ramp can be defined by setting the intermediate points (b and c) of its Bezier to be linearly interpolated between beginning (a) and end (d) points.
Submission Notes and Assessment Criteria
Work individually or in pairs and submit a single report. This report should provide the detail of your analysis, code and results for tasks listed above. This report should be well structured, so that the tutor can easily interpret your results. Explain the methodology that you have used to select the control parameters of your test conditions. Include your table of test conditions and any post-processing code you might have developed to remove some of the tedium from the experimental procedure. Combine it all together into a single PDF document, with a cover page that clearly tells us who you are and what contribution you have made to the project.
For assessment of your work, the tutor will be looking for answers to the following ques- tions.
􏰀 Have you done what the tasks require? Note that your report should be well struc- tured and tidy so that the tutor can easily find your answers. Having your figures labelled and plots correctly titled, with axes labelled, also helps a lot here.
􏰀 Are your design calculations and records accurate?
􏰀 Is your code well-structured and clearly written, with suitable documentation com-
ments?
􏰀 Are your conclusions consistent with your results?
􏰀 Have you used a clear and efficient procedure to iterate toward the best solution?
4

8
A Inlet profile definition
In simulation input script, we define the compression-ramp profile with a Bezier curve using points a, b, c and d. Point d1 is a point interpolated on the Bezier curve and is not used to control its shape. Of these points, only the heights of b and c are to be adjusted by changing the values of the variables h1 and h2 on input script lines 28 and 29. The height of the inlet duct is set via variable h0 on line 27. The position of the cowl tip (point h in the figure) is set by adjusting the angle theta on line 31. A value of zero for theta will set the line from i to h as horizontal. When doing your experimental trial, make your adjustments by changing the values of h0, h1, h2 and theta only.
B Input script
You do not need to understand all of the content of this script in order to make use of it. Note small numbers at the left of the lines. Those numbers are not part of the text file. Note also that some lines are wrapped to fit the width of this document. In the original text file, those lines are not broken.
1 —
2 —
3 —
4 —
5 —
6 config.title = “Flow into a scramjet inlet.”
7 print(config.title)
inlet.lua
Optimize the profile of an scramjet inlet for MECH7101 assignment.
Peter J. 2020 -08 -01
5

9 — Gas model and flow states for simulation.
10 nsp, nmodes, gmodel = setGasModel(’ideal-air-gas-model.lua’)
11 print(“GasModel set to ideal air. nsp= “, nsp)
12
13 — The low_pressure_gas is an arbitrary fill condition for the blocks.
14 — It will be swept away.
15 — The external_stream will provide an environment for the rocket’s
exhaust gas.
16 low_pressure_gas = FlowState:new{p=100.0, T=250.0}
17 speed = 4.0 * low_pressure_gas.a — set speed from Mach number
18 print(“speed=”, speed)
19 external_stream = FlowState:new{p=10.0e3, T=250.0, velx=speed}
20
21 — Define the geometry of the scramjet ramp and a bit of duct
22 — following that ramp.
23 — Remember that Eilmer length units are metres.
24 L0 = 1.00
25 L1 = 0.30
26 L2 = 0.20
27 h0 = 0.05
28 h1 = 0.05
29 h2 = 0.15
30 h3 = 0.30
31 theta = math.rad(10.0) — adjust dip of cowl
32 r = 0.15
33 Htop = 1.5
34 pnts = {
35 — Points defining the compression -ramp surface.
36 a = {x=0.0, y=0.0},
37 b = {x=L0/3, y=h1},
38 c = {x=2*L0/3, y=h2},
39 d = {x=L0, y=h3},
40 d2 = {x=L0+0.5*L1, y=h3},
41 e = {x=L0+L1, y=h3},
42 f = {x=L0+L1+L2, y=0.95*h3},
43 g = {x=0.0, y=h3},
44 h = {x=L0-r*math.cos(theta), y=h3+h0-r*math.sin(theta)},
45 i = {x=L0, y=h3+h0},
46 i2 = {x=L0+0.5*L1, y=h3+h0},
47 j = {x=L0+L1, y=h3+h0},
48 k = {x=L0+L1+L2, y=h3+h0},
49 l = {x=0.0, y=Htop},
50 m = {x=L0-r, y=Htop},
51 m2 = {x=L0+L1, y=Htop},
52 n = {x=L0+L1+L2, y=Htop}
53 }
54 ramp = Bezier:new{points={pnts.a, pnts.b, pnts.c, pnts.d}}
55 t_truncate = 0.87
56 pnts.d1 = ramp(t_truncate) — We are going to end block 0 here
57
58 lines = {}
59 patches = {}
60 — Block leading to the throat.
61 lines.w0 = Line:new{p0=pnts.a, p1=pnts.g}
62 lines.s0 = SubRangedPath:new{underlying_path=ramp, t0=0.0, t1=t_truncate
}
— adjust height of duct
— adjust height of b on ramp — adjust height of c on ramp
6

63 64 65 66 67 68
69 70 71
72 73 74 75 76 77
78 79
80 81 82 83 84 85 86
87 88 89 90 91 92 93 94 95 96 97 98 99
100 101 102 103 104 105 106 107 108 109 110
111 112
lines.n0 = Line:new{p0=pnts.g, p1=pnts.h}
lines.e0 = Line:new{p0=pnts.d1, p1=pnts.h}
patches[0] = AOPatch:new{north=lines.n0, south=lines.s0,
west=lines.w0, east=lines.e0} — 2 Blocks inside the cowl surface.
lines.n1 = Polyline:new{segments={Bezier:new{points={pnts.h, pnts.i, pnts.i2}},
Line:new{p0=pnts.i2, p1=pnts.j}}} lines.e1 = Line:new{p0=pnts.e, p1=pnts.j}
lines.s1 = Polyline:new{segments={Bezier:new{points={pnts.d1, pnts.d, pnts.d2}},
Line:new{p0=pnts.d2, p1=pnts.e}}} lines.n2 = Line:new{p0=pnts.j, p1=pnts.k}
lines.s2 = Line:new{p0=pnts.e, p1=pnts.f}
patches[1] = AOPatch:new{north=lines.n1, south=lines.s1,
west=lines.e0, east=lines.e1}
patches[2] = CoonsPatch:new{p00=pnts.e, p10=pnts.f, p11=pnts.k, p01=pnts
.j}
— Block upstream outer flow.
patches[3] = CoonsPatch:new{p00=pnts.g, p10=pnts.h, p11=pnts.m, p01=pnts
.l}
— 2 Blocks downstream outer flow.
lines.n4 = Line:new{p0=pnts.m, p1=pnts.m2}
lines.w4 = Line:new{p0=pnts.h, p1=pnts.m}
lines.e4 = Line:new{p0=pnts.j, p1=pnts.m2}
patches[4] = CoonsPatch:new{north=lines.n4, south=lines.n1,
west=lines.w4, east=lines.e4}
patches[5] = CoonsPatch:new{p00=pnts.j, p10=pnts.k, p11=pnts.n, p01=pnts
.m2}
— Mesh the patches, with particular discretisation.
cfy = RobertsFunction:new{end0=true, end1=false, beta=1.1} grids = {}
grids[0] =
grids[1] = grids[2] = grids[3] =
grids[4] =
grids[5] =
StructuredGrid:new{psurface=patches[0], niv=61, njv=31}
StructuredGrid:new{psurface=patches[1], niv=45, njv=31}
StructuredGrid:new{psurface=patches[2], niv=21, njv=31}
StructuredGrid:new{psurface=patches[3], cfList={east=cfy, west=cfy},
niv=61, njv=61} StructuredGrid:new{psurface=patches[4],
cfList={east=cfy, west=cfy},
niv=45, njv=61} StructuredGrid:new{psurface=patches[5],
cfList={east=cfy, west=cfy}, niv=21, njv=61}
— Define the flow-solution blocks. blks = {}
for ib=0,5 do
blks[ib] = FluidBlock:new{grid=grids[ib], initialState= low_pressure_gas}
end
7

113 — Set boundary conditions , first , connections
114 connectBlocks(blks[0], east, blks[1], west)
115 connectBlocks(blks[0], north, blks[3], south)
116 connectBlocks(blks[1], east, blks[2], west)
117 connectBlocks(blks[3], east, blks[4], west)
118 connectBlocks(blks[4], east, blks[5], west)
119 — then, directly specify the other boundary conditions.
120 blks[0].bcList[west] = InFlowBC_Supersonic:new{flowCondition=
external_stream}
121 blks[3].bcList[west] = InFlowBC_Supersonic:new{flowCondition=
external_stream}
122 blks[2].bcList[east] = OutFlowBC_Simple:new{}
123 blks[5].bcList[east] = OutFlowBC_Simple:new{}
124
125 — Some more simulation configuration.
126 config.max_time = 5.0e-3 — seconds
127 config.max_step = 30000
128 config.dt_init = 1.0e-7
129 config.dt_plot = config.max_time/10.0
130 config.dt_loads = config.max_time/10.0
131 — For difficult cells.
132 config.cfl_value = 0.4
133 config.cfl_count = 3
134 config.max_invalid_cells = 20
135 config.adjust_invalid_cell_data = true
136 config.report_invalid_cells = false
137 config.suppress_reconstruction_at_shocks = true
138
139 dofile(“sketch-domain.lua”)
C Gas model input file
There is not much in this file, but it is enough to define an ideal-gas model of air, as you would encounter in most fluid mechanics text books.
1 model = “IdealGas”
2 species = {’air ’}
D Run scripts
The following shell scripts will set up a gas model, prepare a set of initial grid and flow files, run a simulation, and then do a bit of post-processing to generate some plotting files for display with Paraview. Although the plotting is not necessary to estimate the performance for a particular simulation, you might like to view the flow field to get an idea of how the gas responds to your inlet definition.
1 #!/bin/bash
2 # prep.sh
3 prep-gas ideal-air.inp ideal-air-gas-model.lua
4 e4shared –prep –job=inlet
8

1 2 3
1 2 3 4
1 2 3 4 5 6
#!/bin/bash
# run.sh
e4shared –run –job=inlet –verbosity=1
#!/bin/bash
# post.sh
e4shared –post –job=inlet –tindx -plot=all
–add-vars=”mach,total-p” –vtk-xml
#!/bin/bash
# post-profile.sh
\
\
1
2
3
Here are the first three lines of the profile file. Each line represents the data for a single cell across the line from e to j in the flow domain figure. The quantities of interest are:
􏰀 Column 2 is the y coordinate for the midpoint of the cell at that point. 􏰀 Column 4 is the volume for the cell at that point.
􏰀 Column 9 is the static pressure of the gas in the cell.
􏰀 Columns 20 is the total pressure for the flow in the cell.
# 1:pos.x 2:pos.y 3:pos.z 4:volume 5:rho 6:vel.x 7:vel.y 8:vel.z 9:p 10: a 11:mu 12:k 13:mu_t 14:k_t 15:S 16:massf[0]-air 17:u 18:T 19:M_local
20: total_p
1.295029781990751250e+00 3.008860054123536076e-01 0.000000000000000000e
+00 1.759568691172197150e-05 9.085514225120879805e-01
e4shared
–post –job=inlet –tindx -plot=last –add-vars=”mach,total-p” \ –slice-list=”1,$,:,0″ \ –output-file=”profile.data”
E
Flow profile file
9.738035859560985728e+02 0.000000000000000000e+00 4.822090005167571007e+02 2.221350016850452691e-02 0.000000000000000000e+00 1.000000000000000000e+00 5.785014961275572887e+02 1.217045238728628494e+06
2.601146673657771302e+00 1.509009943780926696e+05 1.599585093950545891e-05 0.000000000000000000e+00 0.000000000000000000e+00 4.152241431774462108e+05 2.019470932509273009e+00
1.295024090549620643e+00 3.026576785068973430e-01 0.000000000000000000e +00 1.761580042057390993e-05 9.104614257391380194e-01
9.752469866142131423e+02 0.000000000000000000e+00 4.815545081155514140e+02 2.221350016850452691e-02 0.000000000000000000e+00 9.999999999999998890e-01 5.769321853804332250e+02 1.227343361507944530e+06
8.179704583385726480e+00 1.508080139317273279e+05 1.599585093950545891e-05 0.000000000000000000e+00 0.000000000000000000e+00 4.140977576543047908e+05 2.025277040206211243e+00
9