220 likes | 240 Views
Introduction to The Eclipse IDE and 1-D Heat Diffusion. Dr. Jennifer Parham-Mocello. What is an IDE?. IDE – Integrated Development Environment Software application providing conveniences to computer programmers for software development.
E N D
Introduction to The Eclipse IDE and 1-D Heat Diffusion Dr. Jennifer Parham-Mocello
What is an IDE? • IDE – Integrated Development Environment • Software application providing conveniences to computer programmers for software development. • Consists of editor, compiler/interpreter, building tools, and a graphical debugger. Heat Diffusion / Finite Difference Methods
Eclipse • Java, C/C++, and PHP IDE • Uses Java Runtime Environment (JRE) • Install JRE/JDK - http://www.oracle.com/technetwork/java/index.html • Need C/C++ compiler • Install Wascana (Windows version) http://www.eclipselabs.org/p/wascana Heat Diffusion / Finite Difference Methods
Using Eclipse • Example – Open HelloWorld C++ project • File -> New -> C++ Project • Enter Project Name • Building/Compiling Projects • Project -> Build All • Run -> Run • Console Heat Diffusion / Finite Difference Methods
Heat Diffusion Heat Diffusion / Finite Difference Methods
Heat Diffusion Equation • Describes the distribution of heat (or variation in temperature) in a given region over time. • For a function u(x, t) of one spatial variables(x) and the time variable t, the heat diffusion equation is: 1D or 1D Material Parameters – thermal conductivity (k), specific heat (c), density () Heat Diffusion / Finite Difference Methods
Conceptual and theoretical basis • Conservation of mass, energy, momentum, etc. • Rate of flow in - Rate of flow out = Rate of heat storage 2D 1D 3D Heat Diffusion / Finite Difference Methods
Example 1D Heat Diffusion Problem Wire with perfect insulation, except at ends x=4.0 x=0.0 Boundary Conditions Physical Parameters Initial Conditions Heat Diffusion / Finite Difference Methods
Outline of Solution • Discretization (spatial and temporal) • Transformation of theoretical equations to approximate algebraic form • Solution of algebraic equations Heat Diffusion / Finite Difference Methods
Discretization • Spatial - Partition into equally-spaced nodes u0 u1 u2 u3 Temporal - Decide on time stepping parameters x=0.33 x=0.67 x=1.0 x=0.0 Let to = 0.0, tn = 10.0, and Dt = 0.1 Heat Diffusion / Finite Difference Methods
Approximate Theoretical with Algebra Finite difference approximations for first and second derivatives u0 u1 ui-1 ui ui+1 un-1 un Heat Diffusion / Finite Difference Methods
Approximation Heat Diffusion / Finite Difference Methods
Algorithm fort=0,tn for each node, i predict ut+Dt endfor endfor • Predicting ut+Dt at each node • Explicit solution • Implicit solution (system of equations) Heat Diffusion / Finite Difference Methods
Explicit Solution Heat Diffusion / Finite Difference Methods
Simulation (Explicit Solution) Physical Parameters u0 u1 u2 u3 Boundary Conditions Initial Conditions Heat Diffusion / Finite Difference Methods
Extension • Two Dimensions u i,j+1 u i,j u i-1,j u i+1,j u i,j-1 Heat Diffusion / Finite Difference Methods
Implement 1-D Heat Diffusion • Open New C++ Project • Name the Project • Open New C++ source code file • File -> New -> Source File • Name C++ File (remember extension, .C, .c++, .cpp) Heat Diffusion / Finite Difference Methods
EXTRAS Heat Diffusion / Finite Difference Methods
Shorthand Notations • Gradient (“Del”) Operator Heat Diffusion / Finite Difference Methods
Divergence (Gradient of a vector field) Heat Diffusion / Finite Difference Methods
Laplacian Operator Heat Diffusion / Finite Difference Methods
Heat Diffusion Equation - rewritten • LHS represents spatial variations • RHS represents temporal variation Heat Diffusion / Finite Difference Methods