Lecture Objectives Review Explicit vs Implicit Residual Stability
Lecture Objectives: Review - Explicit vs. Implicit - Residual, Stability, Relaxation Simple algorithm
General Transport Equation unsteady-state 1 -D Fully explicit method: Implicit method: Value form previous time step (known value) Make the difference between - Calculation for different time step - Calculation in iteration step
Unsteady state Advection diffusion equation, 1 -D Explicit: Rarely used due to the problem with stability of calculation To achieve stable calculation Dt should be very small
Unsteady state Advection diffusion equation, 1 -D Implicit: Iterative method: Explicit format (to solve system of equations) 2) Guess initial values: 3) Substitute and calculate: 4…. ) Iterate for considered time step In iteration substitute only these values Make the difference between iteration and calculation for next time step
Residual Example: x-exp(1/x)-2=0 Find x using iteration Explicit form 1: x=exp(1/x)+2 Explicit form 2: x=1/(ln(x-2)) Solution process: Guess x 0 Iteration : x 1=exp(1/x 0)+2 , R 1=x 1 -x 0 X 2=exp(1/x 1)+2 , R 2=x 2 -x 1 ……. Not all iteration process converge! See the example for the same equation
Convergence example Explicit form 2: x=1/(ln(x)-ln(2)
Residual calculation for CFD • Residual for the cell RFijk=Fkijk-Fk-1 ijk Variable: p, V, T, … iteration cell position • Total residual for the simulation domain RFtotal=S|RFijk| For all cells • Scaled (normalized) residual RF=S|RFijk|/FF Flux of variable F used for normalization Vary for different CFD software
Relaxation with iterative solvers: variable When the equations are nonlinear it can happen that you get divergency in iterative procedure for solving considered time step divergence solution convergence Solution is Under-Relaxation: iteration Y*=f·Y(n)+(1 -f)·Y(n-1) Y – considered parameter , n –iteration , f – relaxation factor Value which is should be used for the next iteration For our example Y*in iteration 101=f·Y(100)+(1 -f) ·Y(99) f = [0 -1] – under-relaxation -stabilize the iteration f = [1 -2] – over-relaxation - speed-up the convergence Under-Relaxation is often required when you have nonlinear equations!
Example of relaxation Example: Advection diffusion equation, 1 -D, steady-state, 4 nodes 1) Explicit format: 1 2) Guess initial values: 3) Substitute and calculate: 4) Substitute and calculate: ……………. 2 3 4
Navier Stokes Equations CFD Specific Solver Continuity equation Momentum x This velocities that constitute advection coefficients: F=r. V Momentum y Momentum z Pressure is in momentum equations which already has one unknown In order to use linear equation solver we need to solve two problems: 1) find velocities that constitute in advection coefficients 2) link pressure field with continuity equation
Pressure and velocities in NS equations How to find velocities that constitute advection coefficients? For the first step use Initial guess And for next iterative steps use the values from previous iteration
Pressure and velocities in NS equations How to link pressure field with continuity equation? SIMPLE (Semi-Implicit Method for Pressure-Linked Equations ) algorithm Dx W Aw P Dx Dx Ae Aw=Ae=Aside We have two additional equations for y and x directions The momentum equations can be solved only when the pressure field is given or is somehow estimated. Use * for estimated pressure and the corresponding velocities E
SIMPLE algorithm Guess pressure field: P*W, P*P, P*E, P*N , P*S, P*H, P*L 1) For this pressure field solve system of equations: x: y: z: ………………. . Solution is: 2) The pressure and velocity correction P = P* + P’ V = V* + V’ P’ – pressure correction V’ – velocity correction For all nodes E, W, N, S, … Substitute P=P* + P’ and V = V* + V’ into momentum equations and obtain V’=f(P’) V = V* + f(P’) 3) Substitute V = V* + f(P’) into continuity equation solve P’ and then V 4) Solve T , k , e equations
SIMPLE algorithm p=p* Update V in coefficients start Assume V and calculate coefficients Guess p* Step 1: solve V* from momentum equations Step 2: introduce correction P’ and express V = V* + f(P’) Step 3: substitute V into continuity equation solve P’ and then V Step 4: Solve T , k , e equations no Converged (residual check) yes end
Other methods SIMPLER SIMPLEC variation of SIMPLE PISO V = V* + V’ COUPLED - use Jacobeans of nonlinear velocity functions to form linear matrix ( and avoid iteration )
HW 3 Boundary condition and differencing scheme
Newton-Raphson method (example of Jacobean solver) - Faster convergence - Used in many professional tools (Math. CAD, EES, Mat. Lab, Mathematica, etc) More complex for programming - Requires linear solver Based on Taylor-Series Expansion - You need first derivative for each function to create the Jacobean matrix - Equations in the form where all side are on one side of equality sign Our simple example: X-Y/2=-1 → X-Y/2+1=0 X 2 -Y=-3 → X 2 -Y+3=0
Newton-Raphson method Our simple example: f 1 = X-Y/2+1=0 f 2 = X 2 -Y+3=0 Section 6. 11 of handouts Function values for guessed variables Jacobean matrix Steps: 0) Find derivatives d(f 1)/d. X =1 d(f 2)/d. X =2 X , d(f 1)/d. Y =-1/2 , d(f 2)/d. Y =-1 Unknowns (correction Dxi) 1) Initial guess: Y(0)=2, X(0)=2 2) Find f 1(Y(0), X(0))=2 -2/2+1=2 f 2(Y(0), X(0))=22 -2+3=5 3) Using derivatives and guess values find the Jacobean matrix 4) Solve the matrix using linear solver and find DX and DY 5) Find Y(1)=Y(0)+ DY, X(1)=X(0)+ DX, Repeat step (2) with Y(1) and X(1) …. . Follow the procedure till convergence
Course Review (so far)
Conservation Equations Navier Stokes Equations
Reynolds Averaged Navier Stokes equations Continuity: 1) Momentum: 2) 3) 4) Similar is for STy and STx 4 equations 5 unknowns → We need to model
Modeling of Turbulent Viscosity Fluid property – often called laminar viscosity Flow property – turbulent viscosity MVM: Mean velocity models TKEM: Turbulent kinetic energy equation models Additional models: LES: Large Eddy simulation models RSM: Reynolds stress models
Discretization and equation solver Discretization of RANS SIMPLE algorithm Guess p* p=p* Step 1: solve V* from momentum equations Step 2: introduce correction P’ and express V = V* + f(P’) Step 3: substitute V into continuity equation solve P’ and then V Step 4: Solve T , k , e equations Converged (residual check) yes end no
Write down this 146. 6. 228. 78 or • 146. 6. 228. 78 - CAEE-Lic. Srv 07. austin. utexas. edu
- Slides: 24