27.12.2014 Views

COMSOL Multiphysics (formerly FEMLAB) is a finite element ...

COMSOL Multiphysics (formerly FEMLAB) is a finite element ...

COMSOL Multiphysics (formerly FEMLAB) is a finite element ...

SHOW MORE
SHOW LESS

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>FEMLAB</strong>) TUTORIAL<br />

<strong>COMSOL</strong> <strong>Multiphysics</strong> (<strong>formerly</strong> <strong>FEMLAB</strong>) <strong>is</strong> a <strong>finite</strong> <strong>element</strong> analys<strong>is</strong> and solver software<br />

package for various physics and engineering applications, especially coupled phenomena, or<br />

multiphysics. <strong>COMSOL</strong> <strong>Multiphysics</strong> also offers an extensive and well-managed interface to<br />

MATLAB and its toolboxes for a large variety of programming, preprocessing and<br />

postprocessing possibilities. In addition to conventional physics-based user-interfaces,<br />

<strong>COMSOL</strong> <strong>Multiphysics</strong> also allows for entering coupled systems of partial differential<br />

equations (PDEs).<br />

How to create a new model in Comsol<br />

1. Start Comsol <strong>Multiphysics</strong> and create a new file (menu File) indicating the PDE’s to be<br />

used.<br />

2. Define the geometry (menu Draw)<br />

3. Enter the variables needed and boundary conditions in each equation for every<br />

subdomain (menu Physics)<br />

4. Choose the <strong>element</strong> size to be used in the calculations (menu Mesh)<br />

5. Choose the type of numerical solver (menu Solve)<br />

6. D<strong>is</strong>play the results in the most convenient way (menu Postprocessing)<br />

7. The menu <strong>Multiphysics</strong> <strong>is</strong> to perform changes in the model by adding or removing<br />

equations.<br />

Not all of these steps are always necessary when building a model. The order <strong>is</strong> also variable<br />

depending on the complexity of the model.<br />

Example 1 (HEAT TRANSFER)<br />

Consider a cylindrical heating rod which <strong>is</strong> sheathed by a concentric tube of thickness 0.05 m.<br />

The entire assembly <strong>is</strong> immersed in a fluid and the system <strong>is</strong> at steady-state, as shown below.<br />

We w<strong>is</strong>h to determine the temperature d<strong>is</strong>tribution within the sheath. After thinking about the<br />

problem, assume that we arrived at the following approximations (make sure you understand<br />

how we arrived to following approximations for your future quiz and test):


The temperature of the heater <strong>is</strong> constant at 400K.<br />

The temperature at R1 <strong>is</strong> the same as the temperature of the heater, 400K.<br />

The fluid temperature <strong>is</strong> constant at 300K and th<strong>is</strong> <strong>is</strong> the temperature of the surrounding sheath<br />

at R2.<br />

Given the symmetry of the system, it will enough for the analys<strong>is</strong> to define a subdomain in 2D<br />

as shown below.<br />

Solution using Comsol Graphical User Interface.<br />

1. To start Comsol, click the icon <strong>COMSOL</strong> <strong>Multiphysics</strong> 3.2<br />

2. In the Model Navigator window we<br />

must choose the type of coordinate<br />

system that we want to use to solve our<br />

problem. As mentioned above, our<br />

problem <strong>is</strong> pretty symmetric and<br />

therefore a 2D system (which <strong>is</strong> the<br />

default value) will be enough.


3. Next, we need to provide<br />

information about the application<br />

modes (or PDE’s) that must be<br />

taken into consideration in order to<br />

solve our problem. In accordance<br />

with the statement, the problem<br />

can be solved considering only<br />

conductive heat transfer. Hence,<br />

we must select th<strong>is</strong> application<br />

mode and to do so, we must<br />

double-click the option <strong>COMSOL</strong><br />

multiphysics.<br />

4. Next, we double click on the option Heat Transfer.<br />

5. Next, select the option Conduction by doing one click on the symbol “+” to the left. In<br />

doing so two new options will show up. We must pick one of them depending on the type<br />

of regime we will use to solve our problem. For our case we select Steady-state analys<strong>is</strong><br />

doing one click on th<strong>is</strong> option.


8. Once we select the regime three new fields will be activated at the bottom of the window.<br />

The field Dependant variables <strong>is</strong> to specify a name for the dependant variable. Let us keep<br />

the default name T for the variable temperature.


9. Likew<strong>is</strong>e, let us change the name of the application mode (PDE) from ht (default name) to<br />

Conduction.<br />

8. The third field has to do with the numerical calculations. Let us keep the same value for the<br />

time being. Once we have done th<strong>is</strong> we click on OK. A new window will pop up as shown<br />

below.


9. Before going any further, let us save our work. To do so, we click on the menu File and<br />

then on the option Save As.<br />

To save our work we must specify the path and the name of the file. Let us call our model<br />

Heat transfer. After doing th<strong>is</strong>, we must click on the button Save. The file will be saved<br />

with the extension “mph”.


10. The next step <strong>is</strong> to specify the geometry of our system. The idea <strong>is</strong> to use as few figures as<br />

possible to define our system. For our case, the symmetry of the system allows us to use<br />

one single rectangle to define our model. Thus, to draw a rectangle we click on the menu<br />

Draw, then on the option Specify objects and finally on the option Rectangle.<br />

In the new window showing up we specify the size and the position of the rectangle we are<br />

drawing. Since we have to specify dimensions we must be careful with the values we will<br />

enter. The International System of Units (SI) <strong>is</strong> the default option. Thus, the dimensions of<br />

our rectangle will be 0.3 m and 0.05 m for width and height, respectively. The position <strong>is</strong><br />

not important for th<strong>is</strong> case and therefore we will keep the default values. After entering the<br />

values we click on OK.


The rectangle just drawn will be d<strong>is</strong>played as shown below<br />

To zoom in the rectangle we must click the button at the center and the top of the<br />

screen. After that, we press the left button of the mouse and drag the mouse to cover the<br />

object. Finally, we release the left button of the mouse and the object will look bigger as<br />

shown below.


11. Next, we must click on the menu Physics and then on the option Subdomain Settings to<br />

define the parameters needed by the PDE to be solved. We can also do th<strong>is</strong> by pressing the<br />

key F8. The following window will show up.<br />

Every region in our drawing <strong>is</strong> called a subdomain. Since we only have one rectangle then<br />

the area of th<strong>is</strong> object will be the subdomain 1. Next, we have to specify the material the<br />

concentric tube <strong>is</strong> made of in order to use their properties in the calculations. To do so, we<br />

select the subdomain 1, click the field Load… and select Copper from the Library of<br />

materials. Then we click OK.


The properties of copper will be loaded on the subdomain 1 as shown below.<br />

12. After clicking OK we are ready to specify the boundary conditions needed to solve the<br />

PDE. To achieve th<strong>is</strong>, we must click on the menu Physics and the option Boundary<br />

Settings or simply press the key F7. The following windows will be d<strong>is</strong>played.<br />

In the subdomain 1 we have 4 boundaries and we must specify each of them in order to<br />

solve the model. The boundary currently specified will show up selected with a red arrow<br />

as shown below. For the boundary 1 the temperature <strong>is</strong> known and equal to 300 K. To


indicate th<strong>is</strong> we select the option Temperature in the field Boundary condition and enter<br />

the value in the field T 0 . Finally, we click Apply and define the next boundary.<br />

For the boundary 2 the temperature <strong>is</strong> that of the rod (400 K).


For the boundary 3, the temperature <strong>is</strong> 300 K.<br />

Finally, the temperature in the boundary 4 <strong>is</strong> 300 K.


13. After clicking OK, we are now ready to run the model. To do so, we must click on the icon<br />

on the top of the screen and the model will be solved. The results are d<strong>is</strong>played as<br />

shown below.<br />

To view the temperature in each point we must click on any point inside the subdomain and<br />

the value will be d<strong>is</strong>played at the bottom of the screen.<br />

Postprocessing<br />

The menu Postprocessing will<br />

facilitate us to analyze the information<br />

in different ways. Thus, if we want to<br />

d<strong>is</strong>play the variation of the temperature<br />

in a 3D plot instead of a 2D one we<br />

can click the menu Postprocessing<br />

and then the option Plot parameters<br />

(or just simply pressing the key F12).<br />

The following window will be shown.


Next, we select the tag Surface (if not<br />

selected) and click on the button Height<br />

data. After th<strong>is</strong>, we must make sure that<br />

the box Height data <strong>is</strong> also checked to<br />

be able to activate the fields that define<br />

the variable to plot.<br />

Next, we click OK and the 3D plot<br />

will be d<strong>is</strong>played as follows. (The<br />

3D plot can be turned by pressing<br />

the left button of the mouse and<br />

dragging it at any direction we<br />

want)<br />

Radius<br />

Temperature<br />

Length


Another possibility <strong>is</strong> to obtain a temperature profile at certain cross section. Th<strong>is</strong> can be<br />

achieved by using the option Cross Section Plot Parameters in the same menu<br />

Postprocessing.<br />

In the window showing up we must specify two points that define the cross section (if working<br />

on 2D). For instance, if we want a temperature profile along the section defined by the points<br />

(0.2,0) and (0.2,0.05) we enter these values in the box entitled Cross-section line data as<br />

shown below.


After clicking OK the section will be marked on the graph as a red line and the following<br />

graph with the temperature profile will be d<strong>is</strong>played.<br />

Some changes in the<br />

model can be easily<br />

performed. Thus, to<br />

observe how the<br />

temperature changes as<br />

we change the boundary<br />

conditions let us do as<br />

follows. If the boundaries<br />

1 and 4 were very short<br />

then the amount of heat<br />

going out from them can<br />

be assumed to be negligible and therefore those boundaries can be considered as insulated. To<br />

perform these changes in the boundaries we press the key F7 and select the boundaries 1 and 4<br />

at once using the Control key. Then, we change the boundary condition to Thermal<br />

insulation instead of Temperature as shown above.


After clicking OK and running the model, the following result must be obtained.<br />

If the fluid used in the system <strong>is</strong> not contained in the library we can specify its properties<br />

manually by pressing the key F8 to open the Subdomain settings window. For example, let us<br />

assume that the thermal conductivity were 0.1T 3 +50T 2 -10T+5 W/m.K and the density and the<br />

heat capacity, 1100 Kg/m 3 and 100 J/Kg.K respectively. Th<strong>is</strong> data <strong>is</strong> entered as shown below.<br />

After clicking OK and running the model we obtain the following temperature profile at the<br />

cross section defined above.

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

Saved successfully!

Ooh no, something went wrong!