Presentation is loading. Please wait.

Presentation is loading. Please wait.

Simulation and Animation

Similar presentations


Presentation on theme: "Simulation and Animation"— Presentation transcript:

1 Simulation and Animation
Fluids

2 Fluid simulation Content Fluid simulation basics
Terminology Navier-Stokes equations Derivation and physical interpretation Computational fluid dynamics Discretization Solution methods

3 Fluid simulation Simulation of the behavior of fluid flow
Interaction and forces between fluid particles and solid bodies Result of physical properties of fluids Viscosity generates frictional forces External forces Gravitation and other forces Flow models Laminar flow Fluid consists of individual layers sliding over each other Turbulent flow Particles in different layers become mixed due to low friction

4 Fluid simulation Flow models
Laminar flow: no fluid exchange between layers Turbulent flow: no distinct layers, fluid exchange free

5 Fluid simulation Flow movement depends on
Viscous force Inertial force (Trägheitskraft) Described by Reynolds number, which depends on Velocity of the fluid, viscosity  and density , characteristic length D of the flow region Reynolds number (Re) The tendency of flow to be laminar (Re is very small) or turbulent (Re is very large) laminar if Re < 2300 transient for 2300 < Re < 4000 turbulent if Re > 4000 Re =  D V / 

6 Fluid simulation Approaches to describe flow fields Eulerian
Focus is on particular points in the flow occupied by the fluid Record state of a finite control volume around that point Dye injection for visualizing flows Lagrangian Consider particles and follow their path through the flow Record state of the particle along the path Particle tracing for visualizing flows

7 Fluid simulation Basic equations of fluid dynamics Rely on
Physical principles Conservation of mass F=ma Conservation of energy Applied to a model of the flow Finite control volume approach Infinitesimal particle approach Derivation of mathematical equations Continuity equation Navier-Stokes equations

8 Fluid simulation Models of the flow Finite control volume
Control surface S Control volume V V Fixed volume, fluid moves through it

9 Fluid simulation Models of the flow Infinitesimal fluid element
Volume dV dV Fixed fluid element, fluid moves through it Element moving along the streamlines

10 Flow simulation Governing equations of fluid flow
Finite control volume approach Apply physical principals to fluid in control volume and passing through control surface Yields equations in integral form Distinguish between conservation (fixed volume) and nonconservation (moving volume) form Infinitesimal fluid element Apply physical principals to infinitesimal fluid particle Yiels equations in partial differential form Distinguish between conservation (fixed particle) and nonconservation (moving particle) form

11 Navier-Stokes equations
A moving fluid element y V=ui+vj+wk V1 t = 1 x V2 t = 2 z

12 Fluid simulation The time rate of change of density
Particle moves from 1 to 2 Assume density (x,y,z,t) to be continuous and ... Thus, Taylor series expansion can be performed Dividing by (t2-t1) ignoring higher order terms and taking the limit:

13 Fluid simulation The substantial derivative
Time rate of change of density when moving from 1 to 2 Physically and numerically different to the time rate of change of density at fixed point (/t) (local derivative) With

14 Fluid simulation The substantial derivative V: convective derivative
Time rate of change due to movement to position with different properties D/Dt applied to any variable yields change due to local fluctuations and time and spatial fluctuations Can be applied to any flow field variable Pressure (p), temperatur (T), velocity (V) etc.

15 Navier-Stokes equations
The continuity equation Physical principal: conservation of mass Finite fixed control volume: Infinitesimal fluid particle Net mass flow out of control volume through surface Time rate of decrease of mass inside control volume = Net mass flow out of element Time rate of mass decrease inside element =

16 Navier-Stokes equations
The continuity equation The model: infinitesimal element fixed in space Consider mass flux through element dy dz dx

17 Navier-Stokes equations
The continuity equation Infinitesimal element fixed in space Net outflow in x-direction (equal for y/z-direction): Net mass flow: Time rate of mass increase:

18 Navier-Stokes equations
The continuity equation Time rate of mass increase inside element Net mass flow out of element + The partial differential form of the continuity equation Other models yield other forms of the continuity equation, which can be obtained from each other

19 Navier-Stokes equations
The momentum equation (Impulsgleichung) Physical principal: Newton´s second law F=ma Consider an infinitesimal moving element Sketch sources of the forces acting on it Consider x/y/z components separately Fx = max First consider left side of F=ma F = FB + FS Sum of body forces and surface forces acting on element

20 Navier-Stokes equations
The momentum equation F = FB + FS (body forces and surface forces) Body forces Act at a distance (Gravitational, electric, magnetic forces) FB = fx (dxdydz) Surface forces act Act on surface of element Can be split into pressure and viscous forces FS = FPress + FVis Pressure force: imposed by outside fluid, acting inward and normal to surface Viscous force: imposed by friction due to viscosity, result in shear and normal stress imposed by outside fluid

21 Navier-Stokes equations
Sketch of forces (x-direction only) Convention: positive increases of V along positive x/y/z Y 6 2 Sy (shear stress) sz‘ 7 3 P (pressure force) p‘ nx (normal stress) nx‘ sz 4 X sy‘ 1 5 Z

22 Navier-Stokes equations
Surface forces Shear stress Normal stress Y Y yx xx X X Time rate of change of shear deformation Time rate of change of shear volume

23 Navier-Stokes equations
Surface forces On face 0145: On face 2367: Equivalent on faces 0246 and 1357 for zx On face 0123: On face 4567: X 1 2 3 4 5 6 7 P (pressure force) p‘ Sy (shear stress) sy‘ nx (normal stress) nx‘ sz sz‘

24 Navier-Stokes equations
Total force on fluid element =

25 Navier-Stokes equations
Consider right side of F=ma Mass of fluid element Acceleration is time rate of change of velocity (Du/Dt) Thus (equivalent for v/w): The Navier-Stokes equations

26 Navier-Stokes equations
What you typically see in the literature is is the only „strange“ term here : molecular viscosity In Newtonian fluids, shear stress is proportional to velocity gradient [shear stress] =  [strain rate] Described by Navier-Stokes equations Non-Newtonian fluids obey different property, e.g. blood, motor oil Viscosity is not a constant Depends on temperature and pressure

27 Navier-Stokes equations
From Stokes we know (let‘s just believe it here)  : molecular viscosity  : second or bulk viscosity

28 Navier-Stokes equations
Incompressible fluids  = constant  = constant  can be taken outside of partial derivatives in NSE Divergence free (all -terms on previous page vanish)

29 Navier-Stokes equations
With We obtain Sketch of derivation: Write div(V)=0 and resolve for u/x Partially differentiate both sides with respect to x Add 2u/x2 on both sides

30 Navier-Stokes equations
Euler equations Inviscid flow – no viscosity Only continuity and momentum equation

31 CFD – Computational Fluid Dynamics
Solution methods for governing equations Governing equations have been derived independent of flow situation, e.g. flow around a car or inside a tube Boundary (and initial) conditions determine specific flow case Determine geometry of boundaries and behavior of flow at boundaries Different kinds of boundary conditions exist Hold at any time during simulation Lead to different solutions of the governing equations Exact solution exists for specific conditions Initial conditions specify state to start with

32 CFD – Computational Fluid Dynamics
Boundary and initial conditions Initial conditions should satisfy properties of underlying flow model E.g. if div(V) = 0 then u=u0(x,y,z), v=v0(x,y,z), w=w0(x,y,z) should satisfy Boundary conditions specify flow properties at points along the fixed boundary See below

33 CFD – Computational Fluid Dynamics
Solution methods of partial differential equations Analytical solutions Lead to closed-form epressions of dependent variables Continuously describe their variation Numerical solutions Based on discretization of the domain Replace PDEs and closed form expression by approximate algebraic expressions Partial derivatives become difference quotients Involves only values at finite number of discrete points in the domain Solve for values at given grid points

34 CFD – Computational Fluid Dynamics
Discretization Layout of grid points on a grid Location of discrete points across the domain Arbitrary grids can be employed Structured or unstructured grids Implicit or explicit representation of topology (adjacency information) Uniform grids: uniform spacing of grid points in x and y y Pi-1j+1 Pij+1 Pi+1j+1 y Pi-1j Pij Pi+1j y = x Pi-1j-1 Pij-1 Pi+1j-1 x x

35 CFD – Computational Fluid Dynamics
Finite differences Approximate partial derivatives by finite differences between points Derived by considering the Taylor expansion

36 CFD – Computational Fluid Dynamics
Derived by considering the Taylor expansion

37 CFD – Computational Fluid Dynamics
Finite differences for higher order and mixed partial derivatives

38 CFD – Computational Fluid Dynamics
Difference equations - example The 2D wave equation Partial Differential Equation Discretization on a 2D Cartesian grids yields Difference Equation

39 CFD – Computational Fluid Dynamics
Explicit approach Marching solution with marching variable t Values at time t+1 are computed from known values at time t and t-1 Step through all interior points of domain and update ut+1

40 CFD – Computational Fluid Dynamics
Explicit vs. Implicit approach Explicit approach Difference equation contains one unknown Can be solved explicitely for it Implicit approach Difference equation contains more than one unknown Solution by simultaneously solving for all unknown System of algebraic equations to be solved e.g. Crank-Nicolson

41 CFD – Computational Fluid Dynamics
Implicit Crank-Nicholson scheme

42 Computational Fluid Dynamics
Implicit approach – example Poisson equation: Discretization:

43 The Equations Solution of the Navier-Stokes equations Advection
Describes in what direction a “neighboring” region of fluid pushes fluid at u Diffusion Describes how quickly variations in velocity are damped-out; depends on fluid viscosity Pressure Describes in which direction fluid at u is pushed to reach a lower pressure area External Forces Zero Divergence

44 NSE Discretization

45 Navier-Stokes Equations (cont.)
Rewrite the Navier-Stokes Equations where now F and G can be computed

46 Navier-Stokes Equations (cont.)
Problem: Pressure is still unknown! From derive: and end up with this Poisson Equation after discretization:

47 Computational Fluid Dynamics
The algorithm Step 1: compute Ft and Gt Use veocities ut and vt and difference equations for partial derivatives Step 2: solve equations for pressure pt+1 Discretize second order partial derivatives Use Jacobi, Gauss-Seidel, or Conjugate Gradient method Step 3: compute new velocities ut+1, vt+1

48 CFD – Computational Fluid Dynamics
Boundary conditions (2D) No-slip condition Fluid is fixed to boundary; velocities should vanish at boundaries or have velocities of moving boundaries Free-slip condition Fluid is free to move parallel to the boundary; velocity component normal to boundary vanishes Outflow conditions Velocity into direction of boundary normal does not change Inflow conditions Velocities are given explicitely

49 Demo


Download ppt "Simulation and Animation"

Similar presentations


Ads by Google