About Using Materials in COMSOL Multiphysics
Using the Materials in the Physics Settings
The physics setup in a model is determined by a combination of settings in the Materials and physics nodes. When the first material is added to a Component node, COMSOL Multiphysics automatically assigns that material to all domains in the geometry (or all boundaries or edges if the Component only contains surfaces or edges). Different geometric entities can have different materials. The following example uses the heat_sink.mph model file contained in the Heat Transfer Module and CFD Module Applications Libraries.
Figure 9-2: Assigning materials to a heat sink model. Air is assigned as the material to the box surrounding the heat sink, and aluminum to the heat sink itself.
If a geometry consists of a heat sink in a container, Air can be assigned as the material in the container surrounding the heat sink and Aluminum as the heat sink material itself (see Figure 9-2). The Conjugate Heat Transfer interface, selected during model setup, uses a Fluid model to simulate nonisothermal flow, with heat transfer by convection and conduction, in the box surrounding the heat sink, and a Heat Transfer in Solids model to simulate heat conduction in the heat sink. The Heat Transfer in Solids 1 settings use the material properties associated to the Aluminum 3003-H18 materials node, and the Fluid 1 settings define the flow using the Air material properties. The other nodes under Conjugate Heat Transfer define the initial and boundary conditions.
All physics node properties automatically use the correct material properties from the Material nodes when the default From material setting is used. This means that one node can be used to define the physics across several domains with different materials; the COMSOL Multiphysics software then uses the material properties from the different materials to define the physics in each domain.
There are also some physics nodes where you can explicitly select a material from which material properties are retrieved (for example, the Settings window for Fluid Properties for two-phase flow modeling). The default setting is then typically to use the Domain material on each domain (that is, the materials defined on the same domains as the physics that uses the material data). In addition to the Domain material, you can select any other material that is present in the Component, regardless of its selection. The selected material’s properties are then applied to all domains in the feature’s selection.
Evaluating and Plotting Material Properties
You can access the material properties for evaluation and plotting like other variables in a model using the following variable naming conventions and namespaces:
To access a material property throughout the model (across several materials) and not just in a specific material, use the special material namespace root.material. For example, root.material.rho is the density ρ as defined by the materials in each domain in the geometry. For plotting, you can type the expression material.rho to create a plot that shows the density of all materials. This shorthand syntax is available for materials in the Basic (with the tag def) material property group, but you can also access the density in the Basic material property group namespace as material.def.rho.
For an anisotropic property such as the electrical conductivity, its values are available as material.def.sigma11, material.def.sigma12, and so on. If such a property is set as isotropic for some material, material.def.sigma_iso represents that isotropic value.
For properties in property groups other than the Basic group, the full namespace must be used, including the property group name. For example, to access the initial yield stress sigmags for elastoplastic materials in the Elastoplastic Material Model property group, use material.ElastoplasticModel.sigmags.
If you use a temperature-dependent material, each material contribution asks for a special model input. For example, rho(T) in a material mat1 asks for root.mat1.def.T, and you need to define this variable (T) manually — if the temperature is not available as a dependent variable — to make the density variable work.
To access a material property from a specific material, you need to know the names for the material and the property group. Typically, for the first material (Material 1) the name is mat1 and most properties reside in the default Basic property group with the name def. The variable names appear in the Variable column in the table under Output properties in the Settings window for the property group; for example, Cp for the heat capacity at constant pressure. The syntax for referencing the heat capacity at constant pressure in Material 1 is then mat1.def.Cp. Some properties are anisotropic tensors, and each of the components can be accessed, such as mat1.def.k11, mat1.def.k12, and so on, for the thermal conductivity. The numbers 1, 2, and 3 denote the first, second, and third direction, respectively, in the active coordinate system. In the general case, you can define a 3-by-3 tensor, for example, kij in the order k11, k21, k31, k12, k22, k32, k13, k23, and k33. For material properties that are functions, call these with input arguments such as mat1.def.rho(pA,T) where pA and T are numerical values or variables representing the absolute pressure and the temperature, respectively. Functions can be plotted directly from the function nodes’ Settings window by first specifying suitable ranges for the input arguments. If a possibly anisotropic property is defined as isotropic, you can access its value as mat1.def.k_iso, for example.
Material Link nodes define all properties of the current source material in the Material Link’s namespace. For example, for the node Material Link 1 (matlnk1), the density of the currently selected source material is available as matlnk1.def.rho.
Material Switch nodes define variables similarly to Material Link nodes. For example, during a material sweep over the children of Switch 1 (sw1), you can access the density of the material used in the current sweep step as sw1.def.rho.
Many physics interfaces also define variables for the material properties that they use. For example, solid.rho is the density in the Solid Mechanics interface and is equal to the density in a material when it is used in the domains where the Solid Mechanics interface is active. If you define the density in the Solid Mechanics interface using another value, solid.rho represents that value and not the density of the material. If you use the density from the material everywhere in the model, solid.rho and material.rho are identical.
To see the domain groups (that is, groups of domains with equal material settings), the variable root.material.domain — and, for lower-dimensional entities when applicable, root.material.boundary, root.material.edge, and root.material.point — is available and evaluates to unique integer values for each domain group.
For all property groups except the Basic group, changing the name in the Name field also changes the tag, which is what is used in the namespace for accessing material properties.
The Material Type Section
The Material type setting, available on some physics node Settings windows, decides how materials behave and how material properties are interpreted when the mesh is deformed. Select Solid for materials whose properties change as functions of material strain, material orientation, and other variables evaluated in a material reference configuration (material frame). Select Nonsolid for materials whose properties are defined only as functions of the current local state at each point in the spatial frame, and for which no unique material reference configuration can be defined. Select From material to pick up the corresponding setting from the domain material on each domain.