GG250 F-2004 Lab 7-1 Components of Scientific Programming Definition of problem Physical/mathematical formulation (Focus today) Development of computer.

Slides:



Advertisements
Similar presentations
FEA Course Lecture V – Outline
Advertisements

Partial Differential Equations
Fixed point iterations and solution of non-linear functions
Finite Element Method (FEM) Different from the finite difference method (FDM) described earlier, the FEM introduces approximated solutions of the variables.
By S Ziaei-Rad Mechanical Engineering Department, IUT.
Chapter 3 Steady-State Conduction Multiple Dimensions
Design of Systems with INTERNAL CONVECTION P M V Subbarao Associate Professor Mechanical Engineering Department IIT Delhi An Essential Part of Exchanging.
PARTIAL DIFFERENTIAL EQUATIONS
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 2 Mathematical Modeling and Engineering Problem Solving.
GG250 F-2004 Lab 6-1 Components of Scientific Programming Definition of problem Physical/mathematical formulation Development of computer code (Focus today)
CHE/ME 109 Heat Transfer in Electronics LECTURE 11 – ONE DIMENSIONAL NUMERICAL MODELS.
Math for CSTutorial 121 Heat Equation. Laplace Equation.
PARTIAL DIFFERENTIAL EQUATIONS
Macquarie University The Heat Equation and Diffusion PHYS by Lesa Moore DEPARTMENT OF PHYSICS.
Finite Difference Time Domain Method (FDTD)
Partial differential equations Function depends on two or more independent variables This is a very simple one - there are many more complicated ones.
CISE301: Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures KFUPM (Term 101) Section 04 Read & CISE301_Topic9.
SE301: Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures KFUPM Read & CISE301_Topic9 KFUPM.
CHAPTER 8 APPROXIMATE SOLUTIONS THE INTEGRAL METHOD
Computer Assisted Process Design---HYSYS Bo Hu. Introduction HYSYS is only one process simulation program out of a number. Steady State Processes ASPEN.
CHAP 5 FINITE ELEMENTS FOR HEAT TRANSFER PROBLEMS
Internal Flow Convection -constant surface temperature case Another commonly encountered internal convection condition is when the surface temperature.
9.6 Other Heat Conduction Problems
CHAPTER 7 NON-LINEAR CONDUCTION PROBLEMS
ES 128 Computational Solid and Structural Mechanics
Scientific Computing Partial Differential Equations Introduction and
CHAPTER 2 ONE-DIMENSIONAL STEADY STATE CONDUCTION
Chapter 9 Numerical Integration Flow Charts, Loop Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Scientific Computing Partial Differential Equations Poisson Equation.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 5a.
Scientific Computing Partial Differential Equations Implicit Solution of Heat Equation.
Module 4 Multi-Dimensional Steady State Heat Conduction.
Elliptic PDEs and the Finite Difference Method
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 8 - Chapter 29.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapter 24 Boundary Value Problems.
Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Transient Conduction: Finite-Difference Equations and Solutions Chapter 5 Section 5.9  
HEAT TRANSFER FINITE ELEMENT FORMULATION
Engineering Analysis – Computational Fluid Dynamics –
Ch 10.6: Other Heat Conduction Problems
MECH4450 Introduction to Finite Element Methods
MULTIDIMENSIONAL HEAT TRANSFER  This equation governs the Cartesian, temperature distribution for a three-dimensional unsteady, heat transfer problem.
Finite-Difference Solutions Part 2
1 CHEM-E7130 Process Modeling Exercise Numerical integration, distributions etc.
Solving Partial Differential Equation Numerically Pertemuan 13 Matakuliah: S0262-Analisis Numerik Tahun: 2010.
ERT 216 HEAT & MASS TRANSFER Sem 2/ Dr Akmal Hadi Ma’ Radzi School of Bioprocess Engineering University Malaysia Perlis.
1 Variational and Weighted Residual Methods. 2 Introduction The Finite Element method can be used to solve various problems, including: Steady-state field.
Relaxation Methods in the Solution of Partial Differential Equations
Part 8 - Chapter 29.
Chapter 30.
One Dimensional Steady State Heat Conduction
Math for CS Heat Equation. Laplace Equation.
Chapter 2. Mathematical Expression of Conduction
Local Linearity and Approximation
Topic 3 Discretization of PDE
Scientific Computing Partial Differential Equations Implicit Solution of Heat Equation.
CS6068 Applications: Numerical Methods
Step change in the boundary condition of conduction problems
topic4: Implicit method, Stability, ADI method
Topic 3 Discretization of PDE
Mathematical Solution of Non-linear equations : Newton Raphson method
Finite element method.
Steady-State Heat Transfer (Initial notes are designed by Dr
Stencil Pattern ITCS 4/5145 Parallel computing, UNC-Charlotte, B. Wilkinson Oct 14, 2014 slides6b.ppt 1.
APPLICATION OF LINEAR ALGEBRA IN MECHANICAL ENGINEERING
Stencil Pattern ITCS 4/5145 Parallel computing, UNC-Charlotte, B. Wilkinson Jan 28,
What are Fins ? Fins are extended surfaces used to increase the rate of heat transfer. It is made of highly conductive materials such as aluminum.
Stencil Pattern ITCS 4/5145 Parallel computing, UNC-Charlotte, B. Wilkinson StencilPattern.ppt Oct 14,
Programming assignment #1 Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Topic 3 Discretization of PDE
Presentation transcript:

GG250 F-2004 Lab 7-1 Components of Scientific Programming Definition of problem Physical/mathematical formulation (Focus today) Development of computer code (Focus to date)  Development of logic (e.g., flowchart)  Assembly of correct lines of code  Testing and troubleshooting  Visualization of results  Optimization of code Analysis of results Synthesis

GG250 F-2004 Lab 7-2 Steady-State Heat Conduction Equation dx Q in Q out In this exercise, no major Matlab concepts need to be implemented. The focus is on a small change in the coding and mathematics as a result of the physics extending from 1-D to 2-D.

GG250 F-2004 Lab 7-3 Steady-State Heat Conduction Equation (1-D) Change in thermal energy in time = Heat flow out - Heat-flow in T = temperature, and x = position We will represent dT/dx as T'. At steady state, the rate of energy change (E*) is zero: dx Q in Q out Insulated wire or rod

GG250 F-2004 Lab 7-4 Steady-State Heat Conduction Equation (1-D) At steady state,the rate of energy change (E*) is zero everywhere, so E* does not change as a function of position (x): dx Q in Q out This is the Laplace equation, one of the most important equations in physics

GG250 F-2004 Lab 7-5 Steady-State Heat Conduction Equation

GG250 F-2004 Lab 7-6 x i-2 x i-1 x i x i+1 x i+2 What does T" = 0 mean? T' = constant A plot of T vs. x must be a line. T must vary linearly between any two points along the rod at steady state. If T is known at positions x i-1 and x i+1, then T(i) = [T(i-1) + T(i+1) ]/2 T(i) = average of Tat the nearby equidistant points (see Appendix for more detail)

GG250 F-2004 Lab D Steady State Heat Conduction (a) x 1 x 2 x i x 49 x 50 num_iterations = 500; x = 1:50; T = 10.*rand(size(x));% initial temperature distribution n = length(x); for j = 1:num_iterations% a "for loop" is used here for i=2:n-1;% Don't change T at the ends of the rod! T(i) = (T(i+1) + T(i-1))./2; end figure(1); clf; plot(x,T); axis([0 n 0 10]); xlabel('x'); ylabel('T'); end Boundary Pt. with fixed boundary conditions Interior Pt. i =1 i = 2 i = i i = 49 i = 50 Boundary Pt. with fixed boundary conditions

GG250 F-2004 Lab D Steady State Heat Conduction (b) num_iterations = 500; x = 1:50; T = 10.*rand(size(x)); % initial temperature distribution n = length(x); for j = 1:num_iterations% a "for loop" is used here T(2:n-1) = (T (3:n) + T(1:n-2))./2; figure(1); clf; plot(x,T); axis([0 n 0 10]); xlabel('x'); ylabel('T'); end % Shorter, and it runs, but it introduces “noise” Interior Pt. x 1 x 2 x i x 49 x 50 Boundary Pt. with fixed boundary conditions Interior Pt. i =1 i = 2 i = i i = 49 i = 50 Boundary Pt. with fixed boundary conditions

GG250 F-2004 Lab D Steady State Heat Conduction (c) x = 1:50; T = 10.*rand(size(x)); % initial temperature distribution n = length(x); tol = 0.1; dT = tol.*2.*ones(size(T)); % Initialize dT while max(abs(dT)) > tol% a "while loop" is used here for i=2:n-1 ; dT(i) = ((T(i+1) + T(i-1))./2) -T(i); % Change in T T(i) = T(i) + dT(i); % New T = old T + change in T end figure(1); clf; plot(x,T); axis([0 n 0 10]);figure(2) ; plot(x,dT); end % Hit ctrl-c to stop. Why won’t this stop? x 1 x 2 x i x 49 x 50 Boundary Pt. with fixed boundary conditions Interior Pt. i =1 i = 2 i = i i = 49 i = 50 Boundary Pt. with fixed boundary conditions

GG250 F-2004 Lab D Steady State Heat Conduction (d) x 1 x 2 x 3 x 4 x 5 x = 1:50; T = 10.*rand(size(x)); % intial temperature distribution n = length(x); tol = ; dT = tol.*2.*ones(size(T)); % Initialize dT while max(abs(dT(2:n-1))) > tol% a "while loop" is used here for i=2:n-1 ; dT(i) = ((T(i+1) + T(i-1))./2) -T(i); % Change in T T(i) = T(i) + dT(i); % New T = old T + change in T end figure(1); clf; plot(x,T); axis([0 n 0 10]); xlabel('x'); ylabel('T'); end Interior Pt. i =1 i = 2 i = 3 i = 4 i = 5 Boundary Pt. with boundary conditions Boundary Pt. with boundary conditions

GG250 F-2004 Lab D Steady State Heat Conduction Equation x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 y5y4y3y2y1y5y4y3y2y1 Boundary Condition (fixed) Interior Point For a 2-D problem, the temperature at a point is the average of T at the four nearest neighbors Note: grid is square  x =  y

GG250 F-2004 Lab D Steady State Heat Conduction Equation x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 y5y4y3y2y1y5y4y3y2y1 Boundary Condition (fixed) Interior Point *Add a loop to account for 2-D grid *Reformulate T(x i ) to account for 2-D *Check for convergence Note: grid is square  x =  y

GG250 F-2004 Lab 7-13 Appendix This appendix shows in more detail how the second derivative d 2 T/dx 2 is evaluated numerically using a finite difference approximation method.

GG250 F-2004 Lab 7-14 Solution of 1-D Steady State Heat Conduction Equation x-x x+(  x)/2 x x+(  x)/2 x+  x

GG250 F-2004 Lab D Steady State Heat Conduction Equation x-2  x x+  x x x+  x x+2  x

GG250 F-2004 Lab D Steady State Heat Conduction Equation x i-2 x i-1 x i x i+1 x i+2 In words, what does this mean?