+ All Categories
Home > Documents > Galletti, Lesson2 CFD Solvers

Galletti, Lesson2 CFD Solvers

Date post: 07-Feb-2016
Category:
Upload: carmelo
View: 23 times
Download: 0 times
Share this document with a friend
Description:
CFD for programs like ansys fluent
14
Lesson 2: Solver Methods Chiara Galletti Corso in Fluidodinamica Computazionale Reattiva ed Eterogenea – Laurea Magistrale Ingegneria Chimica Starting point…mathematically closed problem For example HOW CAN WE SOLVE THIS SYSTEM IN A DOMAIN WITH A COMPUTER? COMPRESSIBLE FLUID
Transcript
Page 1: Galletti, Lesson2 CFD Solvers

Lesson 2: Solver Methods

Chiara Galletti

Corso in Fluidodinamica Computazionale Reattiva ed Eterogenea – Laurea Magistrale Ingegneria Chimica

Starting point…mathematically closed problem

• For example

HOW CAN WE SOLVE THIS SYSTEM IN A DOMAIN WITH A COMPUTER?

COMPRESSIBLE FLUID

Page 2: Galletti, Lesson2 CFD Solvers

Discretization

Flows and related phenomena can be described by partial-differential(or integro-differential) equations which cannot be solved analitically

(except for special cases).

DISCRETIZATION METHOD

– approximates the differential equations by a system of algebraic equations, which can then be solved on a computer.

– the approximations are applied to small domains in space and/or time so the numerical solution provides results at discrete locations in space

and time.

Approximations…

Numerical results are always approximate:

• The differential equations may contain approximations or idealizations

– for many phenomena (e.g. turbulence, combustion, and multiphase flow) the exact equations are either not available or numerical solution is not feasible� introduction of models.

• Approximations are made in the discretization process

– Discretization errors can be reduced by using more accurate interpolation

• In solving the discretized equations, iterative methods are used.

3 TYPES OF APPROXIMATIONS!

PHYSICAL

MODEL

DISCRETIZATION

ITERATION

Page 3: Galletti, Lesson2 CFD Solvers

Components of a numerical solution method

CONVERGENCE

CRITERIA

SOLUTION METHOD

Linearization and iterative techniques.

FINITE APPROXIMATION

Approximationsfor the derivatives at the

grid points for FDApproximating surface andvolume integrals for FV

NUMERICAL GRID

Structured, unstructured, etc

REFERENCE SYSTEM

Cartesian, cylindrical coord.etc.Fixed or moving, etc

DISCRETIZATION

METHOD

Differential eq. � Algebraic eq.

(FD, FE, FV)

MATHEMATICAL

MODEL

Set of partial differential or integro-differential equations and BCs

NUMERICAL SOLVER

Numerical grid

• The grid divides the solution domain into a finite number of subdomains (elements, control volumes etc.).

• Structured (regular) grid – The position of any grid point (or control volume) within the domain is uniquely identified by a set of 2 (in 2D) or 3 (in 3D) indices, e.g. (i, j, k).

– Each point has 4 nearest neighbors in 2D and 6 in 3D– The neighbor connectivity simplifies programming and the matrix of the algebraic equation system has a regular structure

– Structured grids can be used only for geometrically simple domains.– It may be difficult to control the distribution of the grid points.

Page 4: Galletti, Lesson2 CFD Solvers

Numerical grid

BODY-FITTED GRIDStep-wise representation

Numerical grid

• Block-structured grid– which matches at interfaces

– which does not match at interfaces

Page 5: Galletti, Lesson2 CFD Solvers

Numerical grid

• Unstructured grid– the most flexible

– best adapted to the FVM and FEM

– any shape, but in practice triangles/quadrilaterals in 2D, and tetra/hexahedras in 3D.

– disadvantage of the irregularity of the data structure:

• Node locations and neighbor connections need be specified explicitly.

• The matrix of the algebraic equation system has no regular structure�reordering of the points.

• Solvers are usually slower than those for regular grids.

Numerical grid

• Hybrid grid

Page 6: Galletti, Lesson2 CFD Solvers

Numerical grid

Numerical grid

Page 7: Galletti, Lesson2 CFD Solvers

Properties of a numericalsolution method

ConsistencyDiscretization should become exactwith grid spacing�0

StabilityErrors should not be magnified

ConvergenceSolution of discretized equations tends to the exact solution of the differential equations when grid spacing�0

ConservationNumerical scheme should respect conservation laws both locally and globally.

BoundednessProper bounds for numerical solutions

RealizabilityPhysical models should guarantee realistic solutions

AccuracyLowest errors with smallest effort

Properties of a numerical solutionmethod: consistency

• The discretization should become exact as the grid spacing tends to zero.

• Truncation error = difference between discretized and exact equations

Truncation error � 0 for grid spacing ∆xi� 0 and time step ∆t�0

– If main term of truncation error ∝ ∆xin or ∆tn �method is nth-order approximation

– Consistency needs n > 0

– Ideally, all terms should be discretized with approximations of the same order of accuracy; however, some terms (e.g. convective terms in high Re flows or diffusive terms in low Re flows) may be dominant in a particular flow and it may be reasonable to treat them with more accuracy than others.

– For some discretization methods truncation error = f(∆xi/∆t).

• NB: Even if the approximations are consistent, it does not necessarily mean that the solution of the discretized equation system will become the exact solution of the differential equation in the limit of small step size. For this to happen, the solution method has to be stable.

Page 8: Galletti, Lesson2 CFD Solvers

Properties of a numerical solution method: stability

• The numerical solution method should not magnify the errors that appearin the course of numerical solution process.

• For iterative methods, a stable method does not diverge.

• Many solution schemes require that the time step be smaller than a certain limit or that under-relaxation be used.

• Stability of a numerical method may be analysed with von Neumann's method, butfor complicated, non-linear and coupled equations with complicated boundaryconditions, we may have to rely only on experience and intuition.

Properties of a numerical solutionmethod: convergence

• The solution of the discretized equations should tend to the exact solution of the differential equation as the grid spacing tends to zero.

– For linear initial value problems "given a properly posed linear initial value problem and a finite difference approximation to it that satisfies the consistency condition, stability is the necessary and sufficient condition for convergence". Lax equivalence theorem (Richtmyer and Morton, 1967)

– For non-linear problems ,which are strongly influenced by boundary conditions, the stability and convergence of a method are difficult to demonstrate.

• Convergence is usually checked using numerical experiments, i.e. repeating the calculation on a series of successively refined grids.

– If the method is stable and if all approximations used in the discretization process are consistent, we usually find that the solution does converge to a grid-independent solution.

– For sufficiently small grid sizes, the rate of convergence is governed by the order of principal truncation error component. This allows us to estimate the error in the solution.

Page 9: Galletti, Lesson2 CFD Solvers

Properties of a numerical solution method: conservation

• The numerical scheme should - on both a local and a global basis - respect the conservation laws.

• At steady state IN = OUT– If the strong conservation form of equations and a finite volume method are used, this is guaranteed for each individual control volume and for the solution domain as a whole.

– Other discretization methods can be made conservative if care is taken in the choice of approximations.

– The treatment of sources or sink terms should be consistent so that the total source or sink in the domain is equal to the net flux of the conserved quantity through the boundaries.

• The errors due to non conservation are in most cases appreciable only on relatively coarse grids.

• The problem is that it is difficult to know on which grid are these errors small enough� conservative schemes are therefore preferred.

Properties of a numerical solutionmethod: boundedness

• Numerical solutions should lie within proper bounds.

– Physically non-negative quantities (like density, kinetic energy of turbulence) must always be positive

– Other quantities, such as concentration, must lie between 0% and 100%.

– In the absence of sources, some equations (e.g. the heat equation for the temperature when no heat sources are present) require that the minimum and maximum values of the variable be found on the boundaries of the domain.

• Boundedness is difficult to guarantee.

Page 10: Galletti, Lesson2 CFD Solvers

Properties of a numerical solution method: accuracy

• 3 kinds of errors:

– Modeling errors = difference between the actual flow and the exact solution of the mathematical model;

– Discretization errors = difference between the exact solution of the conservation equations and the exact solution of the algebraic system of equations obtained by discretizing these equations;

– Iteration errors (convergence errors) = difference between the iterative and exact solutions of the algebraic equations systems.

Properties of a numerical solution method: accuracy

• Modeling errors derive from– assumptions made in deriving the transport equations – simplification of the geometry of the solution domain– simplification of boundary conditions etc.

• Modelling errors are not known a priori– they can only be evaluated by comparing solutions in which the discretization and convergence errors are negligible with accurate experimental data or with data obtained by more accurate models

– convergence and discretization errors should be controlled and estimated beforethe models of physical phenomena can be judged.

• Discretization errors:

– on a given grid, methods of the same order may produce solution errors whichdiffer by as much as an order of magnitude.

– the order only tells us the rate at which the error decreases as the mesh spacing isreduced - it gives no information about the error on a single grid.

Page 11: Galletti, Lesson2 CFD Solvers

V&V methodology

(see: Oberkampf and Trucano, Prog. Aerosp. Sci. 38 (2002) 209-272, AIAA Guide for the Verification and Validation of Computational Fluid Dynamics Simulations, AIAA—077-1998)

Reality

Physical model

Computerized model

Validation

Model development

Code verification

VERIFICATIONThe process of determining that a model implementation accurately represents the developer’s conceptual description of the model and the solution to the model“Verification deals with mathematics” (Roache)

VALIDATIONThe process of determining the degree to which a model is an accurate representation of the real world from the perspective of the intended use of the model.“Validation deals with physics” (Roache)

Validation: exp./comp. interactions

Page 12: Galletti, Lesson2 CFD Solvers

Validation

Model A and B are inadequate

Model C and D are not so bad …

Model E is validated! Is it ??

I need more information!

-Experimental uncertainty- Computational uncertainty- Numerical error

Comparison of computational results and experimentsa. Graphical comparisons: little quantitative indication of the level of

agreement over the range independent variables (space, time, …)b. Graphical comparisons are subjectivec. Validation quantification should make use of metrics

Discretization methods

• The most common in commercially available CFD programs are:

– Finite Volume method has the broadest applicability (~80%)

– Finite Element (~15%)

• Other approaches (5%)

– Finite difference (oldest)

– Spectral methods

– Boundary element

– Vorticity based methods.

– Lattice gas/lattice Boltzmann.

– …

Page 13: Galletti, Lesson2 CFD Solvers

Discretization methods: Finite Difference Methods (FDM)

• Oldest method (Euler in the 18th century)

• Conservation equation in differential form.

• Solution domain is divided by a grid

• At each grid point, the differential equation is approximated by replacingthe partial derivatives by approximations in terms of the nodal values of the functions– First and second derivatives of the variables with respect to the coordinates are approximated with Taylor series expansion or polynomial fitting

– One algebraic equation per grid node, in which the variable value at that and a certain number of neighbor nodes appear as unknowns.

• ADV: – FDM is very simple and effective on structured grids.

– It is easy to obtain higher-order schemes on regular grids

• DIS:– Conservation is not enforced.

– Restriction to simple geometries

Discretization methods: Finite Volume Methods (FVM)

• Conservation equation in integral form• The solution domain is divided into control volumes (CVs), and the conservation equations are applied to each CV. – The variable values are calculated at the centroid of each CV (computational node)

– Interpolation is used to express variable values at the CV surface in terms of the nodal values.

– Surface and volume integrals are approximated using suitable quadrature formulae.

– One algebraic equation for each CV, in which a number of neighbor nodal values appear.

• ADV: – any type of grid, ok for complex geometries. – conservative by construction

• DIS:– methods of order higher than second are more difficult to develop in 3D. This is due to the fact that the FV approach requires three levels of approximation: interpolation, differentiation, and integration.

Page 14: Galletti, Lesson2 CFD Solvers

Discretization methods: Finite Elements Methods (FEM)

• Solution domain divided into a set of discrete volumes or finite elements• The solution is assumed a priori to have a prescribed form (e.g. linear shapefor the simplest FEM) in a way that guarantees continuity of the solutionacross element boundaries (linear shape between nodal points)

• This approximation is substituted into the weighted integral of the conservation laws (i.e. equations are multiplied by a weight function beforethey are integrated over the entire domain)

• The equations to be solved are derived by requiring the derivative of the integral with respect to each nodal value to be zero; this corresponds to selecting the best solution within the set of allowed functions (the one with minimum residual)�a set of non-linear algebraic equations.

ADV: – ability to deal with arbitrary geometries– easy to analyze mathematically

DIS:– The matrices of the linearized equations are not as well structured as those for regular grids making it more difficult to find efficientsolution methods.


Recommended