VERSION 4.2a Introduction to Comsol Multiphysics® Benelux COMSOL BV Röntgenlaan 37 2719 DX Zoetermeer The Netherlands  +31 (0) 79 363 4230  +31 (0) 79 361 4212  info@comsol.nl  www.comsol.nl Denmark COMSOL A/S Diplomvej 381 2800 Kgs. Lyngby  +45 88 70 82 00  +45 88 70 82 88  info@comsol.dk  www.comsol.dk Finland COMSOL OY Arabiankatu 12 FIN-00560 Helsinki  +358 9 2510 400  +358 9 2510 4010  info@comsol.fi  www.comsol.fi France COMSOL France WTC, 5 pl. Robert Schuman F-38000 Grenoble  +33 (0)4 76 46 49 01  +33 (0)4 76 46 07 42  info@comsol.fr  www.comsol.fr Germany COMSOL Multiphysics GmbH Berliner Str. 4 D-37073 Göttingen  +49-551-99721-0  +49-551-99721-29  info@comsol.de  www.comsol.de India COMSOL Multiphysics Pvt. Ltd. Esquire Centre, C-Block, 3rd Floor No. 9, M. G. Road Bangalore 560001 Karnataka  +91-80-4092-3859  +91-80-4092-3856  info@comsol.co.in  www.comsol.co.in Italy COMSOL S.r.l. Via Vittorio Emanuele II, 22 25122 Brescia  +39-030-3793800  +39-030-3793899  info.it@comsol.com  www.comsol.it Norway COMSOL AS Postboks 5673 Sluppen Søndre gate 7 NO-7485 Trondheim  +47 73 84 24 00  +47 73 84 24 01  info@comsol.no  www.comsol.no Sweden COMSOL AB Tegnérgatan 23 SE-111 40 Stockholm  +46 8 412 95 00  +46 8 412 95 10  info@comsol.se  www.comsol.se Switzerland COMSOL Multiphysics GmbH Technoparkstrasse 1 CH-8005 Zürich  +41 (0)44 445 2140  +41 (0)44 445 2141  info@ch.comsol.com  www.ch.comsol.com United Kingdom COMSOL Ltd. Broers Building 21 J J Thomson Avenue Cambridge CB3 0FA  +44-(0)-1223 451580  +44-(0)-1223 367361  info.uk@comsol.com  www.uk.comsol.com United States COMSOL, Inc. 1 New England Executive Park Suite 350 Burlington, MA 01803  +1-781-273-3322  +1-781-273-6603 COMSOL, Inc. 10850 Wilshire Boulevard Suite 800 Los Angeles, CA 90024  +1-310-441-4800  +1-310-441-0868 COMSOL, Inc. 744 Cowper Street Palo Alto, CA 94301  +1-650-324-9935  +1-650-324-9936  info@comsol.com  www.comsol.com For a complete list of international representatives, visit  www.comsol.com/contact Home Page  www.comsol.com COMSOL User Forums  www.comsol.com/ community/forums Introduction to COMSOL Multiphysics  1998–2011 COMSOL Protected by U.S. Patents 7,519,518; 7,596,474; and 7,623,991. 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, COMSOL Desktop, COMSOL Multiphysics, Capture the Concept, and LiveLink are registered trademarks or trademarks of COMSOL AB. AutoCAD and Inventor are registered trademarks of Autodesk, Inc., in the USA and other countries. LiveLink for AutoCAD and LiveLink for Inventor are not affiliated with, endorsed by, sponsored by, or supported by Autodesk, Inc., and/or its affiliates and/or subsidiaries. MATLAB is a registered trademark of The Mathworks, Inc. Pro/ENGINEER is a registered trademark of Parametric Technology Corporation or its subsidiaries in the U.S. and in other countries. SolidWorks is a registered trademark of Dassault Systèmes SolidWorks Corp. SpaceClaim is a registered trademark of SpaceClaim Corporation. Other product or brand names are trademarks or registered trademarks of their respective holders. Version: October 2011 COMSOL 4.2a Part No. CM010004 Contents Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Capture the Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Thorough Example: The Busbar . . . . . . . . . . . . . . . . . . .7 Parameters, Functions, Variables, and Model Couplings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 Material Properties and Libraries. . . . . . . . . . . . . . . . . .34 Mesh Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 Adding Physics to a Model. . . . . . . . . . . . . . . . . . . . . . .39 Parameter Sweeps and Parallel Computing. . . . . . . . .60 Parallel Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 Geometry Sequences. . . . . . . . . . . . . . . . . . . . . . . . . . .67 Easy Example: The Wrench. . . . . . . . . . . . . . . . . . . . . .78 Supported External File Formats. . . . . . . . . . . . . . . . . .89 Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 New Terminology in Version 4. . . . . . . . . . . . . . . . . . .95 Introduction | 1 Introduction Computer simulation has become an essential part of science and engineering. Digital analysis of components, in particular, is important when developing new products or optimizing designs. Today a broad spectrum of options for simulation is available; researchers use everything from basic programming languages to various high-level packages implementing advanced methods. Though each of these techniques has its own unique attributes, they all share a common concern: Can you rely on the results? When considering what makes software reliable, it’s helpful to remember the goal: you want a model that accurately depicts what happens in the real world. A computer simulation environment is simply a translation of real-world physical laws into their virtual form. How much simplification takes place in the translation process helps to determine the accuracy of the resulting model. It would be ideal, then, to have a simulation environment that included the possibility to add any physical effect to your model. That is what COMSOL is all about. It’s a flexible platform that allows even novice users to model all relevant physical aspects of their designs. Advanced users can go deeper and use their knowledge to develop customized solutions, applicable to their unique circumstances. With this kind of all-inclusive modeling environment, COMSOL gives you the confidence to build the model you want with real-world precision. Certain characteristics of COMSOL become apparent with use. Compatibility stands out among these. COMSOL requires that every type of simulation included in the package has the ability to be combined with any other. This strict requirement actually mirrors what happens in the real world. For instance in nature, electricity is always accompanied by some thermal effect; the two are fully compatible. Enforcing compatibility guarantees consistent multiphysics models, and the knowledge that, even as the COMSOL family of products expands, you never have to worry about creating a disconnected model again. Another noticeable trait of the COMSOL platform is adaptability. As your modeling needs change, so does the software. If you find yourself in need of including another physical effect, you can just add it. If one of the inputs to your model requires a formula, you can just enter it. Using tools like parameterized geometry, interactive meshing, and custom solver sequences, you can quickly adapt to the ebbs and flows of your requirements. 2 | Introduction COMSOL Multiphysics also has several problem-solving benefits. When starting a new project, using COMSOL helps you understand your problem. You are able to test out various geometrical and physical characteristics of your model, so you can really hone in on the important design challenges. The flexible nature of the COMSOL environment facilitates further analysis by making “what-if” cases easy to set up and run. You can take your simulation to the production level by optimizing any aspect of your model. Parameter sweeps and target functions can be executed right in the user interface. From start to finish, COMSOL is a complete problem-solving tool. As you become a more experienced user of COMSOL, your confidence in computer simulation will grow. You will become a more efficient modeler, and the results will show it. The remainder of this introduction is dedicated to give you a strong start toward this goal. After a general introduction to the user interface, several tutorials will take you step by step through sample models that highlight important features. The informative charts give you an idea of COMSOL’s capability by associated files, functions, and built-in options. By the end you will be well on your way to reaping all the benefits that COMSOL has to offer. Capture the Concept | 3 Capture the Concept COMSOL Multiphysics version 4.2a brings an unprecedented level of clarity to your simulation work by giving you both an organized model overview and a streamlined model-building process. The COMSOL user interface reduces clutter and redundant tasks, so your attention can be focused on the substance of your design studies resulting in increased productivity. Naturally COMSOL continues in its tradition of powerful solvers and flexibility in physics, but it is the new user interface that stands out the most. Organize The COMSOL Desktop helps you organize your simulation by presenting a clear overview of your model at any point. It uses functional form, structure, and aesthetics as the means to achieve simplicity for modeling complex realities. For instance, task-specific tools appear on the Desktop right when you need them; showing only what is currently possible, which removes uncertainty from model building and brings order to your simulations. The Desktop is made up of several windows, which may or may not be displayed depending on the need. These windows include the Model Builder, Settings, Graphics, Messages, Progress, Help, and others. Model Builder with Model Tree Settings Window Graphics WindowMain ToolbarMain Menu Messages, Progress, and Numerical Results 4 | Capture the Concept Customize You can easily customize the layout of these windows on the Desktop to suit your particular work habits: All windows can be positioned and sized in any way. They can be detached from the Desktop and moved back and forth between computer displays. These settings can be saved as preferences for the next time COMSOL Multiphysics is opened. Streamline The user interface streamlines the modeling workflow with the Model Builder. Containing a Model Tree, the Model Builder does much more than outline your model. It is a graphical programming environment that gives you dynamic control of your procedures and simulations. By following along the nodes within the Model Builder, you will experience a smoother, more direct, and less cumbersome way to specify your models. Model Builder and Settings Graphics Window Model Library Material Browser Dynamic Help Capture the Concept | 5 Look at this example of the Model Builder. Notice how every step of the modeling process, from defining global variables to the final report of results, is easy to see. When you right-click any node in the tree, a context menu displays all the available features. The options in the menu include everything you need to build and document a model. So you just right-click for various settings (like geometry, physics, mesh, or results) instead of opening separate windows. 6 | Capture the Concept If you choose an action that requires specification, the matching Settings window displays next to the Model Builder: Click any associated node to return to a specific Settings window. There is no longer the need to open multiple windows, resulting in a streamlined workspace. As you create the model, each step is recorded in the Model Builder. If, for example, your model required a certain sequence of steps to get the right geometry, these are all listed in the order you set. (See the Geometry section in the figure above.) Even better, this series of steps can be edited and rerun without having to repeat the entire simulation. Complicated solver sequences you may need for different studies also benefit greatly from this feature. As you work with the COMSOL Desktop and the Model Builder, you will grow to appreciate the organized and streamlined approach. But any description of a user interface is inadequate until you try it for yourself. So in the next few sections, you are invited to work through some examples to familiarize yourself with the next generation of simulation software. Selected Node and its Settings Window Thorough Example: The Busbar | 7 Thorough Example: The Busbar Electrical Heating in a Busbar In order to get acquainted with COMSOL Multiphysics, it is best to work through a basic example step by step. These instructions describe the essential components of the model building procedure, highlighting several features and demonstrating the common simulation tasks. At the end, you will have built a truly multiphysics model. The model that you are about to create analyzes a busbar designed to conduct direct current to an electric device (see below). The current conducted in the busbar, from bolt 1 to bolts 2a and 2b, produces heat due to the resistive losses, a phenomenon referred to as Joule heating. The busbar is made of copper while the bolts are made of a titanium alloy. The choice of materials is important because titanium has a lower electrical conductivity than copper and will be subjected to a higher current density. 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 yielding structural stresses and strains in the busbar and the effects of cooling by an air stream. 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 bolt cross-section boundaries do not contribute to cooling or heating of the device. The electric potential at the upper-right vertical bolt surface is 20 mV, and that the potential at the two horizontal surfaces of the lower bolts is 0 V. Titanium Bolt 2a Titanium Bolt 1Titanium Bolt 2b 8 | Thorough Example: The Busbar MODEL WIZARD 1 Open COMSOL by double-clicking its icon on the desktop. When the Model Wizard opens, select a space dimension; the default is 3D. Click the Next button . 2 In the Add Physics window, click the Heat Transfer>Electromagnetic Heating folder, then right-click Joule Heating and choose Add Selected. You can also double-click or click the Add Selected button to add the interface. 3 Click the Next button . 4 In the Select Study Type window, click to select the Stationary study type. Click the Finish button . Any selection from the Custom Studies branch needs manual fine-tuning. Preset Studies are studies that have solver and equation settings adapted to the selected physics, in this example, Joule heating. Thorough Example: The Busbar | 9 GLOBAL DEFINITIONS If you want to draw the geometry yourself, the Global Definitions brnch is where you define the parameters. If you would prefer to load the geometry from a file, you can just browse through this section and then skip to “Geometry” on page 10. The Global Definitions node in the Model Builder stores Parameters, Variables, and Functions with a global scope. You can use these operations in several models. In this case, there is only one Model 1 node where the parameters are used. Since you will run a geometric parameter study later in this example, define the geometry using parameters from the start. In this step, enter parameters for the length for the lower part of the busbar, L, the radius of the titanium bolts, rad_1, the thickness of the busbar, tbb, and the width of the device, wbb. You will also add the parameters that control the mesh, mh, a heat transfer coefficient for cooling by natural convection, htc, and a value for the voltage across the busbar, Vtot. 1 Under Global Definitions click the Parameters node . In the Parameters table, click the first row under Name and enter L. 2 Click the first row under Expression and enter the value of L, 9[cm]. You can enter any unit inside the square brackets. 3 Continue adding the other parameters: L, rad_1, tbb, wbb, mh, htc, and Vtot according to the Parameters list. It is a good idea to enter descriptions for variables, in case you forget or share the model with others. L 2xrad_1 wbb tbb 10 | Thorough Example: The Busbar GEOMETRY In “Global Definitions” you learned how to enter parameters in preparation for drawing the busbar geometry. To learn how to use the COMSOL geometry tools and draw the busbar, go to “Geometry Sequences” on page 66. To save time, you can also load the model geometry from the Model Library. Once you have created or imported the geometry, you can then experiment with different dimensions and update the values of L, tbb, or wbb, and rerun the geometry sequence. 1 Select Model Library from the main View menu. 2 In the Model Library, select COMSOL Multiphysics>Multiphysics> busbar_geom. To open, double-click, right-click and select Open, or click the Open button. Now you can experiment with different dimensions. Thorough Example: The Busbar | 11 3 Under Global Definitions click the Parameters node . In the Settings window, select the wbb parameter’s Expression column and enter 10[cm] to change the value of the width wbb. 4 In the Model Builder, click the Form Union node and then the Build All button to rerun the geometry sequence. 5 In the Graphics toolbar click the Zoom Extents button to see the wider busbar in the Graphics window. 12 | Thorough Example: The Busbar 6 To rotate the busbar, left-click and drag it in the Graphics window. To move it, right-click and drag. To zoom in and out, center-click (and hold) and drag. To get back to the original position, click the Go to Default 3D View button on the Graphics toolbar. 7 Return to the Parameters table and change the value of wbb back to 5[cm]. 8 In the Model Builder, click the Form Union node and then the Build All button to rerun the geometry sequence. 9 On the Graphics toolbar, click the Zoom Extents button . 10Save your work as busbar.mph. Experienced users of other CAD programs are already familiar with this approach since all major CAD platforms include parameterized geometries. To support this class of users and to avoid redundancy, COMSOL offers the LiveLink™ family of products. These products connect COMSOL Multiphysics directly with a wbb=5cm wbb=10cm Thorough Example: The Busbar | 13 separate CAD program, so that all parameters specified in CAD can be interactively linked with your simulation geometry. The current product line includes LiveLink™ interfaces for SolidWorks®, Inventor®, Pro/ENGINEER®, Creo™ Parametric, AutoCAD®, and SpaceClaim®. It is also worth noting that the LiveLink™ interface for MATLAB® is available for those who want to incorporate a COMSOL Multiphysics model into an extended programming environment. After completing the geometry for your model, it is time to define the materials. MATERIALS The Materials node stores the material properties for all physics and all domains in a Model node. The busbar is made of copper and the bolts are made of titanium. Both these materials are available from the Built-In material database. 1 In the Model Builder, right-click Materials and select Open Material Browser (or select View>Material Browser). 2 In the Material Browser, expand the Built-In materials folder, locate Copper, right-click and select Add Material to Model . 3 Click the Material Browser tab, and scroll to Titanium beta-21S in the Built-In material folder. Right-click to Add material to model . 14 | Thorough Example: The Busbar 4 In the Model Builder, collapse the Geometry 1 node to get an overview of the model. 5 Under the Materials node , click Copper. 6 In the Settings window, examine the Material Contents section. The Material Contents section has useful feedback about the model’s material property usage. Properties that are both required by the physics and available from the material are marked with a green check mark . Properties required by the physics but missing in the material result in an error and are marked with a warning sign . A property that is available but not used in the model is unmarked. The Coefficient of thermal expansion property is not used, but it is 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 overrides the copper material assignment for those parts. Thorough Example: The Busbar | 15 7 In the Model Builder, click Titanium beta-21S. 8 Select All Domains from the Selection list and then click domain 1. Click the Remove from Selection button . Cross-check: Domains 2, 3, 4, 5, 6, and 7. 16 | Thorough Example: The Busbar 9 Be sure to inspect the Material Contents section in the Settings window. All the properties used by the physics interfaces should have a green check mark . 10Close the Material Browser. PHYSICS The domain settings for the Joule Heating physics interface are complete now that you have set the material properties for the different domains. Next you will set the boundary conditions for the heat transfer problem and the conduction of electric current. Thorough Example: The Busbar | 17 1 In the Model Builder, expand the Joule Heating node to examine the default physics interface nodes. The equations that COMSOL solves are displayed in the Equation section of the Settings window. The equations change based on the Equation form selected. The default equation form is inherited from the study added in the Model Wizard. For the Joule Heating node, COMSOL displays the equations solved for the temperature and electric potential. The domain level Joule Heating Model 1 node has the settings for heat conduction and current conduction. The contribution of the Joule Heating Model 1 node to the entire equation system is underlined in the Equation section. The heating effect for Joule heating is set in the Electromagnetic Heat Source 1 node. The Thermal Insulation 1 node contains the default boundary condition for the heat transfer problem and Electric Insulation 1 corresponds to the conservation of electric current. The Initial Values 1 node contains initial guesses for the nonlinear solver for stationary problems and initial conditions for time-dependent problems. 18 | Thorough Example: The Busbar 2 Right-click the Joule Heating node . In the second section of the context menu—the boundary section—select Heat Transfer in Solids>Heat Flux. 3 In the Heat Flux Settings window, 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 these boundaries are removed from the heat flux selection list, which leaves them with the default insulating boundary condition for the Heat Transfer interfaces. Boundary Section Domain Section Thorough Example: The Busbar | 19 4 Rotate the busbar to view the back. Click one of the circular titanium bolt surfaces to highlight it in green. Right-click anywhere in the Graphics window to remove this boundary from the Selection list. Repeat this for the other two bolts. To display the boundary labels, click the View 1 node under Definitions in the Model Builder and then select the Show geometry labels check box. To view a list of all boundaries, choose Selection List from the View menu. 5 In the Settings window, click the Inward heat flux button. Enter htc in the Heat transfer coefficient field, h. Continue by setting the boundary conditions for the electric current. Cross-check: Boundaries 8, 15, and 43 are removed from the Selection list. 20 | Thorough Example: The Busbar 6 In the Model Builder, right-click the Joule Heating node . In the second section of the context menu—the boundary section—select Electric Currents>Electric Potential. 7 Click the circular face of the upper titanium bolt to highlight it and right-click anywhere to add it to the Selection list. 8 In the Settings window, enter Vtot in the Electric Potential field. The last step is to set the two remaining bolt surfaces to ground. Cross-check: Boundary 43. Thorough Example: The Busbar | 21 9 In the Model Builder, right-click the Joule Heating node . In the boundary section of the context menu, select Electric Currents>Ground. 10In the Graphics window, click one of the remaining bolts to highlight it. Right-click anywhere to add it to the Selection list. Repeat this step for the last bolt. 11On the Graphics toolbar, click the Go to Default 3D View button . Cross-check: Boundaries 8 and 15. 22 | Thorough Example: The Busbar MESH The simplest way to mesh is to create an unstructured tetrahedral mesh, which is perfect for the busbar. Alternatively, you can create several mesh sequences as shown in “Mesh Sequences” on page 37. A physics-controlled mesh is created by default. In most cases, it is possible to skip to the Study branch and just solve the model. For this exercise, the settings are investigated in order to parameterize the mesh settings. 1 In the Model Builder, click the Mesh 1 node . In the Settings window, select User-controlled mesh from the Sequence type list. 2 Click the Size node under Mesh 1. 3 In the Settings window, click the Custom button under Element Size. The stars that display in the upper-right corner of the icons indicate that these nodes are being edited. Enter mh in the Maximum element size field. Enter mh-mh/3 in the Minimum element size field, and enter 0.2 in the Resolution of curvature field. Notice that mh is 6 mm— the value entered earlier as a global parameter. By using the parameter mh, the variations in element size are limited. The Minimum element size is slightly smaller than the maximum size. The resolution of curvature determines the number of elements on curved edges: the larger this resolution value is, the more elements are used. The Maximum element Thorough Example: The Busbar | 23 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. The resolution of narrow regions works in a similar way to the resolution of curvature. 4 Click the Build All button in the Size Settings window to create the mesh as shown in this figure: STUDY 1 To run a simulation, in the Model Builder, right-click Study 1 and choose Compute . The Study node automatically defines a solution sequence for the simulation based on the selected physics and the study type. The simulation only takes a few seconds to solve. 24 | Thorough Example: The Busbar RESULTS The default plot displays the temperature in the busbar. The temperature difference in the device is less than 10 K, due to the high thermal conductivity of copper and titanium. The temperature variations are largest on the top bolt, which conducts double the amount of current compared to the two lower bolts. The temperature is substantially higher than the ambient temperature of 293 K. 1 Left-click and drag the image in the Graphics window to rotate and view the back of the busbar. 2 On the Graphics toolbar, click the Go to Default 3D View button . You can now manually set the color table range to visualize the temperature difference in the copper part. Thorough Example: The Busbar | 25 3 Under the Results>Temperature node , click the Surface 1 node . In the Settings window, click Range, and then select the Manual color range check box. Enter 323 in the Maximum field. Click the Plot button . 4 On the Graphics toolbar, click the Zoom Extents button . 26 | Thorough Example: The Busbar 5 Left-click and drag in the Graphics window to rotate the busbar and view the back. Create a Thumbnail Image for the Plot With any solution, you can create an image that is displayed by COMSOL when browsing for model files. From the File menu, select Save Model Thumbnail. There are two other ways to create images from this plot. One way is to click the Image Snapshot button in the Graphics toolbar to directly create an image. You can also add an Image node to a Report by right-clicking the plot group of interest. The second option means you can reuse the Image Settings if you update the model. Thorough Example: The Busbar | 27 The temperature distribution is symmetric with a vertical mirror plane running between the two lower titanium bolts and running across the middle of the upper bolt. In this case, the model does not require much computing power and you can model the whole geometry. For more complex models, you can consider using symmetries in order to reduce the size of the model. The next Surface plot generated shows the current density in the device. 6 In the Model Builder, right-click Results and add a 3D Plot Group . Right-click 3D Plot Group 2 and add a Surface node . 7 In the Settings window, under Expression, click the Replace Expression button . Select Joule Heating (Electric Currents)>Currents and charge>Current density norm (jh.normJ). This is the variable for the magnitude, or absolute value, of the current density vector. 8 Click the Plot button . The resulting plot is almost uniform due to the high current density at the contact edges with the bolts. Left-click and drag the busbar in the Graphics window to view the back of the busbar. On the Graphics toolbar, click the Go to Default 3D View button . Manually change the color table range to visualize the current density distribution. 28 | Thorough Example: The Busbar 9 Click Range and select the Manual color range check box. Enter 1e6 in the Maximum field. Click the Plot button and save the model as busbar.mph. The resulting plot shows how the current takes the shortest path in the 90-degree bend in the busbar. Notice that the edges of the busbar outside of the bolts are hardly utilized for current conduction. 10Rotate the image to view the back of the busbar where you can see the high current density around the contact surfaces of the bolts. Continue the exercise by adding your own plots to investigate ways to generate cross section plots and cross section line plots. Now you have completed a basic multiphysics simulation. The next sections are designed to increase your understanding of the steps you implemented up to this point as well as to extend your simulation to include other relevant effects, like thermal expansion and fluid flow. Parameters, Functions, Variables, and Model Couplings | 29 Parameters, Functions, Variables, and Model Couplings This section explores working with Parameters, Functions, Variables, and Model Couplings. For this purpose you can continue working with the same model from the previous section. Locate and open the file busbar.mph if it is not already open on the COMSOL Desktop. Global Definitions and Definitions contain functionality that helps you to prepare model inputs and model couplings and to organize simulations. You have already used the functionality for adding Parameters to organize model inputs in “Global Definitions” on page 9. Functions, available as both Global Definitions and Definitions, contain a set of predefined functions that can be useful when you set up multiphysics simulations. For example, the Step function can create a smooth step function for defining different types of switches. To illustrate using functions, assume that you want to add a time dependent study to the busbar model by applying an electric potential 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. Add a function that goes smoothly from 0 to 1 in 0.5 seconds to find out how functions can be defined and verified. 30 | Parameters, Functions, Variables, and Model Couplings DEFINING FUNCTIONS 1 Right-click the Global Definitions node and select Functions>Step . 2 In the Settings window, enter 0.25 in the Location field to set the location of the middle of the step, where it has the value of 0.5. 3 Click Smoothing and enter 0.5 in Size of the Transition zone to set the width of the smoothing interval. 4 Click the Plot button . Parameters, Functions, Variables, and Model Couplings | 31 If your plot matches the one below, this confirms that have defined the function correctly. You can also add comments and rename the function to make it more descriptive. 5 Right-click the Step 1 node in the Model Builder and select Properties . 6 In the Properties window, enter the required information. The Global Definitions and Definitions nodes can contain Variables , which are expressions of the dependent variables—the variables that are solved for in a simulation. You can define global variables that can be used in several models. 32 | Parameters, Functions, Variables, and Model Couplings For the purpose of this exercise, assume that you want to introduce a second model to represent an electric device connected to the busbar through the titanium bolts. A first step would be to rename Model 1 to specify that it represents the busbar. RENAMING NODES 1 Right-click the Model 1 node and select Rename . 2 In the Rename Model window, enter Busbar. Click OK and save the model. Parameters, Functions, Variables, and Model Couplings | 33 DEFINING MODEL COUPLINGS The next steps are for information only and you do not need to reproduce them unless you want to. Click the Definitions node under Busbar (mod1) to introduce a Model Coupling that integrates any Busbar (mod1) variable at the bolt boundaries facing the electric device. You can use this coupling to define a Variable—in Global Definitions—that calculates the total current. This variable is then globally accessible and could, for example, form a boundary condition for the current that is fed to the electric device in the Electric Device (mod2) node. The Model Couplings in Definitions have a wide range of use. The Average , Maximum , and Minimum model couplings have applications in generating results as well as in boundary conditions, sources, sinks, properties, or any other contribution to the model equations. The Probes are for monitoring the solution progress. For instance, you can follow the solution in a critical point during a time-dependent simulation or at parameter value in a parametric study. You can also use Model Couplings to map variables from one face in a model to another (extrusion couplings) or to integrate a variable along curves and map from one entity to another (projection couplings). You can find an example of using the average operator in “Parameter Sweeps and Parallel Computing” on page 59. Also see “Built-in Functions” on page 90, for a list of available COMSOL functions. To learn more about working with definitions, in the Model Builder click the Definitions or Global Definitions node and press F1 to open the Dynamic Help window . This window displays help about the selected item in the COMSOL Desktop and provides links to the documentation. You can also open it from the Help menu. It could take up to a minute for the window to load the first time it is activated but the next time it will load quickly. 34 | Material Properties and Libraries Material Properties and Libraries Up to now, you have used the functionality in Materials to access the properties of copper and titanium in the busbar model. In this section you define material properties and create your own material library. In Materials, you are also able to create your own materials and save them in your own material library. You can also 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. First investigate how to add a property to an existing material. Assume that you want to add bulk modulus and shear modulus to the copper properties. Locate and open the file busbar.mph if it is not already open on the COMSOL Desktop. CUSTOMIZING MATERIALS 1 In the Model Builder, under Materials, click Copper . 2 In the Settings window, the Materials Properties section contains a list of all the definable properties. Expand the Solid Mechanics>Linear Elastic Material Model node. Right-click Bulk Modulus and Shear Modulus and select Add to Material . This lets you define the bulk modulus and shear modulus for the copper in your model. Material Properties and Libraries | 35 3 Locate the Material Contents section. Bulk modulus and Shear modulus rows are now available in the table. The warning sign indicates 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 Copper material. However, you cannot save this in the read-only Solid Mechanics material library. However, you can save it to your own material library. 4 In the Model Builder, right-click Copper and select Add Material to “User Defined Library” . 36 | Material Properties and Libraries 5 Right-click Materials and select Open Material Browser . In the Material Browser, right-click User Defined Library and select Rename Selected . Enter My Materials in the Enter New Name dialog box. Mesh Sequences | 37 Mesh Sequences A model can contain different mesh sequences to generate meshes with different settings. These sequences can then be accessed by the study steps. In the study, you can select which mesh you would like to use in a particular simulation. In the busbar model, a second mesh node is added to create a mesh that is refined in the areas around the bolts and the bend. You do this by increasing the mesh resolution on curved surfaces. Locate and open the file busbar.mph if it is not already open on the COMSOL Desktop. ADDING A MESH 1 To add a second mesh node, right-click the Model 1 node and select Mesh . This creates a Meshes parent node that contains Mesh 1 and Mesh 2. 2 Click the Mesh 2 node. In the Settings window, under Mesh Settings, select User-controlled mesh as the Sequence type. 3 In the Model Builder, under Mesh 2, click Size . The stars in the upper-right corner of the icons indicate that these nodes are being edited. 4 In the Settings window, under Element Size, click the Custom button. 38 | Mesh Sequences 5 Under Element Size Parameters, enter mh/2 in the Maximum element size field and mh/2-mh/6 in the Minimum element size field. Enter 0.2 in the Resolution of curvature field. Click the Build All button . 6 In order to keep this model in a separate file for later use, save the model with a new name, busbar_I.mph. Compare Mesh 1 and Mesh 2 by clicking the respective node. The mesh is updated in the Graphics window. An alternative for using many different meshes is to run a parametric sweep of the parameter for the maximum mesh size, mh, that was defined in Global Definitions. Mesh 1 Mesh 2 Adding Physics to a Model | 39 Adding Physics to a Model COMSOL's distinguishing characteristics of adaptability and compatibility are prominently displayed when you add physics to an existing model. In this section, you will understand the ease with which this seemingly difficult task is performed. By following these directions, you can add structural mechanics and fluid flow to the busbar model. STRUCTURAL MECHANICS After completing the Joule heating simulation, you now know that there is temperature rise in the busbar. So it is logical to ask: What kind of mechanical stress is induced by thermal expansion? To answer this question, COMSOL Multiphysics makes it easy for you to expand your model to include the physics associated with structural mechanics. If you are more interested in adding cooling by fluid flow, you can skip to the section, “Fluid Flow” on page 45. ADDING SOLID MECHANICS The Structural Mechanics Module (which enhances the Solid Mechanics interface) is required to complete these steps. 1 Open the model busbar.mph that was created earlier. In the Model Builder, right-click the Busbar node and select Add Physics . 40 | Adding Physics to a Model 2 In the Model Wizard, select Structural Mechanics>Solid Mechanics . To add this node, you can double-click it, right-click and select Add Selected, or click the Add Selected button . 3 Click the Finish button and save the model with a new name, busbar_II.mph. When adding additional physics interfaces, you need to make sure that materials included in the Materials node have all the required properties for the selected physics interfaces. In this example, you already know that all properties are available for copper and titanium. You can start by adding the effect of thermal expansion to the structural analysis. 4 In the Model Builder, under Solid Mechanics, right-click the Linear Elastic Material Model 1 node and select Thermal Expansion . With the Structural Mechanics Module, the Thermal Stress predefined multiphysics interface is also available to define thermal stresses and strains. Adding Physics to a Model | 41 5 On the Thermal Expansion Settings window, under Model Inputs, select Temperature (jh/jh1) from the Temperature list. This is the temperature field from the Joule Heating interface (jh/jhm1) and couples the Joule heating effect to the thermal expansion of the busbar. Next, fix the busbar at the position of the titanium bolts. 6 In the Model Builder, right-click the Solid Mechanics node and select Fixed Constraint . 42 | Adding Physics to a Model 7 Click the Fixed Constraint node. In the Graphics window, rotate the busbar to view the back. Click one of the bolts to highlight it and right-click to add the bolt to the Selection list. 8 Repeat this procedure for the remaining bolts. You can now update the Study to take the added effects into account. RUNNING A STUDY SEQUENCE—JOULE HEATING AND THERMAL EXPANSION The Joule heating effect is independent of the stresses and strains in the busbar, assuming small deformations and ignoring the effects of electric contact pressure. This means that you can run the simulation using the temperature as input to the structural analysis. In other words, the extended multiphysics problem is weakly coupled. As such, you can solve it in two separate study steps—one for the strongly coupled Joule heating problem and a second one for the structural analysis. 1 In the Model Builder, right-click Study 1 and select Study Steps>Stationary to add a second stationary study step. Cross-check: Boundaries 8, 15, and 43. Adding Physics to a Model | 43 When adding study steps you need to manually connect the correct physics with the correct study step. Start by removing the structural analysis from the first step. 2 Under Study 1, click the Step 1: Stationary node . 3 In the Settings window, under Physics Selection, click the Solid mechanics (solid) row in the Physics interface table. 4 In the Use column, click to change the check mark to an to remove Solid mechanics from Study 1. Then remove Joule heating from the second step. 5 Under Study 1, click Step 2: Stationary 1 . 6 In the Settings window, under Physics Selection, click the Joule heating (jh) row in the Physics interface table. 7 In the Use column, click to change the check mark to an to remove Joule Heating from Study 2. Save the model. 8 Right-click the Study 1 node and select Compute to solve the problem. 44 | Adding Physics to a Model RESULTING DEFORMATION 1 Under Results>Plot Group 2, click the Surface 1 node . In the Settings window, click the Replace Expression button and from the context menu, select Solid Mechanics>Displacement>Total Displacements. You can also enter solid.disp in the Expression field. Click to clear the Manual color range check box if it is selected. The local displacement, due to thermal expansion, is displayed by COMSOL as a surface plot. Next add exaggerated deformation information. 2 In the Model Builder, under Results>3D Plot Group 2, right-click the Surface 1 node and add a Deformation . Save the model. You can also plot the von Mises and principal stresses to assess the structural integrity of the busbar and the bolts. Adding Physics to a Model | 45 FLUID FLOW After analyzing the heat generated in the busbar and possibly the induced thermal stresses, you might want to investigate ways of cooling it by letting air flow over its surfaces. When you have the CFD Module or the Heat Transfer Module, the Conjugate Heat Transfer multiphysics interface is available. This automatically defines coupled heat transfer in solids and fluids including laminar or turbulent flow. Adding fluid flow to the Joule heating model forms a new multiphysics coupling. To simulate the flow domain, you need to create an air box around the busbar. You can do this manually by altering the geometry from your first model. Alternatively, you can load a file including the geometry and the solution to the Joule heating problem. To load the geometry, select View>Model Library , browse to COMSOL Multiphysics>Multiphysics>busbar_box and click Open. Having loaded or created the geometry, now simulate the air flow as in this figure:. Start by adding a new parameter for the inlet flow velocity. Air Inlet Air Outlet 46 | Adding Physics to a Model DEFINING INLET VELOCITY 1 Under Global Definitions, click the Parameters node . 2 In the Settings window, click the last row in the Parameters table. Enter Vin in the Name column and 1e-1[m/s] in the Expression column. Enter a description of your choice. The next step is to add the material properties of air. ADDING AIR 1 In the Model Builder, right-click the Materials node and select Open Material Browser (or select View>Material Browser). Adding Physics to a Model | 47 2 In the Material Browser, expand the Built-In tree. Right-click Air and select Add Material to Model . 3 Close the Material Browser. 4 In the Model Builder, under Materials, click the Air node. 5 In the Graphics window, click the air box to highlight it and right-click to add it to the selection list. Now you can add the physics of fluid flow. Cross-check: Domain 1. 48 | Adding Physics to a Model ADDING FLUID FLOW 1 In the Model Builder, right-click Model 1 and select Add Physics . 2 In the Model Wizard, select Fluid Flow>Single-Phase Flow>Laminar Flow then click the Add Selected button and the Finish button . Save the model with a new name, busbar_box_I.mph. 3 On the Graphics toolbar, click the Wireframe rendering button to look inside the box. Adding Physics to a Model | 49 Now that you have added fluid flow to the model, you need to couple the heat transfer part of the Joule Heating physics interface to the fluid flow. 4 In the Model Builder, right-click Joule Heating . In the first section of the context menu (at the domain level), select Heat Transfer in Solids>Heat Transfer in Fluids. 5 The Settings window for Heat Transfer in Fluids displays. 6 In the Graphics window select the air domain to highlight it (in red) and right-click to add it to the Selection list (which changes the color to blue). Cross-check: Domain 1. 50 | Adding Physics to a Model Now couple fluid flow with heat transfer. 7 In the Settings window, under Model Inputs, select Velocity field (spf/fp1) from the Velocity field list. This identifies the flow field from the Laminar Flow interface and couples it to heat transfer. Moving on to the boundary conditions, specify the inlet and outlet for the heat transfer in the fluid domain. 8 In the Model Builder, right-click Joule Heating . In the second section of the context menu (the boundary section) select Heat Transfer in Solids>Temperature. Adding Physics to a Model | 51 9 In the Graphics window, click the inlet boundary, boundary number 2, and right-click to add it to the Selection list in the Settings window. This sets the inlet temperature to 293 K, the default setting. Continue with the outlet. 10In the Model Builder, right-click Joule Heating . In the second section of the context menu, select Heat Transfer in Solids>Outflow . Cross-check: Boundary 2. 52 | Adding Physics to a Model 11In the Graphics window, click the outlet boundary, boundary number 5, and right-click to add it to the Selection list in the Settings window. The settings for the busbar, bolts, and for 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 see this, click Electric Potential 1 and then Ground 1 in the Model Builder to verify that they have the correct boundary selection. 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. 12In the Model Builder, click the Laminar Flow node . In the Settings window, click the Clear Selection button . 13In the Graphics window, click the air box (domain number 1) and right-click to add it to the Selection, just list like in . Cross-check: Boundary 5. Adding Physics to a Model | 53 You can also verify that Air in Materials has all the properties that this multiphysics combination requires. In the Model Builder, under Materials, click Air. In the Settings window’s Material Contents list, verify that there are no missing properties, which are marked with a warning sign . Continue with the boundaries. 14In the Model Builder, right-click Laminar Flow . From the context menu’s boundary section, select Inlet . 54 | Adding Physics to a Model 15In the Graphics window, select the inlet boundary and right-click to add it to the Selection list (just like in step ). 16Go back to the Inlet Settings window. In the U0 field, enter Vin to set the Normal inflow velocity. 17Right-click Laminar Flow and select Outlet . 18In the Graphics window, select the outlet boundary 5 and right-click (just like in step ). The last step is to add symmetry boundaries. You can assume that the flow just outside of the faces of the channel is similar to the flow just inside these faces. This is correctly expressed by the symmetry condition. Cross-check: Boundary 2. Cross-check: Boundary 5. Adding Physics to a Model | 55 19Right-click Laminar Flow and select Symmetry . 20In the Graphics window, click one of the blue faces in the figure and right-click to add it to the Selection list. Continue with the three other faces. When you know the boundaries, you can click the Paste 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. The next step is to change the mesh slightly in order to get a quick solution. The current mesh settings would take a relatively long time to solve, and you can always refine it later. So for now, make the mesh coarser. Cross-check: Boundaries 1, 3, 4 and 48. 56 | Adding Physics to a Model COARSENING THE MESH 1 In the Model Builder, expand the Mesh 1 node , then click the Size node . 2 In the Settings window, under Element Size, confirm that Predefined and Normal are selected. 3 Click the Build All button . You can assume that the flow velocity is large enough to neglect the influence of the temperature increase in the flow field. It follows that you can solve for the flow field first and then solve for the temperature using the results from the flow field as input. You implement this with a study sequence. RUNNING A STUDY SEQUENCE—FLUID FLOW AND JOULE HEATING When you solve the flow field first and then the temperature field, it yields a weakly coupled multiphysics problem. The study sequence described in this section automatically solves such a weak coupling. 1 In the Model Builder, right-click Study 1 and select Study Steps>Stationary to add a second stationary study step. Next you need to connect the correct physics with the correct study step. Start by removing Joule heating from the first step. Adding Physics to a Model | 57 2 Under Study 1, click Step 1: Stationary . 3 In the Settings window, under Physics Selection, click the Joule heating (jh) row in the Physics interface table. In the Use column, click to change the check mark to an to remove Joule heating from Study 1. Remove the fluid flow from the second step. 4 Under Study 1, click Step 2: Stationary 1 . In the Settings window, under Physics Selection, click the Laminar flow (spf) row in the Physics interface table. In the Use column, click to change the check mark to an to remove Laminar flow from Study 2. Press Ctrl+S to save the model. 5 Right-click Solver Configurations and select Delete Solvers to clear any solver settings that may be kept from the last solution. 6 Right-click the Study 1 node and select Compute to automatically create a new solver sequence that solves the two problems in sequence. The simulation takes a few minutes to run. 7 After the solution is complete, click the Transparency button on the Graphics toolbar to visualize the temperature field inside the box. 58 | Adding Physics to a Model The Temperature Surface plot 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. Parameter Sweeps and Parallel Computing | 59 Parameter Sweeps and Parallel Computing Sweeping a Geometric Parameter Often it is interesting to generate multiple instances of a design to meet specific constraints. For the busbar, a design goal might be to lower the operating temperature and a decrease in the current density achieves this. Since the current density depends on the geometry of the busbar, varying the width, wbb, should change the current density and, in turn, have some impact on the operating temperature. Run a parametric sweep on wbb to study this change. Open the file busbar.mph to add a parametric sweep to Study 1. ADDING A PARAMETRIC SWEEP 1 Open the file busbar.mph. In the Model Builder, right-click Study 1 and select Parametric Sweep . In the Settings window, click the Add button and select the Parameter name, wbb. 2 Enter a range(5e-2,1e-2,1e-1) of Parameter values. This sweeps the width of the busbar from 5 cm to 10 cm with 1 cm increments. Create an Average Model Coupling, which you can later use to calculate the average temperature in the busbar. 60 | Parameter Sweeps and Parallel Computing 3 Right-click Definitions and select Model Couplings>Average . In the Settings window, select All domains from the Selection list. This creates an operator called aveop1. The aveop1 is now available to calculate the average of any quantity defined on those domains. A little later this is used to calculate the average temperature, but it can also be used to calculate average electric potential, current density, and so forth. 4 Right-click Study 1 and select Compute to run the sweep. Save the model as busbar_III.mph. The results show the temperature in the busbar for the last parameter value, wbb=10 cm. Compare this to the temperature for wbb= 5 cm. 5 In the Model Builder, click the first Temperature node . In the 3D Plot Group Settings window, select Solution 2 from the Data set list. This data set contains the results from the parametric sweep. 6 In the Parameters value list, select 0.05. Click the Plot button . Parameter Sweeps and Parallel Computing | 61 7 Under the first Temperature node, click the Surface node . In the Settings window, click Range and select the Manual color range box. Enter 323 in the Maximum field (309.35 for the 10 cm case). The maximum temperature decreases from 331 K to 318 K as the width of the busbar increases from 5 cm to 10 cm. To further analyze these results, you can plot the average temperature for each width. 62 | Parameter Sweeps and Parallel Computing VIEWING THE RESULTS 1 Right-click Results and add a 1D Plot Group . Then right-click 1D Plot Group 4 and select Global . In the Settings window, select Solution 2 from the Data set list. 2 Select From list as the Parameter selection (wbb). Click the first row in the Expressions column and enter aveop1(T). You use a similar syntax to calculate the average of other quantities. 3 Click the Plot button and save the model. In the plot, the average temperature also decreases as the width increases. This indicates that the goal of a lower operating temperature would be fulfilled by using Parameter Sweeps and Parallel Computing | 63 a wider busbar. Of course, this may also increase the total mass (and therefore the cost) of the busbar. This suggests an optimization problem for you to consider. The subject of parameter sweeps naturally raises the question of parallel processing; it would be efficient if all parameters were solved simultaneously. 64 | Parallel Computing Parallel Computing COMSOL supports most forms of parallel computing including shared memory parallelism (for example, multicore processors) and high performance computing (HPC) clusters. You can use clusters to solve a series of parameter steps for a model, one parameter per node, or you can solve a single large model using distributed memory. For maximum performance, the COMSOL cluster implementation can utilize shared-memory multicore processing on each node in combination with the MPI-based distributed memory model. This brings a major performance boost by making the most out of the computational power installed. ADDING A CLUSTER COMPUTING JOB 1 To run cluster simulations, you need to enable advanced options for the Job Configurations node. Click the Show button on the Model Builder and select Advanced Study Options. 2 In the Model Builder, under Study 1, right-click Job Configurations and select Cluster Computing . Parallel Computing | 65 The Cluster Computing Settings window helps to manage the simulation either for running several instances of an identical parameterized model – one parameter value per host – or for running one parameter step in distributed mode. You choose which type of cluster job you want to do from the Cluster type list. COMSOL supports Windows Compute Cluster Server 2003, Windows HPC Server 2008, and Linux. To learn more about running COMSOL in parallel, see the Installation and Operations Guide. 66 | Geometry Sequences Geometry Sequences This section details how to create the busbar geometry using COMSOL’s geometry tools. The step-by-step instructions take you through the construction of the geometry using parameters set up in Global Definitions. Using parameterized dimensions helps to produce what-if analyses and automatic geometric parametric sweeps. If you have not yet done so, follow the steps under the Model Wizard and Global Definitions starting with “Thorough Example: The Busbar” on page 7. Then return to this section to learn about geometry modeling. The first step in the geometry sequence is to draw the profile of the busbar. 1 Right-click Geometry 1 and select Work Plane . In the Settings window, select xz-plane from the Plane list. Click the Show Work Plane button on the Settings toolbar. Continue editing the axis and grid settings in Work Plane 1. Geometry Sequences | 67 2 In the Model Builder, expand the View 2 node and click Axis . Enter the values for the x and y minimums and maximums (see the figure) into the Axis fields and the x and y spacing in the Grid fields. Select the Manual Spacing check box. Leave the Extra x and Extra y fields blank. Click the Apply button . You can use interactive drawing to create a geometry using the drawing toolbar buttons while pointing and clicking in the Graphics window. You can also right-click the Geometry node under Work Plane 1 to add geometric objects to the geometry sequence. In the next set of steps, you will create a profile of the busbar. Geometry Toolbar 68 | Geometry Sequences 3 In the Model Builder under Work Plane 1, right-click Geometry and select Rectangle . Under Size, enter L+2*tbb in the Width field and 0.1 in the Height field. Click the Build Selected button . 4 Create a second rectangle. Under Work Plane 1, right-click Geometry and select Rectangle . Enter L+tbb in the Width field, 0.1-tbb in the Height field, and tbb in the y position field. Click the Build Selected button . Use the Boolean Difference operation to subtract the second rectangle from the first one. 5 Under Work Plane 1, right-click Geometry and select Boolean Operations>Difference . In the Graphics window, click r1 and right-click to add r1 to the Objects to add list. Click the Activate selection button in the Objects to subtract list then right-click to add r2 to the Objects to subtract list. Click Build Selected . You should now have a backward-facing, L-shaped profile. Continue by rounding the corners using fillets. Geometry Sequences | 69 6 Under Work Plane 1, right-click Geometry and select Fillet . In the Graphics window, click point 3, the inner corner, and right-click to add it to the Vertices to fillet list. Enter tbb in the Radius field. This takes care of the inner corner. 7 For the outer corner, right-click Geometry and select Fillet . In the Graphics window, click point 6, the outer corner, and right-click to add it to the Vertices to fillet list. Enter 2*tbb in the Radius field. Click Build Selected . 70 | Geometry Sequences The result should match this figure: Next you extrude the work plane to create the 3D busbar geometry. 8 In the Model Builder, right-click Work Plane 1 and select Extrude . In the Settings window, enter wbb in the Distances from Work Plane table to extrude to the width of the profile. The table allows you to enter several values in order to create sandwich structures with different layer materials. In this case, only one extruded layer is needed. Click Build Selected . Click the Zoom Extents button on the Graphics toolbar, then click the Save button and name the model busbar.mph. The root node is the same name as your file. Next, create the titanium bolts by extruding two circles drawn in two work planes. Geometry Sequences | 71 9 In the Model Builder, right-click Geometry 1 and add a Work Plane . A Work Plane 2 node is added. In the Settings window, under Work Plane, select Face parallel as the Plane type. 10In the Graphics window, click face 8 (highlighted in the figure). Once this surface is highlighted in red, right-click anywhere in the Graphics window to add it to the Planar face list in the Settings window. Face number 8 is now highlighted in blue and the work plane is positioned on top of face number 8. Click the Show Work Plane button to draw the first circle representing the position of the first bolt. Click the Zoom Extents button on the Graphics toolbar. Face 8 72 | Geometry Sequences 11Under Work Plane 2, right-click Geometry and select Circle . In the Settings window, under Size and Shape, define a circle with radius rad_1 and the Center x and y coordinates (0, 0). Click Build Selected . Your geometry should match this figure: 12Continue creating the bolt by adding an extrude operation. In the Model Builder, right-click Work Plane 2 and select Extrude . Geometry Sequences | 73 13In the Settings window, in the first row of the Distances from Work Plane table, enter -2*tbb to extrude the circle a distance equal to the thickness of the busbar. Click the Build Selected button to create the cylindrical part of the titanium bolt that runs through the busbar. Draw the two remaining bolts. 74 | Geometry Sequences 14Right-click Geometry 1 (under Model 1) and select Work Plane . A Work Plane 3 node is added. In the Settings window, for Work Plane 3, select Face parallel as the Plane type. In the Graphics window, click face 4 (shown in the figure). When this surface is highlighted red, right-click anywhere in the Graphics window to add it to the Planar face list in the Settings window. Face number 4 is now highlighted blue. Click the Show Work Plane button and the Zoom Extents button 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. 15Under Work Plane 3, right-click Geometry and select Circle . In the Settings window, under Size and Shape, enter rad_1 in the Radius field. Under Position, enter -L/2+1.5e-2 in the x field, and -wbb/4 in the y field. Click Build Selected . Copy the circle that you just created to generate the third bolt in the busbar. Face 4 Geometry Sequences | 75 16Under Work Plane 3, right-click Geometry and select Transforms>Copy . In the Graphics window, click the circle c1 to highlight it. Right-click anywhere in the Graphics window and add the circle to the Input object list in the Settings window. Under Displacement, enter wbb/2 in the y field. Click Build Selected . Your geometry should match this figure. Continue by extruding the circles. 17In the Model Builder, right-click Work Plane 3 and select Extrude . In the Settings window, in the first row of the Distances from Work Plane table, enter -2*tbb. Click Build 76 | Geometry Sequences Selected . The geometry and its corresponding geometry sequence should match the figure. Click the Save button and name the model busbar.mph. Easy Example: The Wrench | 77 Easy Example: The Wrench Torquing a Wrench Working with hand tools gives you a practical introduction to basics of engineering. At some point in your life It is likely you have tightened a bolt using a wrench. This exercise takes you through a model that analyzes this basic task, going into detail about the associated geometric tolerances, torque specs, and the intrinsic contact problem. In principle, a bolt replaces the need for external fastening by providing an internal clamping force via pretension. The tensile stress in a bolt is produced when it is torqued into a matching threaded hole or nut. The magnitude of this stress depends on many factors, such as material selection, assembly configuration, and lubrication. Control of these parameters becomes the focus of much engineering effort, especially in critical applications such as automotive engines, brakes, aircraft, and structural installations. The following model presents both a bolt and a wrench at the moment of installation. MODEL WIZARD 1 In the Model Wizard, select 3D and click Next . 78 | Easy Example: The Wrench 2 In Add Physics, select Structural Mechanics > Solid Mechanics (solid) . Right-click or double-click to add it to the Selected physics section. 3 Click Next . 4 Click Stationary under Preset Studies. Click the Finish button . GEOMETRY 1 Under Model 1, right-click Geometry 1 and select Import . Easy Example: The Wrench | 79 2 From the Geometry import list, select COMSOL Multiphysics file. 3 Click Browse and locate the file wrench.mphbin in the Model Library folder COMSOL_Multiphysics/Structural_Mechanics. Double-click to add or click Open. 4 Click Import to display the geometry in the Graphics window. MATERIALS The chosen bolt material and tool steel are important characteristics of this contact problem. Here is how to choose them in COMSOL. Rotate: Left-click and drag Pan: Right-click and drag 80 | Easy Example: The Wrench 1 Under Model 1, right-click Materials and select Open Material Browser (or select View>Material Browser). 2 In the Material Browser, under Materials, expand the Built-In folder. Scroll down to find Structural Steel, right-click and select Add Material to Model. 3 Examine the Material Contents section to see how COMSOL categorizes available material information with respect to what the active physics interface requires. Easy Example: The Wrench | 81 GLOBAL DEFINITIONS Parameters 1 In the Model Builder, right-click Global Definitions and choose Parameters . 2 Go to the Settings window for Parameters. 3 Locate the Parameters section. In the Parameters table, enter the following settings: DOMAIN PHYSICS AND BOUNDARY CONDITIONS With the geometry and materials defined, you are now ready to revisit the governing physics introduced in the Model Wizard section. 1 In the Model Builder, right-click Solid Mechanics (solid) and select Fixed Constraint . NAME EXPRESSION DESCRIPTION F 150[N] Applied force 82 | Easy Example: The Wrench 2 Rotate the geometry by left-clicking and dragging into the position shown. Then left-click the cut-face of the partially modeled bolt (which turns the boundary red) and right-click to select it (which turns the boundary blue). 3 Click the Go to Default 3D View button to restore the earlier view. 4 Click the Zoom Box button to prepare the view shown in . 5 In the Model Builder, right-click Solid Mechanics (solid) and select Boundary Load . Cross-check: Boundary 35. Easy Example: The Wrench | 83 6 Rotate the geometry by left-clicking and dragging it into the position shown. Then select the top socket face by left-clicking to highlight the boundary and right-clicking it to add it to the list. 7 In the Boundary Load Settings window, under Force, select Total force as the Load type and enter -F. The negative sign indicates the negative z direction (downward). MESH Because the geometry contains small edges and faces, reduce the size of the minimum element. 1 In the Model Builder, click Model 1>Mesh 1 . 2 Go to the Settings window for Mesh. 3 Locate the Mesh Settings section. From the Sequence type list, select User-controlled mesh. 4 Click Model 1>Mesh 1>Size . 5 Go to the Settings window for Size. 6 Locate the Element Size section. Click the Custom button. 7 Locate the Element Size Parameters section. In the Minimum element size edit field, enter 0.0012. 8 Click the Build All button . Cross-check: Boundary 111. 84 | Easy Example: The Wrench STUDY The following steps are needed to set up an iterative solver. By using such a solver, you can significantly reduce the memory amount needed for the calculations. If your computer has more than 2 GB of memory, you can skip these steps and go directly to step 6 to compute the solution. 1 In the Model Builder, right-click Study 1 and choose Show Default Solver . 2 Expand the Study 1>Solver Configurations>Solver 1> node. 3 Right-click Stationary Solver 1 and choose Iterative . 4 Right-click Iterative 1 and choose Multigrid . 5 Right-click Study 1 and select Compute . DISPLAYING RESULTS COMSOL finishes after about one minute of computation time and displays the default von Mises stress in a Surface plot with the displacement visualized using a Deformation subnode. Change to a more suitable unit as follows. 1 In the Model Builder, expand the Results>Stress (solid) node, then click Surface 1 . 2 Go to the Settings window for Surface. 3 Locate the Expression section. From the Unit list, select MPa. 4 Click the Plot button . Easy Example: The Wrench | 85 5 Click the Zoom Extents button on the Graphics toolbar. von Mises stress distribution in bolt and wrench under an applied vertical load. Next we are going to determine the location of greatest tension by plotting the principal stress field s1. PLOTTING THE PRINCIPAL STRESS FIELD 1 Right-click the Results node and add a 3D Plot Group . 86 | Easy Example: The Wrench 2 Right-click the 3D Plot Group node and select Contour . 3 In the corresponding Contour Settings window, click the Replace Expression button and select Solid Mechanics>Stress>Principal stresses> First principal stress (solid.sp1), which is representative of the s1 field. 4 In the same Settings window, under Expression, select the Description check box and enter Principal Stress Field S1. Under Levels, set the Total levels to 12. Under Coloring and Style, select Filled as the Contour type. Easy Example: The Wrench | 87 5 Click the Plot button and rotate the geometry to approximately the orientation shown in the figure. You can see that the tensile stress concentrates at the handle's top toward the open end, which is consistent with the downward force applied to the socket. Also note high stresses in the head to shank transition of the bolt. 88 | Supported External File Formats Supported External File Formats After completing a design study as you have done, you often want to use the results in some other context. For instance, you may want to output an optimal geometry in a dedicated CAD format. In fact, the broadly applicable nature of multiphysics simulation brings with it the need for interaction with many other scientific computing platforms. For this reason, COMSOL Multiphysics provides the capability to read and write a wide array of file formats. The list below contains several formats that are compatible with COMSOL. These formats are categorized according to the associated type of software. MCAD FILE FORMAT READ WRITE AutoCAD® (.dwg, 3D only)1 Yes6 Yes6 Autodesk Inventor® (.ipt, .iam)2 Yes Yes6 Creo™ Parametric (.prt, .asm)3 Yes6 Yes6 Pro/ENGINEER® (.prt, .asm)2 Yes Yes6 SolidWorks® (.sldprt, .sldasm)2 Yes Yes6 SpaceClaim® (.scdoc)4 Yes6 Yes6 DXF (.dxf, 2D only) Yes Yes Parasolid® (.x_t, xmt_txt, .x_b, .xmt_bin)2 Yes Yes ACIS® (.sat, .sab)2 Yes No Step (.STEP)2 Yes No IGES (.IGES)2 Yes No CATIA® V5 (.CATPart, .CATProduct)5 Yes No VRML, v1 (.vrml, .vrl) Yes No STL (.stl) Yes No 1 Requires LiveLink™ for AutoCAD® 2 Requires one of the LiveLink™ products for AutoCAD®, Creo™ Parametric, Inventor®, Pro/ENGINEER®, SolidWorks®, or SpaceClaim®; or the CAD Import Module 3Requires LiveLink™ for Creo™ Parametric 4Requires LiveLink™ for SpaceClaim® 5Requires the CAD Import Module (or one of the LiveLink™ products for AutoCAD®, Creo™ Parametric, Inventor®, Pro/ENGINEER®, SolidWorks®, or SpaceClaim®) and the File Import for CATIA® V5 6 From/To file via linked CAD package Supported External File Formats | 89 ECAD Material Databases Mesh Numerical Data, Images, and Movies FILE FORMAT READ WRITE NETEX-G (.asc)1 Yes No ODB++(X) (.xml)1 Yes No GDS (.gdx)1 Yes No SPICE (.cir)1 Yes No 1 Requires one of AC/DC Module, RF Module, or MEMS Module FILE FORMAT READ WRITE NASA file (.dat)1 Yes No CHEMKIN (.dat)1 Yes No CAPE -OPEN1 (direct connection) n/a n/a 1Requires Chemical Reaction Engineering Module FILE FORMAT READ WRITE NASTRAN Bulk Data (.nas, .bdf, .nastran, .dat) Yes No VRML, v1 (.vrml, .vrl) Yes No STL (.stl) Yes No FILE FORMAT READ WRITE Plain text (.txt) Yes Yes Copy and paste spreadsheet format No Yes JPEG (.jpg) No Yes PNG (.png) No Yes BMP (.bmp) No Yes EPS (.eps) (2D graphs) No Yes Animated GIF (.gif) No Yes Adobe® Flash (.swf) No Yes AVI (.avi)1 No Yes 1 Available for Windows only 90 | Supported External File Formats Programming Languages Interpolation Data Formats Built-in Functions FILE FORMAT READ WRITE MATLAB®: Model M-File (.m)1 Yes Yes MATLAB®: Function (.m)1 Yes No Java: Model Java File (.java) Yes Yes C: Function Yes No 1 Requires LiveLink™ for MATLAB® FILE FORMAT READ WRITE Spreadsheet Yes Yes Grid Yes No Sectionwise Yes Yes FUNCTION ARGUMENTS AND DEFINITION CALL Analytic The function name is its identifier, for example an1. The function is a mathematical expression of its arguments. Example: Given the arguments x and y, its definition is sin(x)*cos(y). The function has arbitrary number of arguments. The name of the function with comma-separated arguments within parenthesis. For example: an1(x,y) Gaussian Pulse The function name is its identifier, for example gp1. The Gaussian pulse function defines a bell-shaped curve according to the expression It is defined by the mean parameter, s0, and the standard deviation, . The function has one argument. The name of the function with a single argument within parenthesis. For example: gp1(x) y s  1  2 --------------e s s0–  2 – 2 2 ---------------------- = Supported External File Formats | 91 Interpolation The function name is its identifier, for example int1. An interpolation function is defined by a table or file containing the values of the function in discrete points. The file formats are the following: spreadsheet, grid, or sectionwise. The function has one to three arguments. The name of the function with comma-separated arguments within parenthesis. For example: int1(x,y,z) Piecewise The function name is its identifier, for example pw1. A piecewise function is created by splicing together several functions, 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. The name of the function with a single argument within parenthesis. For example: pw1(x) Ramp The function name is its identifier, for example rm1. A ramp function is a linear increase with a user-defined slope that begins at some specified time. The function has one argument. It can also be smoothed. The name of the function with a single argument within parenthesis. For example: rm1(x) Random The function name is its identifier, for example rn1. A random function generates white noise with uniform or normal distribution and has one or more arguments to simulate white noise. The function has arbitrary number of arguments. The name of the function with comma-separated arguments within parenthesis. For example: rn1(x,y) The arguments x and y are used as a random seeds for the random function. Rectangle The function name is its identifier, for example rect1. A rectangle function is 1 in an interval and 0 everywhere else. The function has one argument. The name of the function with a single argument within parenthesis. For example: rect1(x) FUNCTION ARGUMENTS AND DEFINITION CALL 92 | Supported External File Formats Step The function name is its identifier, for example step1. A step function is a sharp transition from 0 to some other value (amplitude) at some location. The function has one argument. It can also be smoothed. The name of the function with a single argument within parenthesis. For example: step1(x) Triangle The function name is its identifier, for example tri1. A triangle function is a linear increase and linear decline within an interval and 0 everywhere else. The function has one argument. It can also be smoothed. The name of the function with a single argument within parenthesis. For example: tri1(x) Waveform The function name is its identifier, for example wv1. A waveform function is a periodic function with one of several characteristic shapes: sawtooth, sine, square, or triangle. The function has one argument. It can also be smoothed. The name of the function with a single argument within parenthesis. For example: wv1(x) FUNCTION ARGUMENTS AND DEFINITION CALL Keyboard Shortcuts | 93 Keyboard Shortcuts SHORTCUT (WINDOWS, LINUX) SHORTCUT (MAC) ACTION F1 F1 Display dynamic help for the selected node F2 F2 Rename the selected node, file, or folder F5 F5 Update solution F8 F8 Build the geometry, build the mesh, or update the plot Del Del Delete a node Alt+left arrow Ctrl+left arrow Move to the previously selected node in the Model Builder Alt+right arrow Ctrl+right arrow Move to the next selected node in the Model Builder Ctrl+A Command+A Select all domains, boundaries, edges, or points; select all cells in a table Ctrl+C Command+C Copy text in fields Ctrl+V Command+V Paste copied text Ctrl+Z Command+Z Undo the last operation Ctrl+Y Ctrl+Shift+Z Redo the last undone operation Ctrl+up arrow Command+up arrow Move a physics node (except default nodes), material node, mesh node, study step node, or results node up one step Ctrl+down arrow Command+down arrow Move a physics node (except default nodes), material node, mesh node, study step node, or results node down one step Ctrl+Tab Ctrl+Tab Switch focus to the next window on the desktop Ctrl+Shift+Tab Ctrl+Shift+Tab Switch focus to the previous window on the desktop Ctrl+Alt+left arrow Command+Alt+left arrow Switch focus to the Model Builder window Ctrl+Alt+right arrow Command+Alt+right arrow Switch focus to the Settings window Ctrl+Alt+up arrow Command+Alt+up arrow Switch focus to the previous section in the Settings window Ctrl+Alt+down arrow Command+Alt+down arrow Switch focus to the next section in the Settings window Shift+F10 or (Windows only) Menu key Ctrl+F10 Open context menu Ctrl+Space Ctrl+Space Open list of predefined quantities for insertion in Expression fields for plotting and results evaluation. 94 | New Terminology in Version 4 New Terminology in Version 4 The following tables include new terminology and names in version 4 and the corresponding equivalents in version 3.5a: General Terminology NEW NAME NAME IN 3.5A COMMENTS Parameters Constants Parameters in 4 have a broader scope, including the geometry. Also, predefined physical constants are new in version 4. Variables Expressions, Expression variables Variables appear in two locations depending on their scope: under Global Definitions with a global scope or under Definitions in each model. In the latter case, scope can be set to the entire model or to selected domains, boundaries, edges, or points. Physics interface Application mode Coupling operators Coupling variables You find the coupling operators under Model Couplings in the Definitions branches. A coupling operator, as opposed to a coupling variable, can be reused with different arguments. For example, the same coupling operator can be used to integrate different quantities over a boundary. Hide Suppress For hiding part of the geometry in the Graphics window. Study type Analysis type The study type sets up a study step, which controls the generation of a solver sequence for performing a certain type of study. Results branch Postprocessing menu The Results branch contains the data sets for evaluation and visualizations of results as well as derived values, plot groups for various plots, tables for numerical results, model reports, and export of animations, data files, and images. Convert to Coerce to For converting geometry objects from one type to another (for example, from a solid to a curve). Domain Subdomain A solid geometry consists of one or several domains. Bidirectional, symmetric constraint Ideal constraint In 4.2a available as a weak constraint and as a strong (pointwise) constraint. Unidirectional constraint Non-ideal constraint In 4.2a available as a weak constraint and as a strong (pointwise) constraint. New Terminology in Version 4 | 95 Physics Interfaces With New Names NEW NAME NAMES IN 3.5A COMMENTS Transport of Diluted Species Convection and Diffusion; Diffusion; Electrokinetic Flow; and Nernst-Planck without Electroneutrality The Transport of Diluted Species interface includes all transport mechanism for mass transport of diluted species. The functionality for migration through electrophoresis and electroosmosis is only available in the Chemical Reaction Engineering Module and MEMS Module. Transport of Concentrated Species Maxwell-Stefan Diffusion and Convection The Transport of Concentrated Species interface also includes two other diffusion models for mass transport of concentrated species: the mixture-averaged diffusion model and a diffusion model based on Fick’s law. Laminar Flow Incompressible Navier-Stokes; non-Newtonian Flow; General Laminar Flow; and Stokes Flow The Laminar Flow interface includes all variants of laminar flow. Some of the functionality is only available in the Chemical Reaction Engineering Module, Subsurface Flow Module, Heat Transfer Module, and Microfluidics Module. Electric Currents Conductive Media DC; Quasi-Statics, Electric The Electric Currents interface solves for the electric potential in applications where electric currents flow in a conductive media. Heat Transfer in Solids Conduction; General Heat Transfer The Heat Transfer in Solids interface provides default settings for conductive heat transfer in solids. But you can easily switch from heat transfer in solids to heat transfer in fluids as well as add and combine different heat transfer mechanism within the same Heat Transfer interface. Heat Transfer in Fluids Convection and Conduction; General Heat Transfer The Heat Transfer in Fluids interface provides default settings for convective and conductive heat transfer in fluids. But you can easily switch from heat transfer in fluids to heat transfer in solids as well as add and combine different heat transfer mechanism within the same Heat Transfer interface. Solid Mechanics Solid, Stress-Strain; Axial Symmetry Stress-Strain; Plane Stress; and Plane Strain In 2D models you can switch between plane stress and plane strain without adding a new physics interface. Deformed Geometry Parameterized Geometry The Deformed Geometry interface is available for all geometries, not just 2D. In version 4 it is also possible to study fully parameterized geometries using parametric sweeps. 96 | New Terminology in Version 4 Material Libraries NEW NAME NAMES IN 3.5A COMMENTS Built-in Basic Material Properties Included in COMSOL Multiphysics. MEMS MEMS Material Properties Included with the MEMS Module, Acoustics Module, and Structural Mechanics Module. Piezoelectric Piezoelectric Material Properties Included with the MEMS Module, Acoustics Module, and Structural Mechanics Module. AC/DC Electric (AC/DC) Material Properties Included with the AC/DC Module. The Samarium Cobalt material is no longer included. Convective Cooling boundary condition Heat Transfer Coefficients In version 4.1 the Convective Cooling boundary condition replaces the library of heat transfer coefficients.The Settings window for the Convective Cooling node contains predefined heat transfer coefficients for natural and forced convection (both internal and external). Included with the Heat Transfer Module. Liquids and Gases Liquids and Gases Included with the Chemical Reaction Engineering Module, Acoustics Module, Subsurface Flow Module, Heat Transfer Module, and MEMS Module. Material Library Material Library The COMSOL Material Library add-on is unchanged. Batteries and Fuel Cells N/A New material library available with the Batteries & Fuel Cells Module. cfd_introduction.book Page 4 Friday, September 23, 2011 12:07 PM www.comsol.com CM010004