Mathematica® and COMSOL Multiphysics® Simulation Software: A Powerful Workflow for Creating General FE Formulations

P. Patki[1], F. Costanzo[1]
[1]Pennsylvania State University, USA
Published in 2019

Our research group focuses on multi-physics biomechanics problems, some of which are not solvable using available modules. The PDE interfaces of COMSOL Multiphysics® simulation software, with their intuitive input syntax, have therefore become for us very valuable tools to advance our research. The problems we solve regularly include large deformation, arbitrary Lagrangian—Eulerian (ALE) schemes, and stabilization. For the latter, we have used various methods including SUP/G [1] and the virtual multiscale method (VMM) [2]. Our group has developed a workflow that allows us to quickly deploy and test FE formulations of almost any complexity. This was possible by using the symbolic manipulation of Wolfram’s Mathematica® (although other programs can also be used) and translating Mathematica® expressions into COMSOL Multiphysics® syntax, which made this step very straightforward. The objective of this presentation is to demonstrate the use of the said workflow.

We begin with a formulation in “paper and pencil”. The formulation can involve any number of scalar, vector, and tensor unknowns and their spatial and temporal derivatives. To input the formulation into, say, the Weak Form PDE interface, one must type it in COMSOL Multiphysics® or into a text file to be imported. For complex problems this task can be daunting and very prone to hard-to-find mistakes. To minimize errors and also to facilitate verification by the method of manufactured solutions (MMS) [3], we then proceed to write the formulation in Mathematica®. All the derivatives and coordinate transformations required by the formulations are computed by Mathematica®. We then use Mathematica® code that we have developed to translate Mathematica® expressions into text input for COMSOL Multiphysics®. The verification step by the MMS requires error estimation and convergence studies. This is easily performed within COMSOL Multiphysics® using the “Integration” operator part of the “Components Couplings” feature of FE models. A convergence study can be easily carried out by way of a “Parametric Study” study step, with the parameter being the mesh diameter.

In this presentation we will demonstrate the use of our workflow via an elementary example, namely, linear isotropic elasticity in 3D. We will then present a more complex problem involving the application of the VMM stabilization in an ALE formulation of a flow through a porous medium problem with axisymmetric geometry. We note that the VMM stabilization relies on COMSOL’s bubble functions. These examples show that COMSOL Multiphysics® is a formidable computing tool as well as a transparent teaching tool for use in graduate as well as undergraduate FEM courses. In fact, F. Costanzo has used COMSOL Multiphysics® in his graduate-level course to illustrate a broad range of topics, including error estimation, convergence, and penalty methods.

REFERENCES

[1] A. N. Brooks and T. J. R. Hughes, Computer Methods in Applied Mechanics and Engineering, 32 (1982), pp. 100–259.

[2] T. J. R. Hughes, et al., Computer Methods in Applied Mechanics and Engineering, 166 (1998), pp. 3–24.

[3] K. Salari and P. Knupp, Code verification by the method of manufactured solutions, Sandia National Laboratories, 2000.