ME - 733 Computational Fluid Mechanics Lecture 2

2y ago
22 Views
2 Downloads
3.64 MB
128 Pages
Last View : 15d ago
Last Download : 3m ago
Upload by : Luis Wallis
Transcription

ME - 733Computational Fluid MechanicsLecture 2Dr./ Ahmed Nagib ElmekawyOct 21, 2018

Leonhard Euler (1707-1783) In 1768, Leonhard Euler introduced the finitedifference technique based on Taylor seriesexpansion.2

Lewis Fry Richardson (1881-1953) In 1922, Lewis Fry Richardson developed the first numericalweather prediction system. Division of space into grid cells and the finitedifference approximations of Bjerknes's"primitive differential equations.” His own attempt to calculate weather for a singleeight-hour period took six weeks and ended infailure. His model's enormous calculation requirements led Richardsonto propose a solution he called the “forecast-factory.” The "factory" would have filled a vast stadiumwith 64,000 people. Each one, armed with a mechanical calculator,would perform part of the calculation. A leader in the center, using colored signal lightsand telegraph communication, would coordinatethe forecast.3

1930s to 1950s Earliest numerical solution: for flow past a cylinder (1933). A.Thom, ‘The Flow Past Circular Cylinders at Low Speeds’, Proc. Royal Society, A141, pp.651-666, London, 1933 Kawaguti obtained a solution for flow around a cylinder, in 1953 byusing a mechanical desk calculator, working 20 hours per week for 18months, citing: “a considerable amount of labour and endurance.” M. Kawaguti, ‘Numerical Solution of the NS Equations for the Flow Around a CircularCylinder at Reynolds Number 40’, Journal of Phy. Soc. Japan, vol. 8, pp. 747-757, 1953.4

1960s and 1970s During the 1960s the theoretical division at Los Alamos contributed many numericalmethods that are still in use today, such as the following methods: Particle-In-Cell (PIC). Marker-and-Cell (MAC). Vorticity-Streamfunction Methods. Arbitrary Lagrangian-Eulerian (ALE). k- turbulence model. During the 1970s a group working under D. Brian Spalding, at Imperial College, London,develop: Parabolic flow codes (GENMIX). Vorticity-Streamfunction based codes. The SIMPLE algorithm and the TEACH code. The form of the k- equations that are used today. Upwind differencing. ‘Eddy break-up’ and ‘presumed pdf’ combustion models. In 1980 Suhas V. Patankar publishes Numerical Heat Transfer and Fluid Flow, probablythe most influential book on CFD to date.5

1980s and 1990s Previously, CFD was performed using academic, researchand in-house codes. When one wanted to perform a CFDcalculation, one had to write a program. This is the period during which most commercial CFDcodes originated that are available today: Fluent (UK and US).CFX (UK and Canada).Fidap (US).Polyflow (Belgium).Phoenix (UK).Star CD (UK).Flow 3d (US).ESI/CFDRC (US).SCRYU (Japan).and more, see www.cfdreview.com.6

Navier-Stokes Equation Derivation Refer to Ch. 3 and Appendix A of Jiyuan Tu, Computational Fluid Dynamics -A Practical Approach, Second Edition,2013. Ch. 2 Wendt, Anderson, Computational Fluid Dynamics - An Introduction, 3rd edition 2009.7

LAGRANGIAN AND EULERIAN DESCRIPTIONSKinematics: The study of motion.Fluid kinematics: The study of how fluids flow and how to describe fluidmotion.There are two distinct wa ys to describe motion: Lagrangian a n d EulerianLagrangian description: To follow the path of individual objects.This method requires us to track the position and velocity of each individualfluid parcel (fluid particle) and take to be a parcel of fixedidentity.With a small number of objects, sucha s billiard balls on a pool table,individual objects can be tracked.In the Lagrangian description, onemust keep track of the position andvelocity of individual particles.84

A more common method is Eulerian description of fluid motion.In the Eulerian description of fluid flow, a finite volume called a flow domainor control volume is defined, through which fluid flows in and out.Instead of tracking individual fluid particles, we define field variables,functions of space and time, within the control volume.The field variable at a particular location at a particular time is the value ofthe variable for whichever fluid particle happens to occupy that location atthat time.For example, the p r e s s u r e field is a scalar field variable. We define thevelocity field a s a vector field variable.Collectively, these (and other) field variables define the flow field. Thevelocity field can be expanded in Cartesian coordinates a s99

In the Eulerian description wedon’t really care what happens toindividual fluid particles; rather weare concerned with the pressure,velocity, acceleration, etc., ofwhichever fluid particle happensto be at the location of interest atthe time of interest.In the Eulerian description, onedefines field variables, such asthe pressure field and thevelocity field, at any locationand instant in time. While there are many occasions inwhich the Lagrangian descriptionis useful, the Eulerian descriptionis often more convenient for fluidmechanics applications. Experimental measurements aregenerally more suited to theEulerian description.1010

CONSERVATION OF MASS—THE CONTINUITYEQUATIONThe net rate of change of mass within thecontrol volume is equal to the rate atwhich mass flows into the control volumeminus the rate at which mass flows out ofthe control volume.To derive a differentialconservation equation, weimagine shrinking a controlvolume to infinitesimal size.1111

12

13

Conservation of Mass: Alternative forms Use product rule on divergence term V u i v j w k i j k x y z

Conservation of Mass: Cylindrical coordinates There are many problems which are simpler to solve if theequations are written in cylindrical-polar coordinates Easiest way to convert from Cartesian is to use vectorform and definition of divergence operator in cylindricalcoordinates

Conservation of Mass: Cylindrical coordinates

Conservation of Mass: Special Cases Steady compressible flowCartesianCylindrical ( u ) ( v) ( w) 0 x y z

Conservation of Mass: Special Cases Incompressible flow constant, and henceCartesianCylindrical u v w 0 x y z V u i v j w k i j k x y z

Conservation of Mass In general, continuity equation cannot be used byitself to solve for flow field, however it can be usedto1. Determine if a velocity field represents a flow.2.Find missing velocity componentExampleFor an incompressible flowu x2 y2 z 2v xy yz zw ?Determine : w , required to satisfy the continuity equation.z2Solution : w 3 xz c( x, y )2

Conservation of MomentumTypes of forces:1. Surface forces: include all forces acting on theboundaries of a medium though direct contact suchas pressure, friction, etc.2. Body forces are developed without physical contactand distributed over the volume of the fluid such asgravitational and electromagnetic. The force F acting on A may be resolved into twocomponents, one normal and the other tangential tothe area.

24If the differential fluidelement is a materialelement, it moves with theflow and Newton’s secondlaw applies directly.

Body Fo rc e sPositive components of the stresstensor in Cartesian coordinates on thepositive (right, top, and front) faces ofan infinitesimal rectangular controlvolume. The blue dots indicate thecenter of each face. Positivecomponents on the negative (left,bottom, and back) faces are in theopposite direction of those shown here.25

Stresses (forces per unit area)Surface ofconstant -xDouble subscript notation for stresses. First subscript refers to the surface Second subscript refers to the direction Use for normal stresses and for tangential stressesSurface ofconstant x

27

28

29

30

31

32

33

Complete Navier–Stokes equations34

35Newtonian ve rs u s Non-Newtonian FluidsRheology: The study of thedeformation of flowing fluids.Newtonian fluids: Fluids for which theshear stress is linearly proportional to theshear strain rate.Non-Newtonian fluids: Fluids for which theshear stress is not linearly related to theshear strain rate.Viscoelastic: A fluid that returns (eitherfully or partially) to its original shape afterthe applied stress is released.Rheological behavior of fluids—shearstress a s a function of shear strain rate.In some fluids a finite stress called theyield s t r e s s is required before thefluid begins to flow at all; such fluidsare called Bingham plastic fluids.Some non-Newtonian fluids are calleds h e a r thinning fluids orp s eu d o pl as tic fluids, because themore the fluid is sheared, the lessviscous it becomes.Plastic fluids are those in which theshear thinning effect is extreme.

36

37Derivation of the Navier–Stokes Equation forIncompressible, Isothermal FlowThe incompressible flowapproximation implies constantdensity, and the isothermalapproximation implies constantviscosity.

38

Navier-Stokes Equations u u u u p u 2 ( u v w ) g x [ (2 .V )] t x y z x x x 3 v u w u [ ( )] [ ( )](a) y x y z x zxmomentum v v v v p v u ( u v w ) g y [ ( )] t x y z y x x y v 2 v w [ (2 .V )] [ ( )](b) y y 3 z z yymomentum w w w w p w u ( u v w ) g z [ ( )] t x y z z x x z v w w 2 [ ( )] [ (2 .V )](c ) y z y z z 3zmomentum

Navier-Stokes Equations For incompressible fluids, constant µ: Continuity equation: .V 0 u 2 v u w u[ (2 .V )] [ ( )] [ ( )] x x 3 y x y z x z u v u w u { [(2 )] [( )] [( )]} x x y x y z x z 2u 2u 2u 2u 2 v 2 w ( 2 2 2 ) ( 2 ) x y z x x y x z 2u 2u 2u u v w ( 2 2 2 ) ( ) x y z x x y z 2u 2u 2u ( 2 2 2 ) 2u x y z

Navier-Stokes Equations For incompressible flow with constant dynamic viscosity: x- momentumDu p 2u 2u 2u g x ( 2 2 2 )Dt x x y z(a) Y- momentumDv p 2v 2v 2v g y ( 2 2 2 )Dt y x y z(b) z-momentumDw p 2w 2w 2w g z ( 2 2 2 )Dt z x y z(c ) In vector form, the three equations are given by: DV2 g p VDtIncompressible NSEwritten in vector form

Navier-Stokes Equations u u u u p u 2 ( u v w ) g x [ (2 .V )] t x y z x x x 3 v u w u [ ( )] [ ( )](a) y x y z x z v v v v p v u ( u v w ) g y [ ( )] t x y z y x x y v 2 v w [ (2 .V )] [ ( )](b) y y 3 z z y w w w w p w u ( u v w ) g z [ ( )] t x y z z x x z v w w 2 [ ( )] [ (2 .V )](c ) y z y z z 3x-momentumy-momentumz-momentum

Navier-Stokes Equations For incompressible fluids, constant µ: Continuity equation: .V 0 u 2 v u w u[ (2 .V )] [ ( )] [ ( )] x x 3 y x y z x z u v u w u { [(2 )] [( )] [( )]} x x y x y z x z 2u 2u 2u 2u 2 v 2 w ( 2 2 2 ) ( 2 ) x y z x x y x z 2u 2u 2u u v w ( 2 2 2 ) ( ) x y z x x y z 2u 2u 2u ( 2 2 2 ) 2u x y z

Navier-Stokes Equations For incompressible flow with constant dynamic viscosity: x- momentumDu p 2u 2u 2u g x ( 2 2 2 )Dt x x y z(a) Y- momentumDv p 2v 2v 2v g y ( 2 2 2 )Dt y x y z(b)222Dw p w w w z-momentum g z ( 2 2 2 )Dt z x y z In vector form, the three equations are given by: DV2 g p VDt(c )Incompressible NSEwritten in vector form

Navier-Stokes Equation The Navier-Stokes equations for incompressible flow invector form:Incompressible NSEwritten in vector form This results in a closed system of equations! 4 equations (continuity and 3 momentum equations) 4 unknowns (u, v, w, p) In addition to vector form, incompressible N-S equation canbe written in several other forms including: Cartesian coordinates Cylindrical coordinates Tensor notation

Euler Equations For inviscid flow (µ 0) the momentum equations are given by: x- momentum u u u u p ( u v w ) g x t x y z x(a) Y- momentum v v v v p ( u v w ) g y t x y z y(b) z-momentum w w w w p ( u v w ) g z t x y z z(c ) In vector form, the three equations are given by: DV g pEuler equationsDtwritten in vector form

Differential Analysis of Fluid Flow Problems Now that we have a set of governing partial differential equations,there are 2 problems we can solve Calculate pressure (P) for a known velocity field Calculate velocity (U, V, W) and pressure (P) for known geometry, boundaryconditions (BC), and initial conditions (IC) There are about 80 known exact solutions to the NSE Solutions can be classified by type or geometry, for example:1. Couette shear flows2. Steady duct/pipe flows (Poisseulle flow)

Exact Solutions of the NSEProcedure for solving continuity and NSE1. Set up the problem and geometry, identifying all relevantdimensions and parameters2. List all appropriate assumptions, approximations,simplifications, and boundary conditions3. Simplify the differential equations as much as possible4. Integrate the equations5. Apply BCs to solve for constants of integration6. Verify results Boundary conditions are critical to exact, approximate, andcomputational solutions. BC’s used in analytical solutions are No-slip boundary condition Interface boundary condition

Summary of Fluid Dynamic Equations in CFDAnalysis49

3D Compressible Navier–Stokes EquationsC.E. in conservative formComplete Navier–Stokes equations in conservation form50

3D Compressible Navier–Stokes EquationsC.E. in conservative formBy expanding ( u ) ( v) ( w) 0 t x y z51

3D Compressible Navier–Stokes EquationsMomentum Equations in conservative form52

3D Compressible Navier–Stokes Equationswhen expanded using Stokes’ hypothesis (λ - 2/3 μ) gives53

3D Incompressible Navier–Stokes EquationsContinuity Equation 𝑢 𝑣 𝑤 0 𝑥 𝑦 𝑧X-Momentum 𝑢 𝑢 𝑢 𝑢 𝑝 2𝑢 2𝑢 2𝑢𝜌 𝑢 𝑣 𝑤 𝜌𝑔𝑥 𝜇 2 22 𝑡 𝑥 𝑦 𝑧 𝑥 𝑥 𝑦 𝑧Y-Momentum 𝑣 𝑣 𝑣 𝑣 𝑝 2𝑣 2𝑣 2𝑣𝜌 𝑢 𝑣 𝑤 𝜌𝑔𝑦 𝜇 2 22 𝑡 𝑥 𝑦 𝑧 𝑦 𝑥 𝑦 𝑧Z-Momentum 𝑤 𝑤 𝑤 𝑤 𝑝 2𝑤 2𝑤 2𝑤𝜌 𝑢 𝑣 𝑤 𝜌𝑔𝑧 𝜇 2 22 𝑡 𝑥 𝑦 𝑧 𝑧 𝑥 𝑦 54 𝑧

2D Incompressible Navier–Stokes EquationsContinuity Equation 𝑢 𝑣 0 𝑥 𝑦X-Momentum 𝑢 𝑢 𝑢 𝑝 2𝑢 2𝑢𝜌 𝑢 𝑣 𝜌𝑔𝑥 𝜇 22 𝑡 𝑥 𝑦 𝑥 𝑥 𝑦Y-Momentum 𝑣 𝑣 𝑣 𝑝 2𝑣 2𝑣𝜌 𝑢 𝑣 𝜌𝑔𝑦 𝜇 22 𝑡 𝑥 𝑦 𝑦 𝑥 𝑦55

Euler EquationsContinuity Equation 𝑢 𝑣 𝑤 0 𝑥 𝑦 𝑧X-Momentum 𝑢 𝑢 𝑢 𝑢 𝑝𝜌 𝑢 𝑣 𝑤 𝜌𝑔𝑥 𝑡 𝑥 𝑦 𝑧 𝑥Y-Momentum 𝑣 𝑣 𝑣 𝑣 𝑝𝜌 𝑢 𝑣 𝑤 𝜌𝑔𝑦 𝑡 𝑥 𝑦 𝑧 𝑦Z-Momentum 𝑤 𝑤 𝑤 𝑤 𝑝𝜌 𝑢 𝑣 𝑤 𝜌𝑔𝑧 𝑡 𝑥 𝑦 𝑧 𝑧56

Poisson Equation 2𝑢 2𝑢 2 𝑓 𝑥, 𝑦2 𝑥 𝑦 2𝜓 2𝜓 2 𝑓 𝑥, 𝑦2 𝑥 𝑦orLaplace Equationor 2𝑢 2𝑢 2 02 𝑥 𝑦 2𝜓 2𝜓 2 02 𝑥 𝑦57

2D Viscous Burgers’ Equation (Convection) 𝑢 𝑢 𝑢 2𝑢 2𝑢 𝑢 𝑣 𝜐 22 𝑡 𝑥 𝑦 𝑥 𝑦 𝑣 𝑣 𝑣 2𝑣 2𝑣 𝑢 𝑣 𝜐 22 𝑡 𝑥 𝑦 𝑥 𝑦2D Heat Equation (Diffusion) 𝑢 2𝑢 2𝑢 𝜐 22 𝑡 𝑥 𝑦58

2D Inviscid Burgers’ Equation (Convection) 𝑢 𝑢 𝑢 𝑢 𝑣 0 𝑡 𝑥 𝑦 𝑣 𝑣 𝑣 𝑢 𝑣 0 𝑡 𝑥 𝑦2D Wave Equation (Linear Convection) 𝑢 𝑢 𝑢 𝑐 𝑐 0 𝑡 𝑥 𝑦59

1D Viscous Burgers’ Equation 𝑢 𝑢 2𝑢 𝑢 𝜐 2 𝑡 𝑥 𝑥1D Heat Equation (Diffusion) 𝑢 2𝑢 𝜐 2 𝑡 𝑥1D Inviscid Burgers’ Equation (Convection) 𝑢 𝑢 𝑢 0 𝑡 𝑥1D Wave Equation (Linear Convection) 𝑢 𝑢 𝑐 0 𝑡 𝑥60

Basics of Finite Difference FormulationsRefer toCh. 2Hoffmann, A., Chiang, S., Computational Fluid Dynamics for Engineers, Vol. I, 4th ed.,Engineering Education System, 2000.Ch. 3, 4 and 5Pletcher, R. H., Tannehill, J. C., Anderson, D., Computational Fluid Mechanics and Heat Tranfer,3rd ed., CRC Press, 2011.Ch. 5Wendt, Anderson, Computational Fluid Dynamics - An Introduction, 3rd edition 2009.

Discretization methods (Finite Difference) First step in obtaining a numerical solution is to discretize the geometric domain to define a numerical grid Each node has one unknown and needs one algebraic equation, which is a relationbetween the variable value at that node and those at some of the neighboringnodes. The approach is to replace each term of the PDE at the particular node by a finitedifference approximation. Numbers of equations and unknowns must be equal

Discretization (Grid Generation) Numerical solutions can give answers at only discrete points in the domain, calledgrid points. If the PDEs are totally replaced by a system of algebraic equations which can besolved for the values of the flow-field variables at the discrete points only, in thissense, the original PDEs have been discretized. Moreover, this method of discretization is called the method of finite differences.

Taylor’s series expansion A partial derivative replaced with a suitable algebraic difference quotient is calledfinite difference. Most finite-difference representations of derivatives are based on Taylor’s seriesexpansion. Taylor’s series expansion:Consider a continuous function of x, namely, f(x), with all derivatives defined at x.Then, the value of f at a location x Δx can be estimated from a Taylor seriesexpanded about point x, that is, f1 2 f1 3 f1 n f23n()()f ( x x ) f ( x ) x x x . ( x) .23n x2! x3! xn! x f1 2 f1 3 f1 n f23nf ( x i 1 ) f ( x i ) ( x i 1 x i ) (x x) (x x) . (x x) .i 1ii 1ii 1i x2! x 23! x 3n! x n In general, to obtain more accuracy, additional higher-order terms must be included.

Taylor’s series expansionf ( x i )f ( x i 1 ) f ( x i ) f ( x i )( x i 1 x i ) ( x i 1 x i ) 2 2!f ( n) ( xi ) ( x i 1 x i ) n Rnn!(xi 1-xi) Δxstep size (define first)f ( x i ) 2f ( x i 1 ) f ( x i ) f ( x i ) x x 2! f ( n) ( xi ) n( x ) n n x Rn f ( x i ) f ( xi )n!n!1 The term, Rn, accounts for all terms from (n 1) to infinity, Truncationerror.

Taylor’s series expansion𝑥𝑖 1 𝑥𝑖 𝑥 ℎ

Truncation Error Need to determine f n 1(x), to do this you need f'(x). If we knew f(x), there wouldn’t be any need to perform theTaylor series expansion. However, R O(Δxn 1), (n 1)th order, the order of truncationerror is Δxn 1. O(Δx), halving the step size will halve the error. O(Δx2), halving the step size will quarter the error.

Forward, Backward and CentralDifferences:(1) Forward difference:Neglecting higher-order terms,we can get(( x i 1 x i ) 2 2 fx i 1 x i ) 3 f ff ( x i 1 ) f ( x i ) ( ) i ( x i 1 x i ) ( 2 )i ( 3 )i x2! x3! x( x i 1 x i ) n n f . ( n ) i .n! xSolve for f( )i x3, we get

Finite Differences:Recall the Definition of a derivative: 𝑦𝑦2 𝑦1 lim 𝑥 𝑥 0 𝑥2 𝑥1 𝑦𝑦2 𝑦1 lim 𝑥 𝑥 0 𝑥

Finite Differences:Recall the Definition of a derivative: 𝑢 𝑥 𝑥𝑖 𝑢 𝑥𝑖 𝑥 𝑢 𝑥𝑖lim 𝑥 𝑥 0𝑢𝑥

Forward, Backward and CentralDifferences:(1) Backward difference:𝑢𝑥

Forward, Backward and CentralDifferences:(2) Forward difference:𝑢𝑥

Forward, Backward and CentralDifferences:(3) Central difference:𝑢𝑥

74

(1) Forward difference:( xi 1 xi )3f ( xi 1 ) f ( xi ) ( xi 1 xi ) f f 3 f( )i ( 2 )i ( 3 )i x( xi 1 xi )2!( xi 1 xi ) x3!( xi 1 xi ) x22( xi 1 xi ) n n f . ( n ) i .n!( xi 1 xi ) xf i 1 f i x 2 f f x 2 3 f x n 1 n f( )i ( 2 )i ( 3 ) i . ( n ) i . x x2 x6 xn! xf i 1 f i O ( x )(a ) x This equation is known as the first forward differenceapproximation of f of order (Δx). x It is obvious that as the step size decreases, the error termis reduced and therefore the accuracy of the approximationis increased.

(2) Backward differenceTaylor series expansion:Neglecting higher-order terms, we can get(( x i x i 1 ) 2 2 fx i x i 1 ) 3 f ff ( x i 1 ) f ( x i ) ( ) i ( x i x i 1 ) ( 2 )i ( 3 )i x2! x3! xnnn n fn ( x i x i 1 )n ( x ) f . ( 1)( n ) i . f ( x ) ( 1) nn! xn!n 1 x3Solve for ( f ) , we geti x(f ( x i ) f ( x i 1 ) ( x i x i 1 ) 2 fx i x i 1 ) 3 f f( )i ( 2 )i ( 3 )i x( x i x i 1 )2 x6 x2( x i x i 1 ) n 1 n ff i f i 1 . ( 1)( n ) i . O ( x )n! x xn(b )

(2) Backward difference which represents the slope of the function at B using the values ofthe function at points A and B, as shown in Figure 2-2. Equation (2-6) is the first backward difference approximation fofof order (Δx). xFigure 2-2. Illustration of gridpoints used in Equation (2-6).

(3) Central difference:f i 1 f i x 2 f f x 2 3 f x n 1 n f( )i ( 2 )i ( 3 ) i . ( n ) i . x x2 x6 xn! xf i 1 f i O ( x )(a ) xn 1f i f i 1 x 2 f f x 2 3 f n fn ( x )( )i ( 2 )i ( 3 ) i . ( 1)( n ) i . x x2 x6 xn! xf i f i 1 O ( x )(b ) x Adind (a) (b) and neglecting higher-order terms, wecan f get f f f f x 2 3 f2( x)i i 1ii xi 1 HOT3 xf f i 1 f( ) i i 1 O ( x ) 2 x2 x3(c )

(3) Central difference: which represents the slope of the function f at point B using the f A and C, as shown in Figure 2-3.values of the function at points x This representation ofis known as the central differenceapproximation of order (Δx)2

Truncation error:The higher-order term neglecting in Eqs. (a), (b), (c)constitute the truncation error.Forward:f i 1 f i f( )i O ( x ) x xBackward:Central:((f f i 1 f)i i O ( x ) x xf f i 1 f) i i 1 O ( x ) 2 x2 x

Second derivatives:( f( x ) 2 2 f x ) 3 f( x ) n n ff i 1 f i ( ) i x ( 2 )i ( 3 ) i . ( n ) i . x2! x3! xn! x3nn( f( x ) 2 2 f x ) 3 f( x) ff i 1 f i ( ) i ( x ) ( 2 )i ( 3 ) i . ( 1) n( n ) i . x2! x3! xn! x3if xi xi 1 x , then (a) (b) becomes* Central difference:2 f2f i 1 f i 1 2 f i ( x ) ( 2 ) i O ( x ) 4 HOT xf i 1 2 f i f i 1 2 f2( 2 )i O ( x )2 x( x )

Second derivatives: f( x ) ff i 1 f i ( ) i x ( 2 )i x2! x2f i 2 f i (23() x 3 f () f(2 x ) f)2 x ( 2 )i x2! x22 x 33!( x ) n n f . ( n ) i .n! xi3()2 x 3 f(2 x ) n n f () . () .3! x 3n! x nIf xi xi 1 x , then (b)-2(a) becomes(((2 x ) 2 2 f( x ) 2 2 f2 x ) 3 f x ) 3 ff i 2 2 f i 1 f i 2 f i ( 2 )i 2( 2 )i ( 3 ) 2( 3 ) HOT2! x2! x3! x3! x332 f2f i 2 2 f i 1 f i x ( 2 ) i O ( x ) 3 x* Forward difference:f i 2 2 f i 1 f i 2 f( 2 )i O ( x )2 x( x )

Second derivatives:nn( f( x ) 2 2 f x ) 3 f( x) ff i 1 f i ( ) i ( x ) ( 2 )i ( 3 ) i . ( 1) n( n ) i . x2! x3! xn! x3( f(2 x ) 2 2 f2 x ) 3 f(2 x ) n n f f i ( )2 x ( 2 )i ( 3 ) . ( n ) . x2! x3! xn! x3f i 2If xi xi 1 x , then (b)-2(a) becomes(((2 x ) 2 2 f( x ) 2 2 f2 x ) 3 f x ) 3 ff i 2 2 f i 1 f i 2 f i ( 2 )i 2( 2 )i ( 3 ) 2( 3 ) HOT2! x2! x3! x3! x332 f2f i 2 2 f i 1 f i x ( 2 ) i O ( x ) 3 x* Backward difference:f i 2 f i 1 f i 2 2 f( 2 )i O ( x )2 x( x )

More Accurate Approximations By considering additional terms in the Taylor series expansions,a more accurate approximation of the derivatives is produced.( f( x ) f x ) 3 ff i 1 f i ( ) i x ( 2 )i ( 3 ) i .HOT x2! x3! x223f i 1 f i x 2 f f( )i ( 2 ) i O ( x ) 2 x x2 xSubstitute a forward difference expression for 2f/ x2 , i.e.,f i 2 2 f i 1 f i 2 f( 2 )i O ( x )2 x( x )gives: f i 1 f i x f i 2 2 f i 1 f i f2 ( )i O( x) O( x) x x2 ( x ) 2 OR f i 2 4 f i 1 3 f i f( )i O ( x ) 2 x2 xa second-order accurate finitedifference approximation

Method of Operators For convenience, define the first forward difference fi 1 – fi as Δxf; andthe first backward difference fi – fi-1 as x f. In general, first order forward and backward differences can beexpressed as nx f i nx 1 ( x f i )and nx f i nx 1 ( x f i ) Various central difference operators can be similarly defined. Sometypical operators are: x fi f x* f i f i 1 f i 1 x f i x f i x2 f i x ( x f i ) x ( f1i 2 f1i 2) ( f i 1 f i ) ( f i f i 1 ) f i 1 2 f i f i 1( x x ) f i x f i x f i f i 1 2 f i f i 1( x x ) f i f i 2 4 f i 1 6 f i 4 f i 1 f i 221i 2 fi 12

Method of Operators Using the operators just defined, the approximationsof the higher derivatives by forward, backward, andcentral differencing may be expressed as nx f i n f( n )i O ( x )n x( x ) f) n i xn( f) n i xn( nx fi n2 nx f2( x ) nx fi nx f i n f( n )i O ( x )n x( x )i n2nn n 1x f22( x )ni O ( x ) 2n 12for n even O ( x ) 2for n odd

Using operator method

Finite Difference Polynomial Assume a second order polynomial Substituting with discrete points: Solving for A, B, and C Differentiating:

Finite Difference Equation Consider the following equation:

Finite Difference Equation – Mixed Derivatives Consider the 2D Taylor series expansion: Using i, j indices in replacement of x,y:

Finite Difference Equation – Mixed Derivatives Similarly:

Mixed derivatives:* Taylor series expansion: f f ( x) 2 2 f ( y ) 2 2 f( x)( y ) 2 f33f ( x x, y y ) f ( x, y ) x y 2 o[( x),( y)]22 x y2! x2! y2! x y* Central difference:f i 1, j 1 f i 1, j 1 f i 1, j 1 f i 1, j 1 2 f o[( x) 2 , ( y ) 2 ]4( x)( y ) x y i , j* Forward difference:* Backward difference:f i 1, j 1 f i , j 1 f i 1, j f i , j 2 f O[( x ) , ( y ) ]( x )( y ) x y i , jf i , j f i 1, j f i , j 1 f i 1, j 1 2 f O[( x ) , ( y ) ]( x )( y ) x y i , j

Finite Difference Equations The finite difference approximations just discussed are used to replacethe derivatives that appear in the PDEs. Consider an example involving time (t) and two spatial coordinates (x,y);i.e., the dependent variable f is f f(t,x,y). A governing PDE of the form: where is assumed constant. It is required to approximate the PDE by a finite difference equation in adomain with equal grid spacing. The subscript indices i and j are used to represent the Cartesiancoordinates x and y, and the superscript index n is used to represent time. It is specified that a first-order finite difference approximation in time andcentral differencing of second-order accuracy in space be used. The spatial grid spacings are Δx and Δy, whereas Δt designates the timestep. The grid system is shown in Figure 2-6.

Computational gridsystem forthe solutionof Equation(2-26).

Note that the value of f at time level n is known, andthe value of f at time level n 1 is to be evaluated. Therefore, Equation may be expressed at time level nor at time level n 1. First, consider Eq. at time level n. For this case, a forward difference approximationwhich is first-order accurate is used. Hence, Therefore, the finite difference formulation of thepartial differential equation (2-26) is:

Explicit and Implicit Formulations The second case, Eq. is evaluated at n 1 time level. Therefore, a first-order backward difference approximation in time isemployed, and the spatial approximations are at time level n 1. Hence, the finite difference formulation takes the form: The resulting finite difference equations, (2-27a) and (2-27b), are classifiedas explicit and implicit formulations, respectively. An obvious distinction between two finite difference equations is thenumber of unknowns appearing in each equation. Explicit equation involves only one unknown, fi,jn 1 , whereas Equation (227b) involves five unknowns. Thus, the solution procedures based on explicit and implicit formulations are different.

Explicit and Implicit Formulations In the explicit formulation, only one unknown appears and maytherefore be solved for directly at each grid point. In the implicit formulation, more than one unknown exists andtherefore the finite difference equation must be written for allthe spatial grid points at n 1 time level to provide the samenumber of equations as there are unknowns and solvedsimultaneously. Obviously, the solution of explicit formulation is simpler thanthe implicit equation. However, as will be seen shortly, implicit formulations aremore stable than explicit formulations. Other differences between explicit and implicit formulationsare discussed in future chapters. If the approximation of the original PDE was such that thetruncation error was of the order [(Δt)2 , (Δx)2, (Δy)2 ], in whichcase the lowest term is of order two, then it would be classifiedas a second-order accurate method.

Applications: Hoffman, Example 2.3 Determine a backward difference approximation for f / x which is of the order (Δx)3 Solution. Consider the Taylor series expansion,( f( x ) f x ) 3 ff i 1 f i ( )( x ) ( 2 ) ( 3 ) O ( x ) 4 x2! x3! x Substitute the backward difference approximationsfor 2 f I x2 and 3f I x3223

Solution Substituting the expressions above into (2-33) produces:

Hoffman, Example 2.4. Using the Taylor seriesexpansion, find asecond-order forwarddifferenceapproximation for f/ xwith unequally spacedgrid points.

Hoffman, Example 2.6 . Given the function f(x) ¼ x2 , compute the first derivative off at x 2 using forward and backward differencing of order(Δx). Compare the results with a central differencing of O(Δx)2and the exact analytical value. Use a step size of Δx 0.1.Repeat the computations for a step size of 0.4. Solution. From Equation (2-4), the forward difference approximation oforder (Δx)

The backward difference approximation which is of order Δx

The results obtained from backward and forward differencing deviatefrom the exact value when a larger step size is used. Selection of thestep size is extremely important in numerical analysis.

Hoffman, Example 2.1Find a forward difference approximation of 0( Δx) for 4f/ x4.

Solution Therefore

Hoffman, Example 2.2. Determine the approximate forward differencerepresentation for 3f / x3 which is of the order (Δx),given evenly spaced grid (a) Taylor series expansion (b) Forward differ

Computational Fluid Mechanics Lecture 2 Dr./ Ahmed Nagib Elmekawy Oct 21, 2018. 2 . Computational Fluid Dynamics -A Practical Approach, Second Edition, 2013. Ch. 2 Wendt, Anderson, Computational Fluid Dynamics - An Introduction, 3rd edition 2009. 4 LAGRANGIAN A

Related Documents:

Fluid Mechanics Fluid Engineers basic tools Experimental testing Computational Fluid Theoretical estimates Dynamics Fluid Mechanics, SG2214 Fluid Mechanics Definition of fluid F solid F fluid A fluid deforms continuously under the action of a s

Fluid Mechanics 63 Chapter 6 Fluid Mechanics _ 6.0 Introduction Fluid mechanics is a branch of applied mechanics concerned with the static and dynamics of fluid - both liquids and gases. . Solution The relative density of fluid is defined as the rate of its density to the density of water. Thus, the relative density of oil is 850/1000 0.85.

ME - 733 Computational Fluid Mechanics Fluent Lecture 2 Boundary Conditions Dr./ Ahmed Nagib Elmekawy Oct 21, 2018

Applied Fluid Mechanics 1. The Nature of Fluid and the Study of Fluid Mechanics 2. Viscosity of Fluid 3. Pressure Measurement 4. Forces Due to Static Fluid 5. Buoyancy and Stability 6. Flow of Fluid and Bernoulli's Equation 7. General Energy Equation 8. Reynolds Number, Laminar Flow, Turbulent Flow and Energy Losses Due to Friction

Fundamentals of Fluid Mechanics. 1 F. UNDAMENTALS OF . F. LUID . M. ECHANICS . 1.1 A. SSUMPTIONS . 1. Fluid is a continuum 2. Fluid is inviscid 3. Fluid is adiabatic 4. Fluid is a perfect gas 5. Fluid is a constant-density fluid 6. Discontinuities (shocks, waves, vortex sheets) are treated as separate and serve as boundaries for continuous .

Continuum mechanics: fundamentals and applications Curriculum 5 1st semester (30 ECTS) rd Focus on basic competencies Mechanics and Thermodynamics of Continua (5 ECTS) Mechanics of Solids (6 ECTS): Elasticity, Plasticity Fluid Mechanics (5 ECTS) Computational Solid and Fluid Mechanics (4 ECTS) Mathematics in Natural Sciences

L M A B CVT Revision: December 2006 2007 Sentra CVT FLUID PFP:KLE50 Checking CVT Fluid UCS005XN FLUID LEVEL CHECK Fluid level should be checked with the fluid warmed up to 50 to 80 C (122 to 176 F). 1. Check for fluid leakage. 2. With the engine warmed up, drive the vehicle to warm up the CVT fluid. When ambient temperature is 20 C (68 F .

Austin, Oscar Palmer Nacogdoches, TX Vietnam War Austin, William . Lopez, Jose Mendoze Mission, TX (Santiago Huitlan, Mexico) World War II (Most sources say that Lopez was born in Texas but he later stated in multiple interviews and his funeral program recorded that he was born in Mexico) Lummus, Jack Ennis, TX World War II Martinez, Benito Fort Hancock, TX Korean War . Compiled by Gayle .