Efficiently Assign Materials in Your COMSOL Multiphysics® Model

September 20, 2016

To optimize your modeling processes, there are a number of built-in materials available for you to use in the COMSOL Multiphysics® software. Along with these materials are features and functionality that allow you to efficiently assign materials to geometric entities in your model. These tools help expedite the process of assigning materials, specifying material properties, and even comparing the impact of different materials on your simulation results. Here, we’ll highlight three tutorial videos that showcase how to use such tools.

Conduct Material Sweeps to Automate Comparing Materials

When assigning materials to your model geometry, you may want to experiment with a few options and see how different materials affect your simulation results. In COMSOL Multiphysics, you can automate this process via the Material Sweep parametric study and Material Switch feature. As such, you do not need to add several materials one at a time and compute for the corresponding solution. In addition to saving you time during model set up, this facilitates the comparison of results during postprocessing.

Switching between different simulation results based on the material.
Screenshot from the material sweeps video, showcasing the ability to switch between different results based on the material.

The Material Switch node houses the materials that you want to sweep over and provides functionality to automatically switch materials while your model is solving.

In the five-minute tutorial video below, we outline the procedure for performing a material sweep in your model and then walk you through the steps for doing so. This includes adding a Material Switch node; specifying parts of the geometry that the material sweep will be applied to; selecting the materials to switch between; adding the Material Sweep parametric study; and finally postprocessing the sweep’s results. We also briefly discuss how you can customize the materials being swept over as well as how to easily toggle between different sets of results obtained from your material sweep.

Video Tutorial: How to Sweep and Compare Materials in COMSOL Multiphysics

Easily Define Material Properties Using Material Functions

As mentioned earlier, COMSOL Multiphysics features a large collection of built-in materials that are available regardless of which modules you hold a license for. Upon adding any of these materials to your model, you will notice that the material properties are provided with certain default values.

In some cases, material properties are constant. In other cases, they may vary in space or be dependent on a physics variable such as temperature. If you want to make a constant material property variable, or if the built-in variation is not what you want to use, you can define your own function. In COMSOL Multiphysics, there are three types of functions that you can use to define a material property: Interpolation, Analytic, and Piecewise functions.

Screenshot showing a data table and plot for an Interpolation function in COMSOL Multiphysics.
Data table and plot for an Interpolation function.

Interpolation functions are used to define a material property through reading in data from a table or file that contains values of the function at discrete points. You can enter this data manually or import it from an external file. This is useful when you have material properties that are obtained from experiments. COMSOL Multiphysics will automatically evaluate and then generate a function that fits the data you provide. Then, you can also choose how the function interpolates between the measured values or extrapolates outside of your specified range of data.

The input fields and plot for an Analytic function.
Input fields and plot for an Analytic function.

Analytic functions are used to define a function using built-in mathematical functions or other user-defined functions. You can enter an expression, specify the input arguments, and define the value range for each of the arguments in your equation.

Settings for a Piecewise function, one of the functions that can be used to define a material property in COMSOL Multiphysics.
Settings for a Piecewise function.

Piecewise functions are used to define a material property using different expressions over different intervals. The start and end point for each set of values, as well as the function applicable to that interval, can be entered manually or imported from an external file. The intervals that you define cannot overlap and there cannot be any holes between the intervals. That way, you have a continuous function uniquely defined in terms of the independent variable.

In the following seven-minute tutorial video, we discuss how to create and define Interpolation, Analytic, and Piecewise functions for any material property in your model, the advantages of using each type, and best practices to keep in mind when creating them. We also go over the settings for each function type, demonstrate how the selection of options such as Extrapolation will change your data plot, and show how you can call out your function in the Material Contents table.

Video Tutorial: Use Functions to Define a Material Property

Utilize Global Materials and Material Links for Multiple Components

While creating a model in COMSOL Multiphysics, you will at some point need to identify the materials that your objects are made of. Normally, this requires completing a series of steps in which you open the Add Material or Material Browser windows; choose the material; select and add it to your component; and then go into the material node’s settings to select the parts of the geometry to which the material applies. You would then need to repeat this procedure for each unique material that you want to include in your simulation. In COMSOL Multiphysics, you can expedite the above process using global materials and material links.

Screenshot showing the use of global materials and material links functionality.
Screenshot displaying use of the global materials and material links functionality.

When a material is added under the Global Materials node, it is available to use anywhere throughout the model. Further, global materials can be used for any geometric entity level, whether you assign them to domains, boundaries, edges, or points.

Material links are used locally under a component’s material node to refer to a global material. This is advantageous when you have a COMSOL Multiphysics file that contains multiple components that are made up of similar materials, as you only need to specify the material once under the Global Materials node and can then link to it under each individual component. It is also beneficial for models in which the same material is assigned to different geometric entity levels such as domains and boundaries. In this case, you would again only need to add the material once and could also add a separate Material Link node for each geometric entity type.

In the six-minute tutorial video below, we show you how to use the global materials and material links functionality. We begin by demonstrating how to add global materials to your model and discuss the differences between adding materials globally and locally. Then, we walk through the steps of how to add material links to your model components and assign them to the geometry. After watching this video, we encourage you to try out this functionality yourself and see firsthand the ease with which you can assign materials in a model that contains multiple components or when you want to use the same materials on multiple parts.

Video Tutorial: Use the Same Material for Multiple Components in COMSOL Multiphysics

Efficiently Define the Materials Used in Your Simulation Studies

You can significantly expedite the process of assigning materials to your model geometry using the features and functionality discussed here. To complement these tools, we’ve created instructional videos to help you learn how to utilize them in your own simulations. Whether you have a model file that involves multiple components, need to define a complicated material property, or have to test different materials in your simulation, COMSOL Multiphysics features built-in tools that make this process simpler and more efficient for you.

Browse Additional Tutorial Videos Relating to Materials

Comments (1)

Leave a Comment
Log In | Registration
Ivar Kjelberg
Ivar Kjelberg
September 21, 2016

Hi, thanks for the nice demos and reminding us about all your Videos.

One little note though 😉
I find that you could do slightly better by being more systematic in the “Units cells”.
Your material database never includes any units, although your functions allow the use of units.
I have noticed that most errors I see in the models on the Forum and made by my colleagues (and sometimes made by myself I should state too) are related to the temperature dependence on the material defined in [degC] and entered as is in [K] default Si units within COMSOL.

By being more systematic, particularly as everything is implemented in COMSOL, we would more easily identify these errors, and we will win report graphs of material properties WITH UNITS !

Thanks for your interesting Blogs,
and have fun COMSOLing