## Geometric Kernels in COMSOL Multiphysics®

##### Lorant Olasz April 16, 2014

The *geometric kernel* is the software component responsible for handling geometry in COMSOL Multiphysics®. You may be wondering what this means or how and why you would use it when modeling. Let’s find out.

### The Geometry in the Simulation Process

Creating or importing a geometry is usually the first step in the COMSOL Multiphysics modeling process. Depending on the goal of our simulation, the geometry can be either a realistic or an idealized representation of a device.

There are various ways to build a geometry. For example, we can draw shapes on a work plane and extrude them, or we can create a solid object and combine it with other solid objects to obtain a final shape. On some occasions, the device we are drawing consists of several parts. To be able to apply different material settings, we would need to draw these parts as separate solid objects.

Imported geometry from a CAD file, for example, often needs repair or simplification by removing small, or otherwise unnecessary, details. In the COMSOL® software, we can draw new shapes to complement imported objects. Regardless of how we create the geometry, we can always go back and edit the various operations (which are collected in the geometry sequence under the *Geometry* node in the Model Builder).

After we create the geometry, we can proceed to define the physics, include material and boundary settings, and then mesh the geometry. If necessary, we can go back to modify the design, in which case the physics settings are retained on the domains and boundaries we have originally selected. Before solving, we create the finite element mesh that should provide an adequate approximation of the geometry. Finally, we evaluate the results of the simulation by plotting them on the geometry.

*Geometry of a wheel rim during the various stages of a fatigue analysis.*

### The Mathematician Behind the Scenes

In COMSOL Multiphysics, the *geometric kernel* is the software component that ensures that all of the above functions work smoothly. The kernel keeps track of the mathematical representations of the geometrical objects we draw or import. It has functions and algorithms for constructing these objects and the interactions between them, such as joining or intersecting. Additionally, there is a part of the geometric kernel that ensures that the geometry is associative, i.e., we can modify it without a need to reapply physics settings. Furthermore, the kernel can also provide information about the geometry for other software components, such as calculating projections or surface curvature for the mesher.

### Not One, but Two Geometric Kernels

Geometric kernels can be configured to do different tasks. To ensure the best possible performance, the COMSOL software provides not one, but two kernels. It includes the COMSOL kernel, which works best with geometry created in the software. To handle imported CAD geometry, the CAD Import Module and LiveLink™ for CAD products package a dedicated geometric kernel, the Parasolid® kernel (called the CAD Import Module kernel in the UI).

The Parasolid® kernel provides repair functionality for imported CAD designs. It also includes functionality that enables simplification of the geometry — to delete fillets or holes, for example. There is more to it than the repair and defeaturing of imported objects, however. The usual geometry operations are also implemented by the Parasolid® kernel. This means that even when using this kernel, we can create and modify geometry, including imported CAD objects.

*Removing holes and other details from a geometry during defeaturing.*

### Selecting the Geometric Kernel

When we install COMSOL Multiphysics with a license that includes the CAD Import Module or one of the LiveLink™ products for CAD, the Parasolid® kernel is set to default when starting a new model. However, we can easily change this setting in the *Preferences* window.

To check and change the geometric kernel in a model component after we have started modeling, we can click the Geometry node in the Model Builder to navigate to the Geometry settings window.

By changing the *Geometry representation* in the settings, we can control which kernel handles the geometry in the current model component. Changing the kernel requires a rebuild of the geometry sequence by using the kernel we have switched to. The geometry sequence cannot be rebuilt using the COMSOL kernel if it includes any operations that are only available with the CAD Import Module kernel. These operations include those that appear under *Defeaturing* and *Repair* in the *Geometry* toolbar and the *Import* feature (if the imported file is of a format supported by the CAD Import Module). In these situations, we can convert the geometry objects to be used with the COMSOL kernel, as shown below.

### Converting Geometry Objects

When we import geometry from a CAD file, we often prepare it for analysis by using the repair and defeaturing operations available with the CAD Import Module kernel. Even though the CAD Import Module is needed to open a model containing such a geometry sequence, there is a simple two-step process to share the geometry in COMSOL format. First, we convert the defeatured geometry objects to the COMSOL format. You can find the Convert to COMSOL operation under *Conversions* in the *Geometry* toolbar, as shown below.

Second, we export the converted geometry objects to the COMSOL Multiphysics format (.mphbin or .mphtxt).

### Further Reading

- Learn more about the availability of geometry modeling operations
- CAD Import Module
- LiveLink™ products for CAD:

*Parasolid is a registered trademark of Siemens Product Lifecycle Management Software Inc. or its subsidiaries in the United States and in other countries. All other trademarks are the property of their respective owners, and COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by, sponsored by, or supported by those, or the above, non-COMSOL trademark owners. For a list of such trademark owners, see www.comsol.com/trademarks.*

## Comments

Josh ThomasApril 22, 2014 11:19 amLorant,

Thanks for the informative article.

You mentioned that the “Convert to COMSOL” operation can be used to share geometries in COMSOL format. This I see is helpful for sharing with those without the CAD Import Module.

But, are there any other advantages to using the COMSOL kernel over the Parasolid kernel? For example, is one kernel faster than the other for large amounts of imports or complicated imports? I see that the Parasolid kernel is the default if you have the appropriate licenses. But, I am wondering if there may be cases where it would make sense to use the “Convert to COMSOL” functionality even if I am not planning on sharing my geometries.

Thanks,

Josh Thomas

Lorant OlaszApril 24, 2014 11:21 amThanks for your comments Josh.

I currently can’t think of any other reasons to convert geometry to COMSOL format. If you import CAD objects it is best to keep those in the default Parasolid format.