Introduction To COMSOLMultiphysics
Introduction To COMSOLMultiphysics
COMSOL Multiphysics
Introduction to COMSOL Multiphysics
© 1998–2023 COMSOL
Protected by patents listed on www.comsol.com/patents, or see Help>About COMSOL Multiphysics on the File
menu in the COMSOL Desktop for less detailed lists of U.S. Patents that may apply. Patents pending.
This Documentation and the Programs described herein are furnished under the COMSOL Software License
Agreement (www.comsol.com/sla) and may be used or copied only under the terms of the license agreement.
COMSOL, the COMSOL logo, COMSOL Multiphysics, COMSOL Desktop, COMSOL Compiler, COMSOL Server,
and LiveLink are either registered trademarks or trademarks of COMSOL AB. 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 trademark owners. For a list of such trademark owners, see www.comsol.com/
trademarks.
Version: COMSOL 6.2
Contact Information
Visit the Contact COMSOL page at www.comsol.com/contact to submit general inquiries or
search for an address and phone number. You can also visit the Worldwide Sales Offices page at
www.comsol.com/contact/offices for address and contact information.
If you need to contact Support, an online request form is located on the COMSOL Access page
at www.comsol.com/support/case. Other useful links include:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
COMSOL Desktop® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Example 1: Structural Analysis of a Wrench. . . . . . . . . . . . . . . . 38
Model Wizard. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Global Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Physics and Boundary Conditions . . . . . . . . . . . . . . . . . . . . . 48
Mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Convergence Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Example 2: The Busbar — A Multiphysics Model . . . . . . . . . . . 75
Model Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Global Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
The Auto Completion and Find Tools . . . . . . . . . . . . . . . . . 83
Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Physics and Boundary Conditions . . . . . . . . . . . . . . . . . . . . . 96
Mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
|3
Building an Application with the Application Builder . . . . . 117
Overview of Advanced Topics. . . . . . . . . . . . . . . . . . . . . . . 134
Advanced Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Parameters, Functions, Variables, and Couplings . . . . . . . . . 136
Material Properties and Material Libraries . . . . . . . . . . . . . . 141
Adding Meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Adding Physics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Parametric Sweeps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Parallel Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
COMSOL Multiphysics Client–Server . . . . . . . . . . . . . . . . . 185
Using the Model Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Creating a Local Database . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Working with a Draft of the Model . . . . . . . . . . . . . . . . . . . 199
Comparing Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Excluding Built, Computed, and Plotted Data . . . . . . . . . . . 208
Importing Auxiliary Data to the Database . . . . . . . . . . . . . . 210
The Model Manager Workspace . . . . . . . . . . . . . . . . . . . . . 212
Appendix A — Building a Geometry . . . . . . . . . . . . . . . . . . . . 214
Appendix B — Keyboard and Mouse Shortcuts . . . . . . . . . . . 231
Appendix C — Language Elements and Reserved Names . . 239
Appendix D — File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Appendix E — Connecting with LiveLink™ Add-Ons . . . . . . 263
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
4|
Introduction
|5
COMSOL Desktop ®
MODEL MANAGER — Click this button to switch to QUICK ACCESS TOOLBAR — Use these
the Model Manager for managing different versions of buttons for access to functionality such as file
your models. open/save, undo/redo, copy/paste, and delete.
APPLICATION BUILDER —
Click this button to switch to
the Application Builder and
start building an application
based on your model.
MODEL BUILDER
TOOLBAR
6|
RIBBON — The ribbon tabs have buttons
and drop-down lists for controlling all
steps of the modeling process. GRAPHICS WINDOW TOOLBAR
|7
The screenshot on the previous pages is what you will see when you first start
modeling in COMSOL Multiphysics using the Model Builder. The COMSOL
Desktop® user interface provides a complete and integrated environment for
physics modeling and simulation as well as application design, providing you with
the tools necessary to build a user-friendly interface for your models. You can
customize the desktop to your own needs. The windows can be resized, moved,
docked, and detached. Any changes you make to the layout will be saved when
you close the session and available again the next time you open COMSOL
Multiphysics. As you build your model, additional windows and widgets will be
added. (See page 28 for an example of a more developed desktop.) Among the
available windows and user interface components are the following:
Ribbon
The ribbon at the top of the desktop gives access to commands used to complete
most modeling tasks. The ribbon is only available in the Windows® version of the
COMSOL Desktop environment and is replaced by menus and toolbars in the
macOS and Linux versions. Click the Application Builder button to switch from
the Model Builder to the Application Builder and start building an application
based on your model.
Settings Window
This is the main window for entering all of the specifications of the model,
including the dimensions of the geometry, properties of the materials, boundary
conditions and initial conditions, and any other information that the solver will
8|
need to carry out the simulation. The picture below shows the Settings window for
the Geometry node.
Plot Windows
These are the windows for graphical output. In addition to the Graphics window,
Plot windows are used for visualizing results. Several Plot windows can be used to
show multiple results simultaneously. A special case is the Convergence Plot
window, an automatically generated Plot window that displays a graphical
indication of the convergence of the solution process while a model is running.
Information Windows
These are the windows for nongraphical information. They include:
• Messages: Various information about the current COMSOL Multiphysics
session is displayed in this window.
• Progress: Progress information from the solver in addition to stop buttons.
• Log: Information from the solver, such as the number of degrees of freedom,
solution time, and solver iteration data.
• Table: Numerical data in table format as defined in the Results node.
• External Process: Provides a control panel for cluster, cloud, and batch jobs.
|9
Other Windows
The Windows drop-down list in the Home tab of the ribbon gives you access to all
COMSOL Desktop windows. On macOS and Linux, you will find this in the
Windows menu. In addition to the windows described earlier, you can access the
following windows:
• Add Physics and Add Multiphysics: Expand the physics interfaces in a model.
• Add Study: Change the type of study.
• Add Predefined Plot: Add a predefined plot associated with a physics interface.
Predefined plots are only available for certain physics interfaces.
• Add Material from Library and the Material Browser: Access the material
property libraries.
• Application Libraries: Choose among the collections of MPH-files containing
tutorial models and runnable applications with accompanying documentation.
• Part Libraries: Load one of the predefined parameterized geometry models.
• Add-in Libraries: Load one of the add-ins that provides customized
functionality.
• Selection List: Show a list of geometry objects, domains, boundaries, edges,
and points that are currently available for selection.
• Properties: View model tree node properties.
• Auxiliary Data: View auxiliary data associated with the model such as
interpolation files or CAD files.
• Messages: Display information after an operation is performed.
• Debug Log: Display debug information for methods.
• Table: Display results in table format.
• External Process: Control COMSOL Multiphysics processes running
separately.
• Comparison Result: Compare the Model Builder and Application Builder
settings of two MPH-files.
• Find and Replace: Enter a search string for finding it in the model’s settings,
tags, labels, tables, etc.
• Versions: Display model versions stored in a Model Manager database.
• Recovery Files: View recovery files.
• Physics Builder Manager: Compile user-defined physics interfaces. This is only
visible if the Physics Builder has been activated in Preferences.
10 |
The Progress Bar with a button for canceling the current computation, if any, is
located in the lower right-hand corner of the COMSOL Desktop interface.
Dynamic Help
The Help window provides context-dependent help texts about windows and
model tree nodes. If you have the Help window open in your desktop (by typing
F1, for example), you will get dynamic help (in English only) when you click a
node or a window. From the Help window, you can search for other topics, such
as menu items.
The main components of the COMSOL Desktop environment are the Model
Builder, the Application Builder, and the Model Manager.
T HE M ODEL B UILDER
The Model Builder is the tool where you define the model and its components,
such as how to solve it, the analysis of results, and creating reports. You do that by
building a model tree. The model tree reflects the underlying data structure — the
model object — which stores the state of the model including settings for
geometry, mesh, physics, boundary conditions, studies, solvers, postprocessing,
and visualizations.
T HE A PPLICATION B UILDER
The Application Builder allows you to quickly create an application (also called an
app) with a specialized user interface that is easy to use. An application is typically
based on a model created with the Model Builder. The Application Builder
provides important tools for creating applications including the Form Editor, the
Main Window Editor, and the Method Editor. The Form Editor includes
drag-and-drop capabilities to easily access and include user interface components,
such as input fields, graphics windows, and buttons. The Main Window Editor lets
you to add ribbon tabs with buttons and menus as well as organize your layout
using subwindows. The Method Editor is a programming environment that, for
example, allows you to modify the model represented by the model object data
structure. You can also use the Method Editor to add user interface logic and
auxiliary functionality to an application. The Java programming language is used
to write code in the Method Editor, which means that all Java syntax and Java
libraries can be used.
| 11
In the Method Editor, program code is stored in methods. A method is another
name for what is known in other programming languages as a subroutine,
function, or procedure. Methods can be used to modify the model object data
structure in the Model Builder and the Application Builder. A method can be used
both for modifying the model object of the current session and for modifying the
model object in a running application. For a quick introduction to the Application
Builder, see “Building an Application with the Application Builder” on page 117.
T HE M ODEL M ANAGER
The Model Manager is a workspace for simulation data management. It allows you
to collaborate with other users and centrally organize models and apps. The
Model Manager provides version control to track changes and updates to your
files. It will aid you in storing only relevant data of MPH-file drafts and revisions.
The Model Manager includes an advanced search tool that allows you to search
the models and applications stored in a Model Manager database for contents
based on keywords or tags. Depending on your license type, you can connect to a
local or remote and centrally managed Model Manager database. For a quick
introduction to the Model Manager, see “Using the Model Manager” on page
188.
F URTHER R EADING
This book, Introduction to COMSOL Multiphysics, gives a detailed introduction
to using the Model Builder and a quick introduction to the Application Builder
and the Model Manager. For detailed information on how to use the Application
Builder, see Introduction to Application Builder and the Application
Programming Guide. For more information on the Model Manager, see the
Reference Manual and the Model Manager Manual.
A p p l i c a t i o n s , C O M S O L S e r v e r ™, a n d C O M S O L
Compiler™
12 |
With a COMSOL Server™ license, applications can be run in major web browsers
on a variety of operating systems and hardware platforms. In addition, you can run
applications by connecting to COMSOL Server with an easy-to-install COMSOL
Client for Windows.
The COMSOL Client for Windows allows a user to run applications that require
a LiveLink™ product for CAD (this functionality is not available when running
applications with a web browser).
Running applications in a web browser does not require any installation and no
web browser plug-ins are needed. Running an application in a web browser
supports interactive graphics in 1D, 2D, and 3D. In a web browser, graphics
rendering in 3D are based on WebGL™ technology, which comes with all major
web browsers. In addition, there is a COMSOL Client version for Android
available in the Google Play™ store.
To create an application based on your model,
click the Application Builder button, accessible
from the Home tab on the ribbon.
For more information on creating COMSOL
applications, refer to the section “Building an
Application with the Application Builder” on page
117 and the book Introduction to Application
Builder.
| 13
Pr efere n ces
Preferences are settings that affect the modeling environment. Most are persistent
between modeling sessions, but some are saved with the model. You access the
preferences from the File menu by selecting Preferences.
In the Preferences window, you can change settings such as graphics rendering, the
number of displayed digits for results, the maximum number of CPU cores used
for computations, or paths to user-defined application libraries. Take a moment to
browse your current settings to familiarize yourself with the different options.
14 |
C OLOR T HEMES
In the User Interface > Color Themes page, there are three color theme preferences:
• Desktop color theme: Choose between a Default, Light, or Dark theme for the
COMSOL Desktop environment.
• Graphics color theme: Choose a color theme for the Graphics window.
• Image export color theme: Choose a color theme for exported images.
When using the Dark theme in Linux, some controls take their color from the
operating system’s theme. You will get a better user experience by picking both a
dark-looking theme in Linux and the Dark theme in the COMSOL Desktop
environment.
| 15
Opening and Saving Files from the File Menu
The File menu provides several options for opening and saving model files on the
COMSOL MPH-file format, as well as a few other supported formats.
16 |
• Open From opens
an existing file
from either the file
system or from a
Model Manager
database (see
“Using the Model
Manager” on page
188).
• Recent opens a recently opened file from the file system or from a Model
Manager database.
• Application Libraries opens a tutorial model or a runnable application from the
Application Libraries.
• Save saves the current file.
• Save As lets you save the
current file to the file system
with a new name using the
Save As dialog box.
• Revert to Saved opens the last saved version of the file and reinitializes the
user interface.
| 17
Creating a New Model
You can set up a model guided by the Model Wizard or start from a Blank Model as
shown in the figure below.
2 Now, add one or more physics interfaces. These are organized in a number of
physics branches in order to make them easy to locate. These branches do not
directly correspond to products. When products are added to your COMSOL
18 |
Multiphysics installation, one or more branches will be populated with
additional physics interfaces.
| 19
3 Select the Study type that represents the solver or set of solvers that will be used
for the computation.
Finally, click Done. The desktop is now displayed with the model tree configured
according to the choices you made in the Model Wizard.
20 |
T h e R i b b o n , Q u i c k A c c e s s To o l b a r , a n d G r a p h i c s M e n u s
The ribbon tabs in the COMSOL Desktop environment reflect the modeling
workflow and give an overview of the functionality available for each modeling
step, including building simulation applications from your models.
The Home tab contains buttons for the most common operations for making
changes to a model, running simulations, and for building and testing
applications. Examples include changing model parameters for a parameterized
geometry, reviewing material properties and physics, building the mesh, running
a study, and visualizing the simulation results.
There are standard tabs for each of the main steps in the modeling process. These
are ordered from left to right according to the workflow: Definitions, Geometry,
Materials, Physics, Mesh, Study, Results, and Developer.
Contextual tabs are shown only if they are needed, such as the 3D Plot Group tab,
which is shown when the corresponding plot group is added or when the node is
selected in the model tree.
Modal tabs are used for very specific operations, when other operations on the
ribbon may become temporarily irrelevant. An example is the Work Plane modal
tab. When working with work planes, other tabs are not shown, since they do not
present relevant operations.
| 21
T HE Q UICK A CCESS T OOLBAR
The Quick Access Toolbar contains a set of commands that are independent of the
ribbon tab that is currently displayed. You can customize the Quick Access Toolbar
and add most commands available in the File menu, including commands for
undoing and redoing recent actions, as well as for copying, pasting, duplicating,
and deleting nodes in the model tree. You can also choose to position the Quick
Access Toolbar above or below the ribbon.
T HE G RAPHICS M ENUS
As an alternative to using the model tree or the ribbon, you can right-click in the
Graphics window to access context-dependent menus. The menus shown will
depend on which node is currently selected in the model tree. By using the Go To
option, when available, you can jump to a context menu for another node in the
model tree.
22 |
MAC OS AND L INUX
In the COMSOL Desktop environment for macOS and Linux, the ribbon is
replaced by a set of menus and toolbars.
The instructions in this book are based on the Windows® version of the COMSOL
Desktop environment. However, running COMSOL Multiphysics and the
COMSOL Desktop environment in macOS and Linux is very similar, keeping in
mind that the ribbon user interface components can instead be found in the
corresponding menus and toolbars. In addition, the Application Builder is only
available in the Windows® version. However, you can run apps in all supported
operating systems.
Using the Model Builder, you build a model by starting with the default model
tree, adding nodes, and editing the node settings.
All of the nodes in the default model tree are top-level parent nodes. You can
right-click on them to see a list of child nodes, or subnodes, that you can add
beneath them. This is the means by which nodes are added to the tree.
When you click on a child node, you will see its node settings in the Settings
window. It is here that you can edit node settings.
It is worth noting that if you have the Help window open, which is achieved either
by selecting Help from the File menu or by pressing the function key F1, then you
will also get dynamic help (in English only) when you click on a node.
| 23
model tree. They can be used, for example, to define the values and functional
dependencies of material properties, forces, geometry, and other relevant features.
The Global Definitions node itself has no settings, but its child nodes have plenty
of them. The Materials subnode stores material properties that can be referenced
in the Component nodes of a model.
The Results node is where you access the solution after performing a simulation
and where you find tools for processing the data. The Results node initially has five
subnodes:
• Datasets, which contains a list of solutions you can
work with.
• Derived Values, which defines values to be derived
from the solution using a number of
postprocessing tools.
• Tables, which is a convenient destination for the
Derived Values or for Results generated by probes
that monitor the solution in real-time while the
simulation is running.
• Export, which defines numerical data, images, and animations to be exported
to files.
• Reports, which collects reports about the model in the HTML, Microsoft
Word, and Microsoft PowerPoint formats.
To these five default subnodes, you may also add more Plot Group subnodes that
define graphs to be displayed in the Graphics window or in Plot windows. Some of
these may be created automatically, depending on the type of simulations you are
performing, but you may include additional figures by right-clicking on the Results
node and choosing from the list of plot types. In addition, you can add an
Evaluation Group node, which is similar to the Derived Values node but with tightly
associated Evaluation Group tables, and a Parameters node for parameters used
exclusively in Results.
24 |
will carry out, the Model Wizard automatically creates one node of each type and
shows you their contents.
It is also possible to add
more Component and Study
nodes as you develop the
model. A model can
contain multiple
Component and Study
nodes and it would be
confusing if they all had
the same name. Therefore,
these types of nodes can be
renamed to be descriptive
of their individual
purposes.
If a model has multiple
Component nodes, they can
be coupled to form a more
sophisticated sequence of
simulation steps.
Note that each Study node
may carry out a different
type of computation, so Keyboard Shortcuts
each one has a separate
Compute button .
To be more specific, suppose that you build a model that simulates a coil assembly
that is made up of two parts: a coil and a coil housing. You can create two
Component nodes: one that models the coil and another that models the coil
housing. You can then rename each of the nodes with the name of the object.
Similarly, you can also create two Study nodes, the first simulating the stationary
or steady-state behavior of the assembly, and the second simulating the frequency
response. You can rename these two nodes to be Stationary and Frequency Domain.
When the model is complete, save it to a file named Coil Assembly.mph. At that
point, the model tree in the Model Builder looks like the figure below.
| 25
In this figure, the root node is named Coil
Assembly.mph, indicating the file in which
the model is saved. The Global Definitions
node and the Results node each have their
default name. Additionally, there are two
Component nodes and two Study nodes
with the names chosen in the previous
paragraph.
Global Parameters
Global parameters are user-defined constant scalars that are usable throughout the
model. That is to say, they are “global” in nature. Important uses are:
• Parameterizing geometric dimensions.
• Specifying mesh element sizes.
• Defining parametric sweeps (simulations that are repeated for a variety of
different values of a parameter such as a frequency or load).
A global parameter expression can contain numbers, global parameters, built-in
constants, built-in and user-defined functions with global parameter expressions
as arguments, and unary and binary operators. For a list of available operators, see
“Appendix C — Language Elements and Reserved Names” on page 239. Because
these expressions are evaluated before a simulation begins, global parameters
cannot depend on the time variable, t. Likewise, they cannot depend on spatial
variables like x, y, or z, nor on the dependent variables for which your equations
are solving.
It is important to know that the names of parameters are case sensitive.
26 |
You define global parameters in the Parameters node in the model tree under
Global Definitions.
Note that you can add multiple Parameters nodes and they will be named
Parameters 1, Parameters 2, etc. In addition, Parameters can be organized into
several cases and then swept over. For more information, see “Parametric Sweeps”
on page 169.
The following spread shows an example of a customized desktop with additional
windows.
| 27
QUICK ACCESS
TOOLBAR SETTINGS WINDOW RIBBON
MODEL BUILDER
WINDOW
MODEL TREE
28 |
DYNAMIC HELP — Continuously updated with online access to the
GRAPHICS WINDOW Knowledge Base and Application Gallery. The Help window enables
easy browsing with extended search functionality.
PLOT WINDOW —
The Plot window is
used to visualize
Results quantities,
probes, and
convergence plots.
Several Plot windows
can be used to show
multiple results
simultaneously.
| 29
Results Parameters
For greater flexibility, it is possible to define parameters that are only used in the
Results node. Using these parameters does not require resolving the model.
Variables
Variables have associated Variables nodes in the model tree and can be defined
either in the Global Definitions node or in the Definitions subnode of any Component
node.
Naturally, the choice of where to define the variable depends on whether you want
it to be global (that is, usable throughout the model tree) or locally defined within
a single Component node. Like a parameter expression, a variable expression may
contain numbers, parameters, built-in constants, and unary and binary operators.
However, it may also contain variables like t, x, y, or z; functions with variable
expressions as arguments; and dependent variables that you are solving for, such
as temperature T or voltage V, in addition to their space and time derivatives.
If you have a model with many Variables nodes it may be useful to group them
together by using the Node Group feature, as shown below. You access this menu
by right-clicking the Definitions node.
Node groups can be used to group nodes in Global Definitions, Definitions under a
Component, Geometry, Materials, physics interfaces, and results.
30 |
Variables Used in Applications
Model parameters and variables can be used in applications. For example, you can
let the user of an application change the value of a parameter. In addition, variables
to be used in applications can be defined in the Application Builder, in the
application tree under the Declarations node. Such variables can also be used in
model methods.
Scope
The “scope” of a parameter or variable is a statement about where it may be used
in an expression. All global parameters are defined in the Global Definitions node
of the model tree as a Parameters subnode. This means that they are global in
scope and can be used throughout the model tree.
A variable may also be defined in the Global Definitions node, as a Variables
subnode, and have global scope, but they are subject to other limitations. For
example, variables may not be used in Geometry, Mesh, or Study nodes (with the
one exception that a variable may be used in an expression that determines when
the simulation should stop).
A variable that is instead defined under the Definitions subnode of a Component
node has local scope and is intended for use in that particular Component (but,
again, not in the Geometry or Mesh nodes). They may be used, for example, to
specify material properties in the Materials subnode of a Component or to specify
boundary conditions or interactions. It is sometimes valuable to limit the scope of
the variable to only a certain part of the geometry, such as certain boundaries. For
that purpose, provisions are available in the settings for a variable to select whether
to apply the definition either to the entire geometry of the Component or only to
a Domain, Boundary, Edge, or Point.
| 31
The figure below shows the definition of two variables, q_pin and R, for which the
scope is limited to just two boundaries identified by numbers 15 and 19.
Such a group of numbers is called a Selection and can be named and then
referenced elsewhere in a model. This can be useful, for example, when defining
material properties or boundary conditions that will use the variable at certain
boundaries but not elsewhere. To give a name to the Selection, click the Create
Selection button ( ) to the right of the Selection list.
Although the variables defined in the Variables node under the Component >
Definitions subnode are intended to have local scope, they can still be accessed
outside of the Component node in the model tree by being sufficiently specific
about their identity. This is done by using a “dot notation”, where the variable
name is preceded by the name of the Component node in which it is defined and
the names are joined by a “dot”. In other words, if a variable named foo is defined
in a Component node named MyModel, then this variable can be accessed outside of
the Component node by using MyModel.foo. This can be useful, for example,
when you want to use the variable to make plots in the Results node. Variables
defined under the Declarations node in the Application Builder are available
globally in form objects and methods but cannot be used in the Model Builder.
32 |
Built-In Constants, Variables, and Functions
See “Appendix C — Language Elements and Reserved Names” on page 239 for
more information.
| 33
To open the Application Libraries window, select Application Libraries from the
Windows menu on the Home toolbar or from the File menu . Then, search by
application name or browse under a module folder name.
34 |
settings and to mesh and re-solve. It is also possible to download the full
versions — with meshes and solutions — of most of these when you update
your Application Libraries. These appear in the Application Libraries window
with the icon. If you position the cursor at a compact file in the
Application Libraries window, a No solutions stored message appears. A solved
version is available for download via the Application Library Update (except
in a few cases where the file is a template related to another, regular, model).
• Preview MPH-files, with only a model description and thumbnail image
available. These appear in the Application Libraries window with the icon.
The file is a preview of an application or a model file, including the model
description and information about used products and physics interfaces and
the computation time. Solved and compact versions are available for
download. Model documentation will be available if you have specified the
use of online help (see the Reference Manual for details on how to do this).
The Application Libraries are updated on a regular basis by COMSOL. To check
all available updates, click Update COMSOL Application Libraries at the top of the
Application Libraries window. You can also find this option from the File > Help
menu (Windows users) or from the Help menu (macOS and Linux users). This
connects you to the COMSOL website, where you can access new applications
and the latest updates.
If your computer has internet connection, then you can click the Application
Gallery button to access a wide range of additional examples from the COMSOL
website.
| 35
Workflow and Sequence of Operations
In the Model Builder window, every step of the modeling process, from defining
global variables to the final report of results, is displayed in the model tree.
From top to bottom, the model tree defines an orderly sequence of operations.
In the following branches of the model tree, the node order makes a difference
and you can change the sequence of operations by moving the subnodes up or
down the model tree:
• Geometry
• Materials
• Physics
• Mesh
• Study
• Plot Groups
36 |
Nodes may be reordered by these methods:
• Drag-and-drop
• Right-clicking the node and selecting Move Up or Move Down
• Pressing Ctrl + Up arrow or Ctrl + Down arrow
In other branches, the ordering of nodes is not significant with respect to the
sequence of operations, but some nodes can be reordered for readability. Child
nodes to Global Definitions is one such example. You can use the filter text field
above the model tree to display only those nodes that match the search string you
enter here. The Filter Options menu, available in the Model Builder toolbar, has
additional settings for modifying the search results.
You can view the sequence of operations presented in the model tree as program
code statements by saving the model as a Model File for MATLAB or as a Model File
for Java after having selected Compact History in the File menu. Note that the
model history keeps a complete record of the changes you make to a model as you
build it. As such, it includes all of your corrections, including changes to
parameters and boundary conditions and modifications of solver methods.
Compacting this history removes all of the overridden changes and leaves a clean
copy of the most recent form of the model steps. In the Application Builder, you
can use the Record Method option to view and edit program code statements in the
Method Editor.
As you work with the COMSOL Desktop interface and the Model Builder, you
will grow to appreciate the organized and streamlined approach. However, any
description of a user interface is inadequate until you try it for yourself. In the next
chapters, you are invited to work through two examples to familiarize yourself
with the software.
| 37
Example 1: Structural Analysis of a Wrench
38 |
Model Wizard
If you select Blank Model, you can right-click the root node
in the model tree to manually add a Component and a Study.
For this tutorial, click the Model Wizard button.
If the COMSOL Desktop user interface is already open,
you can start the Model Wizard by selecting New from the
File menu. Choose the Model Wizard.
The Model Wizard will guide you through the first steps of
setting up a model. The next window lets you select the
dimension of the modeling space.
2 In the Select Space Dimension window, select 3D.
| 39
3 In Select Physics, select
Structural Mechanics > Solid
Mechanics (solid) . Click Add.
Even without add-on modules,
the Solid Mechanics interface is
available in the Structural
Mechanics folder. In the picture
to the right, part of the
Structural Mechanics folder is
shown as it appears when all
add-on modules are available.
40 |
G e o me t r y
This tutorial uses a geometry that was previously created and stored in the
COMSOL native CAD format, .mphbin. To learn how to build your own
geometry, see “Appendix A — Building a Geometry” on page 214.
The location of the Application Library that contains the file used in this exercise
varies based on the software installation and operating system. In Windows, the
file path will be similar to:
C:\Program Files\COMSOL\COMSOL62\Multiphysics\applications.
Now, import the ready-made geometry file as follows.
1 In the Model Builder window, under Component 1, right-click Geometry 1 and
select Import .
As an alternative, you can use the ribbon and click Import from the Geometry
tab.
| 41
2 In the Settings window for Import, from the Source list, if not already selected,
select COMSOL Multiphysics file.
3 Click Browse and locate the file wrench.mphbin in the application library folder
of the COMSOL installation folder. Its default location in Windows is
C:\Program Files\COMSOL\COMSOL62\Multiphysics\applications\
COMSOL_Multiphysics\Structural_Mechanics\wrench.mphbin
42 |
5 Click the wrench geometry in the Graphics window and then experiment with
moving it around. As you point to or click the geometry, it changes color. Click
the Zoom In , Zoom Out , Go to Default 3D View , Zoom Extents , and
Transparency buttons on the Graphics window toolbar to see what happens to
the geometry:
- To rotate, click and drag anywhere in the Graphics window.
- To move, right-click and drag.
- To zoom in and out, click the mouse scroll wheel, continue holding it, and
drag.
- To get back to the original position, click the Go to Default 3D View button
on the toolbar.
Also see “Appendix B — Keyboard and Mouse Shortcuts” on page 231 for
additional information.
The imported model has two parts, or domains, corresponding to the bolt and the
wrench. In this exercise, the focus will be on analyzing the stress in the wrench.
| 43
Mate rials
The Materials node stores the material properties for all physics and all domains
in a Component node. Use the same generic steel material for both the bolt and
tool. Here is how to choose it in the Model Builder.
1 Open the Add Materials window.
You can open the Add Materials
window in either of these two
ways:
- Right-click Component 1 >
Materials in the Model Builder
window and select Add Material
from Library .
- From the ribbon, select the Home tab and then click Add Material.
44 |
Note that some properties are available as functions of temperature T. If
you have no heat transfer physics defined in a model, then this temperature
is taken from the Default Model Inputs under Global Definitions.
See the busbar tutorial sections “Materials” on page 89 and “Customizing
Materials” on page 141 to learn more about working with materials.
| 45
Global Definitions
You will now define a global parameter specifying the load applied to the wrench.
Parameters
1 In the Model Builder window, under Global Definitions , choose Parameters
1 .
2 Go to the Settings window for Parameters 1. In the Parameters table, enter these
settings:
- In the Name column or field, enter F.
- In the Expression column or field, enter 150[N]. The square-bracket notation
is used to associate a physical unit to a numerical value; in this case, the unit
of force in Newtons. The Value column is automatically updated based on the
expression entered once you leave the field or press Return.
- In the Description column or field,
enter Applied force.
If you have a Parameters table with more than one entry, you can sort the
table with respect to a particular column by clicking on the corresponding
header.
The sections “Global Definitions” on page 81 and “Parameters, Functions,
Variables, and Couplings” on page 136 show you more about working with
parameters.
46 |
So far, you have added the physics and
study, imported a geometry, added the
material, and defined one parameter. The
Model Builder node sequence should now
match the figure to the right. The default
feature nodes under Solid Mechanics are
indicated by a D in the upper-left corner of
the node icon .
The default nodes for Solid Mechanics are:
Linear Elastic Material, Free, and Initial
Values.
The node Linear Elastic Material is the
default material model for the Solid
Mechanics interface. The node Free is a
boundary condition that allows all
boundaries to move freely without a
constraint or load. The node Initial Values
is used for specifying initial displacement
and velocity values for a nonlinear or
transient analysis (not applicable in this case).
The default physics nodes cannot be removed. Instead, you specify physics settings
that deviate from that of the default nodes by adding additional nodes. These
additional nodes can override or contribute to the settings of the default nodes as
well as other nodes. For more information, see “Override and Contribution:
Exclusive and Contributing Nodes” on page 153.
At any time, you can save your model and then open it later in exactly the state in
which it was saved.
3 From the File menu, select Save As. Browse to a folder where you have write
permissions and save the file as wrench.mph.
| 47
Physics and Boundary Conditions
With the geometry and materials defined, you are now ready to set the boundary
conditions.
1 In the Model Builder window,
right-click Solid Mechanics
(solid) and select Fixed
Constraint .
This boundary condition
constrains the displacement of
each point on a boundary
surface to be zero in all
directions.
You can also use the ribbon
and, from the Physics tab,
select Boundaries > Fixed
Constraint.
3 Click the Go to Default View button on the Graphics toolbar to restore the
geometry to the default view.
48 |
4 In the Model Builder window, right-click Solid Mechanics (solid) and select
Boundary Load. A Boundary Load node is added to the Model Builder sequence.
The “warning” attribute displayed on the Boundary Load node indicates that its
boundary selection is empty. The next step will be to select a boundary.
5 In the Graphics window, click the Zoom
Box button on the toolbar and drag
the mouse to select the square region
shown in the figure to the right.
Release the mouse button to zoom in
on the selected region.
| 49
Note that to simplify the modeling process, the mechanical contact between the
bolt and the wrench is approximated with a material interface boundary condition.
Such an internal boundary condition is automatically defined and guarantees
continuity in normal stress and displacement across a material interface. A more
detailed analysis including mechanical contact can be done with the Structural
Mechanics Module.
In this dialog box, you can enter a parameter Name and Description.
50 |
The parameter is now added to the list of Parameters, as shown below.
To edit a parameter, select the parameter in an edit field, right-click, and choose
Edit Parameter.
Note that when you hover over edit fields and table cells, a tooltip shows the value
of the parameter or expression. This only works when the value is a constant.
| 51
boundary by using the left mouse button. The boundary now turns blue. Its
boundary number will appear in the Selection list in the Settings window of the
corresponding boundary condition. Once a boundary is selected and you hover
over it again, the boundary turns green. If you click a boundary highlighted in
green, the boundary is deselected and now turns gray again. The same technique
for selecting and deselecting is applicable to geometry objects, domains,
boundaries, edges, and points.
The figure below shows the different selection states for a boundary.
To select internal surfaces that are hidden behind the one closest to you, use one
of the following methods to cycle through the boundaries at the mouse pointer:
roll the mouse scroll wheel, use the keyboard + and - buttons, use the keyboard
arrow-up and arrow-down buttons, or use two-finger drag on a touchpad.
When hovering over a boundary, information about the boundary number and
surface normal direction is displayed in the upper-left corner of the Graphics
window, as shown in the figure below.
52 |
For each boundary surface, the normal vector has a “positive” and “negative”
direction, referred to as the up and down direction, respectively. When hovering
over a surface, the information display shows which normal direction is currently
pointing toward you. This information can be useful, for example, when defining
more advanced boundary conditions, especially on material interfaces.
| 53
Click to select the boundaries to which you would like to apply the boundary
condition. (In this case, the top socket face; boundary 111.) Then, right-click
again and select Boundary Load, as shown in the figure below.
You can also use this method to add additional boundaries to the selections of an
already created boundary condition. In the example above, you could, for
example, while having the Fixed Constraint node selected, select the menu option
Add to Boundary Selection for Fixed Constraint 1 (although it wouldn’t be applicable
in this example).
54 |
By selecting a Clip Plane, for example, you can quickly hide all parts of a model that
is on one side of the plane. The figure below shows a clip plane used to select one
of the interior boundaries of the wrench model.
| 55
Me sh
The mesh settings determine the resolution of the finite element mesh used to
discretize the model. The finite element method divides the model into small
elements of geometrically simple shapes, in this case tetrahedra. In each
tetrahedron, a set of polynomial functions is used to approximate the structural
displacement field — how much the object deforms in each of the three
coordinate directions. The strains are computed by differentiating the
displacement field. Then, the stresses are computed from the strains using the
material properties.
In this example, because the geometry contains small edges and faces, you will
define a slightly finer mesh than the default setting suggests. This will better
resolve the variations of the stress field and give a more accurate result. Refining
the mesh size to improve computational accuracy always involves some sacrifice in
speed and typically requires increased memory usage.
1 In the Model Builder, under Component 1, click Mesh 1 . In the Settings window
for Mesh, under Mesh Settings, select Finer from the Element size list.
2 Click the Build All button in the Settings window or on the Mesh toolbar.
With the resulting mesh, the model will require about 5GB to solve. If you have
a computer with less than 5GB of RAM you can select Fine from the Element
size list (instead of Finer.)
56 |
3 After a few seconds, the mesh is displayed in the Graphics window. Rotate the
wrench to take a look at the element size distribution (this may vary a bit
depending on the version you are running).
| 57
Study
In the beginning of setting up the model, you selected a Stationary study, which
implies that a stationary solver will be used. For this to be applicable, the
assumption is that the load, deformation, and stress do not vary in time. To start
the solver:
1 Right-click Study 1 and select
Compute (or press F8).
After a few seconds of
computation time, the default plot
is displayed in the Graphics
window. During computation, a
Progress window shows progress information from the solvers. After the
computation you can find other useful information about the computation in the
Messages and Log windows; Click the Messages and Log tabs under the Graphics
window to see the kind of information available to you. The Messages window can
also be opened from the Windows drop-down list in the Home tab of the ribbon.
58 |
Results
The von Mises stress is displayed in the Graphics window in a default Volume plot
with the displacement visualized using a Deformation subnode. Change the default
unit (N/m2) to the more suitable MPa as shown in the following steps.
1 In the Model Builder, expand the Results > Stress
(solid) node, then click Volume 1 .
| 59
3 Click the Plot button on the toolbar of the Settings window for the Volume
plot and then click the Go to Default 3D View button on the Graphics window
toolbar.
The von Mises stress distribution is shown in the bolt and wrench under an
applied vertical load.
You can add additional predefined plots by selecting from the list defined by Add
Predefined Plot under Results or by clicking the corresponding button from the
ribbon Home tab.
60 |
4 You can, for example, visualize the applied load distribution. Right-click Results
and select Add Predefined Plot. In the Add Predefined Plot window, select Solid
Mechanics > Applied Loads > Boundary Loads and click Add Plot.
For our purposes we are not interested in the stress in the bolt. We can selectively
visualize the stress in just the wrench by adding a Selection node.
| 61
1 Right-click the Stress > Volume node and select Selection .
62 |
3 Click Plot to see the visualization.
For a typical steel used for tools like a wrench, the yield stress is about 600 MPa,
which means that we are getting somewhat close to plastic deformation for our
150 N load (which corresponds to about 34 pounds force). You may also be
interested in a safety margin of, say, a factor of three. To quickly assess which parts
of the wrench are at risk of plastic deformation, you can plot an inequality
expression such as solid.misesGp>200[MPa]. (The suffix Gp indicates that the stress
variables are obtained from the so called finite element Gauss points.)
1 Right-click the Results node and add a 3D Plot Group .
| 63
2 Right-click the 3D Plot Group 3 node and select Volume .
64 |
for a 150 N load with a factor-of-three safety margin, you would need to change
the handle design somewhat, such as by making it wider.
You may have noticed that the manufacturer, for various reasons, has chosen an
asymmetric design for the wrench. Because of that, the stress field may be different
if the wrench is flipped around. Try now, on your own, to apply the same force in
the other direction and visualize the maximum von Mises stress to see if there is
any difference.
| 65
Convergence Analysis
66 |
4 In the Expressions table, type MPa as the Unit.
| 67
6 To see where the maximum value is attained, you can, for example, use a
Max/Min Volume plot. Right-click the Results node and add a 3D Plot Group
. Next, right-click the 3D Plot Group 4 node and select More Volume Plots
> Max/Min Volume . Change the name of 3D Plot Group 4 to Max/Min Stress.
7 To plot values in the wrench and not in the bolt, right-click the Max/Min Volume
node, select Selection, and then select the wrench, domain number 1.
8 In the Settings window for Max/Min Volume, in the Expression text field, type
solid.misesGp*(x>-0.045). Alternatively, you can use a Filter node: Right-click
the Max/Min Volume plot, select Filter, and change the Logical expression for
inclusion to x>-0.045.
9 In the Settings window under Expression, from the Unit list, select MPa (or enter
MPa in the field).
10Click the Plot button . This type of plot simultaneously shows the location of
the maximum and minimum values and also their coordinate location in the
table below (the exact values may differ depending on the version you are
running).
68 |
An alternative way of plotting the maximum and minimum stress is to
right-click the Stress > Volume plot and select Marker.
Note that the maximum and minimum values using this approach can
differ somewhat since the evaluation method is slightly different.
| 69
6 In the Settings window for Size, under
Element Size, click the Custom button.
Under Element Size Parameters, enter:
- h0/hd in the Maximum element size field.
- h0/(4*hd) in the Minimum element size
field.
- 1.3 in the Maximum element growth rate
field.
- 0.1 in the Curvature factor field.
- 0.2 in the Resolution of narrow regions field.
See page 103 for more information on the
element size parameters.
70 |
4 Under Study 1 > Solver
Configurations > Solution 1,
expand the Stationary Solver 1
node , and right-click Suggested
Iterative Solver and select
Enable. Selecting an iterative
solver option typically reduces
memory usage but may require
physics-specific tailoring of the
solver settings for efficient
computations.
5 Under General in the Settings
window for Suggested Iterative Solver, change the Preconditioning to Right. (This
is a low-level solver option, which in this case will suppress a warning message
that would otherwise appear. However, this setting does not affect the resulting
solution. Preconditioning is a mathematical transformation used to prepare the
finite element equation system for using the iterative solver.)
6 Click the Study 1 node and select Compute , either in the Settings window or
by right-clicking the node. You can also click Compute on the ribbon Home or
Study tab. The computation time will be a few minutes (depending on the
computer hardware) and memory usage will be about 4GB.
R ESULTS A NALYSIS
Note that after running the parametric sweep, a new default plot node is created
corresponding to the new Dataset Study 1/Parametric Solutions 1.
| 71
As a final step, analyze the results from the parametric sweep by displaying the
maximum von Mises stress in a table.
1 In the Model Builder window, under Results > Derived Values, select the Volume
Maximum 1 node .
The solutions from the parametric sweep are stored in the Dataset named Study
1/Parametric Solutions 1. Now, change the Volume Maximum settings
accordingly:
2 In the Settings window for Volume Maximum, change the Dataset to Study
1/Parametric Solutions 1.
3 Click the arrow next to the Evaluate button at the top of the Settings window
for Volume Maximum and select to evaluate in a New Table. This evaluation may
take 10 seconds or so, depending on the computer.
4 To plot the results in the Table, click the Table Graph button at the top of the
Table window (the first few values will vary due to slight mesh variations
between versions for coarser meshes before a more mesh-converged value has
been reached).
It is more interesting to plot the maximum value vs. the number of DOFs. This
is possible by using the built-in variable numberofdofs.
5 Right-click the Derived Values node and select Global Evaluation .
6 In the Settings window for Global Evaluation, change the Dataset to Study
1/Parametric Solutions 1.
7 In the Expressions field, enter numberofdofs.
You can type the first few characters of the variable name and then use
the keyboard shortcut Ctrl+Space to get a variable suggestion from the
list of available variables.
72 |
8 In the Settings window for Global Evaluation, click the arrow next to the Evaluate
button and select the option to evaluate in Table 2, or Table 1, depending on
which previous steps you chose to follow. This displays the DOF values for each
parameter next to the previously evaluated data.
This mesh-convergence analysis shows that the computed value of the maximum
von Mises stress in the wrench handle will decrease from the high original value,
for a mesh with about 115,000 DOFs, to about 369 MPa for a mesh with about
1,000,000 DOFs. If we further refine the mesh we will find that the results will
stay approximately around the value 369 MPa. Note that in this parametric sweep
the coarsest mesh is coarser than the preset Finer mesh used in the wrench before
the convergence study.
The figure below shows the associated Table Graph and Table Graph Settings
window.
Note that depending on the version of COMSOL Multiphysics that you are
running, the above values may vary slightly due to variations in the number of
elements generated by the meshing algorithm.
As an alternative to Derived Values, you can use Evaluation Groups. An Evaluation
Group shares some of the properties of Plot Groups as well as Derived Values. An
Evaluation Group comes with an integrated table whereas Derived Values outputs to
a table of your choice. In addition, Evaluation Groups allows you to automatically
| 73
reevaluate after solving. To enable this, select the corresponding check box in the
Settings window of the Results node as shown in the figure below.
In this Settings window you can also request to regenerate all plots after solving.
You add an Evaluation Group in the same way as a Plot Group: by right-clicking the
Results node. The figure below shows an Evaluation Group that performs the same
task as the Derived Values described earlier.
As done previously for Derived Values, to get optimal accuracy, in the Volume
Maximum settings window, in the Configuration section, change the Point type to
Gauss points.
The figure below shows the corresponding Evaluation Group table.
74 |
Example 2: The Busbar — A Multiphysics Model
The goal of your simulation is to precisely calculate how much the busbar heats
up. Once you have captured the basic multiphysics phenomena, you will have the
chance to investigate thermal expansion that generates structural stresses and
strains in the busbar and the effects of cooling by an air stream.
| 75
The Joule heating effect is described by conservation laws for electric current and
energy. Once solved for, the two conservation laws give the temperature and
electric field, respectively. All surfaces, except the bolt contact surfaces, are cooled
by natural convection in the air surrounding the busbar. You can assume that the
exposed parts of the bolt do not contribute to the cooling or heating of the device.
The electric potential at the upper-right vertical bolt surface is 20 mV and the
potential at the two horizontal surfaces of the lower bolts is 0 V. This corresponds
to a relatively high and potentially unsafe loading of this type of busbar. More
advanced boundary conditions for electromagnetics analysis are available with the
AC/DC Module, such as the capability to give the total current on a boundary. A
more advanced model that includes multiple busbars in an assembly, as shown in
the figure below, can be found in some of the add-on products, including the
AC/DC Module and a few of the LiveLink™ products for CAD.
76 |
• “Adding Meshes” on page 143 gives you the opportunity to add and define
two different meshes and compare them in the Graphics window.
• “Adding Physics” on page 146 explores the multiphysics capabilities by
adding solid mechanics and laminar flow to the busbar model.
• “Parametric Sweeps” on page 169 shows you how to vary the width of the
busbar using a parameter and then solve for a range of parameter values. The
result is a plot of the average temperature as a function of the width.
• “Parallel Computing” on page 181 gives you an overview of how to solve
on clusters.
• “COMSOL Multiphysics Client–Server” on page 185 gives you an
introduction to using the COMSOL Multiphysics client–server mode of
operation.
| 77
Model Wizard
78 |
4 In the Select Study window, click to
select the Stationary study type.
Click the Done button.
Choosing a stationary study means
that we are solving for the
steady-state temperature of the
busbar when it has reached thermal
equilibrium with its surroundings.
| 79
A preconfigured Study has solver and equation settings adapted to the selected
combination of physics interfaces; in this example, Joule Heating.
Note that you may have fewer study types in your study list depending on the
installed add-on modules.
A physics interface is a user interface for a specific physics area that
defines the equations together with settings for mesh generation,
solvers, visualization, and results. A multiphysics interface is a
combination of physics interfaces together with multiphysics couplings.
The Joule Heating multiphysics interface consists of two physics
interfaces, Electric Currents and Heat Transfer in Solids, together with the
multiphysics coupling Electromagnetic Heating that appear in the
Multiphysics branch. This method of mixing physics is very flexible and
makes it possible to use all the capabilities of the participating
single-physics interfaces for multiphysics purposes.
80 |
Global Definitions
| 81
variables in case you want to share the model with others and for your own
future reference.
Click the Save button on the Quick Access Toolbar and name the model
busbar.mph or use the corresponding File menu option. Then, go to “Appendix A
— Building a Geometry” on page 214.
82 |
The Auto Co mpletio n an d Find Tools
The model tree contains a large number of parameters and variables. To make it
easier to find them, you can use the auto completion and find tools as described
below.
A UTO C OMPLETION
You can use Ctrl+Space for auto completion of parameter and variable names. For
example, in the Parameters table, if you click an empty Expression field and then
press Ctrl+Space, you will get a list of parameters and variables, as shown in the
figure below.
This functionality is also available for other edit fields in the Model Builder window.
| 83
F IND
To find parameters, variables, as well as other strings in the model tree, you can
click the Find button in the Quick Access Toolbar or use the keyboard shortcut
Ctrl+F. This opens the Find and Replace window.
The results of the search are displayed below the Contains and Replace with fields.
The results in this example are coming from the completed busbar model by
searching for the string current.
You can double-click any of the rows in this window to open the corresponding
Settings window.
84 |
G e o me t r y
This section describes how the geometry can be opened from the Application
Libraries. The physics, study, parameters, and geometry are included with the
model file you are about to open.
1 Select Application Libraries from the
Windows drop-down menu in the Home tab.
You can also access the Application Libraries
from the File menu.
| 85
3 Under Global Definitions , click the
Parameters node .
In the Settings window for Parameters,
click in the Expression column for the
wbb parameter and enter 10[cm] to
change the value of the busbar width.
4 In the Model Builder window, under
Component 1 > Geometry 1, click the
Form Union node and then the Build
All button in the Settings window to rerun the geometry sequence. You can
also use the ribbon and click Build All from the Geometry group in the Home tab.
86 |
5 In the Graphics toolbar, click the Zoom Extents button to see the wider busbar
in the Graphics window.
- To get back to the original position, click the Go to Default 3D View button
on the toolbar.
| 87
10If you built the geometry yourself, you are already using the file busbar.mph, but
if you opened the file from the Application Libraries window, select Save As from
the File menu and rename the model busbar.mph.
88 |
Mate rials
The Materials node stores the material properties for all physics and geometrical
domains in a Component node. The busbar is made of copper and the bolts are
made of a titanium alloy. Both of these materials are available from the Built-In
material database.
1 In the Model Builder window, right-click Component 1 > Materials and select
Add Material from Library . By default, the window will open on the
right-hand side of the desktop. You can move the window by clicking on the
window title and then dragging it to a new location. While dragging the
window, you will be presented with several options for docking.
The Materials node will show a red × in the lower-left corner if you try to
solve without first defining a material, which we will go over in the next
few steps.
2 In the Add Material window,
expand the Built-In materials
folder and locate Copper.
Right-click Copper and select
Add to Component 1.
Alternatively, you can
double-click.
A Copper node is added to the
Model Builder window.
3 In the Add Material window,
scroll to Titanium beta-21S in the
Built-In material folder list.
Right-click and select Add to
Component 1.
| 89
4 In the Model Builder window, collapse the Geometry 1 node to get an overview
of the model.
At this stage, the Materials node may display one or more red × symbols
depending on the active selection. These will disappear in the next few steps.
5 Under the Materials node, click Copper .
The Material Contents section has useful information about the material
property usage of a model. Properties that are both required by the
90 |
physics and available from the material are marked with a check mark .
Properties required by the physics but missing in the material are marked with
a warning sign . A property that is available but not used in the model is
unmarked.
The Coefficient of thermal expansion, Young’s modulus, and Poisson’s ratio
properties in the table above are not used but will be needed later when
heat-induced stresses and strains are added to the model.
Because the copper material is added first, by default, all parts have copper
material assigned. In the next step, you will assign titanium properties to the
bolts, which override the copper material assignment for those parts.
7In the Model Builder window, click
Titanium beta-21S .
| 91
8 Select All Domains from the Selection list and then click domain 1 in the list. Now
remove domain 1 from the selection list.
To remove a domain from the selection list (or any geometric entity, such as
boundaries, edges, or points), you can use either of these two methods:
- Click domain 1 in the selection list found in the Settings window for Material.
Then, click the Remove from Selection button or press Delete on your
keyboard.
- Alternatively, in the Graphics window, click domain 1 to remove it from the
selection list.
92 |
You can enable and disable material color and texture from the Color
toolbar button in the Graphics window. To render the copper components
using a realistic color, select Show Material Color and Texture. This will also
enable material-true rendering of other materials. Here, you can also
enable coloring of selections by selecting Show Selection Colors.
The figures below show the Settings and Graphics windows corresponding
to a selection where a color (pink) other than the default has been used.
There is also a second selection (not shown) with another color (green).
Note that to see the color while creating a selection, you need to click the
Suppress Selection Highlight button in the Graphics toolbar. For more
information on Selections, see page 149.
To further increase the level of realism in material rendering you can
enable Environment Reflections from the Scene Light menu button in the
Graphics toolbar. From this menu you can choose an Indoor Environment
or Outdoor Environment. You can also enable effects such as Direct Shadows
and Floor Shadows.
| 93
The corresponding image, known as a skybox image, will be reflected in
the material, thereby increasing the level of realism. This is particularly
visible when the material is a metal, as shown in the figure below.
By selecting the Show Skybox option you can display the corresponding
skybox image used for the environment reflection.
For best results you will need a graphics card that supports OpenGL. See
also “Graphics and Plot Windows” on page 14. Not all of these
visualization options will be used in the remainder of this example.
94 |
9 In the Settings window
for Material, be sure to
inspect the Material
Contents section for the
titanium material. All of
the properties used by
the physics should have a
check mark .
| 95
Physics and Boundary Conditions
Next, you will inspect the physics domain settings and set the boundary conditions
for the heat transfer problem and the conduction of the electric current.
In the Model Builder window, examine the default physics nodes of the
multiphysics interface for Joule Heating. First, collapse the Materials node. Then,
click the arrows next to the Electric Currents , Heat Transfer in Solids , and
Multiphysics nodes to expand them.
96 |
To always display the equations in the Settings windows, click the Show
More Options button ( ) on the Model Builder toolbar and select Equation
Sections so that a check mark appears next to it.
The Heat Transfer in Solids and
Electric Currents nodes have the settings
for heat conduction and current
conduction, respectively.
Under the Electric Currents node, the
Current Conservation node represents the
conservation of electric current at the
domain level and the Electric Insulation
node contains the default boundary
condition for Electric Currents.
Under the Heat Transfer in Solids node,
the domain level Solid node represents the
conservation of heat and the Thermal
Insulation node contains the default
boundary condition for Heat Transfer in
Solids. The heat source for the Joule
heating effect is set in the Electromagnetic Heating node under the Multiphysics
node. The Initial Values node, found in both the Electric Currents and Heat Transfer
in Solids interfaces, contains initial guesses for the nonlinear solver for stationary
problems and initial conditions for time-dependent problems.
Now, define the boundary conditions.
1 Right-click the Heat Transfer in Solids node . In the second section of the
context menu — the boundary section — select Heat Flux.
Domain section
Section divider
Boundary section
| 97
2 In the Settings window for Heat Flux,
select All boundaries from the Selection
list.
Assume that the circular bolt
boundaries are neither heated nor
cooled by the surroundings.
In the next step, you will remove the
selection of these boundaries from the
heat flux selection list, which leaves
them with the default Thermal Insulation boundary condition for the Heat
Transfer in Solids interface.
3 Rotate the busbar to view the back. Move the mouse pointer over one of the
circular titanium bolt surfaces to highlight it in green. Click the bolt surface to
remove this boundary selection from the Selection list. Repeat this step to
remove the other two circular bolt surfaces from the selection list. Boundaries
8, 15, and 43 are removed.
Cross-check: Boundaries 8, 15, and 43 are removed from the
Selection list.
43
15
98 |
4 In the Settings window for Heat
Flux, in the Heat Flux section, select
Convective heat flux as the Flux
type. Enter htc in the Heat transfer
coefficient field, h.
This parameter was either entered
in the Parameter table in “Global
Definitions” on page 81 or
imported with the geometry.
| 99
6 Move the mouse pointer over the circular face of the single titanium bolt to
highlight it and then click to add it (boundary 43) to the Selection list.
43
The “warning” attribute displayed on the Ground node indicates that its
boundary selection is empty. The next step will be to select boundaries.
100 |
9 In the Graphics window, click one of the remaining bolts to add it to the
Selection list.
Cross-check: Boundaries 8 and 15.
15
Repeat this step to add the last bolt. Boundaries 8 and 15 are added to the
selection list for the Ground boundary condition.
10On the Graphics toolbar, click the Go to Default View button .
| 101
Electric Currents and then subsequently add Heat Transfer in Solids. In that case,
you right-click the Multiphysics node to add the required multiphysics couplings.
As an alternative, you can click the Add Multiphysics button in the Physics tab on
the ribbon and select a suggested multiphysics coupling in the Add Multiphysics
window.
102 |
Me sh
| 103
3 In the Settings window for Size, in
the Element Size section, click the
Custom button.
Under Element Size Parameters,
enter:
- mh in the Maximum element size
field. Note that mh is 3 mm — the
value entered earlier as a global
parameter. By using the parameter
mh, element sizes are limited by
this value.
- mh-mh/3 in the Minimum element
size field. The Minimum element
size is slightly smaller than the
maximum size.
- 0.2 in the Curvature factor field.
The Curvature factor determines
the number of elements on curved
boundaries; a lower value gives a
finer mesh.
The other two parameters are left
unchanged.
The Maximum element growth rate determines how fast the elements should
grow from small to large over a domain. The larger this value is, the larger the
growth rate. A value of 1 does not give any growth.
For Resolution of narrow regions, a higher value will generally result in a finer
mesh.
The asterisk (*) that displays in the upper-right corner of the Size node
indicates that the node is being edited.
104 |
4 Click the Build All button in the Settings window for Size to create the mesh,
as in this figure:
You can also click Build Mesh in the Home tab of the ribbon.
| 105
Study
106 |
Results
| 107
4 In the Settings window for Volume, click Range to expand the section. Select the
Manual color range check box and enter 324 in the Maximum field (keep the
default for Minimum and replace the default for Maximum). Click the Plot button
in the Settings window for Volume.
5 On the Graphics toolbar, click the Zoom Extents button to view the updated
plot.
6 Click and drag in the Graphics window to rotate the busbar and view the back.
108 |
Then, generate a Surface plot that shows the current density in the device.
1 In the Model Builder window,
right-click Results and add a 3D Plot
Group . In the Label field, enter
Current Density to give the plot
group a descriptive name. Right-click
Current Density (former 3D Plot Group
4) and add a Surface node .
| 109
4 In the Settings window for Surface under Range, select the Manual color range
check box. Enter 1e6 in the Maximum field and replace the default.
110 |
6 Click and drag the busbar in the Graphics window to view the back. Continue
rotating the image to see the high current density around the contact surfaces
of each of the bolts.
When you are done, click the Go to Default View button on the Graphics toolbar.
| 111
1 Right-click Results > Temperature and select More Volume Plots > Max/Min
Volume.
2 In the Settings window for Max/Min Volume under Expression, click the Replace
Expression button . Go to Model > Component 1 > Heat Transfer in Solids >
Temperature > T - Temperature - K and double-click or press Enter to select. You
112 |
can also search for Temperature in the search field above the tree of
postprocessing variables or manually enter T. Click Plot.
The maximum and minimum values are plotted in the Graphics window and
their locations and values are displayed in the Maximum and minimum values
| 113
table. The values may vary a bit depending on the version you are running. For
a finer mesh the results will be the same regardless of version.
114 |
5 In the first row of the Expression table, enter T (unless it is automatically filled
out) for the temperature and click Evaluate at the top of the Settings window.
| 115
image. You can also add an Image node to the Export node to create an image
file. Right-click the plot group of interest and then select Add Image to Export.
You can use the Image Snapshot button to export Results visualizations to
glTF™ (file extension .glb). These files can then be opened in 3D
visualization software such as Paint 3D from Microsoft, as shown in the
figure below. (If you are running Windows 10 or 11, then this may be
available in your system. Otherwise, you can download it from the
Microsoft Store.) You can also find glTF™ viewers online that run in
web browsers.
Make sure to save the model at this stage. This version of the model,
busbar.mph, is reused and renamed during the next set of tutorials.
Alternatively, for the subsequent tutorials, you can use the busbar file in
the Application Libraries under COMSOL Multiphysics > Multiphysics.
116 |
Building an Application with the Application Builder
This section gives a brief introduction to using the Application Builder to create
applications, using the busbar model to demonstrate. Each application will have a
specialized user interface dedicated to interacting with the busbar model that
includes input fields for the length, width, and applied voltage. The outputs will
be the maximum temperature and a temperature plot.
In this introduction, you will learn how to use the New Form wizard to quickly
create an application in two different ways, using two different layout templates.
The wizard is used to create one or more forms with user interface components
called form objects. The wizard gives quick access to a subset of all of the form
objects available for creating applications with the Application Builder. In the
following examples, you will learn how to add input fields, numerical outputs,
graphics, and buttons. For detailed information on building applications, see the
Introduction to Application Builder manual.
The first example shows how to create an application based on a single form, using
the Single form template. The Single form template makes it easy to interactively
move buttons and edit fields by dragging. However, it does not allow you to resize
the graphics when changing the size of the application window. The second
example demonstrates how to use the Basic template to create an application with
several forms, subwindows, and a ribbon. Using this template automatically
creates an application with a resizable graphics window.
| 117
2 To create a new form, click the New Form button on the ribbon. This will create
a new global form.
118 |
The Select Content page appears.
It consists of four tabs for Inputs, Outputs, Graphics, and Buttons. On the Inputs
tab, you can double-click the parameters in the tree to make them available in
the user interface of the application. For this application, we will select a few of
the parameters as input fields and the maximum temperature as the output.
| 119
3 On the Inputs page, double-click each of the parameters: Length (L), Width
(wbb), and Applied voltage (Vtot). Also, on the Outputs tab double-click Volume
Maximum under Derived Values.
The Preview section to the right displays the user interface layout.
4 Click the Graphics tab in the wizard and double-click the Temperature plot. A
graphics object placeholder appears in the Preview area.
120 |
5 Click the Buttons tab in the wizard and double-click Compute Study. A Compute
button now appears in the Preview area beneath the graphics object.
6 Finally, click Done to accept the settings and close the wizard.
After closing the Form wizard, the Form Editor is opened in the Application
Builder workspace. The Form Editor allows you to drag and drop form objects
and add new form objects. The default view is a preview of the form. Double-click
form1 to enable editing.
| 121
7 You can rearrange the user interface by dragging the graphics object to the right
of the input fields and dragging the button to a position directly under the input
fields, as shown in the figure below. Blue guidelines will aid you in aligning the
objects.
You can make the graphics object larger or smaller by dragging the blue handles.
122 |
8 You can test the application by clicking Test Application on the ribbon.
Alternatively, you can click the corresponding button in the Quick Access
Toolbar. This creates a run-time copy of the application and lets you quickly try
different designs during the process of developing an application.
9 Now, try a different Length value, for example, and click Compute.
A DDING A B UTTON
You may wish to preview the geometry before starting the computation. This can
easily be done by adding a button. There are two ways to add a button. Either click
Button button in the Form Objects section of the Form tab on the ribbon, as shown
in the figure below, or use the Editor Tools window. In this example, you will use
the latter method.
| 123
1 First, make sure the Editor Tools window is visible by selecting the
corresponding button on the Home tab of the ribbon.
2 In the Editor Tools tree, right-click the Geometry node and select Button.
For each button, there is a command sequence that controls the action taken
when it is pressed. The command sequence is defined in the Settings window of
124 |
the button. You can open the Settings window (if not already opened) by
double-clicking a button.
4 Double-click the Geometry button to see its Settings window. Command
sequences appear below the tree in the Choose Commands to Run section.
In this case, the command sequence for the Geometry has one command for
plotting the geometry. The input argument contains information concerning
which graphics window to send the geometry plot to. In this case, the graphics
object is graphics1.
To automatically adjust the axis settings, you can add a Zoom Extents command.
5 In the Choose Commands to Run section, locate the Zoom Extents command
under GUI Commands > Graphics Commands. Double-click to add it to the
command sequence.
6 Now, create the input argument to the Zoom Extents command. Click the white
field next to Zoom extents and click the Edit Argument button.
| 125
7 This opens a dialog box with possible input arguments. Select graphics1 under
form1.
9 To make sure the new Geometry button works, you can test the application again
by clicking Test Application on the ribbon.
126 |
To use a form in the Model Builder that was created with the Application Builder,
right-click Global Definitions and select the form under Settings Forms.
M ETHODS
When you need to perform a more advanced operation than what is possible with
a command sequence, you can use the Method Editor to write code that defines
the actions to be taken when the user clicks a button, selects a menu item, etc. In
addition to calling methods from applications or Settings Forms, you can call
methods from the Developer tab on the ribbon or from Method Calls in the model
tree. For more information, see Introduction to Application Builder.
An easy way to get started with the Method Editor is to convert an existing
command sequence into a method.
1 In the Application Builder, locate or open the Settings window for the Geometry
button again. Select Convert to Method in the menu below the command
sequence. (The other two options in the drop-down list are for creating two
types of local methods.)
| 127
2 To open the method in the Method Editor, click the Go to Method button below
the command sequence.
The Method Editor now opens with the code for method1, corresponding to
the Plot Geometry and the Zoom Extents commands in the previous command
sequence.
The Application Builder has several tools for automatically generating code. In
addition to converting a command sequence to a method, you can, for example,
click Record Code on the ribbon.
This will generate code for each operation performed in the COMSOL Desktop
windows. Click Stop Recording on the ribbon to stop recording and go back to the
Method Editor.
128 |
from a Blank form or Single form template; however, using templates accelerates
this process. For more information, see Introduction to Application Builder.
This example uses the busbar model. You can open the busbar file from the
Application Libraries under COMSOL Multiphysics > Multiphysics or, if you saved
your model upon completing Example 2 on page 116, you can open your saved
busbar.mph file.
1 To switch from the Model Builder to the Application Builder, click the
Application Builder button in the leftmost Workspace section of the Home tab on
the ribbon.
| 129
2 To create a new form, click the New Form button on the ribbon. This will create
a new global form.
130 |
The Select Content page appears.
Just like when using the Single form template, this page consists of four tabs for
Inputs, Outputs, Graphics, and Ribbon buttons. On the Inputs tab, you can
double-click the parameters in the tree to make these available in the user
interface of the application. In the same way as in the earlier example, using the
Single form template, on the Inputs tab, double-click each of the parameters:
Length (L), Width (wbb), and Applied voltage (Vtot). Also, in the Outputs page
double-click Volume Maximum under Derived Values.
3 Continue by clicking the Graphics tab in the wizard and double-click the
Temperature plot. A graphics object placeholder appears in the Preview area.
| 131
When using the Basic layout template, this selection determines the default plot
shown when the application is started.
4 The Ribbon buttons tab displays the model and application tree nodes that can
be run by clicking a button on the ribbon in the application user interface.
In the figure below, buttons have been added corresponding to the actions: Plot
Geometry, Plot Mesh, Compute Study, Plot Electric Potential, Plot Temperature,
Plot Current Density, and Reset Window Layout.
The option Reset Window Layout is available under GUI Commands > Main
Window Commands > Reset Window Layout. The application consists of two
subwindows, one for the inputs and outputs and one for the graphics. The Reset
Window Layout button will reset the two resizable subwindows in the application
to their original size. The Subwindows template is similar to the Basic template
but additionally allows you to detach, move around, and dock the subwindows.
In this case, the Reset Window Layout operation will rearrange all subwindows
to their original position and size.
Using the Main Window Editor in the Application Builder, you can add ribbon
buttons that run your own custom command sequences or methods.
Click Done to exit the wizard. This automatically takes you to the Main Window
Editor.
132 |
5 You can test the application by clicking Test Application on the ribbon.
To learn more about using the Form Editor and the Method Editor, see the book
Introduction to Application Builder, which provides more information on
writing methods. For more in-depth information on methods, see the
Application Programming Guide and the Application Builder Reference
Manual.
This completes the busbar example. To switch back to the Model Builder, click
the Model Builder button on the ribbon.
| 133
Over view of A d vance d Topics
The next sections are designed to deepen your understanding of the steps
implemented so far and to extend your simulation to include additional effects like
thermal expansion and fluid flow. These additional topics begin on the following
pages:
• “Parameters, Functions, Variables, and Couplings” on page 136
• “Material Properties and Material Libraries” on page 141
• “Adding Meshes” on page 143
• “Adding Physics” on page 146
• “Parametric Sweeps” on page 169
• “Parallel Computing” on page 181
• “COMSOL Multiphysics Client–Server” on page 185
• “Appendix A — Building a Geometry” on page 214
134 |
Advanced Topics
| 135
Parameters, Functions, Variables, and Couplings
This section explores working with parameters, functions, variables, and nonlocal
couplings.
The Global Definitions and Component > Definitions nodes contain functionality
that helps you to prepare model inputs and nonlocal couplings and to organize
simulations. You have already used the functionality for adding parameters to
organize model inputs in “Global Definitions” on page 81.
Functions, available as both Global Definitions and Component > Definitions,
contain a set of predefined function templates that can be useful when setting up
multiphysics simulations. For example, the Step function template can create a
smooth step function for defining different types of spatial or temporal transitions.
To illustrate using functions, assume that you want to add a time-dependent study
to the busbar model, where an electric potential is applied across the busbar that
goes from 0 V to 20 mV in 0.5 seconds. For this purpose, you could use a step
function to be multiplied with the parameter Vtot. In this section, you will add a
step function to the model that goes smoothly from 0 to 1 in 0.5 seconds to find
out how functions can be defined and verified.
D EFINING F UNCTIONS
For this section, you can continue working with the same model file created in the
previous section. Locate and open the file busbar.mph from page 116 if it is not
already open on the desktop.
136 |
1 Right-click the Global Definitions node and select Functions > Step .
2 In the Settings window for Step, enter 0.25 in the Location field to set the
location of the middle of the step function, where it has the value of 0.5.
| 137
3 Click Smoothing to expand the section and enter 0.5 in the Size of transition zone
field to set the width of the smoothing interval. Keep the default Number of
continuous derivatives at 2.
4 Click the Plot button in the Settings window for Step.
If your plot matches the one below, this confirms that you have defined the
function correctly.
You can enable an interactive tooltip that displays data values while
hovering over the graph. To enable this, click the Enable Tooltip button in
the Graphics toolbar.
You can also add comments to the function to make it more descriptive.
138 |
5 Right-click the Step 1 node in the Model Builder window and select
Properties .
6 In the Properties window, enter any information you want. Right-click the
Properties tab and select Close when you are finished. Special characters and
markup tags that you use here will be displayed in reports generated from the
Reports node.
For the purpose of this exercise, assume that you want to introduce additional
components, for example, a second component to represent an electric device
connected to the busbar through the titanium bolts.
| 139
In this case, it is good practice to give each component a descriptive name. Now,
rename Component 1 to specify that it represents the busbar.
1 Right-click the Component 1 node and select Rename (or press F2).
2 In the Rename Component window, enter Busbar. Click OK and save the model.
140 |
Material Properties and Material Libraries
You have already used the functionality in the Materials node to access the
properties of copper and titanium in the busbar model. In the Materials node, you
are also able to define your own materials and save them in your material library.
In addition, you can add material properties to existing materials. In cases where
you define properties that are functions of other variables, typically temperature,
the plot functionality helps you to verify the property functions in the range of
interest. You can also load Excel® spreadsheets and define interpolation functions
for material properties using LiveLink™ for Excel®.
The Material Library add-on product contains over 15000 materials with
hundreds of thousands of material properties. In addition, many of the add-on
products include material libraries relevant to their application areas.
First, investigate how to add properties to an existing material. Assume that you
want to add bulk modulus and shear modulus to the copper properties.
C USTOMIZING M ATERIALS
Let us keep working on the busbar.
1 In the Model Builder window, under Materials,
click Copper .
| 141
the values are not yet defined. To define the values, click the Value column. In
the Bulk modulus row, enter 140e9 and in the Shear modulus row, enter 46e9.
By adding these material properties, you have changed the contents of the Copper
material. You can save this information in your own material library, but not in the
read-only Solid Mechanics materials library.
4 In the Model Builder window, right-click Copper and select Add to User-Defined
Library .
To see this library, click the Browse Materials in the Materials tab on the ribbon.
142 |
Adding Mesh es
A model component can contain different mesh sequences for generating meshes
with different settings. A mesh sequence is an ordered set of instructions for
generating a mesh. Mesh sequences can be accessed by the study steps. In a study,
you can select which mesh you would like to use in a particular simulation.
In the busbar model, a second mesh node is now added to create a mesh that is a
bit coarser (has larger elements).
A DDING A M ESH
1 Open the model busbar.mph that
was saved earlier on page 116.
2 In order to keep this model in a
separate file for later use, select File
> Save As and rename the model
busbar_I.mph.
3 To add a second mesh node,
right-click the Component 1 node
and select Add Mesh . (If you
followed the instructions in
“Parameters, Functions, Variables,
and Couplings” on page 136, the
name of Component 1 is Busbar
instead.)
By adding another Mesh node, a
Meshes parent node is created that
contains both Mesh 1 and Mesh 2.
4 Click the Mesh 2 node. In the Settings
window for Mesh under Mesh Settings, select
User-controlled mesh as the Sequence type.
A Size and Free Tetrahedral node are now
available under Mesh 2.
| 143
5 In the Model Builder window, under Mesh 2, click Size .
The asterisk in the upper-right corner of a node icon indicates that the node is
being edited.
6 In the Settings window for Size, under Element Size, click the Custom button.
7 Under Element Size Parameters, enter:
- 2*mh in the Maximum element size field, where mh is 3 mm — the mesh control
parameter defined previously.
- 2*(mh-mh/3) in the Minimum element size field.
- 0.2 in the Curvature factor field.
8 Click Build All . Save the file as busbar_I.mph.
Compare Mesh 1 and Mesh 2 by clicking the Mesh nodes. The mesh is updated in
the Graphics window. An alternative to
creating multiple meshes in this way is to
run a parametric sweep of the parameter
144 |
for the maximum mesh size, mh, that was
defined in the section “Global Definitions” on page 81.
Mesh 1 Mesh 2
| 145
Adding Physics
S TRUCTURAL M ECHANICS
After completing the busbar Joule heating simulation, we know that there is a
temperature rise in the busbar. What kind of mechanical stress is induced by
thermal expansion? To answer this question, let us expand the model to include
the physics associated with structural mechanics.
To complete these steps, either the Structural Mechanics Module or the
MEMS Module (which enhances the core Solid Mechanics interface) is
required.
If you want to add cooling by fluid flow, or do not have the Structural
Mechanics Module or MEMS Module, read this section and then go to
“Cooling by Adding Fluid Flow” on page 155.
1 Open the model busbar.mph that was saved earlier on page 116. From the main
menu, select File > Save As and rename the model busbar_II.mph. Alternatively,
you could load the busbar.mph model from the Application Libraries as shown
earlier.
2 In the Model Builder window,
right-click the Component 1 node
and select Add Physics .
146 |
3 In the Add Physics window, under
Structural Mechanics, select Solid
Mechanics .
To add this interface, you can
right-click and select Add to
Component 1 or click the Add to
Component 1 button at the top of
the window. You can also
double-click.
4 Close the Add Physics window and
save the file.
When adding additional physics, you need to make sure that materials
included in the Materials node have all of the required properties for the
selected physics. In this example, all properties are already available for
copper and titanium.
You can start by adding the effect of thermal expansion to the structural
analysis.
5 In the Model Builder window,
right-click the Multiphysics node
and select Thermal Expansion .
A Thermal Expansion node is added
to the model tree.
You can also use the ribbon and,
from the Physics tab, select
Multiphysics Couplings > Thermal
Expansion.
| 147
6 In the Settings window for Thermal
Expansion, select All domains from the
Selection list. This will enable thermal
expansion in the copper as well as in the
titanium bolts.
The Thermal Expansion Properties
section of this window shows
information about the coefficient of
thermal expansion and the strain
reference temperature (there are also
some more advanced settings). The
Coefficient of thermal expansion takes its
value from the Materials node. In the
Model Input section, the Volume
reference temperature (strain reference
temperature) has a default value of
293.15 K (room temperature) taken
from Common model input, which in
this case corresponds to the Default
Model Inputs node that is available in
Global Definitions, and defines the
temperature for which there is no
thermal expansion. The Coupled
Interfaces section shows which two
physics interfaces define the physics for
heat transfer and solid mechanics. This
is useful in the case where there is more
than one physics interface for heat
transfer or solid mechanics in the model
component. Keep all default settings in
this window.
Next, constrain the busbar at the position of the titanium bolts.
7 In the model tree, right-click Solid Mechanics and from the boundary level,
select Fixed Constraint . A node with the same name is added to the tree.
8 Click the Fixed Constraint node . In the Graphics
window, rotate the busbar to view the back. Click the
circular surface of one of the bolts to add it to the
Selection list.
148 |
9 Repeat this procedure for the remaining bolts to add boundaries 8, 15, and 43.
15 43
Next, we update the Study node to take the added physics into account.
| 149
two separate study steps to save computation time — one for Joule heating and a
second one for structural analysis. In a more advanced analysis, you can include all
of the aforementioned effects.
For this example, you can skip these steps and just click Compute.
However, the following technique can be useful for saving computational
time and memory resources, especially for larger simulations.
1 In the Model Builder window, right-click
Study 1 and select Study Steps > Stationary >
Stationary to add a second stationary study
step.
When adding study steps, you need to manually connect the respective
physics with the correct study step. We start by disabling the structural
analysis from the first step.
2 Under Study 1, click the Step 1: Stationary node
.
3 In the Settings window for Stationary, locate the
Physics and Variables Selection.
4 In the Solid Mechanics (solid) row under Solve for, click to change the check mark
to an to remove Solid Mechanics from Study Step 1.
In the Multiphysics couplings section, keep all of the default settings.
Now, repeat these steps to remove Electric Currents (ec) and Heat Transfer in
Solids (ht) from the second study step.
5 Under Study 1, click Step 2: Stationary 2 .
150 |
6 Under Physics and Variables Selection, in the Electric Currents (ec) and
Heat Transfer in Solids (ht) rows, click to change the check mark to
an to remove Joule heating from Step 2: Stationary 2.
7 Right-click the Study 1 node and select Compute (or press F8 or click
Compute on the ribbon) to solve.
Save the file as busbar_II.mph, which now includes the Solid Mechanics interface
and the additional study step.
R ESULTING D EFORMATION
Now that a physics interface has been added, additional plots for Solid Mechanics
need to be added manually. First, a displacement plot.
1 In the Model Builder window, right-click Results and add a 3D Plot Group .
In the Label field enter Displacement to give the plot group a descriptive name.
Right-click Displacement and add a Surface 1 node . Click the Surface 1
node .
| 151
2 In the Settings window for Surface in
the Expression section, click the Replace
Expression button .
152 |
The deformations shown in the figure are highly amplified to make the
very small distortions that actually take place more visible.
4 Save the busbar_II.mph file, which now includes a Surface plot with a
Deformation.
You can also plot the von Mises and principal stresses to assess the
structural integrity of the busbar and the bolts.
| 153
The figure below shows the Override and Contribution section in the Settings
window for Electric Potential. The Overrides list indicates that this boundary
condition takes precedence over the default Electric Insulation boundary condition.
A flux boundary condition, such as one specifying a heat flux, is a typical example
of a contributing node. You can stack several heat flux boundary conditions and
they will all contribute to the total heat flux. The figure below shows an example
where a Heat Flux 2 boundary condition overrides the default Thermal Insulation
boundary condition and contributes to the heat flux together with Heat Flux 1.
In the model tree, the override and contribution relationships are indicated by a
red arrow and an orange circle, respectively.
154 |
C OOLING BY A DDING F LUID F LOW
After analyzing the heat generated in the busbar and possibly the induced thermal
expansion, you might want to investigate ways of cooling the busbar by letting air
flow over its surfaces. These steps do not require any additional modules, as the
model only includes Joule heating without the previous thermal expansion
analysis.
If you use either the Nonisothermal Flow or Conjugate Heat Transfer
multiphysics interface, the coupling between heat transfer in solids and fluids
is automatic, whereas in this example, this is done manually and with limited
functionality. This is to illustrate adding a multiphysics coupling to an already
existing analysis.
Adding fluid flow to the Joule heating model creates a new multiphysics coupling.
To simulate the flow domain, you need to create an air box around the busbar for
the external flow. You can do this manually by altering the geometry from your
first model or by opening an Application Library file. To save time, open a file with
the box already created.
After loading the geometry, as described later, you will learn how to simulate air
flow according to this figure:
Air outlet
Air inlet
| 155
1 If you have just reopened the software, close the New window that opens
automatically by clicking the Cancel button .
2 Click the Home tab, and, from the Windows menu, select Application Libraries .
Navigate to COMSOL Multiphysics > Multiphysics > busbar box. (You can also
open the Application Libraries directly from the File menu.)
Double-click to open the file,
which contains the geometry
in addition to the physics
modeling steps completed
through the end of the
section “Customizing
Materials” on page 141.
156 |
and a description of your choice in the Description column, such as Inlet
velocity.
5 Select File > Save As and save the model with a new name, busbar_box_I.mph.
A DDING A IR
The next step is to add the material properties of air.
1 From the Home tab, select Add Material (or right-click the Materials node and
select Add Material from Library).
2 In the Add Material window, expand
the Built-In node. Right-click Air and
select Add to Component 1. Close the
Add Material window.
3 In the Model Builder window, under Materials, click the Air node .
| 157
5 In the Graphics window, click the air box (domain 1) to add it to the Selection
list, which changes the color to blue. This step assigns the air material properties
to the air box.
158 |
4 In the model tree, select the
Electric Currents (ec) node
. In the Graphics window,
move the mouse pointer
over the air domain and
click to remove it from the
selection list. At this point,
only the busbar should be
selected and highlighted in
blue.
5 In the Model Builder window, right-click Heat Transfer in Solids . In the first
section of the context menu, the domain level , select Fluid.
| 159
7 In the Settings window for Fluid, under
Heat Transfer in Solids, in the section
Model Input, select Absolute pressure
(spf) from the Absolute pressure list. In
the section Heat Convection, select
Velocity field (spf) from the Velocity field
list.
This identifies the pressure and flow
field from the Laminar Flow interface
and couples it to heat transfer.
Now, define the boundary conditions
by specifying the inlet and outlet for the
heat transfer in the fluid domain.
8 In the Model Builder window, right-click Heat
Transfer in Solids . In the second section of
the context menu, the boundary section ,
select Temperature.
A Temperature node is added to the model
tree.
160 |
10In the Model Builder window, right-click Heat Transfer in Solids . At the
boundary level, select Flow Conditions > Outflow. An Outflow node is added
to the model tree.
| 161
The settings for the busbar, the bolts, and the Electric Potential 1 and
Ground 1 boundaries have retained the correct selection, even though you
added the box geometry for the air domain. To confirm this, in the model
tree under Electric Currents, click the Electric Potential 1 and the Ground 1
nodes to verify that they have the correct boundary selection.
Next, continue with the flow settings. You need to indicate that fluid flow only
takes place in the fluid domain and then set the inlet, outlet, and symmetry
conditions. Do this by first removing all domains from the selection and then
adding the air domain.
1 In the model tree, click the Laminar Flow node . In the Settings window for
Laminar Flow, click the Clear Selection button .
162 |
2 In the Graphics window, click the air box (domain 1) to add it to the Selection.
| 163
5 In the Settings window for Inlet
under Velocity in the U0 field,
enter Vin to set the Normal inflow
velocity.
164 |
When you know the boundary
numbers, you can click the
Paste Selection button and
enter the information. In this
example, enter 1,3,4,48 in the
Paste Selection window. Click
OK and the boundaries are automatically added to the Selection list.
| 165
S OLVING FOR F LUID F LOW AND J OULE H EATING
When the flow field is solved before the temperature field, it yields a weakly
coupled multiphysics problem. The study sequence described in this section
automatically solves such a weak, or one-directional, coupling.
1 In the model tree, right-click Study 1 and select Study Steps > Stationary >
Stationary to add a second stationary study step to the Model Builder window.
Next, the correct physics needs to be connected with the correct study step.
Start by disabling the Electric Currents (ec) and Heat Transfer in Solids (ht)
interfaces associated with Joule heating from the first step.
2 Under Study 1, click Step 1: Stationary .
3 In the Settings window for Stationary, locate the Physics and Variables Selection
section. In both the Electric Currents (ec) and the Heat Transfer in Solids (ht)
rows, click to change the check mark to an in the Solve for column,
removing the Joule heating effect from Step 1.
166 |
4 Repeat the step. Under Study 1, click Step 2: Stationary 2 . Under Physics and
Variables Selection, in the Laminar Flow (spf) row, click in the Solve for column to
change the check mark to an .
5 Right-click the Study 1 node and select Compute (or press F8 or click
Compute on the ribbon). This will now automatically create a new solver
sequence that solves for laminar flow and then Joule heating.
6 After the solution is complete, select the Temperature (ht) plot under the Results
node in the Model Builder window. If you do not already have transparency on,
click the Transparency button on the Graphics toolbar to visualize the
| 167
temperature field inside the box. To zoom, middle-click and hold down the
mouse button (or scroll wheel) while dragging the mouse.
The Temperature plot that displays in the Graphics window shows the
temperature in the busbar and in the surrounding box. You can also see that the
temperature field is not smooth due to the relatively coarse mesh. A good
strategy to get a smoother solution would be to refine the mesh to estimate the
accuracy.
7 At this point, save the busbar_box_I.mph file so you can return to it at any time.
The next steps use the original busbar.mph file.
168 |
P a r a m e t r i c S w e ep s
| 169
The Sweep type is used to control parametric sweeps with multiple
parameters. You can choose between sweeping for All combinations of
the given parameters, a subset of Specified combinations, or Parameter
switch. The option Parameter switch makes it possible to sweep over
Cases for Parameters, as defined in Global Definitions (shown below).
Note that you can replace the set of main Parameters used in the model
with that of a Case by selecting from the menu in the upper-left corner
of the Parameters window.
170 |
3 Enter a range of parameter values to sweep the width of the busbar from 5 cm
to 10 cm in 1 cm increments. There are different ways to enter this information:
- Copy and paste or enter range(0.05,0.01,0.1) into the Parameter value list
field.
- Click the Parameter value list field and then
click the Range button and enter the
values in the Range dialog box. In the Start
field, enter 0.05. In the Step field, enter
0.01, and in the Stop field, enter 0.1. Click
Replace.
- In any of the methods, you can also use
length units to override the default SI unit
system using meters. Instead of 0.05, you
can enter 5[cm]; similarly, 1[cm] instead of
0.01 and 10[cm] instead of 0.1. You can also
change the default unit system from the
Settings window of the root node in the
model tree.
Next, define an Average nonlocal coupling that can be used later to calculate the
average temperature in the busbar.
| 171
4 Under Component 1, right-click Definitions and select Nonlocal Couplings >
Average .
5 In the Settings window for Average, select All domains from the Selection list.
172 |
P ARAMETRIC S WEEP R ESULTS
Click the Temperature (ht) 1 node (the second
temperature plot node) located under Results in the
model tree.
The plot that displays in the Graphics window shows
the temperature in the wider busbar using the last
parameter value, wbb=0.1[m] (10[cm]). Select Zoom
Extents from the Graphics window toolbar so that
you can see the entire plot. The resulting plot is rather
uniform in color, so we need to change the maximum
color range.
| 173
2 In the Settings window for Volume,
click Range to expand the section.
Select the Manual color range check
box. Enter 309.5 in the Maximum field
(replace the default).
3 The Temperature (ht) 1 plot is
updated in the Graphics window for
wbb=0.1[m] (10[cm]).
The plot may look a bit different depending on which version you are running.
Compare the wider busbar plot to the temperature for wbb=0.05[m] (5[cm]).
For this purpose, you can reuse one of the previously defined plot groups.
1 In the Model Builder window, click the first Temperature (ht) node .
174 |
2 In the Settings window for
3D Plot Group, select
Study 1/Parametric Solutions
1 from the Dataset list. This
dataset contains the results
from the parametric sweep.
3 In the Parameter value list,
select 0.05 (which
represents wbb=5 cm). Click
the Plot button . Click the
Zoom Extents button on the Graphics window toolbar.
The Temperature (ht) plot is updated for wbb=0.05[m] (5[cm]). Note that if you
have updated the color range for this plot already, your plot should look similar to
the one below. If not, follow the subsequent steps.
(The plot may include the maximum and minimum points, depending on which
version of the model you started from.) Like the wider busbar, the plot may be
quite uniform in color, so change the maximum color range.
1 Under the first Temperature (ht) node, click the Volume node .
2 In the Settings window for Volume, click Range to expand the section (if it is not
already expanded). Select the Manual color range check box.
| 175
3 Enter 323.25 in the Maximum field (replace the default).
The Temperature (ht) plot is updated in the Graphics window for wbb=0.05[m]
(5[cm]).
Click the first and second Temperature plot nodes to compare the plots in the
Graphics window. The maximum temperature decreases as the width of the
busbar increases from 5 cm to 10 cm.
2 In the Settings window for the1D Plot Group, select Study 1/Parametric
Solutions 1 from the Dataset list.
176 |
3 In the Model Builder window, right-click 1D Plot Group and add a Global node.
4 In the Settings window for Global under y-Axis Data, click the first row in the
Expressions column and enter aveop1(T). This is the operator that we defined
on page 172 for later use. You use a similar syntax to calculate the average of
other quantities.
You can also use auto-completion by using Ctrl+Space after clicking the
first row or after typing a few characters.
To use a nonlocal coupling operator without solving, you can select the
option Update Solution that is available by right-clicking a Study node.
| 177
5 Click the Plot button and save the busbar_III.mph model with these
additional plots that use the parametric sweep results.
P ARAMETERS IN R ESULTS
For greater flexibility, it is possible to define parameters that are only used in the
Results node. Using these parameters does not require resolving the model. The
following example shows how you can animate over a Parameter defined under
Results.
1 Right-click the Results node and select Parameters.
178 |
2 Define a parameter, iso_level, with Expression 309.5[K].
3 Right-click the Results node and add an Isothermal Contours plot, from the Heat
Transfer in Solids branch of Study 1/Solution1. For the Isothermal Contours (ht)
plot group, in the Settings window for the Isosurface plot, change the Entry
method to Levels. For the Levels expression field, type iso_level.
| 179
5 Generate an Animation by either selecting the Player option in the Animation
menu of the Isothermal Contours (ht) 1 tab on the ribbon, or right-click the
Export node and select Animation > Player.
6 In the Settings window for Animation, change the Sequence type to Result
parameter and select the iso_level parameter. Type 309 for Start and 310 for
Stop. Click the Play button in the Graphics toolbar or the Show Frame button in
the Settings window for Animation. To get a smoother animation, change the
Number of frames to a higher number; for example, 50.
180 |
Parallel Computing
| 181
C LUSTER S WEEP
The Cluster Sweep option is used for solving several models in parallel where each
model has a different set of parameters. This can be seen as a generalization of
Parametric Sweep. Right-click the Study node to add a Cluster Sweep node.
The Study Settings for Cluster Sweep are similar to that of Parametric Sweep, but
additional settings are required for the cluster or cloud being used. The picture
above shows how the top of the Settings window for Cluster Sweep would look for
the same sweep as defined in “Parametric Sweeps” on page 169. To add and run
a Cluster Sweep in this case, you would first remove the Parametric Sweep node.
C LUSTER C OMPUTING
You can also utilize a cluster or cloud to solve a single large model using
distributed memory. For maximum performance, the COMSOL software cluster
implementation can utilize shared-memory multicore processing on each node in
combination with the Message Passing Interface (MPI) shared-memory model.
This is also known as hybrid parallelism and brings a major performance boost by
making the most out of the computational power available.
Right-click the Study node to add a Cluster Computing node. A Cluster Computing
node cannot be used in combination with a Cluster Sweep. You will be asked if you
want to remove the Cluster Sweep before proceeding. Select Yes.
182 |
The Settings window for Cluster Computing, shown below, helps to manage the
simulation with settings for the cluster or cloud.
The Settings menu under Cluster computing settings has two options: Preferences
controlled or User controlled. The figure above shows the Preferences controlled
option. For the Preferences controlled option, the settings are defined in the
Preferences dialog box in the File menu.
| 183
For the User controlled option, you choose the type of cluster job you want to
perform from the Scheduler type list.
184 |
C O M S O L M u l t i p h y s i c s C li e n t – S e r v e r
| 185
In Linux, you can use the comsol mphserver command. The server and client
sessions can be run on different operating systems. For example, the server can run
in Linux and the client session in Windows.
The first time you start a COMSOL Multiphysics server on a computer, you are
asked for a username and password that are associated with the client–server mode
of operation and stored for future connections. The figure below shows the
command window for starting a server session in Windows.
The figure below shows how to connect to a server session from the COMSOL
Desktop user interface. From the File menu, select COMSOL Multiphysics Server >
Connect to Server to connect.
186 |
You are now prompted for the username and password that you gave the first time
you started a server session.
| 187
Using the Model Manager
This section gives a brief introduction to using the Model Manager for simulation
data management. The Model Manager allows users to collaborate and centrally
organize models and apps and provides tools for version control, efficient storage,
searching for MPH-file contents, and more. A database can either be stored locally
on your computer for personal use, or, if you have an FNL, accessed remotely
from a server for collaborative use. You will learn how to create a local Model
Manager database, store simulation data, and control versions.
For detailed information on using the Model Manager, see the book Model
Manager Reference Manual.
188 |
Creating a Local Database
Assuming you have not already created a local database, this is how you create one
in order to get started using the Model Manager.
In the File menu, the Open and Save As menu items let you open and save files to
a local or shared file system. The Open From and Save To menu items also let you
open and save to a Model Manager database.
1 From the File menu, select Open From.
| 189
3 In the Add Database window, choose New Local Database .
4 In the New Local Database window, type Modeling Example as the name for the
new database in the Name field. You can choose a more suitable name if you
intend to keep using this database.
190 |
A progress window is displayed, informing you that the database is being created
on the file system.
Once finished, the Open window is shown with the newly created database selected
in the list.
6 From the Open window, you can search the database for models to open. At the
moment, your database is empty. Click Cancel.
| 191
Version Control
192 |
4 You can type an optional comment describing what you are saving in the
Comments field. Type Setup for a 3D solid mechanics model using a
stationary study.
| 193
1 From the File menu, select Save as Version.
The Save window opens with your database preselected in the list of options.
The header reads Save version, as the model already exists in the database. The
title is the same as when saving the first version.
194 |
2 In the Title field, change the title to Structural analysis of a wrench and type
Added a geometry for a wrench in the Comments field.
| 195
4 Type Added a description. in the Comments field. Click Save.
T HE V ERSIONS W INDOW
Up to this point, you have saved three versions of the model in the database.
196 |
1 From the Windows menu in the Layout section of the Home tab, select
Versions to open the Versions window.
2 You will see the three versions in a table in chronological order, with the most
recent version in the first row and the oldest version in the last row. The first
row in the table is highlighted in bold to indicate that it is the current version
in the COMSOL Desktop.
| 197
1 Select the last row in the table and click the Open button in the toolbar. You
can also double-click the row. Select No if you are asked to save any unsaved
changes.
The first version is opened in the COMSOL Desktop. In this version, there is
no Import node under the Geometry 1 node, and the Description field is
empty.
2 Select the middle row in the table and click Open .
The second version is opened in the COMSOL Desktop. In this version, the
Import node is now present under the Geometry node, but the Description field
is still empty.
3 Select the first row in the table and click Open .
The third, and latest, version is opened in the COMSOL Desktop.
198 |
W o r k i n g w i t h a D r a ft o f t h e M o d e l
It may have crossed your mind that saving a new model version requires several
steps — especially compared to just pressing Ctrl+S for a model opened from the
file system. You need to open the Save window, think of a comment describing
your changes (although the comment is not required), and then click the Save
button . You might even realize after saving multiple versions that your
modeling work has gone in the wrong direction. You would then have a version
history cluttered with unwanted versions.
A more lightweight option when working on a model is to save a draft of the
model. You can save multiple versions of this draft without affecting the original
model. Once you are happy with your draft, you can save it as a new version of the
original model. You may of course choose to discard your draft altogether and
instead go back to the original model and, perhaps, start a new draft.
S TARTING A N EW D RAFT
Let’s continue working with the wrench model but now using drafts. Make sure
that you have opened the latest (first-row) version in the Versions window.
Add a generic steel material for the wrench and save your work as a new draft.
1 Right-click Component 1>Materials and select Add Material from Library .
2 In the Add Material window, click to expand the Built-In folder. Scroll down to
find Structural steel, right-click, and select Add to Component 1.
3 Close the Add Material window.
| 199
4 From the File menu, select Save Draft. You can also use the keyboard
shortcut Ctrl+S.
You have now created a first version of a draft of the model. You can see this draft
version as a new row in the table in the Versions window above the three versions
of the original model. The draft version uses a separate pen icon ( ) to
distinguish it from the regular versions ( ). Note that the regular versions
belong to the original model, not the draft itself — they are included in the table
to make it easier for you to track where the draft originated from.
200 |
1 Select Parameters 1 in the Model Builder window.
2 In the Settings window’s Parameters table, enter these settings:
- In the Name column, enter F.
- In the Expression column, enter 150[N].
- In the Description column, enter Applied force.
3 From the File menu, select Save Draft.
Selecting Save Draft a second time creates a second version of your draft — the
Versions window now contains two draft versions and three regular versions.
Just as for the regular versions of the original model, you can inspect an older draft
version by selecting the row in the table and clicking Open .
A draft is a model in its own right in the database — existing side-by-side with the
original model. You can switch back and forth between them in the COMSOL
Desktop simply by opening one or the other.
1 From the File menu, select Open From ( ).
2 In the Open window, choose your database, Modeling Example, in the list of
options.
The Open window shows a list containing the latest version of the draft ( ) and
the latest version of the original model ( ).
3 Select the version of the original model ( ) and click the Open button .
The Model Manager detects that there is a draft of the original model in
progress that corresponds to a draft version that is newer than the latest version
| 201
of the model. A dialog box appears, in which you can choose to open that newer
draft version instead.
4 Select the top node in the tree and click Open to open the original model. The
latest version of the model is opened in the COMSOL Desktop — neither the
Structural steel node nor the Parameters settings is present in the model, as
expected.
You could, at this point, continue working with the original model, thereby
implicitly discarding your draft work. The draft itself can be manually deleted from
the database at some later time.
Assume that choose to continue with your draft. Open the latest version again:
1 From the File menu, select Open From .
2 In the Open window, choose your database in the list of options.
3 Select the draft version ( ) and click Open .
Finish the component setup by defining boundary conditions and mesh settings:
1 Right-click Solid Mechanics (solid) and select Fixed Constraints .
202 |
2 In the Graphics window, rotate the geometry and select the front surface of the
partially modeled bolt. The Boundary number in the Selection list is 35.
3 Right-click Solid Mechanics (solid) once more and select Boundary Load .
4 Select the top socket face (boundary 111) in the Graphics window.
5 In the Settings window for Boundary Load, under Force, select Total force as the
Load type and enter -F in the text field for the z component.
6 Select Mesh 1 . In the Settings window for Mesh, under Physics-Controlled
Mesh, select Finer from the Element size list.
7 Click the Build All button in the Settings window.
| 203
With the basic setup finished, select Save Draft to save a third draft version.
204 |
Open the Versions window to see that all draft versions are now gone from the
table. Instead, there is a fourth version of the original model and the draft itself
has been deleted.
| 205
Comparing Versions
You can see all changes made to the model when you save it from your draft.
1 Right-click the second row in the table in the Versions window and select
Compare ( ).
The Comparison Result window is opened with a comparison between the
current model in the COMSOL Desktop and the selected version.
2 The expanded tree shows, for example, the force parameter, the steel material,
the mesh settings, and the two boundary conditions added from your draft.
You can also compare two older versions with each other:
1 Select the second and third rows in the Versions window, using Ctrl+click, then
right-click either one, and select Compare .
The Comparison Result window is updated with a comparison between these two
versions.
206 |
2 Expand the tree and select the Attributes differ child node. In the Comparing
values table, you will find the description you added in the third model version.
| 207
Excluding Built, Computed, and Plotted Data
Let’s now run the study. First, make sure you have the latest version of the model
opened:
1 In the Versions window, double-click the first row.
2 Right-click Study 1 and select Compute to solve the model. When the
computation finishes after a few seconds, the von Mises stress is displayed in a
default Volume plot in the Graphics window.
Storing simulation data generated by a model can require large amounts of disk
space. For such data that is reproducible — such as built, computed, and plotted
data — it may be undesirable, or even impossible due to sheer size, to save it in
the database. To control which data is saved in the database:
1 Select the root node in the Model Builder window.
2 In the Settings window, in the Save section under Built, computed, and plotted
data, in the In database list, select Exclude.
Note that by using the On file list menu, you can also exclude built,
computed, and plotted data when saving to the file system.
The Save window opens for your database with the message Built, computed, and
plotted data is excluded from the save under Information.
208 |
5 Click Save .
The model remains in its solved state in the COMSOL Desktop after the save. Go
to the File menu, select Revert to Saved, and click Yes in the dialog box that
appears. The latest saved version without the solution is opened. You can
reproduce the lost (by now) solution by right-clicking Study 1 and selecting
Compute .
| 209
I m p o r t i n g A u x i l i a r y D at a t o t h e D a t a b a s e
You may have noticed that, while the model is version-controlled in the database,
the same is not true for the CAD input file. You can import the file to the database
as follows:
1 From the Windows menu in the Layout section on the Home toolbar, select
Auxiliary Data to open the Auxiliary Data window.
The Auxiliary Data window shows the input files used in the model. In this case,
a single row is shown, corresponding to the CAD file that is used in the Import
node.
2 Select the table row, right-click on either row, and select Import to Database .
3 The Import dialog box shows the file wrench.mphbin in a table.
4 Click OK.
210 |
Select the Import node in the Model Builder window. The Filename field in the
Import section in the Settings window now shows a reference to the file that is
uploaded to the database.
| 211
The Model Manager Work space
This concludes this quick introduction to the Model Manager. For detailed
information on using the Model Manager, see the book Model Manager
Reference Manual.
You are encouraged to further explore the Model Manager in the Model Manager
workspace. This is a dedicated workspace in the COMSOL Desktop for tasks
related to using the Model Manager.
To open the Model Manager workspace, click the Model Manager button in the
Workspace section of the Home toolbar. In the Model Manager workspace, you will
see the Model Manager toolbar as well as various windows belonging to the
workspace. The latest versions of your model and CAD file are displayed.
212 |
To learn more about what you can do in the workspace, you can, for example:
• Select the model and expand the model tree in the Content section of the
Settings window. Here, you can browse the content of a model without
opening it.
• Search for your model by applying various Item and Contents Filters. Examples
include a Physics filter for finding a Solid Mechanics interface ( ) or a
Parameter filter for the applied force 150[N].
• Right-click the model and select References () to see the database
relationship between the model and the CAD file in the References window.
• Right-click the CAD file and select Versions ( ) to see all versions of the
file — currently only one — in the Versions window.
• Right-click the model and select Commits ( ) to open the Commits window.
Double-click the third table row from the top. You will see details on the
commit in which a new version of the original model was saved from your
draft, and the draft itself was deleted.
In order to more easily test the various features of the Model Manager, you can
download a demo database by selecting, from the File menu, Help > Download
Demo Database for Model Manager.
This demo database contains models and associated files from the Application
Libraries.
| 213
Appendix A — Building a Geometry
This section details how to create the busbar geometry using the built-in geometry
tools in COMSOL Multiphysics. The step-by-step instructions take you through
the construction of the geometry using the parameters set up in the Global
Definitions section.
All geometry operations under the geometry node in the model tree are organized
in a parametric sequence of operations called a geometry sequence. Using
parameterized dimensions helps to produce what-if analyses and geometric
parametric sweeps.
As an alternative to building the geometry using the tools available in COMSOL
Multiphysics, you can import a geometry created with CAD software. The
optional CAD Import Module and Design Module support many CAD file
formats. Moreover, several add-on products are available that provide
bidirectional interfaces to common CAD software packages. See “Appendix E —
Connecting with LiveLink™ Add-Ons” on page 263 for a list. Note that the
Design Module, in addition to the features available in the CAD Import Module,
adds functionality for dimensions and constraints. The Design Module also
includes additional 3D geometry modeling operations such as loft, fillet, chamfer,
midsurface, and thicken.
If you have not done so already, start with “Example 2: The Busbar — A
Multiphysics Model” on page 75. Follow the steps in the section “Model Wizard”
on page 39 to add the physics and study and then follow the steps under Global
Definitions to add the parameters, which are then used in the remainder of this
section. Return to this section to learn about geometry modeling.
Alternatively, load the model
busbar_geom from the Application
Libraries tree under COMSOL
Multiphysics > Multiphysics. Then, in
the model tree, right-click the
Geometry node and select Clear
Sequence. This deletes all geometry
operations from the model tree.
The first step in the geometry
sequence is to draw the profile of the
busbar.
214 |
1 Under Component 1, right-click
Geometry 1 and select Work Plane .
In the Settings window for Work Plane:
- Select xz-plane from the Plane list (the
last option in the list).
- Click the Go to Plane Geometry
button on the toolbar in the
Settings window for Work Plane.
Continue by editing the axis and grid
settings in Work Plane 1.
2 In the Model Builder window, expand
the View 2 node and click Axis .
| 215
You can use interactive drawing to create a geometry using the drawing tools from
the Sketch tab on the ribbon while pointing and clicking in the Graphics window.
You can also right-click the Plane Geometry node under Work Plane 1 to add
geometry objects to the geometry sequence. Note that you can add geometry
objects in the same way from the Work Plane tab on the ribbon. For clarity, this
example will demonstrate the noninteractive way of creating the geometry (not
using the Sketch tab).
In the next few steps, we create a profile of the busbar.
5 In the Model Builder window under Work Plane 1, right-click Plane Geometry
and select Rectangle .
In the Settings window for Rectangle
under Size, enter:
- L+2*tbb in the Width field.
- 0.1 in the Height field.
Click the Build Selected button .
216 |
6 Create a second rectangle. Under
Work Plane 1, right-click Plane
Geometry and select Rectangle .
Under Size, enter:
- L+tbb in the Width field.
- 0.1-tbb in the Height field.
Under Position, enter:
- tbb in the yw field.
Click the Build Selected button .
Use the Boolean Difference operation
to subtract the second rectangle from
the first one.
7 Under Work Plane 1, right-click Plane
Geometry and select Booleans and
Partitions > Difference . In the
Graphics window, click r1 (the larger of the two rectangles) to add it to the
Objects to add list in the Settings window for Difference.
To help select the geometry, you can display geometry labels in the
Graphics window. In the Model Builder window under Geometry 1 >
WorkPlane 1, click the View 2 node. Go to the Settings window for View
and select the Show geometry labels check box.
| 217
8 Click the Difference node. In the
Settings window for Difference, click the
Active selection button to the left of the
Objects to subtract list. Select the
smaller rectangle, r2, by using the
mouse scroll wheel or arrow keys to
cycle through the overlapping
rectangles to first highlight it and then
click on it to select it.
Click Build Selected .
Another way to select r2 in the
Graphics window is to use the Selection
List feature. Go to the Home tab on the
ribbon and select Windows > Selection
List. In the Selection List, click to
highlight r2 (solid). Then, right-click
r2 (solid) in the list and select Add to
Objects to Subtract for Difference to add
it to the Objects to subtract list.
Right-click on the Selection List
window title and select Close.
After building the selected geometry, you should have a backward-facing,
L-shaped profile. Continue by rounding the corners of the L-shaped profile.
218 |
9 Under Work Plane 1, right-click Plane Geometry and select Fillet .
Select point 3 (in the inner-right corner) to add it to the Vertices to fillet list.
There are different ways to add points:
- In the Graphics window, click point 3 to add it to the Vertices to fillet list.
- From the Home tab, select Windows > Selection List. In the Selection List
window, click 3. The corresponding point is highlighted in the Graphics
window. Click the Add to Active Selection for Fillet button in the Settings
window for Fillet or right-click in the Selection List.
| 219
11For the outer corner, right-click
Plane Geometry and select
Fillet .
12In the Graphics window, click point
6, the outer corner, to add it to the
Vertices to fillet list.
13Enter 2*tbb in the Radius field. Click
Build Selected .
In the Design Module you will find tools available in the Sketch tab for
interactive drawing and dimensioning of fillets and general 2D sketches.
220 |
1 In the Model Builder window, right-click Work Plane 1 and select Extrude .
In the Settings window for Extrude, enter wbb in the Distances from Plane table
(replace the default) to extrude to the width of the profile.
The table allows you to enter several values in order to create sandwich
structures with different materials. In this case, only one extruded layer is
needed.
2 Click Build Selected and then click the Zoom Extents button on the Graphics
toolbar. Click the Save button and name the model busbar.mph (if you have
not already done so).
Next, create the titanium bolts by extruding two circles drawn in two work
planes.
| 221
3 In the Model Builder window, right-click Geometry 1 and add a Work Plane .
A Work Plane 2 node is added. In the Settings window for Work Plane, under
Plane Definition, select Face parallel as the Plane type.
4 In the Graphics window, click face 8, as shown in the figure below, to add it to
the Planar face list in the Settings window for Work Plane.
Face 8 is now highlighted in blue and the work plane is positioned on top of the
face.
5 Click the Go to Plane Geometry button to start drawing the first circle
representing the position of the first bolt. Click the Zoom Extents button on
the Graphics toolbar.
222 |
6 Under Work Plane 2, right-click
Plane Geometry and select Circle
.
In the Settings window for Circle:
- Under Size and Shape, in the
Radius field, enter rad_1.
- Under Position, leave the default
xw and yw coordinates (0, 0).
Click Build Selected .
| 223
1 In the Model Builder window, right-click Work Plane 2 and select Extrude .
In the Settings window for Extrude, in the first row of the Distances from Plane
table, enter -2*tbb to extrude the circle.
2 Click the Build Selected button to create the cylindrical part of the titanium
bolt that runs through the busbar.
224 |
3 Right-click Geometry 1 and select Work Plane . A Work Plane 3 node is
added. In the Settings window for Work Plane, for Work Plane 3, select Face
parallel as the Plane type.
4 In the Graphics window, click face 4, as shown in the figure, to add it to the
Planar face list in the Settings window for Work Plane.
5 Click the Show Work Plane button on the Settings window for Work Plane and
the Zoom Extents button on the Graphics toolbar to get a better view of the
geometry.
To parameterize the position of the two remaining bolts, add the circles that
form the cross sections of the bolts.
| 225
6 Under Work Plane 3, right-click Plane Geometry and select Circle .
In the Settings window for Circle:
- Under Size and Shape, enter rad_1
in the Radius field.
- Under Position, enter
-L/2+1.5[cm] in the xw field and
-wbb/4 in the yw field.
Click Build Selected .
226 |
10Click Build Selected and click the Zoom Extents button on the Graphics
toolbar.
Your geometry, as shown in the work plane, should match this figure so far.
| 227
11In the Model Builder window, right-click Work Plane 3 and select Extrude .
In the Settings window for Extrude, in the first row of the Distances from Plane
table, enter -2*tbb (replace the default). Click Build All Objects .
The geometry and geometry sequence should match the figures below. Click
the Save button and name the model busbar.mph.
228 |
C r e a t i n g P a r t s a n d U s i n g the Pa rt Libra rie s
From the Parts ribbon section, you can choose to create or load a part, or add a
part to the model geometry by selecting one from the Part Libraries. Several Part
Libraries are already provided with the software by default. When new parts are
created, they are added under a part’s parent node in the Global Definitions section
of the model tree. To add a part from a library, you can also right-click the
Geometry node and select Parts > Part Libraries.
| 229
The figure below shows an Internal Helical Gear part from the part library of the
Multibody Dynamics Module. The part comes with 18 Input Parameters that
control the dimensions.
For additional information on working with parts and the Part Libraries, see the
Reference Manual.
To continue with the busbar tutorial, return to the section “Materials” on
page 89.
230 |
Appendix B — Keyboard and Mouse Shortcuts
These shortcuts are applicable to the Model Builder, Application Builder, Model
Manager, and the Graphics window.
K EYBOARD S HORTCUTS
| 231
SHORTCUT (WINDOWS, LINUX) SHORTCUT (MACOS) ACTION
232 |
SHORTCUT (WINDOWS, LINUX) SHORTCUT (MACOS) ACTION
| 233
SHORTCUT (WINDOWS, LINUX) SHORTCUT (MACOS) ACTION
234 |
SHORTCUT (WINDOWS, LINUX) SHORTCUT (MACOS) ACTION
| 235
SHORTCUT (WINDOWS, LINUX) SHORTCUT (MACOS) ACTION
236 |
M OUSE S HORTCUTS
Left-click and hold down the Same as for Windows Rotate the scene around the axes
mouse button while dragging parallel to the screen’s x- and y-axes
the mouse. with the origin at the scene rotation
point.
Right-click and hold down the Same as for Windows Move the visible frame on the image
mouse button while dragging plane in any direction (pan).
the mouse.
Middle-click and hold down the Same as for Windows The scene is zoomed in/out around
mouse button while dragging the mouse position where the
the mouse. action started.
Press Ctrl and use the scroll Same as for Windows The scene is zoomed in or out
wheel. around the mouse position where
the action started.
Middle-click and use the scroll Same as for Windows The scene is zoomed in/out around
wheel. the mouse position where the
action started with, but with
somewhat larger steps.
Press Ctrl and left-click. While Same as for Windows Tilt and pan the camera by rotating
holding down the key and about the x- and y-axes in the image
button, drag the mouse. plane.
Press Ctrl and right-click. While Same as for Windows Move the camera in the plane
holding down the key and parallel to the image plane.
button, drag the mouse.
Press Ctrl and middle-click. Same as for Windows Move the camera into and away
While holding down the key from the object (dolly in or out).
and button, drag the mouse.
Press Ctrl and middle-click. Same as for Windows Zoom to the area around the point
on the model determined by the
mouse position.
Press Ctrl+Alt and left-click. Same as for Windows Rotate the objects in the scene
While holding down the keys around the camera look-at direction.
and button, drag the mouse.
Press Alt and left-click. While Same as for Windows. Rotate the objects in the scene
holding down the key and around the axis that intersects the
button, drag the mouse. camera origin and the scene’s
rotation center (roll direction).
| 237
SHORTCUT (WINDOWS, LINUX) SHORTCUT (MACOS) ACTION
Press Alt and right-click. While Same as for Windows Move the scene in the plane
holding down the key and orthogonal to the axis between the
button, drag the mouse. camera and the scene rotation
point.
Press Alt and middle-click. Same as for Windows Move the camera along the axis
While holding down the key between the camera and the scene
and button, drag the mouse. rotation point.
Middle-click on model. Same as for Windows Set the center of rotation.
Press X, Y, or Z and left-click. Same as for Windows Rotate around the X, Y, or Z-axis,
While holding down the key respectively.
and button, drag the mouse.
R R Toggle between manual and
automatic rotation center.
+ or - keyboard button, or + or - keyboard Cycle between 3D geometric
Up arrow or Down arrow button, or entities (domains, boundaries, edges,
button. Up arrow or Down points) for selection. When focus is
arrow button in the Graphics window.
238 |
Appendix C — Language Elements and Reserved Names
These language elements are built in or user defined. Operators cannot be user
defined. Expressions are always user defined.
| 239
Constants and Parameters
There are three different types of constants accessible from the Model Builder:
built-in mathematical and numerical constants, built-in physical constants, and
parameters. Parameters are user-defined constants, which can vary over parameter
sweeps. Constants are scalar valued. The tables below list the built-in
mathematical and numerical constants as well as built-in physical constants.
Constants and parameters can have units.
240 |
B UILT - IN P HYSICAL C ONSTANTS
P ARAMETERS
Parameters are user-defined constant scalars in the Global Definitions branch in the
model tree. Example uses are:
• Parameterizing geometric dimensions
| 241
• Parameterizing mesh element sizes
• Defining parameters to be used in parametric sweeps
Variables
There are two types of variables used in the Model Builder: built-in variables and
user-defined variables. Variables can be scalars or fields. Variables can have units.
Note: Spatial coordinate variables and dependent variables are user-defined
variables of special interest. These variables have default names based on the space
dimension of the geometry and the physics interface, respectively. As a result of
the names chosen for these variables, a list of built-in variables will be created by
COMSOL Multiphysics: the first- and second-order derivatives with respect to
space and time. The following table contains some of the most important built-in
variables. For a complete list, see the Reference Manual.
242 |
B UILT - IN V ARIABLES
| 243
qual, qualcondition, Mesh quality measures Field
qualcurvedskewness,
qualgrowth,
qualmaxangle,
qualskewness,
qualvollength
realdetjac The determinant of the Jacobian matrix for the Field
mapping from a straight mesh element to the
possibly curved element used when solving. Use
this variable to measure the difference in shape
between a curved element and the
corresponding straight element.
realdetjacmin A scalar field variable for each element defined as Field
the minimum value of the reldetjac variable
for the corresponding element.
A reldetjacmin value less than zero for an
element means that the element is wrapped
inside-out; that is, the element is an inverted
mesh element.
s,s1,s2 Curve and surface parameterization variables Field
t Time Global
variable
tcurvx,tcurvy,tcurv1x, Tangential directions for the corresponding Field
curv1y,tcurv1z,tcurv2x, curvature variables
tcurv2y,tcurv2z
tx,ty,t1x,t1y,t1z, Tangent vector components corresponding to the Field
t2x,t2y,t2z curve and surface parameterizations
qual A mesh quality measure between 0 (poor quality) Field
and 1 (perfect quality)
Example: T is the name for the temperature in a 2D, time-dependent heat transfer
model; x and y are the spatial coordinate names. In this case, the following built-in
variables will be generated: T, Tx, Ty, Txx, Txy, Tyx, Tyy, Tt, Txt, Tyt, Txxt, Txyt,
Tyxt, Tyyt, Ttt, Txtt, Tytt, Txxtt, Txytt, Tyxtt, and Tyytt. Here, Tx corresponds
to the partial derivative of the temperature T with respect to x, Ttt corresponds to
244 |
the second-order time derivative of T, and so on. If the spatial coordinate variables
have other names — for example, psi and chi — then Txy would be Tpsichi, and
Txt would be Tpsit. (The time variable t is built in; the user cannot change its
name.)
Functio n s
In the Model Builder, there are two types of functions: built-in and user-defined.
Functions can be scalar valued or field valued depending on the input
argument(s). Some functions can have units for both input and output arguments.
| 245
NAME DESCRIPTION SYNTAX EXAMPLE
ceil Nearest following integer ceil(x)
conj Complex conjugate conj(x)
cos Cosine cos(x)
cosh Hyperbolic cosine cosh(x)
cot Cotangent cot(x)
coth Hyperbolic cotangent coth(x)
csc Cosecant csc(x)
csch Hyperbolic cosecant csch(x)
erf Error function erf(x)
erfinv Inverse error function erfinv(x)
exp Exponential exp(x)
factorial Factorial of nonnegative integer factorial(n)
floor Nearest previous integer floor(x)
gamma Gamma function gamma(x)
gcd Greatest common divisor gcd(a,b)
imag Imaginary part imag(u)
lcm Least common multiple lcm(a,b)
legendre Legendre polynomials legendre(l,x)
legendre Associated Legendre functions legendre(l,m,x)
log Natural logarithm log(x)
log10 Base-10 logarithm log10(x)
log2 Base-2 logarithm log2(x)
max Maximum of two arguments max(a,b)
min Minimum of two arguments min(a,b)
mod Modulo operator mod(a,b)
poweps Power for use with derivatives of poweps(x,n)
expressions that need to be evaluated near
zero
psi Psi function and its derivatives psi(x,k)
random Random function, uniform distribution random(x,y,...)
randomnormal Random function, normal distribution randomnormal(x,y,...)
range Create a range of numbers range(a,step,b)
real Real part real(u)
246 |
NAME DESCRIPTION SYNTAX EXAMPLE
round Round to closest integer round(x), round(x,p)
sec Secant sec(x)
sech Hyperbolic secant sech(x)
sign Signum function sign(u)
sin Sine sin(x)
sinh Hyperbolic sine sinh(x)
sphericaly Spherical harmonic function sphericaly(l,m,theta,phi)
sphericalyr Real spherical harmonic function sphericalyr(l,m,theta,phi)
sqrt Square root sqrt(x)
sqrteps Square root for use with expressions that sqrteps(x)
need to be evaluated near zero
tan Tangent tan(x)
tanh Hyperbolic tangent tanh(x)
zernike Zernike polynomials zernike(n,m,r,phi)
| 247
B UILT - IN O PERATOR F UNCTIONS
These built-in functions behave differently than the built-in mathematical
functions. They may not belong in an introductory text but are listed to complete
the list of reserved names. For more information, see the Reference Manual.
248 |
template from the Functions menu and enter settings to define the name and
detailed shape of the function.
Analytic The function name is its identifier; The name of the function with
for example, an1. comma-separated arguments within
The function is a mathematical parentheses. For example:
expression of its arguments. an1(x,y)
Example: Given the arguments x
and y, its definition is
sin(x)*cos(y).
The function has an arbitrary
number of arguments.
Interpolation The function name is its identifier; The name of the function with
for example, int1. comma-separated arguments within
An interpolation function is defined parentheses. For example:
by a table or file containing the int1(x,y,z)
values of the function in discrete
points.
The file formats are the following:
spreadsheet, grid, or sectionwise.
The function has one to three
arguments.
Piecewise The function name is its identifier; The name of the function with a
for example, pw1. single argument within parentheses.
A piecewise function is created by For example:
splicing together several functions, pw1(x)
each defined on one interval. Define
the argument, extrapolation and
smoothing methods, and the
functions and their intervals.
This function has one argument with
different definitions on different
intervals, which must not overlap or
have any holes between them.
| 249
TEMPLATE NAME ARGUMENTS AND DEFINITION SYNTAX EXAMPLE
Gaussian Pulse The function name is its identifier; The name of the function with a
for example, gp1. single argument within parentheses.
The Gaussian pulse function defines For example:
a bell-shaped curve according to the gp1(x)
expression
– x – x0
2
-----------------------
-
1 2
2
y x = --------------- e
2
250 |
TEMPLATE NAME ARGUMENTS AND DEFINITION SYNTAX EXAMPLE
Waveform The function name is its identifier; The name of the function with a
for example, wv1. single argument within parentheses.
A waveform function is a periodic For example:
function with one of several wv1(x)
characteristic shapes: sawtooth, sine,
square, or triangle.
The function has one argument. It
can also be smoothed.
Normal The function name is its identifier; The name of the function with a
Distribution for example, nd1. single argument within parentheses.
Defines the probability density For example:
function, cumulative distribution nd1(x), nd1_cum(x), and
function, and quantile function for a nd1_cum_inv(x)
normal distribution.
Random The function name is its identifier; The name of the function with
for example, rn1. comma-separated arguments within
A random function generates white parentheses. For example:
noise with uniform or normal rn1(x,y)
distribution and has one or more The arguments x and y are used as
arguments for simulating white random seeds for the random
noise. function.
The function has arbitrary number
of arguments.
External (Global An external function defines an The name of the function and the
Definitions only) interface to one or more functions appropriate number of arguments
written in the C language (which within parentheses. For example:
can be a wrapper function myextfunc(a,b)
interfacing source code written in,
for example, Fortran). Such an
external function can be used, for
example, to interface a user-created
shared library. Note that the
extension of a shared library file
depends on the platform: .dll
(Windows), .so (Linux), or .dylib
(macOS).
| 251
TEMPLATE NAME ARGUMENTS AND DEFINITION SYNTAX EXAMPLE
MATLAB® A MATLAB® function interfaces The name of the function and the
(Global with one or more functions written appropriate number of arguments
Definitions only) in the MATLAB® language. Such within parentheses. For example:
functions can be used as any other mymatlabfunc(a,b)
function defined in COMSOL
Multiphysics®, provided that
LiveLink™ for MATLAB® and
MATLAB® are installed. (MATLAB®
functions are evaluated by
MATLAB® at runtime.)
Elevation The function name is its identifier, The name of the function with
for example, elev1. comma-separated arguments within
Used to import geospatial elevation parentheses. For example:
data from digital elevation models elev1(x,y)
and map the elevation data to a
function of x and y. A DEM file
contains elevation data for a portion
of the Earth’s surface. The resulting
function behaves essentially like a
grid-based interpolation function.
Image The function name is its identifier, The name of the function with
for example, im1. comma-separated arguments within
Used to import an image (in BMP, parentheses. For example:
JPEG, PNG, or GIF format) and map im1(x,y)
the image’s RGB data to a scalar
(single-channel) function output
value. By default, the function’s
output uses the mapping
(R+G+B)/3.
Least-Squares Fit The function name is its identifier, The name of the function with
for example, lsq1_fun1. comma-separated arguments within
Used for least-squares function parentheses. For example:
approximation. Defines a lsq1_fun1(x1,x2)
least-squares fit of one or more
parameterized functions with
respect to the input data. The input
data can be a file, a local table, or a
results table.
252 |
TEMPLATE NAME ARGUMENTS AND DEFINITION SYNTAX EXAMPLE
Gaussian Process The function name is its identifier, The name of the function with
for example, gpm1. comma-separated arguments within
Used for multidimensional parentheses. For example:
interpolation and surrogate model gpm1(x1,x2)
training. Defines one or more
functions trained on input data
through a Gaussian process
regression method. The input data
can be a file or a result table.
Note: Training a Gaussian
Process function requires the
Uncertainty Quantification Module.
Using a model that already contains
a trained Gaussian Process
function does not require any
add-on products.
Polynomial The function name is its identifier, The name of the function with
Chaos for example, pce1. comma-separated arguments within
Expansion Used for multidimensional parentheses. For example:
interpolation and surrogate model pce1(x1,x2)
training. Defines one or more
functions trained on input data
through a Polynomial Chaos
Expansion method. The input data
can be a file or a result table.
Note: Training a Polynomial
Chaos Expansion function
requires the Uncertainty
Quantification Module. Using a
model that already contains a
trained Polynomial Chaos
Expansion function does not
require any add-on products.
Deep Neural The function name is its identifier, The name of the function with
Network for example, dnn1. comma-separated arguments within
Used for multidimensional parentheses. For example:
interpolation and surrogate model dnn1(x1,x2)
training. Defines one or more
functions trained on input data
through a Deep Neural
Network method. The input data
can be a file or a result table.
| 253
TEMPLATE NAME ARGUMENTS AND DEFINITION SYNTAX EXAMPLE
Partial Fraction The function name is its identifier, The name of the function with a
Fit for example, pff1. single argument within parentheses.
Used for rational approximation of For example:
frequency-domain responses. This pff1(x)
approximation makes it possible to
compute its inverse Fourier
transform analytically and thus
obtain the time-domain impulse
response function.
The input data can be a file or a
result table. The output is complex
valued.
Function Switch The function name is its identifier, Switch is a container node for
for example, sw1. functions.
A switch is used to switch between
global functions during a solver
sweep. You add the functions as
subnodes under the Switch node.
The switch for functions acts
essentially as a switch statement in a
programming language; that is, it
dynamically chooses one of its
underlying branches depending on a
parameter that can be controlled
from the solvers using a Function
Sweep study. You can also add a
Switch node under Materials and
then use a Material Sweep to
sweep over a discrete set of
materials.
In the Model Builder, the following table contains the unary and binary operators
that can be used in expressions.
254 |
PRECEDENCE LEVEL SYMBOL DESCRIPTION
4 [] Unit
5 * / Multiplication, Division
6 + - Binary: Addition, Subtraction
7 < <= > >= Comparisons: Less-Than, Less-Than or
Equal, More-Than, More-Than or Equal
8 == != Comparisons: Equal, Not Equal
9 && Logical AND
10 || Logical OR
11 , Element Separator in Lists
Ex pre ss i ons
P ARAMETERS
A parameter expression can contain: numbers, parameters, built-in constants,
built-in functions of parameter expressions, and unary and binary operators.
Parameters can have units.
V ARIABLES
A variable expression can contain: numbers, parameters, constants, variables,
functions of variable expressions, and unary and binary operators. Variables can
have units.
F UNCTIONS
A function definition can contain: input arguments, numbers, parameters,
constants, functions of parameter expressions, including input arguments, unary
and binary operators.
| 255
Appendix D — File Formats
The COMSOL Model MPH-file type, with the extension .mph, is the default file
type containing the entire model tree and application tree from the Model Builder
and Application Builder, respectively. The file contains both binary and text data.
The mesh and solution data is stored as binary data, while all other information is
stored as plain text.
The COMSOL binary and text file types, with the extension .mphbin and .mphtxt,
respectively, contain either geometry objects or mesh objects that can be imported
directly to the Geometry or Mesh nodes in the model tree. Note that if the CAD
Import Module, Design Module, or one of the LiveLink™ add-on products for
CAD was used to create a geometry model, then the same product may be
required to open the corresponding file. This is because the geometry model may
require features that are only available in one of the add-on products.
The Physics Builder file type, with the extension .mphphb, contains one or more
user-defined physics interfaces that you can access from the Model Builder. See the
Physics Builder Manual for more information.
See Supported External File Formats for more information about all the other
formats supported by COMSOL Multiphysics.
CAD
The CAD Import Module and Design Module allow for the import of a range of
industry-standard CAD file types. Additional file types are available through the
256 |
bidirectional functionality of the LiveLink products for CAD as well as with the
File Import for CATIA® V5 add-on.
The DXF (2D), VRML (3D), STL (3D), PLY (3D), and 3MF (3D) file types are
available for import with COMSOL Multiphysics and do not require any add-on
products. Unless noted otherwise in the table below, import of the listed file types
is available on all supported versions of Linux®, macOS, and Windows® operating
systems.
| 257
FILE TYPE EXTENSION IMPORT EXPORT
Revit®, Solid Edge®, SOLIDWORKS®, the CAD Import Module, or the Design Module
2
Import supported on Windows® operating systems only
3Synchronization of files between COMSOL Multiphysics and a linked CAD program
supported on Windows® operating systems only
4
Import supported on Windows® and Linux operating systems only
5
Requires LiveLink™ for Revit®
6Requires LiveLink™ for Solid Edge®
7
Requires the CAD Import Module (or the Design Module or one of the LiveLink™ products
for AutoCAD®, Inventor®, PTC Creo Parametric™, Revit®, Solid Edge®, or SOLIDWORKS®)
and the File Import for CATIA® V5
8Limited to a single geometric domain
9
From/To file using linked CAD package, provided the original CAD geometry is created in the
CAD package
10
Writing to file is supported for 2D geometry only
ECAD
The ECAD Import Module allows for import of 2D layout files with automatic
conversion to 3D CAD models. The Touchstone file type is used for exporting
S-parameters, impedance, and admittance values from simultaneous port and
frequency sweeps. The SPICE Circuit Netlist file type is converted at import to a
series of lumped circuit element nodes under an Electrical Circuit node.
258 |
M ATERIAL D ATABASES
From the Materials node, in the model tree, you can import material data on the
MPH-file format as well as on a COMSOL-native XML format. You can also
export material data on the COMSOL-native XML format. When importing
material data from an MPH-file, only the material contents of the file are
considered. For exporting material data on the MPH-file format, you simply save
the MPH-file using the options on the File menu.
The Chemical Reaction Engineering Module and the Plasma Module can read
CHEMKIN® files for simulating complex chemical reactions in the gas phase. The
Plasma Module can read LXCAT files for sets of electron-impact collision cross
sections. The Metal Processing Module import material properties from the
software JMatPro®.
M ESH
The NASTRAN® Bulk Data file types are used to import a volumetric mesh. The
VRML, STL, PLY, and 3MF file types are used to import a triangular surface mesh
that can serve as a starting point for creating a volumetric mesh.
| 259
FILE TYPE EXTENSION IMPORT EXPORT
260 |
Model files for MATLAB® are editable script files (M-files), similar to the model
files for Java®, for use with MATLAB®. These model files, which have the
extension .m, contain a sequence of COMSOL commands as a MATLAB® M-file.
You can run the model files in MATLAB® like any other M-file scripts. It is also
possible to edit the files in a text editor to include additional COMSOL
commands or general MATLAB® commands. Running model files in the M-file
format requires LiveLink™ for MATLAB®.
With a license for LiveLink™ for Excel®, you can save models on the Visual Basic
for Applications (VBA) format for use with Excel®.
Compiled C-code can be linked with a model or application in several ways
including the External Material and External Function interfaces in the Model
Builder and as the External Library interface in the Application Builder.
| 261
Parameters and variables can be imported and exported to the plain text,
comma-separated values, or data file types.
The continuous and discrete color table text file types are used for user-defined
color tables for results visualization.
Digital elevation model (DEM) files can be read and used as a parametric surface
for defining a geometry.
262 |
Appendix E — Connecting with LiveLink ™ Add-Ons
The following table shows the options to start COMSOL and the different linked
partner software using the LiveLink™ add-on products.
COMSOL® Can Start COMSOL Can Start Partner Software Can Connect
Software from Partner Software from COMSOL Running Sessions
LiveLink™ Yes1 Yes2 No
®
for Excel
LiveLink™ No Yes6 No
for Simulink®
LiveLink™ No No Yes
for AutoCad®
LiveLink™ No No Yes
for Revit®
LiveLink™ No No Yes
for PTC®Creo®
Parametric™
LiveLink™
for Inventor®
- Bidirectional No No Yes
Mode
- One Window Yes No No
Mode
LiveLink™ No No Yes
for Solid Edge®
LiveLink™ No No Yes
for SOLIDWORKS®
1
When you open a model from Excel®, a model window starts and a link is established
automatically. The model window is an output window that displays geometry, mesh, and results.
2
A model that includes a table reference to an Excel® spreadsheet automatically starts an Excel®
process in the background when the model is run in the COMSOL Desktop environment.
3
You can start a COMSOL Multiphysics server from a MATLAB® session using the system
command and then connect to it using mphstart in the MATLAB® command prompt.
4
The COMSOL Multiphysics with MATLAB® desktop shortcut starts a COMSOL Multiphysics
server and MATLAB®, then connects them automatically. When you run a COMSOL Multiphysics
| 263
model in the COMSOL Desktop interface that includes a MATLAB® function (Global Definitions
> Functions), a MATLAB® engine and connection is started automatically.
5You can connect a MATLAB® session to a running COMSOL Multiphysics server using the
command mphstart in the MATLAB® command prompt.
6The COMSOL Multiphysics with Simulink® desktop shortcut starts a COMSOL Multiphysics
server and MATLAB®, then connects them automatically. You can then start Simulink® and add a
COMSOL Cosimulation block where you load a cosimulation file to run a cosimulation.
264 |
Index
| 265
Browse From 42 COMSOL Multiphysics 12
Build All button native CAD format 42
geometry 86 opening 39
meshes 56, 105 COMSOL Server 13
built-in constants
constants, functions, and variables 33 mathematical and physical types 33
materials 44, 89 constraints 214
variables 109 context menu
button object 121 domain and boundary sections 97
Button, Form Objects 123 contextual tab 21
contributing node 154
C CAD files, storing in database 210
convergence analysis 66
CAD Import Module 214, 256
Convergence plot 9, 106
Cancel button 10, 29
cooling
case, parameter 27, 170
air stream 75
chamfer 214
natural convection 81
Chemical Reaction Engineering Module
coupling operator 172
259
Create Selection 32
clip plane 54
button 149
cloud computing 181
custom settings window 126
Cluster Computing node 181, 184
customized desktop 27
cluster job 184
Cluster Sweep node 181, 184 D dark theme 15
color theme 15 datasets, defined 24
coloring default feature 96
materials 93 degrees of freedom 66, 73
selections 93 derivatives 33
command sequence 124, 132 Derived Values 73, 114
Compact MPH-files 34 defined 24
compiler 12 Global Evaluation 72
component coupling 172 Volume Maximum 66, 72, 114
Component node, adding materials 89 Design Module 214, 220, 256
computing studies 71 dimensions 214
COMSOL Client 13 discretize 56
COMSOL Compiler 12 documentation, models 10, 33
COMSOL Desktop environment domain level 97
customizing 27 domain section
on Linux 23 context menu 97
on macOS 23 domains
overview 6 materials 92
266 |
remove from selection 92 exporting images 115
variables scope 31 expressions
down, surface normal direction 53, 243 Boolean 64
draft, Model Manager 199 manual entry 68, 81
draft, saving as version 204 replacing 64, 109, 112
dynamic help 11, 29 units, specifying 67
user-defined 63
E ECAD Import Module 258
External Process window 9
edges
variables scope 31 F file import 42
Editor Templates window 123 File menu 16
eigenfrequency analysis 24 fillet 214, 220
Electric Currents interface filter
defining boundary conditions 97 Model Builder 37
multiphysics 80, 101 Filter Options menu 37
overview 96 find
electric potential 76 parameters and variables 84
physics node 99 finite element
voltage drop, parameter 81 mesh 56
electrical heating 75 preconditioning 71
empty tetrahedra 56
selection 49 Fixed Constraint node 48
Enable Tooltip 138 Floating Network License 181
environment reflections 93 Form Editor 11, 121
equation form objects 117
built-in 96 form union, geometry 86
user-defined 63 frequency response 25
evaluating frequency-domain study 24
volume maximum 66, 112, 114 functions
von Mises stress 67 advanced topics 136
Evaluation Group 73, 114 built-in 33
automatic re-evaluation 73 mathematical 33
example scope 81
advanced, electrical heating 75 Functions node 81
basic, structural mechanics 38
G geometric dimensions
Excel® 261, 263
parameters, and 10, 26, 229
exclude data, Model Manager 208
parametric sweep 81
exclusive node 153
geometry
executable 12
building 81
Export node 24
| 267
CAD format 41 overview 96
importing 41 Help window 11
in Application Libraries 85 opening 23
loading from file 81, 85 high performance computing 181
operations 214 Home tab 21
parameterized 10, 26, 81, 85, 229 HPC 181
sequence 214 hybrid parallelism 182
settings window 8
I Image Snapshot button 115
Geometry node 36
images, creating thumbnails 115
Global Definitions node 23, 27
importing
functions 81
file 42
parameters 81
geometry 41
scope 31, 81
information windows 7, 9, 29
variables 30
initial conditions 8
global parameters 27, 46, 69, 81
Initial Values node
expression 26
Electric Currents interface 97
glTF-file format 116
Heat Transfer in Solids interface 97
graphics
Solid Mechanics interface 47
rendering and hardware 14
input fields 119
Graphics menus 22
Input Parameters
graphics object 120, 122, 131
for part 230
Graphics toolbar
Isosurface plot 179
default view button 48, 60, 101, 111
iterative solver
image snapshot button 115
preconditioning 71
zoom extents button 87, 108
J Java file 37, 260
Graphics window 7, 9, 22, 29
Joule heating
geometry, and 42
equations 96
plot 58
multiphysics coupling 101
rotate geometry 48, 107, 108
multiphysics interface 78
selecting boundary 48, 49, 101
toolbar 7 L Laminar Flow interface 158
using 43, 87 Linux
zoom box 49 clusters 184
Ground, boundary condition 100 version 23
grouping LiveLink™ add-ons 263
nodes 30 local database 189
loft 214
H Heat Transfer in Solids interface
Log window 9, 58
defining boundary conditions 97
multiphysics 80, 101 M macOS version 23
268 |
Main Window Editor 11 Message Passing Interface (MPI) 182
Material Browser Messages window 9, 58
defined 10 method 127
material contents section 44, 90 model 31
material color and texture 93 Method Call 127
material interface Method editor 11, 127
mechanical contact 50, 66 M-file 37, 261
material rendering 93 midsurface 214
materials modal tab 21
copper 75 Model Builder 6, 117, 129
domains, assigning 91 defined 11
model tree 36 example 36
settings window 8 expanding sections 97
steel 44, 63 geometry import 41
titanium alloy 75 keyboard shortcuts 236
Materials node 44, 89 node sequence example 47
mathematical constants and functions the ribbon, and 21
33 toolbar 6
MATLAB® 261 window 28
Max/Min Volume plot 68 model history 37
Maximum and minimum values table Model Manager 6, 12, 17, 188
113 draft 199
MEMS Module exclude data 208
thermal expansion, and 146 Open From 189
mesh Save To 189
convergence analysis, and 66 search 213
density 69 Versions window 196
finite element 56 workspace 212
model tree, and 36 model method 31
parameterizing 69, 103 model tree 6, 28
physics-controlled, default 103 building 23
refining 69 defined 81
settings 56 example 36
unstructured tetrahedral 103 geometry 36
user-controlled 69, 103 Global Definitions node 24, 46, 81
mesh element size Materials node 36, 44
parameters, defining 26, 104 Model Builder 11
settings 56 nodes 23
mesh-convergence analysis 73 Results node 24
| 269
ribbon 21 node groups 30
root node 23 nodes 23
Study node 24, 36 default feature 47
Model Wizard reordering 37
adding physics 24, 40, 78, 192
O Open 16
Component node, and 24
Open From 17
creating a new model 18
Model Manager 189
General Studies 40
OpenGL 14, 94
More Studies 40
Override and Contribution 47, 154
opening 39, 78
P parallel computing 181
preset studies 80, 192
parameter case 27, 170
space dimension 39, 78
parameter switch
study 24, 79
parametric sweep 170
models
parameters 26, 120, 131
defining 11
adding 50
discretization 56
defining 69, 81
documentation 10, 33
displaying value 51
saving 88, 208
editing 50, 86
structural mechanics 38
expression 26, 69
symmetry 108
global 27
workflow 36
meshes, and 69
MPHBIN-file 256
name 69
MPH-file 256
range of values 70
excluding data when saving 208
results 30, 178
full and compact 34
scope 81
saving 88, 116
using, referencing 99
MPHPHB-file 256
Parameters node 81, 136
MPHTXT-file 256
parametric geometry model 214
MPI 182
parametric study 81
multicore processors 181
parametric sweep 26
multiphysics interface 80
all combinations 170
multiphysics models 75
example 70
Multiphysics node 96, 97, 102, 147
meshes, and 69
multiphysics phenomena 75
parameter switch 170
Multislice plot 107
range, defining 70
N New 16
specified combinations 170
New Form wizard 117
part 10, 229
Ribbon buttons tab 132
Input Parameters 230
no solutions stored, message 35
270 |
Part Libraries 229 progress bar 11, 29
physics Progress window 9, 58
adding 78
Q Quick Access Toolbar 6, 8, 22, 28
boundary conditions 96
R Recent 17
electromagnetic heating 78
Record Code 128
heat transfer 78
renaming plot groups 64
Joule heating 75, 96
rendering options 14
laminar flow 158
reports, defined 24
model tree 36
reserved name 33
physics interface 18, 80
Reset Window Layout 132
Electric Currents 80
resizable graphics window 128
Heat Transfer in Solids 80
resolution of curvature, mesh 104
Joule Heating 78
results
Laminar Flow 158
color table range 107, 109
Solid Mechanics 40, 192
derived values 66, 72, 114
Plasma Module 259
displaying 59
player 180
parameters 30, 178
plot
units, changing 59
regenerate after solving 74
Results node
plot group 24
3D plot group 68, 109, 151
3D, adding 63
busbar defaults 107
Plot window 29
subnodes 24
plots
surface node, adding 109, 151
expression, user-defined 63
Revert to Saved 17
max/min volume 68
ribbon 7, 28
model tree 36
Add Material 44, 95, 157
regenerating 68
Build All 86
windows 9
Build Mesh 105
points, variables scope 31
Compute 71, 151, 167
Poisson’s ratio 91
defined 8, 21
polynomial functions 56
example 7
preconditioning 71
importing geometry 41
preferences 14
Model Builder 21
preset studies 80
Physics tab 48, 147
Preview MPH-files 35
Windows 10, 58, 218
principal stress 153
Work Plane 216
program code
Ribbon buttons 132
model file for Java 37
Ribbon buttons tab, New Form wizard
model M-file 37
| 271
132 selection of geometry objects, domains,
root node boundaries, edges, and points 52
default units 171 Settings Form 127
defined 23 Settings Forms 127
model thumbnails 115 Settings window 6, 8, 23, 28
Model Wizard 39 customized 126
Run Application 16 settings window
running simulations 106 keyboard shortcut 236
shared memory parallelism 181
S Save 17
Show Material Color and Texture 93
Save As 17
Show Selection Colors 93
Save To 17
simulation, running 106
Model Manager 189
Single form template 118, 129
saving files 88, 116
skybox image 94
scheduler
software rendering 14
Grid Engine 184
Solid Mechanics interface 40, 192
IBM LSF 184
add-on modules 146
Microsoft HPC Pack 184
Solved MPH files 34
Open Grid Scheduler 184
solvers
PBS 184
configurations 71
SLURM 184
iterative 70
scope
stationary 58, 71
global definitions 81
using 58
parameters and variables 31
space dimension 18
parameters and variables, defined 26
specified combinations
variable name 32
parametric sweep 170
search
Stationary study 40, 58, 192
parameters and variables 84
steady-state study 24
search, in Model Manager database 213
Streamline Multislice plot 107
Select Study window 20
structural analysis 38
selecting
structural displacement field 56
boundaries 51
structural mechanics
multiple boundaries 149
design 65
using the graphics window context
plastic deformation 63
menus 53
stresses and strains 75, 91
selecting internal surfaces 52
von Mises stress 59
Selection 32, 52, 93
Structural Mechanics Module
empty 49
application library 38
selection 149
mechanical contact 50, 66
Selection List window 10, 218
272 |
thermal expansion 146 U unit, changing 59, 152
studies up, surface normal direction 53, 243
computing solutions 71, 106 update COMSOL Application Libraries
defining 58 35
example, multigrid iterative 71 Update Solution 177
example, stationary 58 user interface
model tree 36 COMSOL Desktop 6
preset 80 overview 6
types 24 user-controlled mesh 69
Study node 24 V variables
solution sequence 106 advanced topics 136
Suppress Selection Highlight 93 built-in 33
surface normal direction, graphics dis- example, built-in 72
play 52 expression 30
surface normal direction, up and down scope 81
53, 243 scope, limit 31
Surface plot Variables node 30, 81
color table range 110 version
deformation 59 control 192
electrical current density 109 opening 197
replace expression 109 saving 193
settings 64 Versions window, Model Manager 196
updating 108, 109 visualization 9
T table color table 107, 109
Maximum and minimum 113 Volume Maximum, evaluating 66, 112,
Table window 9 114
graph plot 72 Volume plot 107
wrench results 67 von Mises stress 59, 153
Tables node 24 W Window Layout 132
tables, evaluating 72 Windows list 58, 218
temperature 107, 167 wizard
temperature, average 172 New Form 117
Test Application 123, 133 workflow 33
tetrahedron, polynomial functions 56 Workspace 117, 129
thermal expansion 75, 91
Y yield stress 38, 63
thicken 214
Young’s modulus 91
thumbnail image 115
time-dependent study 24 Z zoom 167
torque, applied 38 Zoom Extents command 125
| 273
274 |