pdetool tutorial

12
22.540 Heat Conduction. Use of Commercial Heat Conduction Code This is a tutorial describing how to solve a heat conduction problem using the MATLAB PDE Toolbox. If you know how to use, and have access to, another commercial finite element or finite volume heat conduction package, you are welcome to use that package, and you can ignore this tutorial. We will use the MATLAB PDE Toolkit to solve the following steady state problem T=1 T=0 T=0 T=0 x y L l A rectangular plate has a circular hole. The top surface is held at T=1, and all other faces are at T=0. The MATLAB PDE Toolkit has to be installed with your version of MATLAB. It is installed on the College of Engineering computers. At the MATLAB command prompt type >>pdetool The following window should appear.

Upload: oluwaseun-awe

Post on 28-Apr-2015

152 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pdetool Tutorial

22.540 Heat Conduction. Use of Commercial Heat Conduction Code This is a tutorial describing how to solve a heat conduction problem using the MATLAB PDE Toolbox. If you know how to use, and have access to, another commercial finite element or finite volume heat conduction package, you are welcome to use that package, and you can ignore this tutorial. We will use the MATLAB PDE Toolkit to solve the following steady state problem

T=1

T=0 T=0

T=0 x

y

L

l

A rectangular plate has a circular hole. The top surface is held at T=1, and all other faces are at T=0. The MATLAB PDE Toolkit has to be installed with your version of MATLAB. It is installed on the College of Engineering computers. At the MATLAB command prompt type >>pdetool The following window should appear.

Page 2: Pdetool Tutorial

The first thing to do is change “generic scalar” in the drop down menu to “heat transfer”.

Page 3: Pdetool Tutorial

To see what equation is being solved click the PDE button. The following menu will appear,

By default the Type of PDE is Elliptic. This is what you need for a steady-state heat conduction problem. To solve a transient problem you would select the Parabolic radio

Page 4: Pdetool Tutorial

button. Note that rho and C are grayed out since they have no meaning in a steady state problem. The equation is shown at the top of the window. –div(k grad(T)) is the heat conduction term. Q is the heat generation per unit volume per unit time. This code only solves 2d problems. One application could be a two dimensional fin with convective losses off the top and bottom surface. This case is handled by the h*(Text-T) term. If the problem is not a fin then set h=0. For our problem we set the constants as follows.

These parameters can be functions of position, in which case you insert a valid MATLAB expression. However, x and y are arrays so the function 4xy would be entered as 4*x .*y (note the use of the dot* operator between x and y) Click OK The next step is to set up the rectangle with a hole. Click on one of the rectangle buttons on the main menu and use your mouse to define a rectangle. The dimensions are not critical right now. You should get something like

Page 5: Pdetool Tutorial

Double click on the rectangle to pull up the following menu

Change the rectangle parameters to what you want, e.g.

Page 6: Pdetool Tutorial

I have chosen a unit square. Click OK To define the hole, click the circle (ellipse) button and position a circle outside the rectangle, something like this

Double click the ellipse and edit its shape and radius. Something like this

Page 7: Pdetool Tutorial

Click OK and drag the circle onto the square.

Page 8: Pdetool Tutorial

Note that the rectangle has the name R1 and the ellipse has the name E1. Now look at the Set Formula box. R1 + E1 means that the heat conduction equation will be solved in the region that is the UNION of R1 and E1 (which in this case is R1, since E1 is a subset of R1). We want to make a hole so we want the set R1-E1. Type this formula into the Set Formula box and click the “partial-omega” button.

I have changed the display her by using the zoom tool and selecting the area you want to zoom in on with the mouse. The other useful set operation that you might want to use in other problems is the intersection of two sets (*). Now we set the Boundary conditions. Click the top edge of the rectangle and then select Specify Boundary Conditions from the Boundary menu. Set T=1 as follows

Page 9: Pdetool Tutorial

Hit OK. All other boundaries, by default are T=0 Now we are ready to mesh. Click the button on the main window with the big triangle. Something like the following will appear

To solve the equations push the = button. The following should appear

Page 10: Pdetool Tutorial

Try refining the mesh. Click the button which has a triangle subdivided into smaller triangles.

Page 11: Pdetool Tutorial

Push the = button again

Page 12: Pdetool Tutorial

That is the basics. Extensive additional documentation is available by clicking the Help button. Conclusions:

• This package is easy to use. • It is very limited in scope • This toolbox is the basis of the FEMLAB commercial package that is much more

sophisticated.