Main Content

findHeatSource

(To be removed) Find heat source assigned to a geometric region

findHeatSource will be removed. Use the CellLoad and FaceLoad properties of femodel instead. (since R2023a) For more information on updating your code, see Version History.

Description

hsa = findHeatSource(heatSources,RegionType,RegionID) returns the heat source value hsa assigned to the specified region.

example

Examples

collapse all

Create a thermal model that has three faces.

thermalmodel = createpde("thermal");
geometryFromEdges(thermalmodel,@lshapeg);
pdegplot(thermalmodel,"FaceLabels","on")
ylim([-1.1 1.1])
axis equal

Figure contains an axes object. The axes object contains 4 objects of type line, text.

Specify that face 1 generates heat at 10 W/m^3, face 2 generates heat at 20 W/m^3, and face 3 generates heat at 30 W/m^3.

internalHeatSource(thermalmodel,10,"Face",1);
internalHeatSource(thermalmodel,20,"Face",2);
internalHeatSource(thermalmodel,30,"Face",3);

Check the heat source specification for face 1.

hsaFace1 = findHeatSource(thermalmodel.HeatSources,"Face",1)
hsaFace1 = 
  HeatSourceAssignment with properties:

    RegionType: 'face'
      RegionID: 1
    HeatSource: 10
         Label: []

Check the heat source specification for faces 2 and 3.

hsa = findHeatSource(thermalmodel.HeatSources,"Face",[2 3]);
hsaFace2 = hsa(1)
hsaFace2 = 
  HeatSourceAssignment with properties:

    RegionType: 'face'
      RegionID: 2
    HeatSource: 20
         Label: []

hsaFace3 = hsa(2)
hsaFace3 = 
  HeatSourceAssignment with properties:

    RegionType: 'face'
      RegionID: 3
    HeatSource: 30
         Label: []

Input Arguments

collapse all

Internal heat source of the model, specified as the HeatSources property of a ThermalModel object.

Example: thermalmodel.HeatSources

Geometric region type, specified as "Face" for a 2-D model or "Cell" for a 3-D model.

Data Types: char | string

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

Data Types: double

Output Arguments

collapse all

Heat source assignment, returned as a HeatSourceAssignment Properties object.

Version History

Introduced in R2017a

collapse all