LECTURE-IV FLUENT Introduction FLUENT is a state-of-the-art computer program for modeling fluid flow and heat transfer in complex geometries. FLUENT provides complete mesh flexibility, solving your flow problems with unstructured meshes that can be generated about complex geometries with relative ease. Supported mesh types include 2D triangular/quadrilateral, 3D tetrahedral/hexahedral/pyramid/wedge, and mixed (hybrid) meshes. FLUENT also allows you to refine or coarsen your grid based on the flow solution. This solution-adaptive grid capability is particularly useful for accurately predicting flow fields in regions with large gradients, such as free shear layers and boundary layers. In comparison to solutions on structured or block structured grids, this feature significantly reduces the time required to generate a ``good'' grid. Solution-adaptive refinement makes it easier to perform grid refinement studies and reduces the computational effort required to achieve a desired level of accuracy, since mesh refinement is limited to those regions where greater mesh resolution is needed. Basic Program Structure Once a grid has been read into FLUENT, all remaining operations are performed within the solver. These include setting boundary conditions, defining fluid properties, executing the solution, refining the grid, and viewing and postprocessing the results. Program Capabilities The FLUENT solver has the following modeling capabilities: flows in 2D or 3D geometries using unstructured solution-adaptive triangular/tetrahedral, quadrilateral/hexahedral, or mixed (hybrid) grids that include prisms (wedges) or pyramids. (Both conformal and hanging-node meshes are acceptable.) incompressible or compressible flows steady-state or transient analysis inviscid, laminar, and turbulent flows Newtonian or non-Newtonian flow convective heat transfer, including natural or forced convection coupled conduction/convective heat transfer radiation heat transfer inertial (stationary) or non-inertial (rotating) reference frame models multiple moving reference frames, including sliding mesh interfaces and mixing planes for rotor/stator interaction modeling chemical species mixing and reaction, including combustion submodels and surface deposition reaction models arbitrary volumetric sources of heat, mass, momentum, turbulence, and chemical species Lagrangian trajectory calculations for a dispersed phase of particles/droplets/bubbles, including coupling with the continuous phase phase-change models flow through porous media lumped-parameter models for fans, pumps, radiators, and heat exchangers multiphase flows, including cavitation free-surface flows with complex surface shapes These capabilities allow FLUENT to be used for a wide variety of applications, including the following: Process and process equipment applications Power generation and oil/gas and environmental applications Aerospace and turbomachinery applications Automobile applications Heat exchanger applications Electronics/HVAC/appliances Materials processing applications Architectural design and fire research In summary, FLUENT is ideally suited for incompressible and compressible fluid flow simulations in complex geometries. Problem Solving Steps Once you have determined the important features of the problem you want to solve, you will follow the basic procedural steps shown below. 1. Create the model geometry and grid. 2. Start the appropriate solver for 2D or 3D modeling. 3. Import the grid. 4. Check the grid. 5. Select the solver formulation. 6. Choose the basic equations to be solved: laminar or turbulent (or inviscid), chemical species or reaction, heat transfer models, etc. Identify additional models needed: fans, heat exchangers, porous media, etc. 7. Specify material properties. 8. Specify the boundary conditions. 9. Adjust the solution control parameters. 10 Initialize the flow field. 11 Calculate a solution. 12 Examine the results. 13 Save the results. 14 If necessary, refine the grid or consider revisions to the numerical or physical model. Step 1 of the solution process requires a geometry modeler and grid generator. You can use GAMBIT or a separate CAD system for geometry modeling and grid generation. You can also use TGrid to generate volume grids from surface grids imported from GAMBIT or a CAD package. Alternatively, you can use supported CAD packages to generate volume grids for import into TGrid or into FLUENT. In Step 2, you will start the 2D or 3D solver. The details of steps 3-14 are shown below. Table 1.4.1: Overview of the FLUENT Menus Solution Step Menu 3. Import the grid. File menu 4. Check the grid. Grid menu 5. Select the solver formulation. Define menu 6. Choose basic equations. Define menu 7. Material properties. Define menu 8. Boundary conditions. Define menu 9. Adjust solution controls. Solve menu 10. Initialize the flow field. Solve menu 11. Calculate a solution. Solve menu 12. Examine the results. Display menu Plot menu Report menu 13. Save the results. File menu 14. Adapt the grid. Adapt menu FLUENT provides three different solver formulations: segregated coupled implicit coupled explicit The segregated solver traditionally has been used for incompressible and mildly compressible flows. The segregated solver provides several physical models that are not available with the coupled solvers: Volume-of-fluid (VOF) model Multiphase mixture model Eulerian multiphase model Non-premixed combustion model Premixed combustion model Partially premixed combustion model Soot and NOx models Rosseland radiation model Melting/solidification model Specified mass flow rate for streamwise periodic flow Shell conduction model Floating operating pressure The following features are available with the coupled solvers, but not with the segregated solver: Real gas model Non-reflecting boundary conditions (available only for the coupled explicit solver) Stiff chemistry solver option for laminar flames Other menu commands will be dealt in the class. The following session is a practice session which deals with a cavity which is in the shape of a rhombus. Some of the boundary conditions are employed on the surface and the solving part is done with the help of fluent 2d. The 3d section problems will be covered in the coming classes. Sample Session In this problem, a cavity in the shape of a 60 rhombus, 0.1 m on a side, contains air at constant density and is driven by the top wall which moves to the right with a speed of 0.1 m/s. With a Reynolds number of about 500, the flow is laminar. Fluid Flow in a Driven Cavity Outline of Procedure The driven cavity flow shown in Figure is a simple 2D problem in which the flow is laminar, there is no heat transfer, and there are no special physical models to consider. In addition, the overall problem geometry, grid, and boundary locations and types have already been defined in the grid generator. You can simply read the grid file, with all this information, into FLUENT. The modeling steps you will follow in this sample FLUENT session are reduced to the following: Read the grid file and check it. Select the default segregated solver. Define the physical models. Specify the fluid properties. Specify the boundary conditions. Save the problem setup. Initialize the solution. Calculate the solution. Save the results. Examine the results. Before starting you should copy file which I sent you into your working directory. Reading and Checking the Grid Start the 2D version of FLUENT Reading the Grid To read in the quadrilateral grid file, select the File/Read/Case... menu item. File Read Case... The Select File dialog box will appear, as shown in Figure. A case file, in general, contains the grid, boundary conditions, and solution control parameters. The grid file is a subset of this, and the grid in this example has been saved in FLUENT format, so you can read it in the same manner as a full case file. (To read a grid file that was saved in another format, you would use the appropriate item in the File/Import submenu.) If the file containing the grid you want to use is shown in Files, you can double-click the left mouse button on its name to begin reading it. If it is not shown, you can modify the path shown in Filter to include the file you are searching for, or you can type the complete name of the file in the box labeled Case File, and then click OK. In this example the file cavity.msh is selected. FLUENT will report its progress in the console window as it reads the grid. Checking the Grid After you read in the grid, you should check its validity by selecting the Grid/Check menu item.Grid Check You should see the domain extents, volume statistics, and connectivity information in the console window, as shown below: Grid Check Domain Extents: x-coordinate: min (m) = 0.000000e+00, max (m) = 1.500000e-01 y-coordinate: min (m) = 0.000000e+00, max (m) = 8.660000e-02 Volume statistics: minimum volume (m3): 7.156040e-05 maximum volume (m3): 7.157349e-05 total volume (m3): 8.660000e-03 Face area statistics: minimum face area (m2): 9.089851e-03 maximum face area (m2): 9.091221e-03 Checking number of nodes per cell. Checking number of faces per cell. Checking thread pointers. Checking number of cells per face. Checking face cells. Checking bridge faces. Checking right-handed cells. Checking face handedness. Checking element type consistency. Checking boundary types: Checking face pairs. Checking periodic boundaries. Checking node count. Checking nosolve cell count. Checking nosolve face count. Checking face children. Checking cell children. Checking storage. Done. The most common error identified by the grid check is negative volumes in the grid. If the minimum volume is negative, you will need to repair the grid to remove this nonphysical discretization of the solution domain. You may be able to use the IsoValue... marking ability in the Adapt pull-down menu to locate the problem by marking and displaying cells with volumes less than zero. Displaying the Grid To display the grid, select the Display/Grid... menu item. Display Grid... In the resulting Grid Display panel, click on the Display push button. This will open a graphics display window and draw the grid. You should see a picture like the one in Figure. Close the Grid Display panel by clicking on the Close push button. THE GRID DISPLAY PANEL Grid Display with Default View You can zoom in to enlarge the view using the mouse. Move the cursor to a point on the screen that is slightly above and to the left of the cavity. Then, while holding down the middle mouse button, move the cursor down and to the right to a point that is slightly below and to the right of the cavity. When you release the middle mouse button, the portion of the display within the zoom box will be expanded to fill the entire window. Selecting the Solver Formulation For this example, the velocities involved are low enough that you can model the problem assuming incompressible flow. For such problems, the segregated solver is appropriate. Since the segregated solver is the default in FLUENT, no change is needed. If you wanted to select one of the coupled solvers, you would visit the Solver panel in the Define/Models submenu. Defining Physical Models In FLUENT, the default physical model setup is for laminar flow. Since the flow modeled in this example is laminar, you will not need to make any changes to the model settings. If you did need to modify the physical models, you would do so using the Viscous Model panel and other panels in the Define/Models submenu. Specifying Fluid Properties To set the fluid properties for your problem, select the Define/Materials... menu item. This will open the Materials panel. Define Materials... THE MATERIALS PANEL If you wanted to use a material other than air you could select it from the materials database, or create your own material. For this problem, you will just make some modifications to the properties for air, the default material. Change the density to 1.0 kg/m 3 and the viscosity to new values, and then close the panel. kg/m-s. Click on Change/Create to save the Specifying Boundary Conditions You can set values for boundary conditions and change boundary types using the Boundary Conditions panel shown in Figure. To open this panel, select the Define/Boundary Conditions... menu item. Define Boundary Conditions... The Boundary Conditions Panel To set the boundary conditions for a particular zone, select the desired boundary in the Zone list. You can change the boundary type by selecting from the Type list. After you select the correct zone type, you can set the actual boundary condition values by clicking on the Set... button. (If you prefer, you can double-click on the boundary zone name in the Zone list instead of clicking on the Set... button.) For this example, you need to change the conditions for the moving (top) wall by setting the x velocity to 0.1 m/s to model the moving cavity lid. If you are not sure which of the two wall boundaries represents the moving (top) wall, you can click your right mouse button on the top wall boundary in the graphics window. The zone information will be printed in the FLUENT console window, and wall-2 will be selected automatically in the Zone list in the Boundary Conditions panel. Now click on the Set... button to open the Wall panel shown in Figure. The Wall Panel To set the wall velocity, you will need to turn on the Moving Wall option. When you do so, the Wall panel will expand to show the wall motion information (see Figure). By default, Translational motion is selected and the velocity Direction is set to X, so you can simply set the Speed to 0.1. (Note that since the adjacent fluid zone is not moving--as it would be if you were modeling a rotating reference frame--you need not worry about the specification of relative or absolute motion; they are equivalent.) The Wall Panel for a Moving Wall After you have entered this value, click on OK to save your settings and close the panel. The only other boundary in this problem is the wall boundary on the remaining three sides of the cavity ( wall-5). For this example, the default wall boundary conditions (no motion) will be used, so no further action is needed. Click on the Close button in the Boundary Conditions panel to close it. Adjusting Solution Controls You can change the default settings for the under-relaxation factors, multigrid parameters, and other flow solver parameters in the panels that are opened from the Solve/Controls submenu. Normally, you will not need to change these parameters. For this problem, the default settings are adequate. Enabling Residual Plotting You will now turn on the graphical residual monitoring so that you can easily watch the progress of the solution. To do this, select the Solve/Monitors/Residual... menu item to open the Residual Monitors panel shown in Figure. Solve Monitors Residual... Under Options, turn on the Plot option to activate the graphical display of residuals during the calculation, and then click OK. The Residual Monitors Panel Saving the Case File Your inputs that define the problem are stored in the case file. You must save this file in order to continue your analysis in a future FLUENT session. (The results that you compute will be stored in a separate file, the data file.) To save the case file, select the File/Write/Case... menu item. The Select File dialog box will appear, as shown in Figure below File Write Case... Saving a Case File Solving the Problem Initializing the Flow Before iterating, you must initialize the flow field to provide a starting point for the solution. You have a choice of computing the initial solution from the settings of one (or all) of the boundary conditions or entering flow-field values individually. Select the Solve/Initialize/Initialize... menu item to open the Solution Initialization panel shown in Figure. Solve Initialize Initialize... Since a strongly recirculating flow is expected to develop, initialization of all values to 0 is acceptable. Thus you can retain the default values in the panel and initialize the flow by clicking on the Init button. Then close the panel. The Solution Initialization Panel Calculating Now you are ready to begin iterating. Select the Solve/Iterate... menu item. This will open the Iterate panel shown in Figure . Solve Iterate... The Iterate Panel Enter 10 for the Number of Iterations and click on the Iterate button to perform the 10 iterations. When the iterations start, you should see the residual plot in the graphics window. After the 10 iterations are complete, your graphics window should look something like Figure below. The residuals are headed downward, which is a good sign. (Note that the actual values of the residuals may differ slightly on different machines, so your plot may not look exactly the same as Figure below.) Figure 1.8.13: Residual Plot After 10 Iterations You will also want to check the flow field to see how it is developing. To view the velocity vectors in the flow field, select the Vectors... menu item in the Display menu. This will open the Vectors panel shown in Figure below. Display Vectors... The Vectors Panel The default settings on this panel produce a vector plot colored by velocity magnitude, which is what you want to see. Click on the Display button, and you should see a plot similar to Figure below. Velocity Vectors After 10 Iterations Even after only 10 iterations, the clockwise recirculation pattern in the cavity is clearly visible. It looks like the solution is proceeding in an acceptable manner, so you can just ask for more iterations to complete the solution. Enter 90 for the Number of Iterations in the Iterate panel, and click on Iterate. The solution is converged to the default tolerances after a total of about 50 iterations. At this point, your residual plot will look something like Figure below. (Note that the exact number of iterations required for the solution to converge may vary on different computers.) Residuals After Convergence Saving the Results As discussed earlier, when the case file was saved, inputs that define the problem and the results computed by FLUENT are stored in two separate files: the case file and the data file. You must save both files in order to resume your analysis in a future FLUENT session. Note that FLUENT does not automatically save these files for you. Although you already saved the case file before you began the calculation, it is a good idea to save it again, along with the data file. To save the case and data files, select the File/Write/Case & Data... menu item. The Select File dialog box will appear, as shown in Figure File Write Case & Data... Saving Case and Data Files Examining the Results Plotting Contours You have already seen how to make a velocity vector plot. Now select the Contours... menu item in the Display menu. This will open the Contours panel shown in Figure Display Contours... The Contours Panel In the upper drop-down list under Contours Of, select Velocity..., and then select Stream Function in the lower list. Decrease the number of contour Levels to 10 and click on the Display button. The resulting display should appear as shown in Figure Close the panel when you are finished displaying contours. Contours of Stream Function