2 Contents What is Computational Fluid Dynamics(CFD)?Why and where use CFD?Physics of FluidNavier-Stokes EquationNumerical DiscretizationGridsBoundary ConditionsNumerical StaffCase Study: Backward-Facing StepContents

3 Navier-Stokes EquationsFluidProblemComparison&AnalysisFluid MechanicsPhysics of FluidCFDSimulation ResultsComputerMathematicsNavier-Stokes EquationsComputer ProgramProgrammingLanguageNumericalMethodsDiscretized FormGridsGeometryNow, let’s see what is CFD.Firstly, we have a fluid problem.To solve this problem, we should know the physical properties of fluid by using Fluid Mechanics.Then we can use mathematical equations to describe these physical properties. This is Navier-Stokes Equation.The Navier-Stokes Equation is analytical. Human can understand it and solve them on a piece of paper. But if we want to solve this equation by computer, we have to translate it to the discretized form.The translators are numerical discretization methods, such as Finite Difference, Finite Element methods.Consequently, we also need to divide our whole problem domain into many small parts because our discretization is based on them.Then, we can write programs to solve them. The typical languages are Fortran and C.Running the programs on workstation or supercomputer. At the end, we cam get our simulation results.We can compare and analyze the simulation results with experiments or the real problem. If the results are not sufficient to solve the problem, we have to repeat the process until find satisfied solution.This is CFD.What is CFD?

4 Contents What is Computational Fluid Dynamics(CFD)?Why and where use CFD?Physics of FluidNavier-Stokes EquationNumerical DiscretizationGridsBoundary ConditionsNumerical StaffCase Study: Backward-Facing StepContents

5 Simulation(CFD) Experiment Why use CFD? Cost Cheap Expensive TimeShortLongScaleAnySmall/MiddleInformationAllMeasured PointsRepeatableSomeSecuritySafeSome DangerousWe have known what is CFD. Now, let’s see why we use CFD?Here is a comparison table of Simulation and Experiment. From this table, we can see thatSimulation is much cheaper that experiment because we do not need to buy the expensive experiment equipments.We can get the results in short time with CFD.We can do simulation for any scale of problem. For example, from the small bubbles to weather of earth. But experiment can only work for the small or middle size object.From Simulation, we can get any information we need.But in experiment, we can only obtain data from the measured point.Simulation is very easy to repeat, we only need to run the program again. But experiment is not so easy, especially the combustion,explosions. They are unrepeatable.Some experiment are very dangerous, for example, pollution and radiation. But if we use Simulation, it is very safe.###################As you see, CFD has many advantages,. Some body may say, we do not need experiments any more, CFD is enough. This is wrong. We still need experiment to validate the simulation results. The improvement is that In the previous time, we needed hundreds experiments. Now we can firstly do simulations, at the end, do one or two experiments to validate.Why use CFD?

6 Where use CFD? Aerospace Automotive Biomedical Chemical ProcessingHVACHydraulicsPower GenerationSportsMarineBiomedicineAutomotiveTemperature and natural convection currents in the eye following laser heating.Now, let me show you some applications of CFD.Aerospace is a very important CFD application field. For example, the design of airplane.Automotive is another important field. This picture show the streamlines of a car.Biomedicine is a new field for CFD. This graph shows the the temperature and natural convection currents in the eye following laser heating.Where use CFD?

7 Where use CFD? Aerospacee Automotive Biomedical Chemical ProcessingHVAC(Heat Ventilation Air Condition)HydraulicsPower GenerationSportsMarinereactor vessel - prediction of flow separation and residence time effects.HydraulicsHVACChemical industry is another important CFD application field. This graph show - prediction of flow separation and residence time effects in Polymerization reactor vessel.This graph shows the streamlines of a workstation. This is very useful for Heat Ventilation Air Condition.This graph shows the application in Hydraulics.Streamlines for workstation ventilationWhere use CFD?

8 Flow around cooling towersSportsPower GenerationAerospaceAutomotiveBiomedicalChemical ProcessingHVACHydraulicsPower GenerationSportsMarineFlow around cooling towersMarineWe can also use CFD to improve the techniques of swimming.Improve the design of Power Factory and ship.Where use CFD?

9 Contents What is Computational Fluid Dynamics(CFD)?Why and where use CFD?Physics of FluidNavier-Stokes EquationNumerical DiscretizationGridsBoundary ConditionsNumerical StaffCase Study: Backward-Facing StepContents

10 Fluid = Liquid + Gas Density ρ Viscosity μ: Physics of Fluidresistance to flow of a fluidSubstanceAir(18ºC)Water(20ºC)Honey(20ºC)Density(kg/m3)1.27510001446Viscosity(P)1.82e-41.002e-2190The applications of CFD are very interesting. How can we get this results? Firstly, we should know the physics of fluid.The first thing we should make clear is what is fluid. Fluid is liquid and gas, for example, water and air.Fluid has some important properties, for example, Pressure, velocity, temperature and mass. Here I want to emphasis two properties.The first one is density. In fluid mechanics, if density is constant, we call is fluid is incompressible fluid. Sometimes, if the change of the density is very small, we can also treat the fluid as incompressible fluid. For example, water.If density is variable, we call the fluid is compressible. For example, air is compressible fluid.Later on we will see the mathematical equation for incompressible fluid is much simples than compressible fluid.Another important property is viscosity. Viscosity is an internal property of a fluid that offers resistance to flow. For example, to stir water is much easier than stir honey because the viscosity of water is much small than honey.This table shows the density and viscosity of air, water and honey.Physics of Fluid

11 Contents What is Computational Fluid Dynamics(CFD)?Why and where use CFD?Physics of FluidNavier-Stokes EquationNumerical DiscretizationGridsBoundary ConditionsNumerical StaffCase Study: Backward-Facing StepContents

12 M Conservation Law in out Mass Momentum EnergyTo describe the physical properties by mathematics, we need a conservation law.This picture shows the principle of conservation law. The change of the mass is equal to the mass flow in minus mass flow out.If the mass flow in is equal to mass flow out, then the change of mass is zero.Actually, the conservation law is not only for mass, but also for momentum and energy.Conservation Law

13 Navier-Stokes Equation IMass ConservationContinuity EquationCompressibleIncompressibleUsing the Conservation law, we can derive the mathematical equations for fluid. These equations are Navier-Stokes equations.The first one is Continuity Equation, it comes from Mass Conservation.Dp/Dt is the change of the mass, pdu/dx is convective term, which means the mass flux.This is for compressible fluid because the density can change with time.If density is constant, which means Dp/dt is zero. We have is simple formula. This is for incompressible fluid.Navier-Stokes Equation I

14 Navier-Stokes Equation IIMomentum ConservationMomentum EquationI : Local change with timeII : Momentum convectionIII: Surface forceIV: Molecular-dependent momentum exchange(diffusion)V: Mass forceIf we apply Momentum Conservation, we can get momentum equation.The first term is local momentum change with time.The second term is convective term, or we can say momentum flux.The third term is momentum change due to surface force. We can image that the pressure is active at the surface of object, and the surface force can change the momentum of object.The fourth term is momentum exchange with molecular motion. The momentum of the object can transfer to momentum of molecules.The last term is momentum change due to Mass Force. For example, the gravity force, acceleration force.Navier-Stokes Equation II

15 Navier-Stokes Equation IIIMomentum Equation for Incompressible FluidThe previous momentum equation is for compressible fluid. For the incompressible, we can simplify it.As we know, the molecular momentum exchange term is here.For incompressible flow, the continuity equation is du/dx=0. Which means the dUk/dxk is zero, so the later term is zero.For this term, we can spread it as ….. Because dui/dxi=0, we only have …left.So the momentum equation for incompressible fluid can be written as this formula.Navier-Stokes Equation III

16 Navier-Stokes Equation IVEnergy ConservationEnergy EquationI : Local energy change with timeII: Convective termIII: Pressure workIV: Heat flux(diffusion)V: Irreversible transfer of mechanical energy into heatIf we use energy conservation law, we can get energy equation.The first term is local energy change with time.The second term is convective term.The third is heat flux.Fourth is the work done by pressure.The last one is the transfer of mechanical energy into heat.Navier-Stokes Equation IV

17 Contents What is Computational Fluid Dynamics(CFD)?Why and where use CFD?Physics of FluidNavier-Stokes EquationNumerical DiscretizationGridsBoundary ConditionsNumerical StaffCase Study: Backward-Facing StepContents

18 Discretized EquationsDiscretizationAnalytical EquationsDiscretized EquationsDiscretization MethodsFinite DifferenceStraightforward to apply, simple, sturctured gridsFinite ElementAny geometriesFinite VolumeConservation, any geometriesWe have get Navier-Stokes equations. But these equations are analytical equations. Human can understand and solve, but computer can not.So we need to translate them to the forms which computer can understand. This process is discretization.The typical discretization methods are Finite Difference, Finite Element and Finite volume methods.Here I will introduce finite volume method for you.Discretization

19 Finite Volume I General Form of Navier-Stokes EquationLocal change with timeFluxSourceIntegrate over theControl Volume(CV)Integral Form of Navier-Stokes EquationLocal changewith time in CVFlux Overthe CV SurfaceSource in CVThe Navier-Stokes euqations can be written as this general form. If we set busai equal 1, we can get continuity equation, busai equal to Uj, we get momentum equation, pusai equal to T, then we can get energy equation.If we integrate over the Control Volume, we call it CV. Using Gauss theory, we can get the Volume Integral Form of Navier –Stokes Equation like this.The first volume integral is local in control volume, the second is flux over the surface of control volume. The right hand side is the source term.Next step, we should find the method how to approximate the volume integral and surface integral.Finite Volume I

21 Finite Volume III Approximation of Volume IntegralsApproximation of Surface Integrals ( Midpoint Rule)InterpolationUpwindCentralFirstly, let’s see the volume integral.Here, I introduce the simplest approach. It is first order approach. If we want higher accuracy, we can use more complex methods.For example, we want to get the mass of CV. It is the integral of density by volume. We can use the density of the center point time the volume of CV to approximate it. If the density is constant, which means the flow is incompressible, then this approach is exact approach. The other example is the momentum of CV. We still use the value of center point.To approach the surface integral, I also introduce a simple method. It is midpoint rule, it is second order method.For 2D case, the pressure integral at surfaces id the sum of 4 surfaces. Then we can use the pressure at the midpoint of side times length of side instead of do integral along the side.Then another problem comes out. Our variable are stored at the center of control volume, how can we get the value at the border?We can use interpolation to realize it.Finite Volume III

22 Discretization of Continuity EquationOne Control VolumeWhole DomainFirstly, let’s see the volume integral.Here, I introduce the simplest approach. It is first order approach. If we want higher accuracy, we can use more complex methods.For example, we want to get the mass of CV. It is the integral of density by volume. We can use the density of the center point time the volume of CV to approximate it. If the density is constant, which means the flow is incompressible, then this approach is exact approach. The other example is the momentum of CV. We still use the value of center point.To approach the surface integral, I also introduce a simple method. It is midpoint rule, it is second order method.For 2D case, the pressure integral at surfaces id the sum of 4 surfaces. Then we can use the pressure at the midpoint of side times length of side instead of do integral along the side.Then another problem comes out. Our variable are stored at the center of control volume, how can we get the value at the border?We can use interpolation to realize it.Discretization of Continuity Equation

23 Discretization of Navier-Stokes EquationFV Discretization of Incompressible N-S EquationUnsteadyConvectionDiffusionSourceTime DiscretizationExplicitImplicitIf we use finite volume method for the all domain, we get a matrix system for Navier-Stokes Equation. Here is the Finite Volume discretization of Incompressible N0S Equation.Omiga .. Is unstaedy term, …..Especially the unsteady term is changing with time, we need time discretization for this term. There are two ways: explicit and implicit.If we want to get the value of du/dt at time n+1, we can only use the value of u at time n. This is explicit method.If we use the value at both previous and current time step, it is implicit method.Explicit method is very stable, but slow. Implicit method is much faster, but not always stable.Discretization of Navier-Stokes Equation

24 Contents What is Computational Fluid Dynamics(CFD)?Why and where use CFD?Physics of FluidNavier-Stokes EquationNumerical DiscretizationGridsBoundary ConditionsNumerical StaffCase Study: Backward-Facing StepContents

25 Structured Grid Unstructured Grid Block Structured Grid Grids+ all nodes have the same number of elements around itonly for simple domainsUnstructured Grid+ for all geometriesirregular data structureBlock Structured GridFrom finite volume method, we know that we need to divide the whole problem domain into many small domains, then integrate at these small domains. This is Gird GenerationWe have 3 methods to generate the grids.The simplest one is structured grid. This type of grids, all nodes have the same number of elements around it. We can describe and store them easily. But this type of grid is only for the simple domain.If we have a complex domain, we can use unstructured grid. For example, this is a complex object. The flow near the object isvery important and complex, we need very fine grid at this region. Far away from the airfoil, the flow is comparably simple, so we can use coarse grid.Generally, unstructured grid is suitable for all geometries, it is very popular in CFD. The disadvantage is that because the data structure is irregular, it is more difficult to describe and store them.Block structure grid is a compromising of structured and unstructured grid. The idea is, firstly, divide the domain into several blocks, then use different structured grids in different blocks.Grids

26 Contents What is Computational Fluid Dynamics(CFD)?Why and where use CFD?Physics of FluidNavier-Stokes EquationNumerical DiscretizationGridsBoundary ConditionsNumerical StaffCase Study: Backward-Facing StepContents

27 Boundary Conditions Typical Boundary Conditions oNo-slip(Wall), Axisymmetric, Inlet, Outlet, PeriodicPeriodic boundary condition in spanwise direction of an airfoilInlet ,u=c,v=0oNo-slip walls: u=0,v=0v=0, dp/dr=0,du/dr=0Outlet, du/dx=0dv/dy=0,dp/dx=0rxAxisymmetricTo solve the equation system, we also need boundary conditions.The typical boundary conditions in CFD are No-slip boundary condition, Axisymmetric boundary condition, Inlet, outlet boundary condition and Periodic boundary condition.For example, there is a pipe, the flow comes in from the west, comes out from the east side. So we can use inlet at the west side, which means we can set the velocity manually.At the west side, we use outlet boundary condition to keep all the properties constant at x direction, which means the gradient is zero.At the wall of pipe, we can set the velocity is zero, this is no-slip boundary condition.At the center of pipe, we can use axisymmetric boundary condition.Periodic boundary condition isBoundary Conditions

28 Contents What is Computational Fluid Dynamics(CFD)?Why and where use CFD?Physics of FluidNavier-Stokes EquationNumerical DiscretizationGridsBoundary ConditionsNumerical StaffCase Study: Backward-Facing StepContents