# ThermalModel

Thermal model object

## Description

A `ThermalModel`

object contains information
about a heat transfer problem: the geometry, material properties, internal heat sources,
temperature on the boundaries, heat fluxes through the boundaries, mesh, and initial
conditions.

## Creation

Create a `ThermalModel`

object using `createpde`

with the first argument `"thermal"`

.

## Properties

`AnalysisType`

— Type of thermal analysis

`"steadystate"`

| `"transient"`

| `"modal"`

| `"steadystate-axisymmetric"`

| `"transient-axisymmetric"`

| `"modal-axisymmetric"`

Type of thermal analysis, specified as `"steadystate"`

,
`"transient"`

, `"modal"`

,
`"steadystate-axisymmetric"`

,
`"transient-axisymmetric"`

, or
`"modal-axisymmetric"`

.

To change a thermal analysis type, assign a new type to
`model.AnalysisType`

. Ensure that all other properties
of the model are consistent with the new analysis type.

`Geometry`

— Geometry description

`AnalyticGeometry`

| `DiscreteGeometry`

Geometry description, specified as `AnalyticGeometry`

for a 2-D geometry
or `DiscreteGeometry`

for a 2-D or 3-D
geometry.

`MaterialProperties`

— Material properties within the domain

object containing material property assignments

Material properties within the domain, specified as an object containing the material property assignments.

`HeatSources`

— Heat source within the domain or subdomain

object containing heat source assignments

Heat source within the domain or subdomain, specified as an object containing heat source assignments.

`BoundaryConditions`

— Boundary conditions applied to the geometry

object containing boundary condition assignments

Boundary conditions applied to the geometry, specified as an object containing the boundary condition assignments.

`InitialConditions`

— Initial temperature or initial guess

object containing the initial temperature assignments within the
geometric domain

Initial temperature or initial guess, specified as an object containing the initial temperature assignments within the geometric domain.

`Mesh`

— Finite element mesh

`FEMesh`

object

Finite element mesh, specified as an `FEMesh`

object. For
details, see FEMesh Properties. You create the mesh by
using the `generateMesh`

function.

`StefanBoltzmannConstant`

— Constant of proportionality in Stefan-Boltzmann law governing radiation heat transfer

number

Constant of proportionality in Stefan-Boltzmann law governing radiation heat transfer, specified as a number. This value must be consistent with the units of the model. Values of the Stefan-Boltzmann constant in commonly used system of units are:

SI – 5.670367e-8 W/(m

^{2}·K^{4})CGS – 5.6704e-5 erg/(cm

^{2}·s·K^{4})US customary – 1.714e-9 BTU/(hr·ft

^{2}·R^{4})

`SolverOptions`

— Algorithm options for PDE solvers

`PDESolverOptions`

object

Algorithm options for the PDE solvers, specified as a PDESolverOptions Properties object. The
properties of `PDESolverOptions`

include absolute and
relative tolerances for internal ODE solvers, maximum solver iterations, and
so on.

## Object Functions

`geometryFromEdges` | Create 2-D geometry from decomposed geometry matrix |

`geometryFromMesh` | Create 2-D or 3-D geometry from mesh |

`importGeometry` | Import geometry from STL or STEP file |

`thermalProperties` | Assign thermal properties of a material for a thermal model |

`internalHeatSource` | Specify internal heat source for a thermal model |

`thermalBC` | Specify boundary conditions for a thermal model |

`thermalIC` | Set initial conditions or initial guess for a thermal model |

`generateMesh` | Create triangular or tetrahedral mesh |

`solve` | Solve structural analysis, heat transfer, or electromagnetic analysis problem |

`reduce` | Reduce structural or thermal model |

`linearize` | Linearize structural or thermal model |

`linearizeInput` | Specify inputs to linearized model |

`linearizeOutput` | Specify outputs of linearized model |

## Examples

### Create and Populate Thermal Model

Create a transient thermal model container.

thermalmodel = createpde("thermal","transient")

thermalmodel = ThermalModel with properties: AnalysisType: "transient" Geometry: [] MaterialProperties: [] HeatSources: [] StefanBoltzmannConstant: [] BoundaryConditions: [] InitialConditions: [] Mesh: [] SolverOptions: [1x1 pde.PDESolverOptions]

Create the geometry and include it in the model.

g = @squareg; geometryFromEdges(thermalmodel,g)

ans = AnalyticGeometry with properties: NumCells: 0 NumFaces: 1 NumEdges: 4 NumVertices: 4 Vertices: [4x2 double]

Assign material properties.

thermalProperties(thermalmodel,"ThermalConductivity",79.5,... "MassDensity",7850,... "SpecificHeat",450,... "Face",1)

ans = ThermalMaterialAssignment with properties: RegionType: 'face' RegionID: 1 ThermalConductivity: 79.5000 MassDensity: 7850 SpecificHeat: 450

Specify that the entire geometry generates heat at the rate of 25.

internalHeatSource(thermalmodel,25)

ans = HeatSourceAssignment with properties: RegionType: 'face' RegionID: 1 HeatSource: 25 Label: []

Apply insulated boundary conditions on three edges and the free convection boundary condition on the right edge.

thermalBC(thermalmodel,"Edge",[1,3,4],"HeatFlux",0); thermalBC(thermalmodel,"Edge",2,... "ConvectionCoefficient",5000,... "AmbientTemperature",25)

ans = ThermalBC with properties: RegionType: 'Edge' RegionID: 2 Temperature: [] HeatFlux: [] ConvectionCoefficient: 5000 Emissivity: [] AmbientTemperature: 25 Vectorized: 'off' Label: []

Set the initial conditions: uniform room temperature across domain and higher temperature on the left edge.

```
thermalIC(thermalmodel,25);
thermalIC(thermalmodel,100,"Edge",4)
```

ans = GeometricThermalICs with properties: RegionType: 'edge' RegionID: 4 InitialTemperature: 100

Specify the Stefan-Boltzmann constant.

thermalmodel.StefanBoltzmannConstant = 5.670367e-8;

Generate the mesh.

generateMesh(thermalmodel)

ans = FEMesh with properties: Nodes: [2x1529 double] Elements: [6x728 double] MaxElementSize: 0.1131 MinElementSize: 0.0566 MeshGradation: 1.5000 GeometricOrder: 'quadratic'

`thermalmodel`

now contains the following properties.

thermalmodel

thermalmodel = ThermalModel with properties: AnalysisType: "transient" Geometry: [1x1 AnalyticGeometry] MaterialProperties: [1x1 MaterialAssignmentRecords] HeatSources: [1x1 HeatSourceAssignmentRecords] StefanBoltzmannConstant: 5.6704e-08 BoundaryConditions: [1x1 ThermalBCRecords] InitialConditions: [1x1 ThermalICRecords] Mesh: [1x1 FEMesh] SolverOptions: [1x1 pde.PDESolverOptions]

## Version History

**Introduced in R2017a**

### R2022a: Reduced-order modeling for thermal analysis

You can now approximate the dynamics of the original system with a smaller system
while retaining most of the dynamic characteristics. See `reduce`

for details.

### R2021b: Sparse linear models for use with Control System Toolbox

### R2020a: Axisymmetric analysis

You can now specify `AnalysisType`

for axisymmetric models.
Axisymmetric analysis simplifies 3-D thermal problems to 2-D using their symmetry
around the axis of rotation.

## See Also

`createpde`

| `generateMesh`

| `geometryFromEdges`

| `geometryFromMesh`

| `importGeometry`

| `internalHeatSource`

| `thermalProperties`

| `pdegplot`

| `pdeplot`

| `pdeplot3D`

| `thermalBC`

| `thermalIC`

## MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)