Material Properties
The Material node of the model object stores the material properties. In this example, the Joule Heating interface is used to include both an electric current and a heat balance. Thus, the electric conductivity, heat capacity, relative permittivity, density, and thermal conductivity of the materials all need to be defined.
The busbar is made of copper and the bolts are made of titanium. The properties you need for these two materials are listed in the table below:
To define material properties using the COMSOL API, you can either create the material from scratch or import the material data from another model MPH file. In this example you will first create the Copper material node from scratch and then import the Titanium material data from an existing model from the Application library.
1
mat1 = comp1.material.create('mat1');
2
Set the properties for the 'electricconductivity', 'heatcapacity', 'relpermittivity', 'density' and 'thermalconductivity' according to the table above:
mat1.materialModel('def').set('electricconductivity', {'5.998e7[S/m]'});
mat1.materialModel('def').set('heatcapacity', '385[J/(kg*K)]');
mat1.materialModel('def').set('relpermittivity', {'1'});
mat1.materialModel('def').set('density', '8700[kg/m^3]');
mat1.materialModel('def').set('thermalconductivity', {'400[W/(m*K)]'});
3
Set the name of the material to 'Copper'. By default the first material is assigned to all domains:
mat1.label('Copper');
Now, import Titanium material data from the busbar model MPH file, which is available in the COMSOL Multiphysics Application Library.
4
modelRef = '<COMSOL_path>\applications\COMSOL_Multiphysics\    Multiphysics\busbar.mph';
ModelUtil.scanModel(modelRef,'Material','op')
where <COMSOL_path> is the path of your COMSOL installation root directory. From the output, one can see that the material node contains two materials. The second material mat2 is the one defining Titanium beta-21S data and that is the one you will import in the model in the steps below.
5
Import material mat2 from the model busbar.mph to the material node of the current model:
comp1.material.insert(modelRef,'mat2','');
6
comp1.material('mat2').selection.named('sel1');
Only one material per domain can be assigned. This means that the last operation automatically removes the bolts from the selection of the copper material.