Skip to content

Examples of using MATLAB, Symbolic Math Toolbox, Partial Differential Equation Toolbox, and Simscape Fluids for solving canonical problems in Heat Transfer

License

BSD-3-Clause, BSD-3-Clause licenses found

Licenses found

BSD-3-Clause
LICENSE
BSD-3-Clause
license.txt
Notifications You must be signed in to change notification settings

MathWorks-Teaching-Resources/examples-in-heat-transfer

Open in MATLAB Online

Examples in Heat Transfer

Table of Contents

Tools

Setup and Usage

Examples

Heat Conduction Through Composite Wall

Analytically Solving 2D Steady-State Heat Equation on Thin, Rectangular Plate

Solving Transient Heat Equation

Heat Transfer and Energy Balance in 1D and 2D using Finite Difference Methods and PDE Toolbox

Finite Difference and Finite Element Methods for 2D Steady-State Heat Transfer - Indexing variations

Lumped Modeling of Heat Transfer Systems - From Iron Rod to House Thermal Network

Modeling and Optimization of Cooling Pipes

Getting Started

License

Community Support

This repository shows examples of using MATLAB®, Symbolic Math Toolbox™, Partial Differential Equation Toolbox™, and Simscape™ Fluids™ for solving canonical problems in Heat Transfer. The focus of these examples are complementing the analytical (pen-and-paper) solutions with computational workflows. From various computational approaches, educators can employ those closer to their teaching style and goals. Through study of these fundamental examples students learn different ways to apply computational tools in solving heat transfer problems and use them in real world applications. Here are the highlights of the discussed workflows and related tools.

Tools

  • Creating interactive live script for teaching and solving example problems
  • Implementing your own numerical methods to solve equations
  • Use tested and trusted numerical solvers to solve various types algebraic and differential (ODE, BVP, 1D-PDE) equations
  • Visualize and analyze results
  • Use tools from more than 100 toolboxes and addons
  • Symbolic solution of algebraic and differential equation
  • Symbolic calculation with variables associated with physical units, and performing dimensional analysis and verification
  • Visualization of symbolic equations
  • Solve steady-state and transient heat transfer problems using finite element analysis in 2D/3D
  • Visualize and post-process results
  • Couple thermal systems with structural stress analysis
  • Approximate dynamic characteristics using reduced-order models
  • Block-based modeling with components representing physical parts and phenomena
  • System level modeling of thermal and fluid systems
  • Connection to multi-domain system (mechanical, electrical) for real-world applications
  • Create model of lab experiments for lab pre-work/analysis

Setup and Usage

Each example have its own folder, and can be copied and used individually. Open the folder and run the main live script, or use the links below.

Examples

Heat Conduction Through Composite Wall

Open live script locally

Requires MATLAB, Symbolic Math Toolbox, and Partial Differential Equation Toolbox.

  • Steady-state conduction
  • Thermal resistance models in 2D
  • FEA models in 2D and 3D
  • Temperature and flux visualization
  • Interactive parameter variations

Overview figure of conductive composite wall problem

Analytically Solving 2D Steady-State Heat Equation on Thin, Rectangular Plate

Open live script locally

Requires MATLAB, Symbolic Math Toolbox, and Partial Differential Equation Toolbox.

  • Step-by-step solution of heat equation with method of separation of variables
  • Visualization of analytical solution
  • Comparison with FEA solution (PDE Toolbox)
  • Lumped Modeling of Heat Transfer Systems

Overview figure of analytical 2D steady-state heat equation

Solving Transient Heat Equation

Open live script locally

Link to video description

Requires MATLAB, and Symbolic Math Toolbox.

  • Derivation of heat equation and validation of unit consistency
  • Symbolic solution of transient heat equation with homogeneous BC using Fourier analysis and separation of variables
  • Visualization of Fourier modes and embedding
  • Interactive controls to choose material properties and solution parameters

Overview figure of solving transient heat equation

Heat Transfer and Energy Balance in 1D and 2D using Finite Difference Methods and PDE Toolbox

Open live script series locally

Requires MATLAB, Symbolic Math Toolbox, and Partial Differential Equation Toolbox.

  • Thermal analysis of 1D transient heat conduction: explicit (Forward Time Central Space) and implicit (standard and Crank-Nicolson) methods
  • Thermal analysis of 2D steady-state heat conduction: a standard explicit FD technique for solving Laplace's equation on a simple square sheet
  • Thermal analysis of 2D steady-state heat transfer: an "authentic" house insulation design case study supporting 2D conduction and convection
  • Derivation of Finite Difference stencils and their implementations with symbolic computing
  • Using textural indexing in Tables to assemble the Finite Difference system equations
  • Validation of numerical methods by PDE solvers in MATLAB or Partial Differential Equation Toolbox
  • Visualization of results and dynamics of the system

Overview figure of FD and PDE solutions - Intro

Finite Difference and Finite Element Methods for 2D Steady-State Heat Transfer - Indexing variations

Open live script series locally

Requires MATLAB, Symbolic Math Toolbox, and Partial Differential Equation Toolbox

  • Square domain with mix od Dirichlet and Neumann boundary conditions
  • Finite element solution with PDE Toolbox
  • Finite difference solution developed from scratch with three ways to manage and implement the Finite Difference methods
    1. tables for NODE lookup and storing A and b matrices
    1. table for NODE lookup and sparse matrices for storing A and b
    1. dictionary for NODE lookup and space matrices for storing A and b [fastest implementation]

Overview figure of FD and PDE solutions - Indexing

Lumped Modeling of Heat Transfer Systems - From Iron Rod to House Thermal Network

Open live script locally

Requires MATLAB, Simulink, and Simscape

  • Explaining conduction, convection, and thermal mass through a simple canonical problem (heat transfer in a rod)
  • Step-by-step addition of physical phenomena to increase model complexity gradually
  • Comparison of analytical and lumped model solution
  • Comparison of computational results for modeling the rod with one vs many segments
  • Using the same concept for modeling a simple house thermal network

Overview figure of Lumped modeling of heat transfer

Modeling and Optimization of Cooling Pipes

Open heat transfer live script locally

Requires MATLAB and Partial Differential Equation Toolbox

  • Generating the geometry with parametric features (number and size of pipes in the block)
  • Evaluation of boundary condition to solid part for natural and forced convection
  • Finite element solution of the steady-state heat transfer problem with a heat source
  • Analysis of the solution with Visualize PDE Results live task

Open optimization live script locally

Requires MATLAB, Partial Differential Equation Toolbox, Optimization Toolbox™ and Global Optimization Toolbox

  • Design optimization of a cooling block (number of pipes and their hydraulic diameter)
  • Using surrogate optimization solver (appropriate when evaluation of objective function is computationally expensive)
  • Visualization of the optimal solution

Overview figure of Cooling pipes

Getting Started

License

The license is available in the License.txt file in this repository.

Community Support

MATLAB Central

Copyright 2024 The MathWorks®, Inc.

About

Examples of using MATLAB, Symbolic Math Toolbox, Partial Differential Equation Toolbox, and Simscape Fluids for solving canonical problems in Heat Transfer

Resources

License

BSD-3-Clause, BSD-3-Clause licenses found

Licenses found

BSD-3-Clause
LICENSE
BSD-3-Clause
license.txt

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages