Presentation on theme: "Chapter 2 Introduction to CFD"— Presentation transcript:
1 Chapter 2 Introduction to CFD Introductory FLUENT TrainingSharif University of TechnologyLecturer: Ehsan Saadati
2 What is CFD?Computational fluid dynamics (CFD) is the science of predicting fluid flow, heat and mass transfer, chemical reactions, and related phenomena by solving numerically the set of governing mathematical equationsConservation of massConservation of momentumConservation of energyConservation of speciesEffects of body forcesEtc.The results of CFD analyses are relevant in:Conceptual studies of new designsDetailed product developmentTroubleshootingRedesignCFD analysis complements testing and experimentation by reducing total effort and cost required for experimentation and data acquisition.
3 How Does CFD Work?ANSYS CFD solvers are based on the finite volume methodDomain is discretized into a finite set of control volumesGeneral conservation (transport) equations for mass, momentum, energy, species, etc. are solved on this set of control volumesPartial differential equations are discretized into a system of algebraic equationsAll algebraic equations are then solved numerically to render the solution fieldControlVolume*Fluid region of pipe flow is discretized into a finite set of control volumes.UnsteadyConvectionDiffusionGenerationEquation VariableContinuity 1X momentum uY momentum vZ momentum wEnergy hThis background page is to introduce the concept of FVM to the user. We will assume that the majority of users will be relatively new to CFD. This page allows us to introduce the concept of spatial discretization and equation discretization which leads into the next slide that summarizes the steps involved in cfd analysis- meshing and solving.* FLUENT control volumes are cell-centered (i.e. they correspond directly with the mesh) while CFX control volumes are node-centered
4 Problem Identification CFD Modeling OverviewProblem IdentificationDefine your modeling goalsIdentify the domain you will modelPreProcessing and Solver ExecutionCreate a solid model to represent the domainDesign and create the mesh (grid)Set up the physics (physical models, material properties, domain properties, boundary conditions, …)Define solver settings (numerical schemes, convergence controls, …)Compute and monitor the solutionPost-ProcessingExamine the results.Consider revisions to the model.Problem IdentificationDefine goalsIdentify domainPre-ProcessingGeometryMeshPhysicsSolver SettingsSolveCompute solutionTurbulence models:Spalart-Allmarask-e, RNG k-e, Realizable k-eNon-equilibrium wall functions; compressibility and transpiration effectsTwo-layer/zonal modelsLow-Re modelsSuite of damping function modelsV2F modelk-w (Wilcox, SST) – FLUENT 6Reynolds Stress Model (RSM) – (LRR, SSG)Large Eddy Simulation (LES)Heat transferConduction, Convection, RadiationMultiphase and free surface modelsDiscrete Phase, VOF, ASM; Eulerian(multifluid) models in FLUENT 6Porous media and lumped parameter modelsFan, heat exchangers, porous jump, porous mediaMultiple reference frames, sliding mesh and mixing plane modelInviscid, laminar or turbulentUpdate ModelPost ProcessingExamine results
5 1. Define Your Modeling Goals Problem IdentificationDefine goalsIdentify domainWhat results are you looking for (i.e. pressure drop, mass flow rate), and how will they be used?What are your modeling options?What physical models will need to be included in your analysis (i.e. turbulence, compressibility, radiation)?What simplifying assumptions do you have to make?What simplifying assumptions can you make (i.e. symmetry, periodicity)?Do you require a unique modeling capability?User-defined functions (written in C) in FLUENT or User FORTRAN functions in CFXWhat degree of accuracy is required?How quickly do you need the results?Is CFD an appropriate tool?
6 2. Identify the Domain You Will Model Problem IdentificationDefine goalsIdentify domainHow will you isolate a piece of the complete physical system?Where will the computational domain begin and end?Do you have boundary condition information at these boundaries?Can the boundary condition types accommodate that information?Can you extend the domain to a point where reasonable data exists?Can it be simplified or approximated as a 2D or axisymmetric problem?Domain of Interest as Part of a Larger System (not modeled)Domain of interest isolated and meshed for CFD simulation.
7 3. Create a Solid Model of the Domain Pre-ProcessingGeometryMeshPhysicsSolver SettingsHow will you obtain a solid model of the fluid region?Make use of existing CAD models?Extract the fluid region from a solid part?Create from scratch?Can you simplify the geometry?Remove unnecessary features that would complicate meshing (fillets, bolts…)?Make use of symmetry or periodicity?Are both the solution and boundary conditions symmetric / periodic?Do you need to split the model so that boundary conditions or domains can be created?Solid model of aHeadlight Assembly
8 4. Design and Create the Mesh A mesh divides a geometry into many elements. These are used by the CFD solver to construct control volumesPre-ProcessingGeometryMeshingPhysicsSolver SettingsWhat degree of mesh resolution is required in each region of the domain?The mesh must resolve geometric features of interest and capture gradients of concern, e.g. velocity, pressure, temperature gradientsCan you predict regions of high gradients?Will you use adaption to add resolution?What type of mesh is most appropriate?How complex is the geometry?Can you use a quad/hex mesh or is a tri/tet or hybrid mesh suitable?Are non-conformal interfaces needed?Do you have sufficient computer resources?How many cells/nodes are required?How many physical models will be used?TriangleQuadrilateralTetrahedronHexahedronPyramidPrism/Wedge
9 Tri/Tet vs. Quad/Hex Meshes For flow-aligned geometries, quad/hex meshes can provide higher-quality solutions with fewer cells/nodes than a comparable tri/tet meshQuad/Hex meshes show reduced numerical diffusion when the mesh is aligned with the flow.It does require more effort to generate a quad/hex meshMeshing tools designed for a specific application can streamline the process of creating a quad/hex mesh for some geometries.
10 Tri/Tet vs. Quad/Hex Meshes For complex geometries, quad/hex meshes show no numerical advantage, and you can save meshing effort by using a tri/tet mesh or hybrid meshQuick to generateFlow is generally not aligned with the meshHybrid meshes typically combine tri/tet elements with other elements in selected regionsFor example, use wedge/ prism elements to resolve boundary layers.More efficient and accurate than tri/tet alone.Wedge (prism) meshTetrahedral mesh
11 Multizone (or Hybrid) Meshes Model courtesy of ROI EngineeringA multizone or hybrid mesh uses different meshing methods in different regions. For example,Hex mesh for fan and heat sinkTet/prism mesh elsewhereMultizone meshes yield a good combination of accuracy, efficient calculation time and meshing effort.When the nodes do not match across the regions, a non-conformal interface can be used.
12 Non-Conformal MeshesNon conformal meshes are useful for meshing complex geometriesMesh each part then join togetherNon conformal interfaces are also used in other situationsChange in reference framesMoving mesh applicationsNon-conformalinterface3D Film CoolingCoolant is injected into a duct from a plenum. The plenum is meshed with tetrahedral cells while the duct is meshed with hexahedral cellsCompressor and ScrollThe compressor and scroll are joined through a non conformal interface. This serves to connect the hex and tet meshes and also allows a change in reference frame
13 Set Up the Physics and Solver Settings For a given problem, you will need to:Define material propertiesFluidSolidMixtureSelect appropriate physical modelsTurbulence, combustion, multiphase, etc.Prescribe operating conditionsPrescribe boundary conditions at all boundary zonesProvide initial values or a previous solutionSet up solver controlsSet up convergence monitorsPre-ProcessingGeometryMeshPhysicsSolver SettingsFor complex problems solving a simplified or 2D problem will provide valuable experience with the models and solver settings for your problem in a short amount of time.
14 Compute the SolutionThe discretized conservation equations are solved iteratively until convergence.Convergence is reached when:Changes in solution variables from one iteration to the next are negligible.Residuals provide a mechanism to help monitor this trend.Overall property conservation is achievedImbalances measure global conservationQuantities of interest (e.g. drag, pressure drop) have reach steady values.Monitor points track quantities of interest.The accuracy of a converged solution is dependent upon:Appropriateness and accuracy of physical models.Mesh resolution and independenceNumerical errorsSolveCompute solutionA converged and mesh-independent solution on a well-posed problem will provide useful engineering results!
15 Examine the ResultsPost ProcessingExamine resultsUpdate ModelExamine the results to review solution and extract useful dataVisualization Tools can be used to answer such questions as:What is the overall flow pattern?Is there separation?Where do shocks, shear layers, etc. form?Are key flow features being resolved?Numerical Reporting Tools can be used to calculate quantitative results:Forces and MomentsAverage heat transfer coefficientsSurface and Volume integrated quantitiesFlux BalancesExamine results to ensure property conservation and correct physical behavior. High residuals may be caused by just a few poor quality cells.
16 Consider Revisions to the Model Post ProcessingExamine resultsUpdate ModelAre the physical models appropriate?Is the flow turbulent?Is the flow unsteady?Are there compressibility effects?Are there 3D effects?Are the boundary conditions correct?Is the computational domain large enough?Are boundary conditions appropriate?Are boundary values reasonable?Is the mesh adequate?Can the mesh be refined to improve results?Does the solution change significantly with a refined mesh, or is the solution mesh independent?Does the mesh resolution of the geometry need to be improved?
17 Models Available in FLUENT 12 Fluid flow and heat transferMomentum, continuity, energy equationsRadiationTurbulenceRANS-based models (Spalart-Allmaras, k–ε, k–ω, Reynolds stress)Large-eddy simulation (LES) and detached eddy simulation (DES)Species transportVolumetric reactionsArrhenius finite-rate chemistryTurbulent fast chemistryEddy Dissipation, non-Premixed, premixed, partially premixedTurbulent finite-rate chemistryEDC, laminar flamelet, composition PDF transportSurface ReactionsPressure Contours in Near-Ground FlightThis slide and the next introduce a summary of all models available in fluent. I don’t think it is necessary to give examples of each model in particular, but to generalize by stating that reacting flows and multiple phase flows can be studied.‘Can fluent do this…?’ type questions should be deferred to 1) after lecture discussion, 2) tutorial, or 3) ask an expert. If we don’t take this approach, this lecture could go on for a very long time.Temperature Contours for Kiln Burner Retrofit
18 Models Available in FLUENT 12 Multiphase flowsDiscrete Phase Model (DPM)Volume of Fluid (VOF) model for immiscible fluidsMixturesEulerian-Eulerian and Eulerian-granularLiquid/Solid and cavitation phase changeMoving and deforming meshMoving zonesSingle and multiple reference frames (MRF)Mixing plane modelSliding mesh modelMoving and deforming (dynamic) mesh (MDM)User-defined scalar transport equationsGasoutletOilThree- PhaseInletWaterContours of Oil Volume Fractionin a Three-Phase SeparatorPressure Contours in a Squirrel Cage Blower (Courtesy Ford Motor Co.)
19 FLUENT CFD Workflow under Workbench 2 Start ANSYS WorkbenchDrag the Fluid Flow (FLUENT) system from Analysis Systems group in the Toolbox onto preview drop target shown in the Project Schematic.
20 Import the GeometryRight-click on Geometry cell A2 and select Import GeometryImport the geometry file (CAD model or DesignModeler .agdb file)You can also link the FLUENT simulation to an existing DesignModeler session.
21 Generate a Mesh Right-click on Mesh cell and select Edit. Meshing opens and loads geometrySelect Mesh under Model in OutlineNote that Preferences are automatically set for FLUENT, because Meshing was opened from a FLUENT system.
22 Define Boundary and Cell Zones Create boundary zones using Named selections.Select the surface which will represent the boundary you wish to set.Right-click the selection and select Create Named Selection.Name the selection and click OK.You will also need to define the regions of the flow containing fluid and solid (if any).Solids are required for conjugate heat transfer calculations only.More details will be presented later.velocity inlet
23 Set Up and Run FLUENT Edit the Setup cell to set up the model options Boundary conditionsSolver settingsSolutionPost processingOnce run, the solution can then be either post processed in FLUENT or data exported to CFD-Post for post processingContour and vector plotsProfile plotsCalculation of forces and momentsAnimation of unsteady flow results
24 Demonstration of FLUENT Software Start FLUENT (assume the mesh has already been generated).Set up a simple problem.Solve the flow field.Postprocess the results.Online help and documentation is available on each panel by pressing the help buttonRequires that you have the documentation installed and properly connected to your web browser.The demo should include a very quick gambit session. This session will involve the import of a database file, the setting of boundary zone names, and the export of a mesh. We do not want to give the trainees enough knowledge at this point on how to generate geometry or mesh. The purpose of this step is to provide a connection between the names of the boundaries assigned in gambit to the names of the boundaries in fluent.Discuss items 2 and 3 on the previous slide when in gambit. Discuss items when in fluent.Assume the customers are relatively new to CFD- try not to refer to terminology that has not yet been introduced. Remember to:1. Discuss layout of gui (working from left to right), 2. Show the grid early in the demo, 3. Scale grid, 4. Show boundary names, 5. Discuss default settings of models and properties, 6. Show several post-processing features.It is not necessary to point out all models or capabilities at this time. It will be brought up in later lectures.
25 Navigating the PC at Fluent Log in to your workstationLogin name: fluentPassword: fluentDirectoriesTutorial mesh/case/data files can be found in c:\Student Files\fluent\tut\We recommend that you save your work into a central working folder: c:\usersWorking folder shown on the desktop is a shortcut to c:\usersTo start FLUENT and/or Workbench, use the desktop icons.Your support engineer will save your work at the end of the week.It is recommended that you restart FLUENT and/or Workbench for each tutorial to avoid mixing solver settings from different workshops.