160 likes | 440 Vues
Computational Fluid Dynamics 5 Lecture 2. Professor William J Easson School of Engineering and Electronics The University of Edinburgh. Last week’s examples. Create new working directory Create a simple geometry in GAMBIT and mesh Solve for laminar flow in the channel
E N D
Computational Fluid Dynamics 5Lecture 2 Professor William J Easson School of Engineering and Electronics The University of Edinburgh
Last week’s examples • Create new working directory • Create a simple geometry in GAMBIT and mesh • Solve for laminar flow in the channel • Present the output in a variety of formats • Model 1 is incompressible, laminar flow through a channel • Reynolds numbers must be << Recrit Velocities << speed of sound if gas • low velocity and/or channel width • YOU must calculate appropriate numbers • Garbage in – garbage out
Last week’s examples (cont) • The main objective of the exercise with the flow between planes is to familiarise you with the software • Further numerical experiments before next week: • 3D Laminar flow through a circular pipe • How does the point of fully developed flow vary with velocity? • 2D Laminar jet into chamber • What is the rate of expansion of the jet? • Attempt some of the GAMBIT tutorials
Laminar Jet • How fast does the jet spread? • How large should the domain be? • Is a special grid required?
Discretising equations What are we solving?
Components of the N-S equations • Need to know • values of each variable (eg u) at each point • values of the first derivative • values of cross-derivatives • values of second derivatives • ……..and more
Forward approximation to value of the 1st derivative of u in space u x i-1 i i+1 dx
Rearward approximation to value of the 1st derivative of u in space u x i-1 i i+1 dx
Central approximation to value of the 1st derivative of u in space u x i-1 i i+1 dx
Approximations to values of the 1st derivative of u in space u forward rearward central x i-1 i i+1 dx
1st & 2nd Order Finite Difference 1st order forward difference 1st order rearward difference 2nd order central difference
i-1,j+1 i,j+1 i+1,j+1 i-1,j i,j i+1,j i-1,j-1 i,j-1 i+1,j-1 Discretising equations(Anderson) The value of the variable, u, at the grid point i+1,j can be approximated by a Taylor expansion:
1st & 2nd Order Finite Difference From the previous equation, we can find expressions for the derivatives: 1st order forward difference 2nd order central difference 2nd order central difference
Practical consequences of discretisation • Errors arise from spacing of grid – needs to be small enough to represent the key aspects of the flow • Errors arise from the order of the equations • 1st order should generally not be used • Only 2nd order solutions are acceptable for journal publication
Testing solution • Start with a coarse grid • Solve the problem • Double the grid density • Compare with the first solution • If the values have not changed significantly, it is likely that the solution is grid-independent • If the values have changed significantly, continue until they stop changing
Week 2 - example • Flow over a backward-facing step • Flow expands and leaves a recirculating vortex behind the step • Solve to 2nd order and maintain laminar flow • How long does the domain have to be to ensure that the solution is valid • Upstream? • Downstream?