12.07.2015 Views

COMSOL 4.2 Tutorial

COMSOL 4.2 Tutorial

COMSOL 4.2 Tutorial

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>COMSOL</strong> <strong>4.2</strong> <strong>Tutorial</strong><strong>COMSOL</strong> Multiphysics (formerly FEMLAB) is a finite element analysis, solverand Simulation software / FEA Software package for various physics andengineering applications, especially coupled phenomena, or multiphysics.<strong>COMSOL</strong> Multiphysics also offers an extensive interface to MATLAB and itstoolboxes for a large variety of programming, preprocessing and postprocessingpossibilities. The packages are cross-platform (Windows, Mac, Linux,Unix.) Inaddition to conventional physics-based user-interfaces, <strong>COMSOL</strong> Multiphysicsalso allows for entering coupled systems of partial differential equations (PDEs).How to create a new model in <strong>COMSOL</strong>1. Start <strong>COMSOL</strong> Multiphysics2. Work through the <strong>COMSOL</strong> Model Wizard which will require you to select thecoordinate system for the model, the relevant physics to the problem, and the typeof study you wish to perform (Time dependant or stationary).3. Define the parameters, equations and variables pertinent to the model (subdirectory (Global Definitions).4. Define the geometry of the model (Geometry).5. Select the materials you wish to use in your model (Materials).


6. Select the boundary, bulk and initial conditions for your system for each physicsyou are using (This will be entered separately for each different physics you areusing e.g. you will need to enter these for Laminar Flow and again for HeatTransfer if you are using both ).7. Choose the element size to be used (Mesh).8. Adjust solver parameters and compute (Study).10. Display the desired results in the most meaningful way (Results).Not all of these steps are always necessary when building a model. The order isalso variable depending on the complexity of the model.Example 1. (Heat transfer)Consider a cylindrical heating rod which is sheathed by a concentric tube ofthickness 0.05 m and which starts 0.05 m away from the center. The entireassembly is immersed in a fluid and the system is at steady-state, as shown below.We wish to determine the temperature distribution within the sheath. Afterthinking about the problem, assume that we arrived at the followingapproximations (make sure you understand how we arrived at followingapproximations for your future quiz and test): The temperature of the heater isconstant at 400K. The temperature at R1 is the same as the temperature of the


Startup1. Start <strong>COMSOL</strong> by clicking the<strong>COMSOL</strong> Multiphysics <strong>4.2</strong> icon.2. When <strong>COMSOL</strong> starts, the ModelWizard will be open automatically.This wizard asks you to define thespatial dimension you’ll be using forthe model as well as the applicablephysics and the type of study you wishto perform (either time dependant or stationary). For this problem start by selecting2D, continue by clicking theblue, right pointing arrow at thetop right of the Model Wizardscreen.3. Next select the applicablephysics for the model. In thiscase heat transfer in solids willbe selected. This can be foundunder the Heat Transfer module.Click the triangle to the left of


Einstimmig genehmigt wird ein Lotissementprojekt von Herrn Jean-Pierre Mehlen im Ort genannt „um Beschelchen“ inReuland. Hier ist der Bau von 3 Einfamilienhäusern sowie 6 Doppelhaushälften vorgesehen.Nächster Punkt der Tagesordnung war die definitive Genehmigung mit 8 Stimmen und 1 Gegenstimme eines Projektesbetreffend den Bau eines Appartementgebäudes in der Straße „op Praikert“ in Heffingen, dies nachdem 2 PersonenEinspruch gegen besagtes Bauvorhaben eingelegt hatten.Alsdann werden die Mitglieder der einzelnen Kommissionen ernannt:Schulkommission:- Schiltz Guy, Krecké Jacques, Schmitz Arnould, Schantzen ArletteKulturkommission:- Gillen-Diederich Ginette, Hendriks-Heinisch Maisy, Moschetti-Wetz Sanny, Raths Nico, Schmit-Dusatko Danielle,Schoellen André, Schwartz Jean , Visser LucienneKommission für das 3te Alter:- Di Giambattista-Feltes Tilly, Giver Sonja, Hendriks-Heinisch Maisy, Hoffmann Nic, Schantzen Arlette, Schiltz Guy,Schiltz-Winckel SylvieSport- und Jugendkommission:- Beaume Marcel, Kauffmann Henri, Schwartz Jean, Rach John, Reinert ChrisBau- und Verkehrskommission:- Colbach Pol, Faber Frank, Kauffmann Henri, Kieffer Ricky, Krecké Jacques, Nicolay Jean-Marie, Rach John,Schoellen André, Seiler RomainUmweltkommission:- Hendriks Nico, Hoffmann Nic, Krecké Jacques, Moschetti-Wetz Sanny, Nicolay Jean-Marie,- Schiltz-Winckel Sylvie, Sins Georges, Visser Lucienne, Wilgé PitIntegrationskommission:- Vollmitglieder: Di Giambattista Salvatore, Dumser-Schwickerath Myriam, Lachambre Frédéric, Moschetti-WetzSanny, Schantzen Arlette, Schiltz Guy- Ersatzmitglieder: Dumser Patrick, Juchno Joanna, Marques de Almeida Valente Antonio,- Van der Hoeven MoniqueFinanzkommission:- Dumser-Schwickerath Myriam, Faber Frank, François Alain, Kauffmann Henri, Krecké Jacques, Moschetti-WetzSannyKommission für Internet und Informationsblatt:- Hendriks Nico, Schantzen Arlette, Schiltz Guy, Schwartz Jean


GeometryNow we are ready to add the geometry ofthe model. This is very simple because ourassumptions have placed the problem intoonly 2 dimensions. Our geometry consistsof only of a rectangle.1. To create this rectangle first find thegeometry icon in the model builder menusand right click it, this will bring up themenu shown at right.2. Find the “Rectangle” button in this newmenu and left click this.3. At this point the rectangle has been added, however the dimensions of thisrectangle need to be changed to fit the dimensions in the problem. We do this byleft clicking the white rectangle just to the left of the geometry icon. This willexpand the geometry tab to show all the sub tabs contained within geometry. If youadded the rectangle correctly you will see the tab called Rectangle 1. This containsall the information regarding this object and to adjust the dimensions and positionof this rectangle this is where we do so. Left click the tab labeled Rectangle 1.


4. If you have completed the above steps successfully your screen should resemblethe one above. Notice that by default the corner of the rectangle has been placed atthe origin (position x= 0, y =0) and given width and height of 1m. For this problemthe height needs to be 5 cm (0.05 m) and the width needs to be 30 cm (0.3 m).Enter these values into the designated fields and press the blue building icon at thetop right of the rectangle menus. This is the “Build All” button and will add yourrectangle to the model.


5. To get the graphical interface of <strong>COMSOL</strong> to center on the rectangle and adjustthe axis bounds click the “Zoom Extents” buttonMaterialsTo give the rectangle thermal properties such as heat capacity and thermalconductivity we can either add these directly under the “Heat Transfer” tab or byselecting a material to build the rectangle from. In this problem we will make ourrectangle out of copper and we will do this using the “Materials” tab.


1. Left click on “Materials” tab and then left click “Materials Browser”. Yourscreen should look like the screen below.2. As can be seen above the “Material Browser” has a search bar that allows you toenter the name of the material in question and <strong>COMSOL</strong> will find any matcheswithin its database. Enter copper into the search bar and click search.3. Open the “Built-In” tab and then right click “Copper”. Your screen should nowlook like the one below. Left click “Add Material to Model”. You have now addedcopper to all domains by default which means the rectangle now has the propertiesof solid copper.


Heat TransferIt is under the “Heat Transfer” tab that the boundary, bulk and initial conditions forthe equations of heat conduction can be input. In our case we only have boundaryconditions. Initial conditions are used in conjunction with time dependant studiesand bulk conditions apply to the entire domain, not just a boundary. In our case wehave on boundary in contact with the heated rod which is at 400k and all otherboundaries in contact with the thermostat bathe at 300k.1. To input these boundary conditions first open the Heat Transfer tab by leftclicking the white triangle to the left of the Heat Transfer icon. Your screen shouldlook like this.


2. Right click the Heat Transfer icon to open a menu containing the various typesof bulk and boundary conditions. Go through this menu and select “Temperature”by left clicking. A new icon will now appear under initial values that says“Temperature” this is where we will input one of our two temperature conditions.3. Add another temperature boundary condition by repeating step 2.


4. After adding the two temperature boundaryconditions yourscreenshouldlook like the image to the right. We nowneed to specify a value and a location forour temperature boundary conditions. Let’sstart with the warm surface. Start by leftclicking “Temperature 1”. The interfaceregion of <strong>COMSOL</strong> should now look likethe image at left. We need to do 2 thingshere. The first is to add the surface to whichwe wish to apply this boundary condition and the second is to give a value to thistemperature. We will choose the bottom of our rectangle as the location for ourboundary condition. In the graphical interface left click this boundary (whichshould then turn red as seen below and click thebutton to add. Now set thetemperature to 400 k by typing 400 into the T o field.


If done properly your screen should look like this.5. We now need to apply the cooler boundary condition. Do this by clicking“Temperature 2” to open the interface and select the top and side boundaries toapply the boundary condition. Then enter 300 into the T o field. Your screen shouldlook the one below. This concludes our activities within the Heat Transfer tab wecan now proceed to calculate the solution.


StudyTo calculate the solution to our PDE we simply right click on the “Study” tab andclick the green equals sign .After solving the PDE thetemperature profile will bedisplayed as shown below.


ResultsTo display the temperature at a given point left click the point you wish to probeand the result will be displayed under the results tab as shown below.


To make a graph showing the temperature profile along a line we will need to adda “cut line” to our solution and display the temperature along it. This may be doneas follows.1. Right click “data sets” under the resultstab and select “2D cut line” from themenu which will pop up.2. The two points defining the “cut line”need to be selected. In this case we willhave our “cut line” start at point (0.15,0) and end at point (0.15,0.05). To do thisenter these coordinates intothe “cut line 2D” screenthat will come up after leftclicking on the “Cut line2D” icon under the datasets tab. Your screen shouldlook like the one at left.3. Press the paint brush button in the top right of the “Cut line 2D” screen tohave the cut line displayed. Your cut line should look like the one below.


4. We now need to add a “1D plot group” to the results. As you may be beginningto realize <strong>COMSOL</strong> uses a right clickinterface for addition of most options. Soright click “Results” and left click the “1Dplot group”.5. We want to add a line graph to our “1D plot group”, so to do this right click on“1D Plot Group” and choose“Line Graph” from the menu.This will add a line graph under the “1D plot group”6. Finally left click on “Line graph” and for data select “Cut Line 2D”, this willtake the temperature everywherealong the cut line we created. Tocreate the graph left click the paintbrush button. You shouldobtain the following result.


As can be seen the temperature decreases linearly from the heated surface to thecooled surface.Adjusting The ProblemAt this point it is a simple matter to go back and change some of our boundary orbulk conditions. We will do so now.We will start by changing the lateral surfaces to perfect insulators. We do this asfollows:1. Go back to “Heat Transfer” and left click the arrow just to the right of this iconto open all of the options.


2. Go to the boundary condition “Temperature 2” and de-select the lateral surfacesso that now only the upper surface is at constant 300 k. You de-select a subdomainby left clicking it and then pressing the minus button. If done correctlyyour constant temperature condition should look like the one below. By defaultnow the lateral surfaces will be insulated.3. Right click on “Study” and press compute. The below result should appear.


Notice how only the region of the rectangle close to the lateral surfaces haschanged from before. If you check the temperature profile along the cut line youshouldn’t see much of a change because this cut line was exactly in the middle ofour rectangle where the side effects were minimal.We will now add a heat generation term. This is a bulk condition and can be addedin a similar way as the temperature boundary conditions.1. Go back up to “Heat Transfer” and right click to open the list of possibleboundary and bulk conditions. Left click on“Heat Source”, this will add a “Heat Source1” icon within “Heat Transfer” menu. Leftclick this to open the interface.2. We need to add the domain over which this condition applies, and as a bulkcondition it will apply over the entire geometry. So left click the rectangle and thenleft click the plus sign as done previously.3. Now a value for a per volume heat generation term needs to be added. We willuse 100,000,000 W/m 3 as shown below.


4. Again after changing any boundary or bulk condition(s) a new solution must befound so right click on “Study” and press compute. The below result should beobtained.It is elucidating to examine the temperature profile for this solution so click onyour previously made line graph displaying the temperature across the cut line.This should look like the one below.


Note how this differs from the solution without heat generation, the maximumtemperature is no longer at the heated surface, but instead near the center of therectangle because of the large amount of heat being produced throughout the entirevolume.Example 1.1 (2D Axisymmetric Heat Transfer)We will now solve the same problem as in example 1, but this time without thereduction of the problem into rectangular coordinates. To avoid redundancy onlythe steps that are significantly different from those in example 1 will be explainedin detail.Startup1. You will need to start a new model either be restarting <strong>COMSOL</strong> or by clicking“New” in the “File” menu.


2. You will now select “2D Axisymmtric” insteadof simply 2D. This will take whatever geometryyou create and rotate it about an axis and is idealfor problems with symmetry about an axis.3. You will select “Heat Transfer” as your physicsand “Stationary” as your study as before.GeometryWe will now create our geometry, this is the where the biggest differences existbetween this model and the previous one.1. Right click geometry and add a rectangle.2. Have the corner placed at z=0m and r=0.05m. Notice that our geometry will bespun around the line r=0.3. Click “Build All” and obtain the following result.MaterialsSelect Copper as the material and apply this to the geometry as before.


Heat TransferWe will use the same boundary conditions as before. Namely that@ r=R1 T=400k@ r=R2 T=300k@ z=0 T=300k and @ z= 0.3m T=300kThis means that as before we will need to add two different temperatureconditions. This is done by right clicking on heat transfer and clicking temperature.Enter the appropriate temperatures in the temperature field and select theappropriate surfaces to apply these boundaries (same as before).StudyNow that the model has been built we are ready to examine the solution. Rightclick “Study” and left click compute. The below result should be obtained.


This is a pretty image but does not tell us much about the actual solution. To get abetter understanding of the temperature profile we will add a “Cut Line” as before.1. Right click on “Data Sets” under the “Results” tab. Click “Cut Line 2D”2. Set the two points for the cut line as (r=0.05m,z=0.15m) and (r=0.10,z=0.15m)3. Right click on “Results” and add a 1D plot group.4. Right click on 1D plot group and add a line graph.5. In the line graph interface select “Cut line 2D” as the data source and click thepaintbrush icon to have the graph generated. The below result should be obtained.Compare this solution to the solution from example 1.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!