CFD { SOE323/4: CFD Lecture 3
@u x @t @u y @t @u z @t r:u = 0 () + r:(uu x ) = + r:(uu y ) = + r:(uu z ) = @x @y @z + r 2 u x (2) + r 2 u y (3) + r 2 u z (4) Transport equation form, with source @x Two main problems The equation is non-linear 2 The source term involves p
NSE 3 equations for 4 variables, + constraint equation. Need p to nd u, need u to nd p Equations solved sequentially Iterate until all elds correct Several dierent approaches used to solve these equations. 2 main ones : { Pressure Implicit Splitting of Operators { for time dependent ows { Semi-Implicit Method for Pressure Linked Equations { used for steady state problems
Eqn (2) if we know p, ux, can nd u x. Eqns (2{4), () combined! equation for p given the ux : r: rp A Flux has to satisfy continuity () = (ux term) algorithm as follows : Guess p, ux (values from previous timestep) 2 Use equation (2) to nd u x, u y etc. 3 Solve pressure equation for p 4 Correct ux to satisfy continuity
Start Guess p, flux (values from previous timestep) Use equation (3) to find ux, uy, uz Solve pressure equation to get p Correct flux to satisfy continuity Y Next timestep? N
Could iterate until steady-state. More usual to use. r:u = 0 r:(uu x ) = r:(uu y ) = r:(uu z ) = @x @y @z + r 2 u x + r 2 u y (5) + r 2 u z Guess an initial pressure eld p 2 Use equation (5) to create a velocity eld u from this pressure eld
3 Find a correction p 0 to the pressure eld p = p + p 0 4 Correct the velocity (ux) to obey continuity. In theory, p and u should now be the desired solution. In practice, it is necessary to repeat this procedure as an iterative process. If new solution p, u adopted at each step! algorithm becomes unstable. Thus, use underrelaxation : 5 Underrelax solution p n+ = p + ( )p n is underrelaxation parameter. At each step of the iteration, the error in the solution (the residual) should decrease { residuals for all variables should be monitored to ensure this.
Start Guess p * Find u * from momentum eqn. Find pressure correction p Find flux correction Correct fields p ** = p * + p Update fields (underrelaxation) n Tolerance achieved? y
Initial condition { state of p and u at all points in the ow. most uid ow problems parabolic or hyperbolic! solution depends in part on initial conditions specify known values for p and u, or make sensible guess may need to timestep until the eect of the I.C. absent Steady viscous ows { elliptic however methods parabolic { need starting conditions Boundary conditions { largely specify what the solution will be
3 main types of b.c. { walls, inlets, outlets Walls { u = 0 parallel to the wall (unless the wall is moving in which case the uid will share the motion) Fluid inlet { specify u. Fluid outlet { specify p N.B. If b.c. incorrectly specied, problem becomes ill posed { no solution possible.
Build mathematical model of the problem (NSE, turbulence, combustion... Discretise the equations on a mesh converts mathematical model to dierence equations Solve the discretised equations inverting discretised matrix equation NSE nonlinear,! and Analyse the results check results make sense physically, check numerical solution, eg. mesh independence process data to extract information
Using commercial code : Dene the geometry Generate the mesh Switch on physical models Specify physical constants Specify boundary/initial conditions Specify numerical parameters Run the solver Postprocess results