Introduction to Computational Fluid Dynamics
Fluid Mechanics and Heat Transfer. Basic equations. Continuity (Mass Conservation) divv 0 div v 0 t incompressible
Momentum Equation (Navier-Stokes equations) Incompressible viscous fluid ( constant, constant ) v v v F grad p v t
Lecture 2 –Basic equations. Dimensionless parameters 1 Introduction to Computational Fluid Dynamics
Energy equation dE d 1 p divk grad T dt dt where E is the internal energy of a fluid particle (viscous compressible fluid)
- gas heating due to the compression d 1 p p divv dt continuity equation - mechanical work of the viscous forces transformation in heat
Lecture 2 –Basic equations. Dimensionless parameters 2 Introduction to Computational Fluid Dynamics
p By taking into account that the enthalpy of a unit of mass is i E we obtain di dp divk grad T dt dt But for a perfect gas we have
di c pdT and energy equation becomes d dp c pT divk grad T dt dt where df Df f v f dt Dt t is the substantial derivative.
Lecture 2 –Basic equations. Dimensionless parameters 3 Introduction to Computational Fluid Dynamics
Momentum Equation (for fluid saturated porous media) By a porous medium we mean a material consisting of a solid matrix with an interconnected void.
Porous media are present almost always in the surrounding medium, very few materials excepting fluids being non-porous.
heat exchanger processor cooler porous rock
Lecture 2 –Basic equations. Dimensionless parameters 4 Introduction to Computational Fluid Dynamics
Darcy’s (law) equation (momentum equation) K v grad p g where
v is the average velocity (filtration velocity, superficial velocity, seepage velocity or Darcian velocity)
K k g is the permeability of the porous medium
Darcy’ law expresses a linear dependence between the pressure gradient and the filtration velocity. It was reported that this linear law is not valid for large values of the pressure gradient.
Lecture 2 –Basic equations. Dimensionless parameters 5 Introduction to Computational Fluid Dynamics
Darcy’s law extensions Forchheimer’s extension
c p v F v v K K where cF is a dimensionless parameter depending on the porous medium
Brinkman’s extension p v ~ v K where ~ is an effective viscosity
Brinkman-Forchheimer’s extension c p v F v v ~ v K K
Lecture 2 –Basic equations. Dimensionless parameters 6 Introduction to Computational Fluid Dynamics
Energy equation for porous media T c c v T k T p m p fluid e t where
c c 1 c p m p fluid p solid
ke k fluid 1ksolid
Lecture 2 –Basic equations. Dimensionless parameters 7 Introduction to Computational Fluid Dynamics
Bouyancy driven flow1
There exists a large class of fluid flows in which the motion is caused by buoyancy in the fluid. Buoyancy is the force experienced in a fluid due to a variation of density in the presence of a gravitational field. According to the definition of an incompressible fluid, variations in the density normally mean that the fluid is compressible, rather than incompressible. For many of the fluid flows of the type mentioned above, the density variation is important only in the body-force term of the momentum equations. In all other places in which the density appears in the governing equations, the variation of density leads to an insignificant effect. Buoyancy results in a force acting on the fluid, and the fluid would accelerate continuously if it were not for the existence of the viscous forces. The situation depicted above occurs in natural convection.
1 I.G. Currie, Fundamental Mechanics of Fluids, 3rd ed., Marcel Dekker, New York, 2003
Lecture 2 –Basic equations. Dimensionless parameters 8 Introduction to Computational Fluid Dynamics
Generally, density is a function of temperature and concentration
T,c
Black Sea salinity, temperature and density (Ecological Modelling, 221, 2010, p. 2287-2301)
Lecture 2 –Basic equations. Dimensionless parameters 9 Introduction to Computational Fluid Dynamics
Boussinesq’s approximation
, Momentum
Lecture 2 –Basic equations. Dimensionless parameters 10 Introduction to Computational Fluid Dynamics
Dimensionless equations u v w 0 x y z
u u u u p 2u 2u 2u u v w F x 2 2 2 t x y z x x y z
v v v v p 2v 2v 2v u v w F y 2 2 2 t x y z y x y z
w w w w p 2w 2w 2w u v w F z 2 2 2 t x y z z x y z
T T T T 2T 2T 2T c u v w k q( 0) p 2 2 2 t x y z x y z
2 2 2 2 2 2 u v w v u w v u w 2 2 2 x x x x y y z z x
Lecture 2 –Basic equations. Dimensionless parameters 11 Introduction to Computational Fluid Dynamics
We introduce further the dimensionless variables t x y z u v w F p T T , X , Y , Z , U , V , W , F ' , P , 0 t0 L L L U0 U0 U0 g p0 T into the governing equations
u U0 U u X U0 U UU0 , UU0 , t t t0 x X x L X p X p P P p 0 , x X 0 x L X
2u u U U U 2U X U 2U 0 0 0 x2 x x x L X L X 2 x L2 X 2 T T T X T T T0 , T T0 t t t0 x X x L X
2T T T T 2 X T 2U x2 x x x L X L X 2 x L2 X 2
Lecture 2 –Basic equations. Dimensionless parameters 12 Introduction to Computational Fluid Dynamics and we obtain the dimensionless equations
U V W 0 X Y Z
L U U V W gL p P 2U 2U 2U U V W F ' 0 2 x 2 2 2 2 t0U0 X Y Z U0 U0 X U0L X Y Z
k 2 2 2 L Q c p U U V W 0 2 2 2 t0U0 X Y Z U0L X Z Z c p LT
Lecture 2 –Basic equations. Dimensionless parameters 13 Introduction to Computational Fluid Dynamics
Dimensionless numbers A. Strouhal number The Strouhal number (St) is a dimensionless number describing oscillating flow mechanisms: L L oscillation St t0U0 U0 average velocity
B. Froude number The Froude number (Fr) is a dimensionless number defined as the ratio of the flow inertia to the external field (the latter in many applications simply due to gravity). In naval architecture the Froude number is a very significant figure used to determine the resistance of a partially submerged object moving through water, and permits the comparison of similar objects of different sizes, because the wave pattern generated is similar at the same Froude number only. U Fr 0 gL
Lecture 2 –Basic equations. Dimensionless parameters 14 Introduction to Computational Fluid Dynamics
C. Euler number It expresses the relationship between a local pressure drop e.g. over a restriction and the kinetic energy per volume, and is used to characterize losses in the flow, where a perfect frictionless flow corresponds to an Euler number of 1. p 0 Eu 2 U0 2 Usually, we take p0 U0 and we obtain Eu = 1.
D. Reynolds number U L U L Re 0 0 The Reynolds number is defined as the ratio of inertial forces to viscous forces and consequently quantifies the relative importance of these two types of forces for given flow conditions. laminar flow occurs at low Reynolds numbers, where viscous forces are dominant, and is characterized by smooth, constant fluid motion; turbulent flow occurs at high Reynolds numbers and is dominated by inertial forces, which tend to produce chaotic eddies, vortices and other flow instabilities.
Lecture 2 –Basic equations. Dimensionless parameters 15 Introduction to Computational Fluid Dynamics
c / Pr p k k / c p It is the ratio of momentum diffusivity to thermal diffusivity. The Prandtl number contains no such length scale in its definition and is dependent only on the fluid and the fluid state. As such, the Prandtl number is often found in property tables alongside other properties such as viscosity and thermal conductivity. •gases - Pr ranges 0.7 - 1.0 •water - Pr ranges 1 - 10 •liquid metals - Pr ranges 0.001 - 0.03 •oils - Pr ranges 50 - 2000
E. Eckert number It expresses the relationship between a flow's kinetic energy and the boundary layer enthalpy difference, and is used to characterize heat dissipation.
U 2 Εc 0 c p T
Lecture 2 –Basic equations. Dimensionless parameters 16 Introduction to Computational Fluid Dynamics
Using the above dimensionless numbers we obtain: U V W 0 X Y Z U U V W 1 P 1 2U 2U 2U St U V W F ' Eu x 2 2 2 X Y Z Fr X Re X Y Z …. Q 1 2 2 2 Ec St U V W 2 2 2 X Y Z Re Pr X Z Z Re or using differential operators V 0 (23) V 1 1 St V V F'Eu P V (24) Fr Re 1 Ec St V (25) Re Pr Re
Lecture 2 –Basic equations. Dimensionless parameters 17 Introduction to Computational Fluid Dynamics
Comments Dimensionless numbers allow for comparisons between very different systems and tell you how the system will behave Many useful relationships exist between dimensionless numbers that tell you how specific things influence the system When you need to solve a problem numerically, dimensionless groups help you to scale your problem. Analytical studies can be performed for limiting values of the dimensionless parameters
Express the governing equations in dimensionless form to: (1) identify the governing parameters (2) plan experiments (3) guide in the presentation of experimental results and theoretical solutions
If the flow is not oscillatory, we take usually t0 L U0 and thus St =1. If t0 we have St = 0 and the flow is steady.
Lecture 2 –Basic equations. Dimensionless parameters 18 Introduction to Computational Fluid Dynamics
Numerical methods for initial values problems (IVP or Cauchy problem) Pendulum Mathematical model:
d 2 g d L sin 0, (t0 ) 0 , (t0 ) '0 dt2 L dt
Radioactive elements decay:
dm m, m(t ) m dt 0 0 where m is the mass of the radioactive element and is the decay constant.
Lecture 2 –Basic equations. Dimensionless parameters 19 Introduction to Computational Fluid Dynamics
Theoretical aspects
The general Cauchy problem: y'(t) f (t, y), a t b y(a) ya Using numerical methods we obtain a discrete approximation of y in some points, called nodes, which form a grid (mesh).
A grid for the interval [a,b] having a constant step h is: a,a h,a 2h,...,a ih,...,a (N 1)h,b or
ti a (i 1)h, i 1,..., N where N is the number of subintervals, and the step is constant: h (b a)/(N 1).
Lecture 2 –Basic equations. Dimensionless parameters 20 Introduction to Computational Fluid Dynamics
By using a numerical method we obtain the approximated discrete values not y(ti ) yi , i 1,..., N
y(t)
yi+2 yi+1
yi-1 yi
yi-2 t i+1 i-2 i-1 i i+2
Lecture 2 –Basic equations. Dimensionless parameters 21 Introduction to Computational Fluid Dynamics
One step methods An example: The Euler method (Leonhard Euler-(1707 – 1783))
y'(t) f (t, y), a t b y(a) ya By using a Taylor expansion (y should be of class C 2) we have: h2 y(t ) y(t h) y(t ) h y'(t ) y"( ), (t ,t ) i1 i i i 2 i i i i1 Thus, one get: h2 y(t ) y(t ) h f (t , y(t )) y"( ) i1 i i i 2 i By dropping the last term the Euler formula is obtained: y y 0 a yi1 yi h f (ti , yi ), i 0,1,..., N 1
Remark: yi 1 depends on yi , ti and h.
Lecture 2 –Basic equations. Dimensionless parameters 22 Introduction to Computational Fluid Dynamics
(Richard L. Burden and J. Douglas Faires , Numerical Analysis,Ninth Edition, 2011).
Lecture 2 –Basic equations. Dimensionless parameters 23 Introduction to Computational Fluid Dynamics
One may notice that the Euler method follow the tangent for the current node to approximate the value in the next node.
Lecture 2 –Basic equations. Dimensionless parameters 24 Introduction to Computational Fluid Dynamics
Same problem for h = 0.2 (11 nodes). Comparison with the
Lecture 2 –Basic equations. Dimensionless parameters 25 Introduction to Computational Fluid Dynamics
An one step method for the Cauchy problem is given by y y h(t , y ,h), [t, y][a,b] Rn , h 0 i1 i i i :[a,b] Rn1 Rn ~ Considering the exact solution (in the grid points) y(ti ) we define the local truncation error as follow: y y ~y(t ) ~y(t ) ~y(t ) ~y(t ) T (t , y ,h) i1 i i1 i (t , y ,h) i1 i i i h h i i h (the difference between the approximation increment and the exact increment for one step) A method is consistent if T(t, y,h) 0 uniformly when h 0 for (t, y)[a,b] Rn .
(it is necessary that (t, y,0) f (t, y))
Lecture 2 –Basic equations. Dimensionless parameters 26 Introduction to Computational Fluid Dynamics
A method is of order p if T (t, y,h) Kh p
uniformly on [a,b] Rn , where is a vector norm, and K is constant. We may use the following notation: T (t, y,h) O(h p ), h 0
(for p 1 the method is consistent). It can be shown that Euler method is a method of order one, O(h).
Lecture 2 –Basic equations. Dimensionless parameters 27 Introduction to Computational Fluid Dynamics
Improved Euler methods
evaluation of the tangent is made in an intermediary point of the interval ti ,ti1
y(t)
slope = f(ti+1, yi+hf(ti, yi)) yexact ymodified yEuler y average slope i ti ti+1/2 ti+1 t slope = f(ti, yi)
Modified Euler
ti ti+1 Heun
Lecture 2 –Basic equations. Dimensionless parameters 28 Introduction to Computational Fluid Dynamics
not 1 -evaluation in the middle of t ,t , t t h i i1 i1/ 2 i 2 1 1 y(t ) y(t ) h f t , y y(t ) h f t h, y hf (t , y ) i1 i i1/ 2 i1/ 2 i i 2 i 2 i i Euler 1 1 y(ti1) y(ti ) h f ti h, yi h f (ti , yi ) 2 2 K (t ,y ) 1 i i K2 (ti ,yi ,h) K (t , y ) f (t , y ) K (t , y ) f (t , y ) 1 i i i i 1 i i i i 1 1 K 2 (ti , yi ,h) f ti h, yi hK1 K ( t , y ,h) f t h, y hK 2 i i i 2 i 2 1 1 yi1 yi hK1 K 2 yi 1 yi hK2 2
modified Euler method Heun’s method (trapezoidal rule)
Lecture 2 –Basic equations. Dimensionless parameters 29 Introduction to Computational Fluid Dynamics
Runge-Kutta type methods
evaluation in intermediary points of ti ,ti1
Standard Runge-Kutta method h y y K 2K 2K K i1 i 6 1 2 3 4
K1 f (ti , yi ) 1 1 K 2 f ti h, yi hK1 2 2
1 1 K 3 f ti h, yi hK 2 2 2 K 4 f ti h, yi hK3 Carl David Tolmé Runge Martin Wilhelm Kutta (1856 – 1927) (1867 – 1944)
Lecture 2 –Basic equations. Dimensionless parameters 30 Introduction to Computational Fluid Dynamics
Matlab solvers for Cauchy problems (ODE) Syntax
[t,Y] = solver(odefun,tspan,y0,options, p1, p2, ...) or sol = solver(odefun,[t0 tf],y0...) where solver can be ode45, ode23, ode113, ode15s, ode23s, ode23t or ode23tb.
Input parameters (selection) odefun – right hand member of the Cauchy problem tspan –integration interval. y0– initial value options – solver options.
Lecture 2 –Basic equations. Dimensionless parameters 31 Introduction to Computational Fluid Dynamics
Output parameters: t – column vector of time points; y – solution array sol – solution structure
Lecture 2 –Basic equations. Dimensionless parameters 32 Introduction to Computational Fluid Dynamics
Lecture 2 –Basic equations. Dimensionless parameters 33 Introduction to Computational Fluid Dynamics
Example: Solve pendulum equation using ode45:
d 2 g d sin 0, (0) 0, (0) 0.1 dt2 L dt
We note y1 and rewrite the system in the form dy 1 y ; dt 2 dy g 2 sin y dt L 1 dy y 0 0; 1 0 0.1 1 dt
function dy=fPendul(t,y,flag,g,L) dy=[y(2);-g/L*sin(y(1))];
Lecture 2 –Basic equations. Dimensionless parameters 34 Introduction to Computational Fluid Dynamics
%pendulum equation a=0;b=pi/2;%integration interval g=9.8;%accelaration due to the gravity L=0.1;%length of the pendulum y0=[0,0.1];%initial conditions options=odeset('RelTol',1e-8);%modify the options %use the solver [t,y]=ode45('fPendul',[a,b],y0,options,g,L) plot(t,y(:,1));
Lecture 2 –Basic equations. Dimensionless parameters 35