Vous êtes sur la page 1sur 42

Numerical Methods in Aerodynamics

Lecture 1: Basic Concepts of Fluid Flows

Plan for this course

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Today's Lecture
Introduction to aerodynamics Navier-Stokes equations Introduction to Fortran90 Finite Volume method for solving differential equations
Example: diffusion problem Example: convection-diffusion problem

Exercise: Start solving the Navier Stokes equations


Lid driven cavity flow, Fortran program

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Literature

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Why are we interested in knowing about aerodynamics?

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Windturbine Aerodynamics

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Navier-Stokes equations
Describe the fluid properties: velocity components, pressure, density, Internal energy and temperature. Can only be solved analytical for very simple problems In differential form the governing equations of the flow of a compressible Newtonian fluid are: Mass equilibrium

Momentum equations

Energy equation Unknowns: , ui, p, I, T (7 unknowns, 5 equations). Equations of state: p =p(, T) , I =I(, T)

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Incompressible, stationary flow


Density is constant Mass equilibrium

Momentum equations

Unknowns: ui, p (4 unknowns, 4 equations).

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Mass Conservation
[rate of change in time of the density] + [net flow of mass out of element]=0

convective term

Incompressible flow, density is constant

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Momentum conservation
[rate of increase of momentum of fluid particle] = [sum of forces on fluid particle]

convective term diffusion term (viscous) transient term pressure term

source term

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

General transport equation

Rate of increase of in fluid element

Rate of flow of out of fluid element

Rate of increase of due to diffusion

+ Rate of increase of due to sources

Mass conservation

Momentum conservation

10

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Integral form of the general transport equation


Looking at a control volume (CV), stationary flow

Gauss' theorem

convective term

diffusion term

11

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

BREAK
Next:
Fortran90 programming

12

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Fortran90
"Hello World"-program
Compile, link, run Write to the screen in different ways Read input from the screen to a variable

Loops
do, do while, if-then

Write to a file, read from a file


open a file formated read and write

Project
main program functions subroutines

Exercise: solve a system of linear equations, write to a file, load and plot in Matlab

13

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

"Hello World"-program (hello_world.f90)

14

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Loops

15

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Read from text file and write to text file (write_file.f90)


Matlab code for loading a textfile
plotting.m

16

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Program, subroutine, function (program_structure.f90)

17

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Exercise:
Problem

solve the system of linear equations using an iterative method

write solution to a file load and plot solution in Matlab

18

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Exercise: Hint
You will need the following variables
integer n,I real*8 Ta(5),Tb(5) ! Ta are the Tn values Tb are the Tn+1 values

Initial guess for Ta


Ta = (/0,0,0,0,0/)

19

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

BREAK
Next: Finite-Volume method for solving differential equations
Example: diffusion problem Example: convection-diffusion problem

20

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Steady state, diffusion problems

Grid generation Discretisation of equations Solution of the discretised equations

21

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Grid generation, 1D

22

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Discretisation
1D governing equation

Integral over CV and using Gauss' theorem

Out-going normal n

Solution to integral

23

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Discretisation
The diffusive flux of entering the left-hand side (west) minus the diffusive flux leaving the right-hand side (east) is equal to the generation of

Central difference scheme for evaluating gradients

Inserting and rearranging

24

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Discretisation of boundary nodes (boundary A)

Boundary A

Boundary B

25

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Summary for the diffusion problem


Define and A for all cell faces Define the grid xWP, xPE, xwP, xPe for all control volumes Internal nodes

Boundary node A

Boundary node B

26

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Solution of equations
The equations for each internal nodal point are set up The equations for the boundary points are set up to incorporate the boundary conditions The system of linear equations can be put in matrix format

Various techniques may be used to solve the matrix equation


Direct Methods:
Matrix inversion Gaussian elimination Thomas algorithm or the tri-diagonal matrix algorithm (TDMA)

Indirect methods (iterative):


Jacobi iteration (the one you used in the fortran exercise) Gauss-Seidel iteration

27

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Exercise: conductive heat transfer

28

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Grid

Set up the system of linear algebraic equations, use five CV's i.e. x=0.004 m

29

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Convection-diffusion problems

The diffusion process affects the distribution of a transported quantity along its gradients in all directions, whereas convection spreads influence only in the flow direction Peclet number is a measure of the relative strengths of convection and diffusion

30

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Discretisation
Right-hand side (diffusive term) identical with previous example

Left-hand (convective term) gives

Continuity equation gives

31

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Differencing schemes
central differencing scheme (CVS) introduces influence at node P from the directions of all its neighbours. Good for diffusion problems (Pe is small). Bad for convection problems (Pe is large) CVS is used for the diffusion term

The upwind differencing scheme (UDS) is used for the convective terms

32

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Differencing schemes internal points

33

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Differencing schemes boundary points


Boundary node A

Boundary node B

34

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Example: 1D transport of by convection and diffusion


Velocity is assumed known No source term Area is constant Density is constant Diffusion coefficient is constant Grid Peclet number Boundary u=0.1 m/s S=0 Ae=Aw=A =1 =0.1 L=1 m, x=0.2 m Pe = 0.2 A=1, B=0

35

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Solution

Analytical solution

36

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Example: 1D transport of by convection and diffusion


Velocity is assumed known No source term Area is constant Density is constant Diffusion coefficient is constant Grid Peclet number Boundary u=2.5 m/s S=0 Ae=Aw=A =1 =0.1 L=1 m, x=0.2 m Pe = 5 A=1, B=0

37

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Solution

Analytical solution

38

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Problems with UDS


Only first order accurate, where CDS is second order accurate Introduces numerical diffusion. The leading truncation error term resembles a diffusive flux

39

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Exercise: Setting up and running the flow solving program


Three parts exists
Grid generation (post processing) Solution of the problem (solver) Plotting (pre processing)

Include these in one project Run the grid program Run the solver Run the plotting program

40

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

What did we learn?


Navier-Stokes equations

Introduction to Fortran90 Finite volume method for diffusive 1D problems


central differencing scheme (CDS)

Finite volume method for convective-diffusive 1D problems


central differencing scheme (CDS), upwind differencing scheme (UDS)

Next time:
2D problems (staggered grids) How to include pressure (SIMPLE-algorithm)

41

Numerical Methods in Aerodynamics


Lecture 1: Basic Concepts of Fluid Flows

Thank you for your attention

42

Vous aimerez peut-être aussi