150 likes | 162 Views
Objective. Numerical methods. Convection term. d x w. d x e. P. E. W. D x. e. w. – Central difference scheme:. - Upwind-scheme:. If Vx>0. and. and. If Vx<0. Diffusion term. d x w. d x e. P. E. W. D x. e. w. Summary: Steady–state 1D. I). X direction. If V x > 0,
E N D
Objective • Numerical methods
Convection term dxw dxe P E W Dx e w – Central difference scheme: - Upwind-scheme: If Vx>0 and and If Vx<0
Diffusion term dxw dxe P E W Dx e w
Summary: Steady–state 1D I) X direction If Vx > 0, If Vx < 0, Convection term - Upwind-scheme: P E W dxe dxw and a) and Dx e w Diffusion term: b) When mesh is uniform: DX = dxe = dxw Assumption: Source is constant over the control volume Source term: c)
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 i N 1 2 N-1 3 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 E P 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 Dx Dx P E W Upwind scheme: Dx Vx<0 Vx>0 Central differencing scheme: Higher order differencing scheme: Quadratic upwind differencing Scheme (QUICK) N+1 N+2 N-1 N N-2 P WW E EE W 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 forQUICK 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 2 2 2 Difference of value between two iteration 2 2
Numerical instabilitydivergency divergence variable solution convergence iteration
General Transport Equationunsteady-state H N Equation in the algebraic format: W E P S L We have to solve the system matrix for each time step ! Transient term: Are these values for step or + ? If: - - explicit method - + - implicit method Unsteady-state 1-D
General Transport Equation unsteady-state Fully explicit method: Or different notation: Implicit method For Vx>0 For Vx<0
Steady state vs. Unsteady state Steady 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