Tutorial 1: Heat conduction in a slab
Tutorial 1: Heat conduction in a slab
Tutorial 1: Heat conduction in a slab
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Tutorial</strong> 1: <strong>Heat</strong> <strong>conduction</strong> <strong>in</strong> a <strong>slab</strong><br />
2007 Cornell University<br />
BEE453, Professor Ashim Datta<br />
Authored by V<strong>in</strong>eet Rakesh and Frank Kung<br />
Software: COMSOL 3.3<br />
<strong>Tutorial</strong> 1: <strong>Heat</strong> <strong>conduction</strong> <strong>in</strong> a <strong>slab</strong> ............................................................................................... 1<br />
Problem Specification .................................................................................................................. 1<br />
Step 1: Specify<strong>in</strong>g the Problem Type .......................................................................................... 2<br />
Step 2: Creat<strong>in</strong>g the Geometry .................................................................................................... 4<br />
Step 3: Mesh<strong>in</strong>g ........................................................................................................................... 5<br />
Step 4: Def<strong>in</strong><strong>in</strong>g Material Properties and Initial Condition ........................................................... 7<br />
Step 5: Def<strong>in</strong><strong>in</strong>g Boundary Conditions......................................................................................... 8<br />
Step 6: Specify<strong>in</strong>g Solver Parameters ......................................................................................... 9<br />
Step 7: Postprocess<strong>in</strong>g .............................................................................................................. 11<br />
Step 8: Save and Exit ................................................................................................................ 15<br />
Problem Specification<br />
This is the first of a series of examples <strong>in</strong>tended for a gentle <strong>in</strong>troduction to COMSOL. Our<br />
goal here is to compute transient temperatures profiles for 1-D heat <strong>conduction</strong> <strong>in</strong> the <strong>slab</strong><br />
below dur<strong>in</strong>g the heat<strong>in</strong>g process. The temperature <strong>in</strong> both bottom and top surfaces of the<br />
<strong>slab</strong> are kept constant and equal to 90 0 C and 20 0 C respectively. The sides of the <strong>slab</strong> are<br />
assumed to be <strong>in</strong>sulated. The thickness of the <strong>slab</strong> is 4 cm. The <strong>in</strong>itial temperature is 20 C.<br />
The density is 900 kg/m 3 . The thermal conductivity is 0.55 W/mK. The specific heat is 3800<br />
J/kg K.<br />
1
Step 1: Specify<strong>in</strong>g the Problem Type<br />
The problem <strong>in</strong> this case is transient heat <strong>conduction</strong> <strong>in</strong> a 1D sett<strong>in</strong>g. We will first set<br />
COMSOL up for this type of problem<br />
The model you specify determ<strong>in</strong>e the Govern<strong>in</strong>g Equations that will be used. Start<strong>in</strong>g from the<br />
energy transport equation:<br />
2<br />
∂T<br />
∂T<br />
k ∂ T Q<br />
+ u = +<br />
2<br />
{ ∂t<br />
{ ∂x<br />
ρc<br />
p<br />
∂x<br />
ρc<br />
p<br />
14243<br />
{<br />
transient<br />
convection<br />
diffusion<br />
source<br />
(1)<br />
For our problem, the temperatures are dependant on time; there is no fluid flow and no source<br />
terms. The only mode of heat transfer is by diffusion. So the problem is a transient diffusion<br />
problem with no convection and heat source. So the govern<strong>in</strong>g equation changes to:<br />
∂T<br />
∂t<br />
=<br />
k<br />
ρc<br />
p<br />
2<br />
∂ T<br />
2<br />
∂x<br />
(2)<br />
2
1. Start COMSOL by double<br />
click<strong>in</strong>g on the COMSOL<br />
Multiphysics icon on the<br />
Desktop<br />
2. Select 2D next to Space<br />
Dimension<br />
(Note: COMSOL can do 1D<br />
problems, however to give<br />
you a better understand<strong>in</strong>g of<br />
COMSOL we’ll model the<br />
problem as 2D)<br />
3. S<strong>in</strong>gle Click on COMSOL<br />
Multiphysics >> <strong>Heat</strong> Transfer<br />
>> Conduction >> Transient<br />
Analysis. Transient Analysis<br />
under <strong>conduction</strong> is selected<br />
as we <strong>in</strong>tend to solve a time<br />
dependent <strong>conduction</strong><br />
problem (Equation 2).<br />
4. Click on the Sett<strong>in</strong>gs Tab<br />
5. Set the Unit system to SI<br />
6. Click OK. COMSOL W<strong>in</strong>dow<br />
opens up.<br />
7. Under File, click on Save<br />
as…<br />
8. Create your own folder us<strong>in</strong>g<br />
your NetID <strong>in</strong> the My<br />
Documents folder and save<br />
your work there. Specify the<br />
file name (e.g. cond.mph) and<br />
save it as .mph file.<br />
3
Step 2: Creat<strong>in</strong>g the Geometry<br />
The geometry <strong>in</strong> this case is a 1D <strong>slab</strong> that is 4 cm high (along y axis). We are model<strong>in</strong>g the<br />
problem as 2D and so we assume the dimension of 2 cm <strong>in</strong> the other direction (i.e. along x<br />
axis). In this example (<strong>in</strong> contrast with the drug delivery example) we will draw out the <strong>slab</strong><br />
directly without specify<strong>in</strong>g the grid.<br />
1. Click on Draw >> Specify Objects >><br />
Rectangle. Rectangle w<strong>in</strong>dow opens<br />
up.<br />
2. Specify width as 0.02 and height as<br />
0.04. These are the dimensions of<br />
the <strong>slab</strong> <strong>in</strong> m.<br />
3. Click on OK.<br />
4. Click on Zoom Extents to fit the<br />
geometry <strong>in</strong> the w<strong>in</strong>dow.<br />
The geometry that is created is shown <strong>in</strong><br />
the figure.<br />
4
Step 3: Mesh<strong>in</strong>g<br />
Mesh<strong>in</strong>g is divid<strong>in</strong>g the geometry <strong>in</strong>to small elements. We can mesh the face directly, but <strong>in</strong><br />
this case, we will mesh the edges first and then the face. This method is used to control the<br />
number of elements <strong>in</strong> certa<strong>in</strong> parts of the geometry like the boundaries and <strong>in</strong>terfaces. In<br />
many cases we need a f<strong>in</strong>er mesh near the boundary and so we mesh the edge accord<strong>in</strong>gly<br />
and what we get is a non-uniform mesh. However <strong>in</strong> this case we mesh the geometry with a<br />
uniform mesh with a spac<strong>in</strong>g of 0.002 between the nodes.<br />
1. Under Mesh, click on Mapped<br />
Mesh Parameters…<br />
2. Click on the Boundary Tab<br />
3. In Boundary Selection, select 1<br />
and 4 by left click<strong>in</strong>g and hold<strong>in</strong>g<br />
the Ctrl key. We will specify 20<br />
elements each on the left and<br />
right edges.<br />
4. Check the box for Constra<strong>in</strong>ed<br />
edge element distribution<br />
5. Click on Number of edge<br />
elements, and type <strong>in</strong> 20 <strong>in</strong> the<br />
box below.<br />
6. For boundary 2 and 3, use<br />
number of edge elements as 10.<br />
We specify 10 elements each on<br />
the top and bottom edges.<br />
7. Press the ‘Remesh’ Button on the<br />
bottom. The mesh that is<br />
obta<strong>in</strong>ed is shown <strong>in</strong> the figure.<br />
8. Click ‘Ok’<br />
5
9. Your screen should now look like<br />
this.<br />
6
Step 4: Def<strong>in</strong><strong>in</strong>g Material Properties and Initial Condition<br />
We are solv<strong>in</strong>g the energy equation and so we need to provide the solver with the appropriate<br />
material property values required for the analysis. These properties are:<br />
(i) Density (ρ): The density of the material of the <strong>slab</strong> is 900 kgm -3<br />
(ii) Thermal Conductivity (k): The thermal conductivity is 0.55 W(mK) -1<br />
(iii) Specific <strong>Heat</strong> (c p ): The specific heat is 3800 J (kgK) -1<br />
The Slab is <strong>in</strong>itially at a temperature of 20 0 C <strong>in</strong>itially. We will also specify this <strong>in</strong> the software <strong>in</strong><br />
this step.<br />
1. Under Physics, click on<br />
Subdoma<strong>in</strong> Sett<strong>in</strong>gs…<br />
1<br />
2. Click on 1 to select the <strong>slab</strong>.<br />
3. Left click on the text field next<br />
to Thermal Conductivity and<br />
type 0.55<br />
4. Left click on the text field next<br />
to Density and type 900<br />
5. Left click on the text field next<br />
to <strong>Heat</strong> Capacity and type 3800<br />
6. Click on the Init Tab<br />
7. In the box under Initial Value, fill<br />
<strong>in</strong> 293. The <strong>slab</strong> is <strong>in</strong>itially at a<br />
temperature of 20 0 C (=293 K).<br />
8. Click Ok<br />
7
Step 5: Def<strong>in</strong><strong>in</strong>g Boundary Conditions<br />
The boundary conditions for the problem are:<br />
On the bottom boundary: Temperature = 90 0 C<br />
On the top boundary: Temperature = 20 0 C<br />
On the left boundary: The left boundary is <strong>in</strong>sulated. Therefore, <strong>Heat</strong> Flux =0.<br />
On the right boundary: The right boundary is <strong>in</strong>sulated. Therefore, <strong>Heat</strong> Flux =0.<br />
We now specify these boundary conditions to the solver.<br />
The default boundary condition for this solver is thermal <strong>in</strong>sulation so we simply need to change<br />
the boundary conditions for the top and bottom<br />
1. Under Physics, click on<br />
Boundary Sett<strong>in</strong>gs…<br />
2. Click on 2 <strong>in</strong> the Boundary<br />
Selection box<br />
3. Change the Boundary<br />
Condition to Temperature<br />
4. In T 0 , change the<br />
temperature to 90. The<br />
bottom of the <strong>slab</strong> is at<br />
90 0 C (=363 K).<br />
5. Repeat for side 3 us<strong>in</strong>g<br />
293. The top of the <strong>slab</strong> is<br />
at 20 0 C (=293 K).<br />
6. Click on OK<br />
8
Step 6: Specify<strong>in</strong>g Solver Parameters<br />
We now specify the time <strong>in</strong>tegration method for the time dependant problem. We use the<br />
default values for solver sett<strong>in</strong>gs for this problem as well. To select fixed time steps, we need<br />
to go the “Time Stepp<strong>in</strong>g” Tab <strong>in</strong> the Solver Parameters w<strong>in</strong>dow. However, we do not do this<br />
for the problem. Variable time stepp<strong>in</strong>g is used as the default for this problem.<br />
1. Under Solve, click on<br />
Solver Parameters.<br />
2. Under the General Tab,<br />
select Transient under<br />
Analysis if it is not<br />
already selected<br />
3. Select Time dependent<br />
under Solver.<br />
4. In the Times: box, type<br />
<strong>in</strong> 0:10:5400. This tells<br />
the solver to start at 0<br />
seconds, then save the<br />
solution every 10<br />
seconds until it reaches<br />
5400 seconds.<br />
5. Click Ok<br />
6. Click on Get Initial Value<br />
under Solve. This step<br />
<strong>in</strong>itializes the solver with<br />
the value provided when<br />
the <strong>in</strong>itial conditions<br />
were specified (Step 4).<br />
7. Under Solve, click on<br />
Solver Manager.<br />
9
8. Click on the Solve For<br />
tab.<br />
9. Select T for temperature<br />
if it is not already<br />
selected. By select<strong>in</strong>g T,<br />
we are direct<strong>in</strong>g the<br />
solver to solve for the<br />
temperature.<br />
10. Click on the Output tab.<br />
11. Select T for temperature<br />
if it is not already<br />
selected. By select<strong>in</strong>g T,<br />
we are direct<strong>in</strong>g the<br />
program to save the<br />
temperature values.<br />
12. Press Solve. Once<br />
Solve is pressed, the<br />
solver solves the<br />
transient heat transfer<br />
equation (Equation 2 on<br />
page 2). It will take<br />
approximately 1-2 m<strong>in</strong><br />
to solve. We are now<br />
ready to do post<br />
process<strong>in</strong>g (look<strong>in</strong>g at<br />
the results).<br />
10
Step 7: Postprocess<strong>in</strong>g<br />
Post-process<strong>in</strong>g is view<strong>in</strong>g the results obta<strong>in</strong>ed on runn<strong>in</strong>g the simulations of the problem. We<br />
will generate graphs and charts based upon our simulation.<br />
Display<strong>in</strong>g the Mesh<br />
1. To display the mesh, simply click on<br />
the Mesh Mode button. Mesh mode<br />
can also be selected by click<strong>in</strong>g on<br />
Mesh >> Mesh Mode.<br />
1.<br />
The mesh is shown <strong>in</strong> the figure below.<br />
11
Plot Temperature vs. Time at a particular coord<strong>in</strong>ate<br />
We will now plot the temperature history at po<strong>in</strong>t (0.01, 0.01) <strong>in</strong> the <strong>in</strong>terior of the <strong>slab</strong> to see<br />
how the temperature varies with time at that location.<br />
1. Under Postprocess<strong>in</strong>g, click on<br />
Cross-Section Plot Parameters… (It<br />
may take some time to open up).<br />
2. Click on the Po<strong>in</strong>t tab,<br />
1<br />
3. Make sure Temperature is selected <strong>in</strong><br />
the Predef<strong>in</strong>ed quantities section.<br />
4. In Coord<strong>in</strong>ates, type <strong>in</strong> 0.01 for x and<br />
0.01 for y.<br />
5. Press OK<br />
The temperature history plot obta<strong>in</strong>ed for<br />
the po<strong>in</strong>t (0.01, 0.01) is shown <strong>in</strong> the<br />
figure below.<br />
12
Obta<strong>in</strong> the surface plot at the last time step<br />
We now plot the temperature contour <strong>in</strong> the <strong>slab</strong> at the end time (i.e. after 1.5 hrs or 5400 s).<br />
1. Under Postprocess<strong>in</strong>g<br />
click on Plot Parameters.<br />
1<br />
2. Click on the General Tab<br />
3. Check the box for Surface<br />
under Plot Type.<br />
4. Next to Solution at time:<br />
select 5400.<br />
5. Click on the Surface Tab.<br />
6. Select Temperature next<br />
to Predef<strong>in</strong>ed quantities, if<br />
it is not already selected.<br />
7. Click on OK.<br />
The contour plot that is<br />
obta<strong>in</strong>ed is shown on the next<br />
page.<br />
14
Step 8: Save and Exit<br />
Now, before we end the session we need to save the files for future use.<br />
1. Go to File<br />
2. Click on Save<br />
3. Go to File >> Exit<br />
15