Objective Numerical methods
Convection term dxw P dxe W E Dx – Central difference scheme: - Upwind-scheme: If Vx>0 and If Vx<0 and
Diffusion term W dxw P dxe E Dx w e
Summary: Steady–state 1D I) X direction If Vx > 0, If Vx < 0, Convection term - Upwind-scheme: W P dxw dxe E and a) and Dx w e Diffusion term: b) When mesh is uniform: DX = dxe = dxw Assumption: Source is constant over the control volume c) Source term:
1D example - uniform mesh After substitution a), b) and c) into I): We started with partial differential equation: same and developed algebraic equation: We can write this equation in general format: Unknowns Equation coefficients
1D example multiple (N) volumes N unknowns 1 2 3 i N-1 N Equation for volume 1 N equations Equation for volume 2 …………………………… Equation matrix: For 1D problem 3-diagonal matrix
3D problem Equation in the general format: H N W P E S L Wright this equation for each discretization volume of your discretization domain A F 60,000 elements 60,000 cells (nodes) N=60,000 x = 60,000 elements 7-diagonal matrix This is the system for only one variable ( ) When we need to solve p, u, v, w, T, k, e, C system of equation is larger
Higher order differencing scheme for advection W Dx P Dx E Upwind scheme: Vx<0 Dx Vx>0 Central differencing scheme: Higher order differencing scheme: Quadratic upwind differencing Scheme (QUICK) N-2 N-1 N N+1 N+2 WW P W E EE We need to find coefficients aP, aW, aE, aWW, aEE,
Quadratic upwind differencing Scheme (QUICK) Coefficients: Advection coefficient: Source: Diffusion coefficients : For advection only:
Matrix for QUICK method Use Spars Matrix Solver
Iteration method Alternative to use matrix solver tool is to use iterations You can use excel if you are not familiar with matrix solver tools General Iteration Procedure: 1) Express equation in explicit form 2) Guess initial values 3) Substitute initial values and calculate new values 4) Substitute new values and calculate newer values 6) Repeat step 4) until convergence is achieved example Iterations -residual Value: T1 Residual initial guess 22 iteration 1 23 1.00000 iteration 2 23.25 0.25000 iteration 3 23.390625 0.14063 iteration 4 23.483459 0.09283 iteration 5 …… --- 23.96441 Iteration 98 23.96444 0.00003 2 2 2 Difference of value between two iteration 2 2
Numerical instability divergency divergence variable solution convergence iteration
General Transport Equation unsteady-state H N Equation in the algebraic format: W P E S L We have to solve the system matrix for each time step ! Transient term: Are these values for step or + ? Unsteady-state 1-D If: - - explicit method - + - implicit method
General Transport Equation unsteady-state Fully explicit method: Or different notation: Implicit method For Vx>0 For Vx<0
Steady state vs. Unsteady state We use iterative solver to get solution Unsteady state We use iterative solver to get solution and We iterate for each time step Make the difference between - Calculation for different time step - Calculation in iteration step