Assign thermal properties of a material for a thermal model

`thermalProperties(`

assigns material properties, such as thermal conductivity, mass density, and
specific heat. For transient analysis, specify all three properties. For
steady-state analysis, specifying thermal conductivity is enough. This syntax sets
material properties for the entire geometry.`thermalmodel`

,'ThermalConductivity',`TCval`

,'MassDensity',`MDval`

,'SpecificHeat',`SHval`

)

For a nonconstant or nonlinear material, specify `TCval`

,
`MDval`

, and `SHval`

as function
handles.

`thermalProperties(___,`

assigns material properties for a specified geometry region.`RegionType`

,`RegionID`

)

returns the material properties object.`mtl`

= thermalProperties(___)

Assign material properties for a steady-state thermal model.

model = createpde('thermal','steadystate'); gm = importGeometry(model,'SquareBeam.STL'); thermalProperties(model,'ThermalConductivity',0.08)

ans = ThermalMaterialAssignment with properties: RegionType: 'cell' RegionID: 1 ThermalConductivity: 0.0800 MassDensity: [] SpecificHeat: []

Assign material properties for transient analysis.

thermalmodel = createpde('thermal','transient'); gm = importGeometry(thermalmodel,'SquareBeam.STL'); thermalProperties(thermalmodel,'ThermalConductivity',0.2,... 'MassDensity',2.7*10^(-6),... 'SpecificHeat',920)

ans = ThermalMaterialAssignment with properties: RegionType: 'cell' RegionID: 1 ThermalConductivity: 0.2000 MassDensity: 2.7000e-06 SpecificHeat: 920

Create a steady-state thermal model.

`thermalModel = createpde('thermal');`

Create nested cylinders to model a two-layered insulated pipe section, consisting of inner metal pipe surrounded by insulated material.

`gm = multicylinder([20,25,35],20,'Void',[1,0,0]);`

Assign geometry to the thermal model and plot the geometry.

thermalModel.Geometry = gm; pdegplot(thermalModel,'CellLabels','on','FaceAlpha',0.5)

Specify thermal conductivities for metal and insulation.

thermalProperties(thermalModel,'Cell',1,'ThermalConductivity',0.4)

ans = ThermalMaterialAssignment with properties: RegionType: 'cell' RegionID: 1 ThermalConductivity: 0.4000 MassDensity: [] SpecificHeat: []

thermalProperties(thermalModel,'Cell',2,'ThermalConductivity',0.0015)

ans = ThermalMaterialAssignment with properties: RegionType: 'cell' RegionID: 2 ThermalConductivity: 0.0015 MassDensity: [] SpecificHeat: []

Use function handles to specify a thermal conductivity that depends on temperature and specific heat that depends on coordinates.

Create a thermal model for transient analysis and include the geometry. The geometry is a rod with a circular cross section. The 2-D model is a rectangular strip whose *y*-dimension extends from the axis of symmetry to the outer surface, and whose *x*-dimension extends over the actual length of the rod.

thermalmodel = createpde('thermal','transient'); g = decsg([3 4 -1.5 1.5 1.5 -1.5 0 0 .2 .2]'); geometryFromEdges(thermalmodel,g);

Specify the thermal conductivity as a linear function of temperature, $\mathit{k}=40+0.003\mathit{T}$.

k = @(location,state)40 + 0.003*state.u;

Specify the specific heat as a linear function of the *y-*coordinate, $\mathit{cp}=500\mathit{y}$.

cp = @(location,state)500*location.y;

Specify the thermal conductivity, mass density, and specific heat of the material.

thermalProperties(thermalmodel,'ThermalConductivity',k,... 'MassDensity',2.7*10^(-6),... 'SpecificHeat',cp)

ans = ThermalMaterialAssignment with properties: RegionType: 'face' RegionID: 1 ThermalConductivity: @(location,state)40+0.003*state.u MassDensity: 2.7000e-06 SpecificHeat: @(location,state)500*location.y

`thermalmodel`

— Thermal model`ThermalModel`

objectThermal model, specified as a `ThermalModel`

object.
The model contains the geometry, mesh, thermal properties of the material,
internal heat source, boundary conditions, and initial conditions.

**Example: **`thermalmodel = createpde('thermal','steadystate')`

`RegionType`

— Geometric region type`'Face'`

for a 2-D model | `'Cell'`

for a 3-D modelGeometric region type, specified as `'Face'`

or
`'Cell'`

.

**Example: **`thermalProperties(thermalmodel,'Cell',1,'ThermalConductivity',100)`

**Data Types: **`char`

| `string`

`RegionID`

— Geometric region IDvector of positive integers

Geometric region ID, specified as a vector of positive integers. Find the
region IDs by using `pdegplot`

.

**Example: **`thermalProperties(thermalmodel,'Cell',1:3,'ThermalConductivity',100)`

**Data Types: **`double`

`TCval`

— Thermal conductivity of the materialpositive number | matrix | function handle

Thermal conductivity of the material, specified as a positive number, a matrix, or a function handle. You can specify thermal conductivity for a steady-state or transient model. In case of orthotropic thermal conductivity, use a thermal conductivity matrix.

Use a function handle to specify the thermal conductivity that depends on space, time, or temperature. The function must be of the form

TCval = TCfun(location,state)

The solver passes `location`

data as a structure array
with the fields `location.x`

,
`location.y`

, and, for 3-D problems,
`location.z`

. The `state`

data is a
structure array with the fields `state.u`

,
`state.ux`

, `state.uy`

,
`state.uz`

(for 3-D problems), and
`state.time`

(for transient problems). The
`state.u`

field contains the solution vector. The
`state.ux`

, `state.uy`

,
`state.uz`

fields are estimates of the solution’s
partial derivatives at the corresponding points of the location structure.
The `state.time`

field contains time at evaluation
points.

`TCfun`

must return a matrix `TCval`

with number of rows equal to 1, `Ndim`

,
`Ndim*(Ndim+1)/2`

, or `Ndim*Ndim`

,
where `Ndim`

is 2 for 2-D problems and 3 for 3-D problems.
The number of columns must equal the number of evaluation points, ```
M
= length(location.x)
```

. For details about dimensions of the
matrix, see c Coefficient for specifyCoefficients.

**Example: **`thermalProperties(thermalmodel,'Cell',1,'ThermalConductivity',100)`

or
`thermalProperties(thermalmodel,'ThermalConductivity',[80;10;80])`

for orthotropic thermal conductivity

**Data Types: **`double`

| `function_handle`

`MDval`

— Mass density of the materialpositive number | function handle

Mass density of the material, specified as a positive number or a function handle. Specify this property for a transient thermal conduction analysis model.

Use a function handle to specify the mass density that depends on space, time, or temperature. The function must be of the form

MDval = MDfun(location,state)

The solver passes `location`

data as a structure array
with the fields `location.x`

,
`location.y`

, and, for 3-D problems,
`location.z`

. The `state`

data is a
structure array with the fields `state.u`

,
`state.ux`

, `state.uy`

,
`state.uz`

(for 3-D problems), and
`state.time`

(for transient problems). The
`state.u`

field contains the solution vector. The
`state.ux`

, `state.uy`

,
`state.uz`

fields are estimates of the solution’s
partial derivatives at the corresponding points of the location structure.
The `state.time`

field contains time at evaluation
points.

`MDfun`

must return a row vector `MDval`

with the number of columns equal to the number of evaluation points,
`M = length(location.x)`

.

**Example: **`thermalProperties(thermalmodel,'Cell',1,'ThermalConductivity',100,'MassDensity',2730e-9,'SpecificHeat',910)`

**Data Types: **`double`

| `function_handle`

`SHval`

— Specific heat of the materialpositive number | function handle

Specific heat of the material, specified as a positive number or a function handle. Specify this property for a transient thermal conduction analysis model.

Use a function handle to specify the specific heat that depends on space, time, or temperature. The function must be of the form

SHval = SHfun(location,state)

The solver passes `location`

data as a structure array
with the fields `location.x`

,
`location.y`

, and, for 3-D problems,
`location.z`

. The `state`

data is a
structure array with the fields `state.u`

,
`state.ux`

, `state.uy`

,
`state.uz`

(for 3-D problems), and
`state.time`

(for transient problems). The
`state.u`

field contains the solution vector. The
`state.ux`

, `state.uy`

,
`state.uz`

fields are estimates of the solution’s
partial derivatives at the corresponding points of the location structure.
The `state.time`

field contains time at evaluation
points.

`SHfun`

must return a row vector `SHval`

with the number of columns equal to the number of evaluation points,
`M = length(location.x)`

.

**Example: **`thermalProperties(thermalmodel,'Cell',1,'ThermalConductivity',100,'MassDensity',2730e-9,'SpecificHeat',910)`

**Data Types: **`double`

| `function_handle`

`mtl`

— Handle to material propertiesobject

Handle to material properties, returned as an object.
`mtl`

associates material properties with the
geometric region.

A modified version of this example exists on your system. Do you want to open this version instead?

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.

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: .

Select web siteYou can also select a web site from the following list:

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

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

- 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)