CFD Notes

47
Lecture 1: 1.4 What is CFD? CFD is the science of predicting the behavior of fluid flows by solving the governing equations (Navier-Stokes) of their flow numerically. in brief, it is the process of converting the continuous partial differential equations into algebraic equations and then solving them with a computer. 1.5 Why perform CFD? Option 1: build/test many designs on the track option 2: build many designs, test in a wind tunnel, and test some on the track Option 3: CAD designs, tested in CFD, then wind tunnel, then track Navier-Stokes Equations – conservation of momentum, energy, and continuity ˙ m ¿ m out ρvA

Transcript of CFD Notes

Lecture 1:1.4 What is CFD?CFD is the science of predicting the behavior of fluid flows by solving the governing equations (Navier-Stokes) of their flow numerically. in brief, it is the process of converting the continuous partial differential equations into algebraic equations and then solving them with a computer.

1.5 Why perform CFD?Option 1:build/test many designs on the trackoption 2:build many designs, test in a wind tunnel, and test some on the trackOption 3:CAD designs, tested in CFD, then wind tunnel, then track

Navier-Stokes Equations conservation of momentum, energy, and continuity

Lecture 2: Governing Equations of Fluid Motion2.1 Brief Calculus Reviewchain rule given a function

we can then solve for the derivative we are interested in, for example if we wanted , we divide both sides by

Divergence operator

i.e. given a vector

2.2 substantial derivativethe substantial derivative is an important concept in aerodynamics. Consider a fluid property that is independent of the amount of matter (i.e. mass of fluid) (aka intensive)if is a fluid property independent of mass but varies in space and time then:

the substantial derivative of an intensive fluid property is defined as the time rate of change following a moving fluid element

in other words the substantial derivative denoted by is nothing more than the total derivative

2.3 continuity equationin developing the continuity equation we follow three steps:1. state the fundamental physical principle2. apply it to a suitable model of the flow3. obtain equations to satisfy the principle

For continuity:1. mass is conserved2. we have 4 different ways of modelling the flow:a. finite volume fixed in space with fluid moving through itb. finite control volume moving with the fluid so that the fluid particles are always in the same CVc. infinitesimal fluid element fixed in space with the fluid moving in it (models that dont move with the fluid result in a form of the equation known as conservation equationsd. infinitesimal fluid element moving along streamline with velocity V, moving with the fluid (non-conservation form)

Lecture 3: Derivation of the Governing equations (continued)3.1 review of the substantial derivativefor temperature, our intensive fluid property we have

3.2 Finite Volume, Fixed in spaceas we have shown last lecture, this is nothing more than the total derivative with respect to time (using the chain rule). physically, [3.1] states that the fluid element temperature is changing because the temperature itself may be fluctuating with time (local derivative) AND because the fluid is moving to another point in the flow field where the temperature is different (convective derivative)

therefore, if flow exits, is positive, and if flow is entering, then it is negative

net mass flow will be the summation of S:

for the right side consider a very small element inside out CV, its mass will be:

3.3 continuity Moving CVfor this flow model, where our CV is moving with the fluid and mass is neither created nor destroyed we can say that the mass of the CV does not change with time:

3.4 Continuity Fixed infinitesimally small elementnet mass flow out of = time rate of decrease in mass inside

in the x-direction the net mass flow out is:

similarly for y-direction:

and z-direction:

therefore net mass flow through the element:

3.5 continuity moving infinitesimally small element since out small element is moving with the flow (mass inside is fixed) then the rate of change of mass inside the element is zero

Lecture 4: governing equations continued4.1 momentum equationPhysical principle: using an infinitesimally small moving element

body forces act at a distance (gravity, magnetism)surface forces act directly on the surface of the element (pressures, shear)

convention: denotes a stress in j direction normal to I axis.

the net surface for in the x direction is then:

Lecture 5: Governing Equations Continued5.1 Brief vector algebra reviewRecall the vector identity for the divergence of the product of a scalar times a vector:

5.2 The momentum equation continuedFrom last lecture we had:

Also:

Recall our vector identity:

Going back to our x-direction equation from lecture 4, and substituting for the left hand side:

Isaac Newton stated that the sheer stress in a fluid is proportional to the time rate of strain (i.e. velocity gradients). Such fluids are known as Newtonian fluids. Fluids that are not proportional are known as non-Newtonian fluids (blood, shampoo, ink, some salad dressings). Most fluids in our application are Newtonian. For Newtonian fluids we have the Stokes equations (1845)

Where is the molecular viscosity coefficient and is the second viscosity coefficient.

Stokes hypothesis is that:

Lecture 6: governing equations continued6.1: the momentum equationsif we sub in the equations for into our momentum equation from the last lecture, we can obtain the momentum equation in terms of our flow field variables:

in the x direction:

6.2 Energy Equations:we start by stating our physical principle and applying. here we use the infinitesimally small fluid element moving with the flow (if you recall it yields the differential non conservative form)physical principle: energy is conserved, apply this to a fluid element moving with the flow

work in simple terms is a force acting on an object to move it a certain distance.

net work done by pressure in the x-direction:

similarly for sheer stress:

same for normal stress.

considering all forces in the x direction:

Lecture 7: Energy Equation Continuedthe net rate of work done on the moving fluid element is the sum of the contributions in all 3 directions including body forces:

B term is due to:1. volumtric heating such as absorbtion/emmision of radiations2. heat transfer across the element surfaces due to thermal gradints (thermal condictivity)

we define as the rate of volumetric heat addition per unit mass

where is defined as heat transferred by thermalconduction per unit mass per area (heat flux in x)

net heat transfer due to conduciton is then:

sum of all the componants will yeild:

recall fourriers law:

where k is the thermal conductivityrecall we are after the net flux of heat:

lastly, the A term has 2 contributions:1. internal energy due to random molecular motion 2. Newtonian kinematic energy due to translational motion of the fluid element since we are following the fluid element, the time rate of change is the substantial derivative

Lecture 8: towards solving the governing equations of the flow8.1 review of some mathematical conceptsSubstantial derivative (flow of fluid variable )

Divergent vector identity where is a scalar and is a vector

Divergent Theorem from vector calculus (Gauss Theorem) a surface integral can be expressed as a volume integral:

8.2 The physical meaning of the divergence of velocity

Consider a CV moving with the fluid and the CV is always made up of the same fluid particles as it moves with the flow; hence its mass is fixed, invariant with time. However, its volume (V) and control Surface (S) are changing with time as it moves to different regions of the flow where different values of exist. I.e. its volume of fixed mass is constantly increasing or decreasing its volume and changing shape.

Consider an infinitesimal element of the surface, moving at local velocity then:

Over the increment the total change in volum is equal to the summation of all over the control surface; i.e. the surface integral:

If we divide by the result is physically the rate of change of the moving control volume

And using the divergence theorem:

If we imagine that the CV is shrunk to an infinitesimally small volume, with a volume (still moving with the flow) then:

If is small enough such that is essentially the same through ought then:

Therefore, is physically the time rate of change of the volume of the moving fluid per unit volume?8.3 manipulation of the different forms of the governing equations Recall from lecture 3, for continuity: Conservative integral form:

Non-conservative integral form:

Conservative differential form

Non-conservative differential form

Since all four equations were derived to solve the same physical principle, they are therefore equal and can be converted from one to another with some manipulation:

E.g. converting [3.2] to [3.4]

Density is fixed in space so we can move the derivative inside:

Using gauss theorem:

Then we have:

This integral can only be zero if the integrand is zero at every point, therefore:

E.g. converting [3.4] to [3.5]Employ the vector identity:

Subbing into [3.4] we get:

Lecture 9: solving the governing equations and fundamentals of numerical methodsGoverning equations and Figures are posted on CU Learn9.1 Forms of GE particularly suited for CFDExamine the conservation form of each of the GEs. We note that they all have the same generic form given by:

Equation [9.1] can represent the entire system of GEs in conservation form if u, F, G, H, and J are interpreted as column vectors then:

The rest is available on CuLearn

9.2 Overview of Discretization SchemesWe will now discuss hoe the GEs can be solved numerically. The 1st step is to define the appropriate equation (e.g. compressible/incompressible viscid/inviscid steady/transient) once the equations have been selected one has to decide how to discretize the equations.Discretization is the process where the continuous differential equations are approximated by a system of algebraic equations for the variables at some discrete locations in tie and space. There are many approaches, but the most common for CFD applications are Finite difference methods, finite volume method, and finite element method.9.3 finite difference methodFDM is the oldest method. Good for simple geometries where it is easiest to implement. The starting point is the differential conservative form. The solution is governed by a grid with nodes spaced at a finite distance apart. At each point the DE is approximated by replacing the PDs with approximations, which all functions are terms in the neighbouring grid nodes. The result is one algebraic equation per grid point and a certain number of neighbouring grid points appearing as unknowns. Taylor series expansion is commonly used to obtain the approximations of the derivatives. Examples will be done in class.Lecture 9 Continued9.4 Finite Volume MethodsThe starting point for FVM is the integral form of the GE. The domain is divided into a finite number of continuous CVs. the CV can be polyhedral, tetrahedral, or hexahedral. For each CV the variable values are approximated at a computational node at the centroid of the CV (cell centered method) or at the nodes of the CV (node centered FV). Interpolation is then used to express values at the CV surfaces. Advantages of the FV method are that it is suitable to any fluid or grid, so that complicated geometries can be accommodated. A disadvantage is that FV discretization requires higher than second order systems which are harder to develop in 3D. Thus for a given grid it can have reduced accuracy.9.5 Finite Element MethodSimilar to FV method, however the variation of a flow variable within an element is approximated with a polynomial (instead of node-centered and cell-centered methods). This is also good for complex geometries, but the resulting equations are complicated and can take a while to solve.9.6 computational grids in CFDThe three methods discussed all sub-divide the solution domain into discrete locations in space through a form of a computational grid. The computational grid has arguable the largest effect on the accuracy of the CFD simulation and improves the convergence rate. There are several parameters that are used to determine the quality of a grid for CFD. Some of the most important ones:Cell Volume:the volume of the grid cell. The volume should be small enough so that many cells are contained in the region of interest to the flow

Orthogonality of grid lines:how orthogonal the grid lines are to the direction of greatest change in the flow.

Cell aspect ratio:the ration of a cells height to width ratio. Of more concern for triangular faced elements (tetrahedral). A large AR implies highly skewed cells.

Skewedness of Cells:how large the angle is between the cell faces. In highly skewed cells, there will be a small angle, which results in errors when the sine/cosines are taken.

Rate of change of cell volume:change in volume of one cell to another.9.6.1 Structured gridsAre composed of congruent parallelograms (2D) or parallel pipes (3D). Each cell can be addressed by an index (i, j, k) each cell has co-ordinates (dx, dy, dz) representing grid spacing.9.6.2 Unstructured Gridsan unstructured grid is constructed from simple shapes: triangles, tetrahedral (3D), or polyhedral. rather than nodes being identified by a set of indices, unstructured grids use a list of connectivity that specifies the way a given set of indices make up an element. n unstructured grid provides maximum flexibility and complicated geometry can be mapped easily with an unstructured grid, unstructured grids are typically more complicated to solve due to the connectivity matrix that needs to be resolved.

Lecture 10: Properties of numerical Methodswhatever discretization method is chosen it must possess certain properties to ensure the solution is accurate:10.1 consistencythe difference between the exact continuous PDE and the approximate discrete equation is termed the truncation error. the magnitude of error is a function of the grid spacing. for a method to be consistent the error must approach zero as the grid spacing heads to zero10.2 order of accuracyif the discrete approximation for the most important discretized equation is proportional to or , we call the method an nth order approximation10.3 stabilitya discretization scheme is table if it does not magnify small errors in numerical calculations. magnification of errors will cause the solution to diverge.10.4 convergencea numerical method is convergent if the difference in the solution of the discretized equation and the exact solution tends to zero as grid spacing goes to zero. convergence can be tested by refining a mesh.10.5 conservationas the equations that are solved are conservation laws, the numerical solution should ensure that conservation is respected. conservation places a constraint on the solution error. because if mass, momentum, and energy are conserved within the solution domain errors can improperly redistribute the qualities only.10.6 boundednessthe solution to the DE must lie within proper bounds. physically non-negative quantities (pressure, density) must always be positive. the ability of the discretization scheme to respect these bounds is termed boundedness10.7 accuracyThe solutions of the DE are only approximate so an amount of error is associated with any numerical method

Lecture 11: Physical Behavior of PDEThere are 2 main types of behavior: equilibrium problems and marching problems.11.1 Equilibrium ProblemsThese are steady state problems in which the solution to the PDE is desired in a closed domain that is subject to a set of boundary conditions.Key property:Must reach steady state and be that a disturbance somewhere in the solution changes the behavior somewhere else.

11.2 Marching Problemsin marching problems, the solution for the PDE is fixed by a set of initial boundary conditions, and the time dependant solutions is obtained by marching forward in time. In these problems the solution is transient.E.g. moving waves or unsteady equations, disturbances may not be transmitted everywhere in the flow field, but can only influence a particular region, called domain of dependence

11.3 Classification of PDETo identify whether a PDE is an equilibrium equation or marching problem, we need to know how the information is transmitted within the problem space, generally the PDE. We do this by classifying them into different types.

Where a, b, c, d, e, f, and g may be constants or functions of (x, y) i.e. a linear equation.

The behavior of the PDE is largely governed by the second derivative terms, if we re-arrange the equation we get:

The transmission of info occurs along lines called characteristic lines or simple characteristics.

the equations for the characteristic curves are given by:

We can see that plays a major role in the nature and existence of the characteristics. we can distinguish three cases:

2 real characteristics, Hyperbolic - marching1 real characteristic, Parabolic - marchingno real characteristics, elliptic equilibrium

Example 1:Consider the following PDE:

What type of PDE is the above at ?Solution:

At eppilipticD