1 / 45

CFD: Inside the Black Box

Explore the governing equations of fluid dynamics and the solution methods used in computational fluid dynamics (CFD). Learn about continuity, momentum, energy equations, and more.

philipj
Télécharger la présentation

CFD: Inside the Black Box

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CFD: Inside the Black Box The Governing Equations of Fluid Dynamics and Solution Methodology

  2. CFD: Inside the Black Box Contents • What is CFD? • The Governing Equations • Continuity • Momentum • Energy • Equations of State • CFD Solution Methods: Finite Volume Method • Domain discretization • Discretization of the Governing Equations • Numerical Schemes for Interpolation • Convergence and Residuals

  3. What is CFD? • The simulation of fluid flows (and transport phenomena) • Water flow through a pipe (fluid flow) • Heat exchangers (heat transfer) • Power plant emission dispersion (mass transport) • Chemical reactors (chemical reactions, plasma physics) • Using computers to numerically (algebraically) solve the governing laws of fluid dynamics • Governing laws = Partial Differential Equations (PDEs) representing conservation laws for mass, momentum, and energy

  4. The Governing Equations of Fluid Dynamics • They are the continuity, momentum, and energy equations • They are the mathematical statements of three fundamental physical principles (the conservation laws) • Mass is conserved (Continuity Equation) • Newton’s second law (F = ma) (Momentum Equation) • Energy is conserved (Energy Equation) • Two primary forms of the 3 equations: Lagrangianand Eulerian • Governing Equations can be derived using either form and also can be converted between forms.

  5. Lagrangian vs. Eulerian Description Lagrangian (follow the particle) Eulerian (fixed location) A flow field can be thought of in terms of how flow properties change at a fixed point in space and time (i.e. in a control volume or fluid element) • A flow field can be thought of as being comprised of many “fluid particles”. Mathematical laws can be derived for each fluid particle

  6. Governing Equations Assumptions in CFD • Fluid is a continuum (molecular structure and motion may be ignored) • Fluid properties at a given location in space and time are averages of a large number of molecules • These hold true in both Lagrangian and Eulerian approaches

  7. The Continuity Equation: Foundation • Physical principle: Mass is conserved • Rate of increase of mass in fluid element = net rate of flow of mass into fluid element • Rate of Increase= • Properties at faces = first two terms of Taylor series expansion

  8. The Continuity Equation: Derivation • Summing all terms in the previous slide and dividing by the volume leads to the following equation: • In vector notation: • This is the differential and conservation form of the continuity equation

  9. The Continuity Equation: Physical Meaning • For incompressible fluids: • Thus the equation reduces to Change in Density Net mass flow across boundaries of fluid element (convective derivative)

  10. The Momentum Equation: Foundation • Physical principle: Newton’s Second Law • Force = (mass) x (acceleration): rate of change of momentum = sum of forces • Rate of increase for x, y, z momentum • Two sources of forces: • Body forces- act on the volume of fluid particles (act at a distance) • Include: gravity and electromagnetic • Surface forces- act directly on a surface of the fluid particles • Include (all-inclusive): Pressure and Viscous (shear and normal stress)

  11. The Momentum Equation: Derivation • Surface forces (Pressure and Viscous) in the x direction can be visualized to the right • Body forces can be summed into a source term: (density of fluid particle) x (forces)

  12. The Momentum Equation: Derivation (Cont.) • By summing all the forces and setting equal to the rate of increase, we can derive the x component of The Momentum Equation • Similarly, the y and z component can also be derived:

  13. The Momentum Equation: Derivation (Cont) • The previous equations are The Momentum Equations is differential, non-conservation form (i.e. for a fluid particle) • In order to convert the equation to conservation form (i.e. for a stationary fluid element)

  14. The Momentum Equation: Physical Meaning • The Momentum Equations just derived are commonly referred to as the Navier-Stokes Equations • Side note – today the term Navier-Stokes equations is typically used to refer to all 3 continuity equations, not just the Momentum Equation • In the 17th century, Isaac Newton deduced that shear stress in a fluid is proportional to the time-rate-of strain (i.e. velocity gradients). • Fluids that observe this behavior (ex. Water) are called Newtonian fluids • Fluids which do not observe this behavior (ex. Blood) are Non-Newtonian fluids

  15. The Momentum Equation: Physical Meaning • For Newtonian fluids, Stokes obtained the following equations, relating shear stress to the time-rate-of-strain (i.e. Velocity Gradients) • He also hypothesized about the relationship between molecular viscosity and bulk viscosity

  16. The Momentum Equation: Derivation • By substituting the equations on the previous slide into the Momentum equations, we obtain the complete Navier-Stokes equations in conservation form

  17. The Energy Equation: Foundation • Physical principle: Energy is conserved • (Rate of change of energy in Fluid Particle) = (Net flux of heat into particle) + (rate of work done on fluid particle by body and surface forces) • Energy E = i + ½(u2+v2+w2) • i = internal (thermal) energy • ½(u2+v2+w2) = kinetic energy • Potential energy (gravity) is usually treated separately as a source term

  18. The Energy Equation: Derivation – Body and Surface Forces • Work done by surface stresses (x direction) • Work done by body forces

  19. The Energy Equation: Derivation – Body and Surface Forces • Summing all forces on previous page leads to the following equation:

  20. The Energy Equation: Derivation – Heat Conduction • Energy flux due to heat conduction • Summing all components gives

  21. The Energy Equation: Derivation – Rate of Energy Change • Total energy of a moving fluid per unit mass is • (internal energy per unit mass) + (kinetic energy per unit mass) • Thus the time rate of change of energy for a fluid particle

  22. The Energy Equation: Derivation • By substituting our equations into our physical foundation • (Rate of change of energy in Fluid Particle) = (Net flux of heat into particle) + (rate of work done on fluid particle by body and surface forces) • We obtain the energy equation (Total Energy)

  23. The Energy Equation: Derivation • By converting the equation to conservation form, expressing it in terms of internal energy (subtracting out kinetic energy), and expressing the equation in terms of flow-field variables, we obtain:

  24. The Governing Equations: Summary • Fluid motion is described by 5 partial differential equations representing the 3 fundamental principles (conservation laws) • The Continuity Equation (mass is conserved) • The Momentum Equations (F = ma) • The Energy Equation (energy is conserved)

  25. The Governing Equations: Summary • This coupled system of 5 non-linear partial differential equations is very difficult to solve analytically (to date, there is no general closed-form solution to these equations). • The system contains 6 unknown flow field variables (density, pressure, x-velocity, y-velocity, z-velocity, internal energy) • Remember: sheer and normal stress are functions of the velocity gradients

  26. Equations of State • Additional equations are needed to close the system (6 unknowns, but only 5 equations). • Equations of State: • Now we have 7 equations for 7 variables.

  27. How does CFD use the Governing Equations? Solution Methodology

  28. CFD Solution Methods • Various solution methods for solving the Governing Equations • FDM, FEM, FVM, BEM, Lattice Boltzmann, etc. • Several Commonalities • Domain is discretized into series of grid points/control volumes • Discretize the governing equations (i.e. convert to algebraic form) • More on this later • Solve the equations

  29. Finite Volume Method (FVM) • Most common method in commercial CFD software • Basic Methodology • Divide the flow domain into control volumes • Integrate the differential equation over the control volume and apply the divergence theorem • Assumptions made about how flow property values vary at control volume faces in order to evaluate the derivative terms • Results is a set of linear algebraic equations for each control volume • Solve system of equations for each control volume

  30. Finite Volume Method: The Solution Domain • Solution domain is subdivided into control volumes (cells) by a grid • The grid defined the boundaries of the control volumes, while the computational node is at the center • Flow property values are calculated at the computational node, with values at the faces interpolated from adjacent nodes

  31. Finite Volume Method: Control Volume • The net flux through the control volume boundary is the sum of the integrals over the control volume faces

  32. Finite Volume Method: Discretization Example • We will illustrate how the conservation equations used in CFD can be discretized by examining chemical species transport in the flow field to the right • The species transport equation (given incompressible flow) is: • c is concentration of the chemical species, D is the diffusion coefficient, and S is a source term

  33. Finite Volume Method: Discretization Example (Cont.) • The balance over the control volume (cell p) is given by • However, this equation contains the concentration values at the faces, which need to be interpolated from the cell centers

  34. Finite Volume Method: Discretization Example (Cont.) • To interpolate the values at the cell faces, we will use the first order upwind scheme. This scheme assumes that the value at the face is equal to the value of the cell center directly upstream from it. Thus the equation transforms from: • To:

  35. Finite Volume Method: Discretization Example (Cont.) • Rearranging the equation: • Simplifying: • Here nb refers to neighboring cells. The coefficients and will be different for every cell at every iteration. The species concentration field can be calculated by recalculating cp from this equation iteratively for all cells in the domain.

  36. Finite Volume Method: Interpolation – Finding Face Values • Fluid properties are always calculated/defined at cell centers, thus assumptions need to be made about the interpolation of that value between cell centers, to cell faces • Several numerical schemes can be used: • First-order upwind • Central differencing • Power-law • Second-order upwind • QUICK

  37. Finite Volume Method: First Order Upwind Scheme • Value at the cell face is equal to the value at the cell center upstream of that face

  38. Finite Volume Method: Central Differencing Scheme • Value at the cell face is determined by linear interpolation between the cell centers adjacent to that face

  39. Finite Volume Method: Power-law scheme • The value at the cell face is determined by an exponential profile through the adjacent cell center values

  40. Finite Volume Method: Second-order Upwind Scheme • The value of the cell face is determined by linear extrapolation from the two upstream cell centers

  41. Finite Volume Method: QUICK Scheme • Quadratic Upwind Interpolation for Convective Kinetics • A quadratic curve is fitted through the two upstream and one downstream cell centers

  42. Finite Volume Method: Reaching a Solution • As mentioned, each of the governing equations is converted to algebraic form and solved for each of the cell centers, this is essentially a “best guess” to the true solution, but still far off from it. • With these values, the systems of equations is again solved at each cell to come up with new values, another “best guess” to the true solution and a bit closer. • This iterative process is continued until the change in value from one iteration to the next becomes to small that the solution can be considered converged (i.e. the true solution). • Flow field and scalar fields do not change between iterations when converged!

  43. Finite Volume Method: Residuals • The residuals are one method for judging if the solution is converged • Measure error in conservation equations • GOAL IS TO MINIMIZE RESIDUALS • Absolute residual at cell p is defined as: • Typically this is scaled relative to the local value, and summed across the entire domain to determine:

  44. Finite Volume Method: Ensuring Convergence • While residuals are one of the most common ways to judge convergence, they are not the end all be all. • Typically residuals need to be on the order of 1E-3 to 1E-4 to consider a solution converged. • But a converged solution may have high residuals while a non-converged solution has residual values in the 1E-3 to 1E-4 range. • Other methods to monitor convergence include calculating forces on a object, monitoring temperature/flow plots to ensure they are not changing between iterations

  45. Finite Volume Method: Visualizing the Results

More Related