COMSOL Tips & Tricks

Published: Wed, 10/01/14

Greetings! Here's another COMSOL Tips & Tricks to consider... just before the COMSOL Conference next week. We hope to see you there!

COMSOL Multiphysics has many powerful "built-in" capabilities.  Recently, we learned how to use one particular set of features that have turned out to be very useful and practical.  Sometimes it is desirable to calculate the average of an expression over a specified shape surrounding a location.  COMSOL Multiphysics has a set of built-in operators that do just this using a sphere in 3D or a circle in 2D.  The user must specify the radius of the sphere or circle as well as the expression and the resolution of the operation.  For example,

In 3D, you can also calculate the average of the expression on the surface of the sphere of given radius rather than over its volume.  To do this, you may use the sphavg() operator instead of the ballavg() operator.  In 2D, there are analogous operations available which substitute a circle for a sphere. To summarize the difference between the different operators in 3D and 2D see the following table:

One final point on using these operators that we'd like to pass along is that for large 3D models we highly recommend using the 'no. of averaging points' argument to decrease the default, full resolution of this operation.  If no argument is given, COMSOL Multiphysics will default to using all node points within the sphere or on the the surface of the sphere.  In our experience, this operation can take 15-30 minutes to refresh plotting if it is being used on contour plots.  As shown above, we have selected to use only 10 averaging points for the ballavg() operation and in our experience this resolution gives a good compromise of accuracy versus time to plot.  We recommend using this number as a starting point.

Until next time...

Jeff & Kyle

PS. Maybe you have some question about this or other Tips & Tricks you would like to ask us at the conference?

Phone: 614-861-7015