# Step 1: Create Geometry in GAMBIT

Since the nozzle has a circular cross-section, it's reasonable to assume that the flow is axisymmetric. So the geometry to be created is two-dimensional.

Start GAMBIT
Create a new folder called nozzle and select this as the working directory. Add -id nozzle to the startup options.

Create Axis Edge
We'll create the bottom edge corresponding to the nozzle axis by creating vertices A and B shown in the problem specification and joining them by a straight line. Operation Toolpad > Geometry Command Button Create Vertex Create the following two vertices: Vertex 1: (-0.5,0,0) Vertex 2: (0.5,0,0) Operation Toolpad > Geometry Command Button Create Edge Select vertex 1 by holding down the Shift button and clicking on it. Next, select vertex 2. Click Apply in the Create Straight Edge window. > Edge Command Button > > Vertex Command Button >

Create Wall Edge
We'll next create the bottom edge corresponding to the nozzle wall. This edge is curved. Since A=pi r2 where r(x) is the radius of the cross-section at x and A = 0.1 + x2 for the given nozzle geometry, we get r(x) = [(0.1 + x2)/pi]0.5; -0.5 < x < 0.5

This is the equation of the curved wall. Life would have been easier if GAMBIT allowed for this equation to be entered directly to create the curved edge. Instead, one has to create a file containing the coordinates of a series of points along the curved line and read in the file. The more number of points used along the curved edge, the smoother the resultant edge. The file vert.dat contains the point definitions for the nozzle wall. Take a look at this file. The first line is 21 1 which says that there are 21 points along the edge and we are defining only 1 edge. This is followed by x,r and zcoordinates for each point along the edge. The r-value for each x was generated from the above equation for r(x). Thez-coordinate is 0 for all points since we have a 2D geometry. Right-click on vert.dat and select Save As... to download the file to your working directory. Main Menu > File > Import > ICEM Input ... Next to File Name:, enter the path to the vert.dat file that you downloaded or browse to it by clicking on theBrowse button. Then, check the Verticesand Edges boxes under Geometry to Create as we want to create the vertices as well as the curved edge.

Click Accept. This should create the curved edge. Here it is in relation to the vertices we created above:

Similarly. create the vertical edge for the outlet. > Edge Command Button > (Click picture for larger image) Create Face Form a face out of the area enclosed by the four edges: .(Click picture for larger image) Create Inlet and Outlet Edges Create the vertical edge for the inlet: Operation Toolpad > Geometry Command Button Create Edge Shift-click on vertex 1 and then the vertex above it to create the inlet edge.

Operation Toolpad > Geometry Command Button Form Face > Face Command Button > Recall that we have to shift-click on each of the edges enclosing the face and then click Apply to create the face. change Interval Count to 20 for the side edges and Interval Count to 50 for the top and bottom edges. Operation Toolpad > Mesh Command Button Edges Like the Laminar Pipe Flow Tutorial. Then. we need to mesh it. We would like to create a 50x20 grid for this geometry. Save Your Work Main Menu > File > Save This will create the nozzle. we are going to use even spacing between each of the mesh points. so deselect the box next to Grading that says Apply. we will first start by meshing the edges. Mesh Edges As in the previous tutorials. Check that it has been created so that you will able to resume from here if necessary. > Edge Command Button > Mesh . We won't be using the Grading this time. Step 2: Mesh Geometry in GAMBIT Now that we have the basic geometry of the nozzle created.dbs file in your working directory.

we need to mesh the face. select the face and click the Apply button. > Face Command Button > Mesh Figure Save Your Work Main Menu > File > Save . Operation Toolpad > Mesh Command Button Faces As before.(Click picture for larger image) Mesh Face Now that we have the edges meshed.

enter inlet. For Type:. we would like to specify the boundary conditions here in GAMBIT. . Under Entity:. Click Apply. The selected edge should appear in the yellow box next to the Edgesbox you just worked with as well as the Label/Type list right under the Edges box. You should see the new entry appear under Name/Type box near the top of the window. We will first specify that the left edge is the inlet. select WALL. > Specify Boundary Types Command Now select the left edge by Shift-clicking on it.Step 3: Specify Boundary Types in GAMBIT Specify Boundary Types Now that we have the mesh. Operation Toolpad > Zones Command Button Button This will bring up the Specify Boundary Types window on the Operation Panel. Next to Name:. pick Edges so that GAMBIT knows we want to pick an edge (face is default).

Type in nozzle. Select Export 2d Mesh since this is a 2 dimensional mesh. centerline..msh for the File Name:.. You should have the following edges in the Name/Type list when finished: Save and Export Main Menu > File > Save Main Menu > File > Export > Mesh. Click Accept. and wall edges. .Repeat for the outlet.

Launch FLUENT Start > Programs > Fluent Inc > FLUENT 6.msh in your working directory.26 > FLUENT 6. you can download the mesh by right-clicking on this link. Check and Display Grid First.3. Navigate to your working directory and select the nozzle.msh has been created in your working directory. Click OK..26 Select 2ddp from the list of options and click Run. we check the grid to make sure that there are no errors. You can then proceed with the flow solution steps below.msh file. Import File Main Menu > File > Read > Case. Main Menu > Grid > Check .. The following should appear in the FLUENT window: Check that the displayed information is consistent with our expectations of the nozzle grid. Step 4: Set Up Problem in FLUENT If you have skipped the previous mesh generation steps 1-3.Check nozzle. Save the file as nozzle.3.

This will bring up the FLUENT documentation in your browser.7. while the density-based approach was mainly used for high-speed compressible flows. the pressure-based approach was developed for low-speed incompressible flows.3 Documentation. This will solve the axisymmetric form of the governing equations. . Go to chapter 25 in the user's guide. Section 25. In the Solver menu. Click on the link to the user's guide.Documentation > Fluent 6. However. The density-based approach." Since we are solving a high-speed compressible flow. shock resolution) advantage over the pressure-based solver for highspeed compressible flows. Both approaches are now applicable to a broad range of flows (from incompressible to highly compressible). the pressure field is extracted by solving a pressure or pressure correction equation which is obtained by manipulating continuity and momentum equations. In the densitybased approach. So which solver do we use for our nozzle problem? Turn to section 25. choose Axisymmetric. recently both methods have been extended and reformulated to solve and operate for a wide range of flow conditions beyond their traditional or original intent. but the origins of the density-based formulation may give it an accuracy (i.e. the continuity equation is used to obtain the density field while the pressure field is determined from the equation of state. it discusses the Pressure-Based and Density-Based solvers. was originally designed for high-speed compressible flows." Mull over this and the rest of this section." "In both methods the velocity field is obtained from the momentum equations. let's pick the density-based solver. Under Space.1 in chapter 25: "The pressure-based solver traditionally has been used for incompressible and mildly compressible flows.1 introduces the two solvers: "Historically speaking. in the pressure-based approach. select Density Based. on the other hand." "On the other hand.

Define > Models > Energy The energy equation needs to be turned on since this is a compressible flow where the energy equation is coupled to the continuity and momentum equations. This means the solver will neglect the viscous terms in the governing equations.Click OK. . Click OK. Define > Models > Viscous Select Inviscid under Model.

This means FLUENT uses the ideal gas equation of state to relate density to the static pressure and temperature. So set Operating Pressure in thePressure box to 0. Close the window. You should see the window expand. Under Properties. Define > Materials Select air under Fluid materials. choose Ideal Gas next to Density. Define > Operating Conditions We'll work in terms of absolute rather than gauge pressures in this example. Click Change/Create. .Make sure there is a check box next to Energy Equation and click OK.

Define > Boundary Conditions Set boundary conditions for the following surfaces: inlet. This value is 99.. click OKto close the window. For a subsonic inlet. Click Set. . wall. After you have entered the values. It is important that you set the operating pressure correctly in compressible flow calculations since FLUENT uses it to compute absolute pressure to use in the ideal gas law. The Pressure Inletwindow should come up.Click OK. Select inlet under Zone and pick pressure-inlet under Type as its boundary condition. centerline. Check that under the Thermal tab. the Total Temperature is 300 K. Set the total pressure (noted as Gauge Total Pressure in FLUENT) at the inlet to 101... This initial guess value can be calculated from the 1D analysis since we know the area ratio at the inlet. outlet. Click OK.325 Pa as specified in the problem statement. Note that this value will be updated by the code. Supersonic/Initial Gauge Pressure is the initial guess value for the static pressure.348 Pa.

pick pressure-outlet as the boundary condition for the outlet surface. Then.9 as specified in the problem statement. Note that a second-order discretization scheme will be used.. . Set the centerline zone to axis boundary type. Solve > Control > Solution We'll just use the defaults. Click OK. Step 5: Solve! Now we will set the solve settings for this problem and then iterate through and actually solve it. Make sure that wall zone is set to wall boundary type.Using the same steps as above. As you may recall from the previous tutorials. when the Pressure Outlet window comes up. Set Initial Guess Main Menu > Solve > Initialize > Initialize. set the pressure to 3738. this is where we set the initial guess values for the iterative solution. Select inlet under Compute From. Click OK.. We'll set these values to be the ones at the inlet.

Change the residual under Convergence Criterion for continuity. velocity and temperature are now assigned to each cell in the grid. Also.. We'll iterate the solution until the residual for each equation falls below 1e-6. select Plot. The residual is a measure of how well the current solution satisfies the discrete form of each governing equation. . This completes the initialization. x-velocity. Set Convergence Criteria FLUENT reports a residual for each governing equation being solved..Click Init. under Options. yvelocity and energy to 1e-6. The above values of pressure. Main Menu > Solve > Monitors > Residual. Close the window. This will plot the residuals in the graphics window as they are calculated.

this time.. we are going to plot the velocity along the centerline. Save case and data after you have obtained a converged solution. Iterate Until Convergence Main Menu > Solve > Iterate. Plot > XY Plot . In the Iterate Window that comes up. Click Iterate. we are going to use the dimensionless Mach quantity. Step 6: Analyze Results Mach Number Plot As in the previous tutorials. The residuals for each iteration is printed out as well as plotted in the graphics window as they are calculated. However.Click OK.. change the Number of Iterations to 500.

since we are going to plot this number at both the wall and axis.. Then. In addition. we will plot the corresponding variation from 1D theory. Also..xy by clicking on Load File. instead of selecting Axial Velocity as theY Axis Function. select Mach Number. load the mach_1D.. select centerline and wall under Surfaces. Click Plot. Do everything as we would do for plotting the centerline velocity.We are going plot the variation of the Mach number in the axial direction at the axis and wall. However. Figure How does the FLUENT solution compare with the 1D solution? .

. it is very useful to see how the pressure and temperature changes throughout the object... First. make sure that under Contours Of. Therefore. Display > Contours.. Pressure Contour Plot Sometimes..Pressure. This increases the number of lines in the contour plot so that we can get a more accurate result. This can be done via contour plots. change the default 20 to 40.xy by checking Write to File and clicking Write.. we are going to plot the pressure contours of the nozzle. We want this at a fine enough granularity so that we can see the pressure changes clearly. Click Display. and Static Pressure is selected..Is the comparison better at the wall or at the axis? Can you explain this? Save this plot as machplot.. Under Levels.

as is consistent with fluid going through a nozzle.Figure Notice that the pressure on the fluid gets smaller as it flows to the right. Back in the Contours window. and Static Temperature... Temperature Contour Plot Now we will plot the temperature contours and see how the temperature varies throughout the nozzle. select Temperature. under Contours Of. Click Display. Figure .

Recall that the quasi-1D result for the Mach number variation was given to you in the M_1D.xy file. Also. MATLAB or EXCEL.xy. Calculate the static temperature variation for the quasi-1D case from the Mach number variation given in M_1D. Recall that the static pressure p at the exit is 3.738. Also. (b) Plot the variation of static pressure at the axis and the wall as a function of the axial distance x.xy. Step 7: Refine Mesh Solve the nozzle flow for the same conditions as used in class on a 80x30 grid. Also. plot the corresponding results obtained on the 50x20 grid used in class and from the quasi-1D assumption. the temperature decreases towards the right side of the nozzle. You can make the plots in FLUENT. indicating a change of internal energy to kinetic energy as the fluid speeds up. plot the corresponding results obtained on the 50x20 grid used in class and from the quasi-1D assumption. .As we can see. Comment very briefly on the grid dependence of your results and the comparison with the quasi1D results. (c) Plot the variation of static temperature at the axis and the wall as a function of the axial distance x. Note all five curves should be plotted on the same graph so that you can compare them. plot the corresponding results obtained on the 50x20 grid used in class and from the quasi-1D assumption. (a) Plot the variation of Mach number at the axis and the wall as a function of the axial distance x. Calculate the static pressure variation for the quasi-1D case from the Mach number variation given in M_1D.9 Pa.

06:.20.943 0  907.4.5.8:70 414090.890.:084157088:70 .04.1470.943-0384..0703.9810890/8.3/0307940   84 :3/07 59438 800.04.:7703984:9438.0/ %0708/:..90/  .39 %0.8830/940.3090708/:.303:\$4.0439478#08/:..4393:9  .70 .7034.073306:.70901472410.:3/0743.04.1470.3/902507..943 480903/4  \$0943..  .9431. &%7054798.83907.8-040   .9  .4.0.9.9!49 %854990708/:.073306:.83/4..909084:943:3990708/:. .-4.708/:.0 3907/ %8.42509089039.0703.8..9..9:70..07907.0790743147.:.

943894 .3090:2-0741907.0907.0.6:.5.:2-07!49 8390570.90&3943.07 98 920 0.303:\$4.070/84:943  \$9053..70..0 .4390.80.903/49.8 0..70439454990.907. ....83/4..90/  \$...04-9.907.04.0#08:98 .0390730 40.90  %0708/:.9.4:89:947.19074:.   907.30/..4208:5 .9.9..43.704394:8090/203843088.0703.399  !49!49 .890 .943857390/4:9.854990/3907.3//.90  390907.80.81470.:.

 3 .7.0.3434.07 3890.8  800..943.'04.47708543/3.704354990.04..3/.943 800.8..93.0390730.425.* -.9./70.990.9 40./902..7099084:943 .9-4990....0793.:3/07\$:71.08  %03 4..9.94317429047  40.7.3/.3/.:2-07  84 83.!49   :70 4/40890&%84:943.3:2-07390.00./41 800.9.804://41475499390.//943 054990./0   .9434190.0390730..704394549983:2-07.8908:3.

!7088:708800.08 .3790940..398 \$.47.549 -.9:70.82..90.85.:9 94 %83.3:.4394:784190340 %0701470 2.4394:7549 849.9..  .098549.3790  !7088:704394:7!49 \$4209208 98.3090/01.90708:9   .79849..7843-09907.4394:75498  85.90/  0.8.990.:7.0.9 %8.70..308974:4:990 4-0..990.3/902507.7043945499057088:70.90.309..308...890.9.07:801:9480049057088:70.34:05.130034:7..808903:2-0741308390.08:709.3998.0.9 :3/074394:78 1 !7088:70 ..38009057088:70.2470.3/..3-0/430.7  &3/070..3/\$9.425.4394:78  789 0.

07.708974:4:990 340  .. %02507.438890399 1:/43974:.3904394:783/4 :3/074394:78 1 800.9:70  .340  %02507.9:70.9.85.88.9:704394:7!49 4054990902507.09.3/\$9.89148949079 .3/800490902507.9:70 .99057088:7043901:/09882. :70 49.9:70..9%02507.   :70 .4394:78.

94:.8901:/8500/8:5  \$905#013008 \$4.8843.0 84 54990.9.9.3:2-07.70902 4:.07-70143907//0503/03..88....47708543/3708:984-9.88:25943 #0..80174290 .3800 90902507. /89.207.88:25943 .8. !4990.8 .990098  !..990.9..93..9..8 ..3:2-07.7. !4990.3/90.80.990 89.3:2-07.3.943.9434189...7.47708543/3708:984-9.:.43/9438.70.  7/ #0.8 .8:80/3.030794309.8 ..57088:70.32.9..943.09054983&% %47   .584 9.1:3.425.20.8.304139073.94341.943147906:..   .:. /89.990.902507.88.8 708:98    ..9906:.0 84 54990.3/1742 906:.033*    .03944:390* 10 490.!4990.7.943147906:.1:3.8 .801742 90...425.033*   422039.78439906:.09034014147908.47708543/3708:984-9..80894...30/4390  7/:80/3.0307.9434189...7..7.57088:705.943.902507.9434190.3/1742 906:.88.0 84 54990.8 708:914790..9:70...8.0414:7708:98.3/90. /89.7.990.1:3..3/1742 906:.7.8.9.30/4390  7/:80/3.3:2-07.9:70.57088:70.0884:/-054990/43908. .9434190.7/890798/04190340 3/.8 ..:7.3.909089.8..9:70/0.9434190.0.7.3.3/90.1.3/90.909089..30/4390  7/:80/3.88:25943 ..3.8..9.