Sie sind auf Seite 1von 27

Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

- 1 -
LAMINAR FORCED CONVECTION OVER A HEATED FLAT PLATE

Problem Statement

Ambient room temperature air at standard atmospheric pressure flows over semi
infinite flat plate that is being heated by surface heat flux
s
q'' . Air starts to flow at x = 0
with a uniformly distributed velocity profile V. The plate has an insulated section
extending from x = 0 to x = x
0
and experiences applied heat flux ( ) ,0
s
q x '' from x = x
0
to
x = L (the considered plate length L is not shown). Of general interest is to learn how to
use COMSOL in obtaining the flow and temperature distribution fields and compare
them with the Blasius and Pohlhausen solutions (or more general curve fits of them). It is
desired to obtain qualitative, as well as quantitative perspectives about boundary layer
flow concept from COMSOL solutions.

nown qu K antities:


luid: Air F

= 0.1 m/s V
T = 20 C
s
q'' = 1000 W/m
2


b
n external flow, forced convection problem. Both fluid and temperature

elt
e of the
ng the thickness of the plate, the flow and heat transfer processes can be

O

servations
This is a
fields are essential parts of the problem. COMSOL model must include steady
state analyses for both heat transfer and Navier Stokes application modes.

Subject to all 16 assumptions given in section 7.2.1, Blasius solution applies.
Although Pohlhausens solution does not apply directly due to a lack of plate
temperature knowledge, it still can be used to develop equations for local Nuss
number and plate surface temperature distribution. Reference equations for these
quantities will be presented in Postprocessing and Visualization section.

Although one of the assumptions for analytic solution is that of constant
properties, COMSOL can easily handle material property variations. Som
key properties of air strongly depend on temperature variations. We will discuss
which properties of air should be varied in Options and Settings, along with
equations that achieve this. Property variation will be included in our COMSOL
model.

Neglecti
modeled with a simple rectangular geometry. However, plate boundary must then
be split into two separate but connected boundaries in order to allow the correct
boundary condition setup.
Flow over an Isothermal Flat Plate with an
Insulated Leading Section

L = 10 cm
x
0
= 2 cm
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

- 2 -
Assignment

1. State and calculate the conditions under which the flow field in this problem can
.
2. Use COMSOL to solve for and save 2D color distributions of velocity and
3. Use COMSOL to solve for and save 2D color distributions of key air properties.

4. Use COMSOL to plot and save T(0.08,y).
5. Use COMSOL to plot and extract surface temperature data
be considered laminar and that the concept of boundary layer flow can be applied

temperature fields.

Use your textbooks Appendix C to examine whether or not these properties were
accurately determined by COMSOL.


( ) ,0 T x . Use this data
lid? [Note:
6. Use COMSOL data for
to compare it with surface temperature reference equations given in
Postprocessing and Visualization section. Are COMSOL results va
In this instruction set, part of this assignment question will be done with
MATLAB, but you are free to use any software of your choice]

( ) ,0 T x on
0
x x L s s and Newtons law of cooling to
determine COMSOL h(x) for
0
x x L s s . Compute and plot analytically
determined local h(x) given by a reference equation and COMSOL h(x) o
same graph. [Note: In this instruction set, part of this assignment question will
done with MATLAB, but you are free to use any software of your choice]

7. Calculate and plot the percent error between COMSOL h(x) and theoretical
n the
be
h(x).
.
MATLAB to graph on the same plot
Base your error analysis on assumption that COMSOL h(x) is the correct solution
Can you conclude that COMSOL results are valid? [Note: In this instruction set,
part of this assignment question will be done with MATLAB, but you are free to
use any software of your choice]

8. [Extra Credit]: Use COMSOL and
theoretical and COMSOL determined boundary layer o . Comment on
differences in the solutions you notice. Which results would you trust? Th
instructions for COMSOL boundary layer data extraction and sample MATL
scripts that will plot
e
AB
o are given separately in the appendix.

9. [Extra Credit]: Determine wall shear
o
t induced by the flow on the plate and
friction coefficient C
f
.


Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

Modeling with COMSOL Multiphysics

MODEL NAVIGATOR

To start working on this problem, we first need to enable two application modes in the
model navigator to create a Multiphysics model. The correct application modes are
located under COMSOL Multiphysics Fluid Dynamics and Heat Transfer sections. These
modes will be responsible for setting up and calculating temperature and velocity
distribution fields, respectively.

For this setup:

1. Start COMSOL Multiphysics.

2. From the list of application modes, select COMSOL Multyphysics Fluid
Dynamics Incompressible Navier Stokes Steady state analysis.

3. Click the Multiphysics button.

4. Click the Add button.

5. From the list of application modes, select COMSOL Multyphysics Heat
Transfer Convection and Conduction Steady state analysis.

6. Click the Add button.

7. Click OK.


- 3 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

- 4 -
OPTIONS AND SETTINGS: DEFINING CONSTANTS

In this section, we will define material properties of air (Applying them to geometry is
done in Subdomain Settings section). Some of the properties strongly depend on
temperature while others do not. Since we are working with a rather large heat flux and
would like to include property variation in the model, we first need to determine which of
the properties exhibit strong temperature dependence. This is done by examining
Appendix C Properties of dry air at atmospheric pressure. Since we do not know the
high temperature extreme in this problem, we will take the largest temperature available
in Appendix C.

Notice that with increasing temperature, properties of air either increase or decrease in
the temperature range of 20C to 350C. Notice further that no property reaches a
maximum or a minimum in this temperature range. This enables us to concentrate our
attention on the extremes of the temperature range in evaluating temperature dependence
of the properties. The following table lists numerical values for properties of air at these
temperature extremes and shows the percent difference in those properties based on these
extremes.

p
C
k Pr
EVALUATED AT T
1006.1 1.2042 18.17x10
-6
0.02564 0.713
EVALUATED AT 350C
1056.8 0.5665 31.07x10
-6
0.04692 ~0.7
% DIFFERENCE
(based on 20C)
5.04 53 71 83 1.86


Based on these calculations, it is now clear that for air in this temperature range, , ,
and strongly depend on temperature while
p
and r are weakly dependent properties
with respect to temperature. Therefore, and will be set as constants while
k C
Pr
P
p
C , , and
k will be modeled as varying properties.

The following equations will be used to calculate air properties that vary strongly with
temperature:
( )
10
3 0
3.723 0.865log
6 8
, [kg/m]
10 , [W/m K]
6 10 4 10 , [Pa s]
w
T
P M
RT
k
T

+

=
=
= +


ng [Ref.: J .M. Coulson and J .F. Richardson, Chemical E ineering, Vol. 1, Pergamon Press, 1990, appendix]


Where,
0
(atmospheric pressure) 101.3 kPa,
(molecular weight of air) 0.0288 kg mol ,
(universal gas constant) 8.314 J /mol K
w
P
M
R
= =
= =
= =

Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

Armed with these equations, let us now define temperature dependent air properties in
COMSOL.

1. From the Options menu select Expressions Scalar Expressions

2. Define the following names and expressions:

NAME EXPRESSION UNIT DESCRIPTION
k_air 10^(-3.723+0.865*log10(abs(T[1/K])))[W/(m*K)] W/(mK) Air Conductivity
rho_air 1.013e5[Pa]*28.8[g/mol]/(8.314[J /(mol*K)]*T) kg/m
3
Air Density
mu_air 6e-6[Pa*s]+4e-8[Pa*s/K]*T Kg/(ms) Air Viscosity

3. Click OK.

COMSOL automatically determines correct property unit under the Unit column. If it
does not, you are most likely entering wrong expressions. Carefully check the expression
you typed and make corrections, if necessary. The description column is optional and can
be left blank.

Although Prandtls number is essential, it is a composite property that is defined by ,
p
C
, and k , most of which have now been defined. The only constant property that needs
to be defined as well is . We will define and apply it to geometry in Subdomain
Settings section.
p
C

GEOMETRY MODELING

In this model we will create a 2D rectangular geometry by drawing it. This is particularly
useful since we need to create a boundary for the insulated part as a separate entity.

1. Start by clicking on the Line button located on the draw toolbar.

2. Position your cursor at the origin (0,0) in the main drawing area and start making
a line by pressing on the left mouse button (LMB) once and moving the mouse to
the right. You should be getting a line that looks like this one .

3. Move your cursor to the (0.2,0) coordinate and press the left mouse button (LMB)
once to create the first line. As you do this, the line segment from (0,0) to (0.2,0)
should turn red, as shown here .

4. Continue to make the line segments outlined in the previous step for the following
coordinates; from: (a) (0.2,0) to (1,0); (b) (1,0) to (1,0.4); (c) (1,0.4) to (0,0.4);
and (d) (0,0.4) to (0,0). The geometry you are creating should look rectangular.

5. Once back at the origin (0,0), press on the right mouse button (RMB) to finish the
rectangle.
- 5 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

We now must scale the geometry down to centimeters. (Recall that COMSOLs default
system of units is the MKS. Therefore, we just made a 1 meter long rectangle).

6. To scale the geometry, go under Draw Modify Scale menu and type 0. 1
as a scale factor for both x and y fields as shown below:


7. Click OK.

8. Click on Zoom Extents button in the main toolbar to zoom into the
geometry.

Your geometry should now be complete and highlighted in red, as shown below.




PHYSICS SETTINGS

Physics settings in COMSOL consist of two parts: (1) Subdomain settings and (2)
boundary conditions. The subdomain settings let us specify material types, initial
conditions, modes of heat transfer (i.e. conduction and/or convection). The boundary
conditions settings are used to specify what is happening at the boundaries of the
geometry. In this model, we will have to specify and couple physics settings for the flow
of air and heat transfer. Let us begin with the air flow physics settings.

- 6 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

Incompressible Navier Stokes (ns) Subdomain Settings:

1. From Mulptiphysics menu, select 1 Incompressible Navier Stokes (ns).

2. From the Physics menu select Subdomain Settings (equivalently, press F8).

3. Select subdomain 1 in the Subdomain selection window.

4. Enter r ho_ai r and mu_ai r in the fields for density and dynamic viscosity .

5. Click OK.




Incompressible Navier Stokes (ns) Boundary Conditions:

1. From the Physics menu open the Boundary Settings (F7) dialog box.

2. Apply the following boundary conditions:

BOUNDARY
BOUNDARY
TYPE
BOUNDARY
CONDITION
COMMENTS
1 Inlet Velocity
Enter 0. 1 in U
0
field
(Normal Inflow velocity)
2, 4 Wall No Slip
3, 5
Open
boundary
Normal stress Verify that field f
0
is set to 0

3. Click OK to close the boundary settings window.


- 7 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

Convection and Conduction (cc) Subdomain Settings:

1. From Mulptiphysics menu, select 2 Convection and Conduction (cc) mode.

2. From the Physics menu, select Subdomain Settings (F8).

3. Select Subdomain 1 in the subdomain selection field.

4. Enter k_ai r , r ho_ai r and 1006 in the k(isotropic), , and C
p
fields,
respectively.

5. Enter u and v in the u and v fields, respectively.

6. Click OK to close the Subdomain Settings window.



Convection and Conduction (cc) Boundary Conditions:

1. From the Physics menu open the Boundary Settings (F7) dialog box.

2. Apply the following boundary conditions:

BOUNDARY BOUNDARY CONDITION COMMENTS
1 Temperature Enter 273. 15+20 in T
0
field
2, 3 Thermal Insulation
4 Heat Flux Enter 1000 in q
0
field
5 Convective flux

3. Click OK to close Boundary Settings window.

- 8 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

MESH GENERATION

To minimize the computational time without compromising much accuracy of the
solution, we must change the default meshing parameters. To do this,

1. Go to the Mesh menu and select Free Mesh Parameters option.

2. Change Predefined mesh sizes from Normal to Finer.

3. Switch to Boundary tab.

4. Select boundaries 1 and 5 in the Boundary selection field while holding the
Control (ctrl) key on your keyboard.

5. Switch to Distribution tab.

6. Enable Constrained edge element distribution option.

7. Enter 20 in the Number of edge elements field.



8. Select boundary 2. (Do not hold the Control (ctrl) key on your keyboard)

9. Switch to Distribution tab and enable Constrained edge element distribution.

10. Enter 30 in the Number of edge elements field.

11. Select boundary 4. (Do not hold the Control (ctrl) key on your keyboard)

12. Switch to Distribution tab and enable Constrained edge element distribution.

13. Enter 80 in the Number of edge elements field.

14. Switch to Point tab.

15. Select points 1 and 3 in the Point selection field while holding the Control
(ctrl) key on your keyboard.

16. Enter 0. 0001 in the Maximum element size field.
- 9 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

17. Click the Remesh button.

18. Click OK to close the Free Mesh Parameters window.



As a result of these steps, you should get the following triangular mesh:



We are now ready to compute our solution.

- 10 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

COMPUTING AND SAVING THE SOLUTION

In this step we define the type of analysis to be performed. We are interested in steady
state analysis here, which we previously selected in the Model Navigator. Therefore, no
modifications need to be made. To enable the solver, proceed with the following steps:

1. From the Solve menu select Solve Problem. (Allow few seconds for solution)

2. Save your work on desktop by choosing File Save. Name the file according
to the naming convention given in the Introduction to COMSOL Multiphysics
document.

The result that you obtain should resemble the following boundary color map:



By default, your immediate result will be given in Kelvin instead of degrees Celsius. (In
fact, the first result you will see is the velocity field, not temperature). Furthermore, it
will be colored using a jet colormap and the velocity field (represented by arrows in the
above) will not be shown. We will use distinct colormap options to represent the air
velocity and temperature fields. The next section (Postprocessing and Visualization) will
help you in obtaining the above and other diagrams, such as 2D color distributions of key
air properties, a plot of T(y) at x =8 cm, a plot of local ( ) ,0
x
q x '' for
0
x x L s s . We will
also show how to use COMSOL to compute the total heat transfer rate per unit length,
T
q'
and use MATLAB to determine h(x) from COMSOL ( ) ,0
x
q x '' data and analytically.


- 11 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

- 12 -
POSTPROCESSING AND VISUALIZATION

After solving the problem, we would like to be able to look at the solution. COMSOL
offers us a number of different ways to look at our temperature (and other) fields. In this
problem we will deal with 2D color maps, velocity (and other) vector fields, extraction of
plate surface temperature , as well as computation of local heat transfer
coefficient and 1D temperature distribution plot. You will then address the questions of
COMSOL solution validity and compare the results to theoretical predictions mainly by
using MATLAB.
( ,0 T x )


Displaying T(x, y) and Vector Field V(x, y)

Let us first change the unit of temperature to degrees Celsius:

1. From the Postprocessing menu, open Plot Parameters dialog box (F12).

2. Under the Surface tab, change the unit of temperature to degrees Celsius from
the drop down menu in the Unit field.

3. Change the Colormap type from jet to hot.

4. Click Apply to refresh main view and keep the Plot Parameters window open.



Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

The 2D temperature distribution will be displayed using the hot colormap type with
degrees Celsius as the unit of temperature. Lets now add the velocity vector field V(x,y).

5. Switch to the Arrow tab and enable the Arrow plot check box.

6. Choose Velocity field from Predefined quantities.

7. Enter 20 in the Number of points for both x and y fields.

8. Press the Color button and select a color you want the arrows to be displayed in.
(Note: choose a color that produces good contrast. Green and white are good
choices here).

9. Click Apply to refresh main view and keep the Plot Parameters window open.



At this point, you will see a similar plot as shown on page 11. It is a good idea to save
this colormap for future use. Before you do save it, however, experiment with the
Number of points field in Plot Parameters window and adjust the velocity vector
field to what seems the best view to you. Put 30 for the y field and update your view
by pressing Apply button. Notice the difference in velocity vector field representation.
Try other values.

- 13 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

You may also want to see other quantities as vector fields. Available quantities are: (1)
Temperature gradient, (2) Conductive heat flux, (3) Convective heat flux, and (4) Total
heat flux. To see these quantities represented by a vector field:

10. Change the color of the arrow (see step 8).

11. Choose the quantity you wish to plot from Predefined quantities.

12. Click Apply.

13. Click OK when you are done displaying these quantities to close the Plot
Parameters window.


Saving Color Maps:

After you have selected a view that shows the results clearly, you may want to save it as
an image for future discussion. This may be done as follows:

1. Go to the File menu and select Export Image. This will bring up an
Export Image window.

For a 4 by 6 image, acceptable image quality settings are given in the figure below. If
you need higher image quality, increase the DPI value.



2. Change your Export Image value settings to the ones in the above figure.
3. Click the Export button.
4. Name and save the image.

- 14 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

Displaying V(x, y) as a Colormap:

1. From the Postprocessing menu, open Plot Parameters dialog box (F12).

2. Under the Arrow tab, disable the Arrow plot checkbox

3. Switch to Surface tab.



4. From Predefined quantities, select Velocity field.

5. Change the Colormap type from hot to jet.

6. Click Apply to refresh main view and keep the Plot Parameters window open.


The 2D Velocity distribution will be displayed using the jet colormap.


Displaying Variations of Key Air Properties as Colormaps:

With the Plot Parameters window open, ensure that you are under the Surface tab,

7. Type k_ai r in Expression field (without quotation marks).



8. Click Apply. (Note: The unit will change automatically)

These steps produce a colormap that displays variations in airs thermal conductivity k.
Note the values on the color scale and compare them with Appendix C of your textbook.

- 15 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

To produce colormaps for density and viscosity variations, repeat steps 6 and 7 while
typing r ho_ai r and mu_ai r , respectively in the Expression field in step 6. When
done, click OK to close the Plot Parameters window.

Note: You may also view composite properties, such as kinematic viscosity and Prandtls
number simply by entering their definitions in the Expression field. Thus, to view
kinematic viscosity variation, enter mu_ai r / r ho_ai r . For Prandtl number, enter
1006*mu_ai r / k_ai r . It is even possible to enter expressions for other desired quantities,
such as local Reynolds number. For Reynolds number evaluated at every x and y using
x as the computational value in its definition, enter 0. 1[ m/ s] *r ho_ai r *x/ mu_ai r . For
Reynolds number evaluated at every x and y using y as the computational value in its
definition, enter 0. 1[ m/ s] *r ho_ai r *y/ mu_ai r .


Plotting T(0.08, y) (or T(y) at x = 8 cm):

1. From Postprocessing menu select Cross Section Plot Parameters option.

2. Switch to the Line/Extrusion tab.

3. Change the Unit of temperature to degrees Celsius.

4. Change the x axis data from arc length to y.

5. Enter the following coordinates in the Cross section line data: x0 =x1 = 0.08;
y0 =0 and y1 =0.04.

6. Click OK.

- 16 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

- 17 -
These steps produce a plot of T(y) at x =8 cm, from y =0 cm (plate surface) to y =4 cm
(ambient environment conditions). Temperature T is plotted on the y axis and y
coordinates are plotted on the x axis. To save this plot,

7. Click the save button in your figure with results. This will bring up an
Export Image window.

8. Follow steps 2 4 as instructed on page 14 to finish with exporting the image.


Plotting Plate Surface Temperature ( ) 0 T x, For
0
s s x x L

To plot for ( ) ,0 T x
0
x x L s s using COMSOL,

1. Select Cross Section Plot Parameters option from Postprocessing menu.

2. Switch to the Line/Extrusion tab.

3. From Predefined quantities, select Temperature.

4. Change the Unit of temperature to degrees Celsius.

5. Change the x axis data from y to x.

6. Enter the following
coordinates in the Cross
section line data: x0 =0.02,
x1 = 0.1; y0 =y1 =0.

7. Click OK to close Cross
Section Plot Parameters
window.




As a result of these steps, a new plot
will be shown that graphs ) ,0 T x for (
0
x x L s s . Do not close this plot just
yet. We are going to extract this data
to a text file for comparative analysis
with MATLAB.


Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

- 18 -
Exporting COMSOL Data to a Data File:

1. Click on Export Current Plot button in the graph created in the previous s

tep.
2. Click Browse and navigate to your saving folder (say Desktop).
3. Name the file comsol _t emper at ur e. t xt . (Note: do not forget to type the .txt
4. Click OK to save the file.
his completes COMSOL modeling procedures for this problem.

extension in the name of the file).




T
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

Modeling with MATLAB

This part of modeling procedures describes how to create comparative graphs of local
heat transfer coefficient h(x) (along the heated portion of the plate) using MATLAB.
Obtain MATLAB script file named heat ed_pl at e. m from Blackboard prior to
following these procedures. Save this file in the same directory as the data file(s)
(comsol _t emper at ur e. t xt ) from COMSOL. (Note: heat ed_pl at e. m file is attached to
the electronic version of this document as well. To access the file directly from this
document, select View Navigation Panels Attachements and then save
heat ed_pl at e. m in a proper directory)


Comparing COMSOL solution with Approximated Pohlhausen Solution:

The reference analytic equations for heated plates with an insulation section are:

( )
1
3
1 1
3 2
1
3
1 1
3 2
0
0
0.417 1 Pr Re
2.396 1
Pr Re
x
x
s
s
h x x
Nu
k x
q x x
T x T
k x

(
= =
(

''
(
= +
(



MATLAB script (heat ed_pl at e. m) is programmed to use exported COMSOL data for
surface temperature ) and Newtons Law of cooling to determine the local heat
transfer coefficient h(x) along the heated portion of the plate. The script is also
programmed to calculate analytical local heat transfer coefficient h(x) and surface
temperature according to analytic reference equations given above. These equations
represent a more general approximation to Pohlhausen solution that is suitable for plates
with insulated section and applied heat flux. The script will ultimately produce
comparative graphs that will plot both solutions. Follow the steps below to complete this
problem:
( ,0 T x

1. Open MATLAB by double clicking its icon on the Desktop.

2. Load heat ed_pl at e. m file by selecting File Open Desktop
heated_plate.m. The script responsible for COMSOL data import and data
comparison will appear in a new window.

3. Press F5 key to run the script. MATLAB editor will display a warning message.
Click Change Directory to run the script.

Approximated Pohlhausens and COMSOL solutions for h(x) and ( )
s
T x will be plotted
in Figures 1 and 3. Figures 2 and 4 plot the percent error between quantities considered
according to the equations printed on the figures. These results are shown on the next
page.
- 19 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

Results plotted with MATLAB:



The results shown above were based on varying properties of air determined by the
equations given in Options and Settings: Defining Constants section. By default, the
script is programmed to use constant air properties determined at film temperature. This,
however, introduces greater error. If you wish to use varying properties, you must export
them to the same folder where the MATLAB script is. You must export varying Prandtls
number, conductivity k, and kinematic viscosity v along heated portion of the surface of
the plate. Refer to steps 1 7 on page 17 and 1 4 on page 18 to properly extract these
quantities. Type the following expressions in the Expressions field of Cross Section
Plot Parameters window to extract these properties and give them the following file
names:

PROPERTY EXPRESSION FILE NAME
Pr 1018*mu_air/k_air Pr_comsol.txt
k
k_air k_comsol.txt
v mu_air/rho_air eta_comsol.txt


- 20 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

Further, you will need to un suppress a section in MATLAB script. This is explained in
the script itself under Var yi ng Quant i t i es I mpor t Fr omCOMSOL section.

While in MATLAB, you may zoom into plots to notice departures in results based on the
solution methods.

Armed with these results, you are in a position to answer most of the assigned questions.
(Approaches that show how to answer extra credit questions are given in appendix).


This completes MATLAB modeling procedures for this problem.
- 21 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

APPENDIX

MATLAB script

If you could not obtain this script from the Blackboard or the PDF file, you may copy it
here, then paste it into notepad and save it in the same directory where you saved
COMSOL data file(s). You will most likely get hard to spot syntax errors if you copy
the script this way. It is therefore highly advised that you use the other 2 methods on
obtaining this script instead of the copying method.

%#########################################################################
%ME 433 - Heat Tr ansf er
%Sampl e MATLAB Scr i pt For :
%( X) Lami nar Ther mal Boundar y Layer [ Speci f i ed Sur f ace Heat Fl ux]
%I MPORTANT: Save t hi s f i l e i n t he same di r ect or y wi t h
% " comsol _t emper at ur e. t xt " f i l e.
%#########################################################################
%
cl c; %Cl ear s t he UI pr ompt
cl ear ; %Cl ear s var i abl es f r ommemor y

%%Const ant Quant i t i es
Ti nf = 20; %Ambi ent t emper at ur e, [ degC]
Vi nf = 0. 1; %Vel oci t y at t he i nl et , [ m/ s]
k_ai r = 0. 03525; %Ai r conduct i vi t y at Tf i l m, [ W/ m- K]
Pr _ai r = 0. 701; %Ai r Pr andt l number at Tf i l m, [ 1]
et a_ai r = 29. 75e- 6; %Ai r vi scosi t y at Tf i l m, [ m^2/ s]
x0 = 0. 02; %A spei cal pl at e coor di nat e! , [ m]
qs = 1000; %Appl i ed Sur f ace Heat Fl ux, [ W/ m^2]

%%Var yi ng Quant i t i es I mpor t Fr omCOMSOL
%#########################################################################
%Un- suppr ess t he quant i t i es bel ow t o per f or mver i f i cat i on of r esul t s
%usi ng var yi ng ai r pr oper t i es det er mi ned by COMSOL. Make sur e t o expor t
%t he f ol l owi ng dat a f i l es f r omCOMSOL and save t hemi n t he same
%di r ect or y as t hi s scr i pt : Pr _comsol . t xt , k_comsol . t xt , et a_comsol . t xt .
%Ot her wi se, l eave t hi s sect i on suppr essed. When suppr essed, t he r esul t s
%you get ar e det er mi ned at T f i l mand i nt r oduce l ar ges er r or s.
%#########################################################################
%l oad Pr _comsol . t xt
%Pr _ai r = Pr _comsol ( : , 2) ' ;
%l oad k_comsol . t xt
%k_ai r = k_comsol ( : , 2) ' ;
%l oad et a_comsol . t xt
%et a_ai r = et a_comsol ( : , 2) ' ;
%cl ear Pr _comsol k_comsol et a_comsol ;

%%COMSOL Dat a I mpor t and h( x) Comput at i on
l oad comsol _t emper at ur e. t xt
x = comsol _t emper at ur e( : , 1) ' ;
Ts_comsol = comsol _t emper at ur e( : , 2) ' ;
hx_comsol = qs. / ( Ts_comsol - Ti nf ) ;
cl ear comsol _t emper at ur e;

%%Fi ndi ng Ts( x) and h( x) Anal yt i cal l y ( Cor r el at i on Equat i on)
Rex = Vi nf *x. / et a_ai r ;
qs = 1000; %Appl i ed Uni f or mSur f ace Heat Fl ux, [ W/ m^2]
Ts_anal yt = Ti nf + 2. 396*qs. / k_ai r . *( 1- x0. / x) . ^( 1/ 3) . *x. / . . .
( Pr _ai r . ^( 1/ 3) . *Rex. ^( 1/ 2) ) ; %Cor r el at i on Eq. f or T( x)
Nux = 0. 417*( 1- x0. / x) . ^( - 1/ 3) . *. . .
Pr _ai r . ^( 1/ 3) . *Rex. ^( 1/ 2) ; %Local Nussel t number , [ 1]
hx_anal yt = Nux. *k_ai r . / x; %Local Heat t r ansf er coef f i ci ent , [ W/ ( m^2- C) ]

%%Er r or anal ysi s i n h( x) and Ts( x)
del t ah = abs( hx_comsol - hx_anal yt ) ; %| - > Si mpl e %Er r or
er r or h = del t ah. / hx_comsol *100; %| - > cal cul at i on f or h
- 22 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

del t aT = abs( Ts_comsol - Ts_anal yt ) ; %| - > Si mpl e %Er r or
er r or T = del t aT. / Ts_comsol *100; %| - > cal cul at i on f or T

%%h( x) Pl ot Begi ns Her e:
f i gur e1 = f i gur e( ' I nver t Har dcopy' , ' of f ' , . . . %\
' Col or map' , [ 1 1 1 ] , . . . %| - > Set t i ng up t he f i gur e
' Col or ' , [ 1 1 1] ) ; %/
pl ot ( x, hx_comsol , ' b' , x, hx_anal yt , ' r - - ' ) %Pl ot s COMSOL vs. Theor y h

%%Pl ot cosmet i cs f or f i gur e 1 begi n her e:
annot at i on( f i gur e1, ' t ext box' , . . .
' St r i ng' , {' Fl ow Over a Heat ed Pl at e' , ' wi t h I nsul at ed Edge' }, . . .
' Hor i zont al Al i gnment ' , ' cent er ' , . . .
' Font Si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Fi t BoxToText ' , ' of f ' , . . .
' Li neSt yl e' , ' none' , . . .
' Backgr oundCol or ' , [ 1 1 1] , . . .
' Posi t i on' , [ 0. 5324 0. 6079 0. 3669 0. 1669] ) ;

annot at i on( f i gur e1, ' t ext box' , . . .
' St r i ng' , {' q_s" = 1000W/ m^2' , ' T_\ i nf t y = 20\ ci r cC' , ' V_\ i nf t y = 0. 1 m/ s' , ' L = 10
cm' , ' x_0 = 2 cm' }, . . .
' Font Si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' , . . .
' Fi t BoxToText ' , ' of f ' , . . .
' EdgeCol or ' , [ 1 1 1] , . . .
' Backgr oundCol or ' , [ 1 1 1] , . . .
' Posi t i on' , [ 0. 599 0. 3462 0. 2552 0. 3127] ) ;

l egend( ' COMSOL Sol ut i on' , ' Anal yt i c Equat i on' )
box of f
gr i d on
t i t l e( ' \ f ont name{Ti mes New Roman} \ f ont si ze{16} \ bf Local Heat Tr ansf er Coef f i ci ent ' )
xl abel ( ' x, [ m] ' )
yl abel ( ' h( x) , [ W/ m^2- \ ci r cC] ' )
set ( get ( gca, ' YLabel ' ) , . . .
' f ont si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' )
set ( get ( gca, ' XLabel ' ) , . . .
' f ont si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' )

%%Er r or Pl ot i n h( x) begi ns her e:
f i gur e2 = f i gur e( ' I nver t Har dcopy' , ' of f ' , . . . %\
' Col or map' , [ 1 1 1 ] , . . . %| - > Set t i ng up t he f i gur e
' Col or ' , [ 1 1 1] ) ; %/
pl ot ( x, er r or h) %Pl ot s %Er r or i n h

%%Pl ot cosmet i cs f or f i gur e 2 begi n her e:
box of f
gr i d on
t i t l e( ' \ f ont name{Ti mes New Roman} \ f ont si ze{16} \ bf Er r or Anal ysi s i n h( x) ' )
xl abel ( ' x, [ m] ' )
yl abel ( ' Er r or i n h( x) , [ %] ' )
set ( get ( gca, ' YLabel ' ) , . . .
' f ont si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' )
set ( get ( gca, ' XLabel ' ) , . . .
' f ont si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' )

st r 1( 1) = {. . .
' $${\ %er r ={h_{x_{anal yt }}- h_{x_{comsol }}\ over h_{x_{comsol }}}\ t i mes 100} $$' };
t ext ( ' uni t s' , ' nor mal i zed' , ' posi t i on' , [ . 35 . 2] , . . .
' f ont si ze' , 14, . . .
- 23 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' , . . .
' Backgr oundCol or ' , [ 1 1 1] , . . .
' i nt er pr et er ' , ' l at ex' , . . .
' st r i ng' , st r 1) ;

%%Ts( x) Pl ot Begi ns Her e:
f i gur e3 = f i gur e( ' I nver t Har dcopy' , ' of f ' , . . . %\
' Col or map' , [ 1 1 1 ] , . . . %| - > Set t i ng up t he f i gur e
' Col or ' , [ 1 1 1] ) ; %/
pl ot ( x, Ts_comsol , ' b' , x, Ts_anal yt , ' r - - ' ) %Pl ot s COMSOL vs. Theor y h

%%Pl ot cosmet i cs f or f i gur e 3 begi n her e:
annot at i on( f i gur e3, ' t ext box' , . . .
' St r i ng' , {' Fl ow Over a Heat ed Pl at e wi t h I nsul at ed Edge' }, . . .
' Font Si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Fi t BoxToText ' , ' of f ' , . . .
' Li neSt yl e' , ' none' , . . .
' Backgr oundCol or ' , [ 1 1 1] , . . .
' Posi t i on' , [ 0. 1493 0. 8014 0. 6401 0. 08788] ) ;

annot at i on( f i gur e3, ' t ext box' , . . .
' St r i ng' , {' q_s" = 1000W/ m^2' , ' T_\ i nf t y = 20\ ci r cC' , ' V_\ i nf t y = 0. 1 m/ s' , ' L = 10
cm' , ' x_0 = 2 cm' }, . . .
' Font Si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' , . . .
' Fi t BoxToText ' , ' of f ' , . . .
' EdgeCol or ' , [ 1 1 1] , . . .
' Backgr oundCol or ' , [ 1 1 1] , . . .
' Posi t i on' , [ 0. 6266 0. 1593 0. 2552 0. 3127] ) ;

l egend( ' COMSOL Sol ut i on' , ' Anal yt i c Equat i on' , ' l ocat i on' , ' sout hwest ' )
box of f
gr i d on
t i t l e( ' \ f ont name{Ti mes New Roman} \ f ont si ze{16} \ bf Pl at e Sur f ace Temper at ur e' )
xl abel ( ' x, [ m] ' )
yl abel ( ' T_s( x) , [ \ ci r cC] ' )
set ( get ( gca, ' YLabel ' ) , . . .
' f ont si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' )
set ( get ( gca, ' XLabel ' ) , . . .
' f ont si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' )

%%Er r or Pl ot i n Ts( x) begi ns her e:
f i gur e4 = f i gur e( ' I nver t Har dcopy' , ' of f ' , . . . %\
' Col or map' , [ 1 1 1 ] , . . . %| - > Set t i ng up t he f i gur e
' Col or ' , [ 1 1 1] ) ; %/
pl ot ( x, er r or T) %Pl ot s %Er r or i n h

%%Pl ot cosmet i cs f or f i gur e 4 begi n her e:
box of f
gr i d on
t i t l e( ' \ f ont name{Ti mes New Roman} \ f ont si ze{16} \ bf Er r or Anal ysi s i n T_s( x) ' )
xl abel ( ' x, [ m] ' )
yl abel ( ' Er r or i n T_s( x) , [ %] ' )
set ( get ( gca, ' YLabel ' ) , . . .
' f ont si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' )
set ( get ( gca, ' XLabel ' ) , . . .
' f ont si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' )

st r 1( 1) = {. . .
' $${\ %er r ={T_{s_{anal yt }}- T_{s_{comsol }}\ over T_{s_{comsol }}}\ t i mes 100} $$' };
- 24 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

- 25 -
t ext ( ' uni t s' , ' nor mal i zed' , ' posi t i on' , [ . 35 . 2] , . . .
' f ont si ze' , 14, . . .
' Font Name' , ' Ti mes New Roman' , . . .
' Font Angl e' , ' i t al i c' , . . .
' Backgr oundCol or ' , [ 1 1 1] , . . .
' i nt er pr et er ' , ' l at ex' , . . .
' st r i ng' , st r 1) ;


COMSOL Hints and Sample MATLAB Scripts For Extra Credit Question

The goal of this question is to obtain boundary layer o from COMSOL and compare it
directly with analytical boundary layer solution obtained by Blasius. This is particularly
tricky, since there is no clear definition as to where the viscous boundary layer thickness
o
/
occurs. Notice that in our textbook, the definition is given based on the condition that
be 0.994, from which, with the use of table 7.1, equation 7.11 is derived. We could
have taken as close to unity as we wish and equation 7.11 would therefore change.
layer, since it implies t V = . The number 0.994, however, is special because it
corresponds to a Prandtls r of 1.0 on Pohlhausens solution given in figure 7.2
From figure 7.2 and equation 7.19, it follows that for air (Pr =0.7), / 1
t
u V

/ u V

Physically, the closer / u V

hat u
nu
is to unity, the better the distinction in the viscous boundary
.

mbe
o o > , since
6.5
t
q ~ .

e therefore need to program MATLAB with the following analytical equation fo W ro :

5.2
Re
x
x
o =

To compute Re
x
, properties at T
film
must be found. This is easily done since both
temperature extremes are now known. Variable x ranges between 0 0.1 x s s meters.

In COMSOL, we have to use Contour plot type to single out velocity iso curve that
orrespond to condition. To extract boundary layer c / 0.994 u V =

o from COMSOL,


ckbox on the top left portion of the window.

1. From the Postprocessing menu, open Plot Parameters dialog box (F12).
2. Under the Arrow tab, disable the Arrow plot checkbox
3. Switch to Contour tab.

4. Enable Contour plot che

5. Type u in the Expression field. (without quotation marks)

Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

6. Enable Vector with isolevels radio button option. (The entry field right below it
enables us to enter the single out the velocity for which we want the iso curve to
be mapped out).

7. Enter 0. 0944 in the entry field below Vector with isolevels. (This is the x
component velocity that satisfies / 0.994 u V

= condition).

8. Switch to General tab.

9. Disable all other plot types except Contour and Geometry edges.

10. Use the Plot in drop down menu (located on the bottom left of the window) to
switch from Main axes to New figure.

11. Click OK. Viscous COMSOL boundary layer satisfying will be
shown in a new plot figure.
/ 0.994 u V

=

12. Click on Export Current Plot button .

13. Name the file f l ui d_bl ayer . t xt . (Note: do not forget to type the .txt
extension in the name of the file).

14. Click OK to save the file. The file is saved in the same directory where you first
saved COMSOL model file with extension .mph.

- 26 -
Laminar Forced Convection Over a Heated Flat Plate ME433 COMSOL INSTRUCTIONS

- 27 -
The following MATLAB script sample shows how the above analytical equations can be
programmed. It also imports COMSOL boundary layer data saved in f l ui d_bl ayer . t xt
text file and uses it to plot comparative graphs.

%%Pr el i mi nar i es
cl c; %Cl ear s t he UI pr ompt
cl ear ; %Cl ear s var i abl es f r ommemor y
%%Const ant Quant i t i es
Vi nf = 0. 1; %Vel oci t y at t he i nl et , [ m/ s]
k_ai r = 0. 03525; %Conduct i vi t y at Tf , [ W/ m- K]
r ho_ai r = 0. 8150; %Densi t y at Tf , [ kg/ m^3]
Pr _ai r = 0. 701; %Pr andt l number at Tf i l m, [ 1]
mu_ai r = 24. 24e- 6; %Vi scosi t y at Tf , [ m^2/ s]
et a_ai r = mu_ai r / r ho_ai r ; %Speci f i c vi scosi t y at Tf , [ m^2/ s]

%%COMSOL Dat a I mpor t
l oad f l ui d_bl ayer . t xt ;
xcomsol = f l ui d_bl ayer ( : , 1) ;
ycomsol = f l ui d_bl ayer ( : , 2) ; %<- - COMSOL Vi scous Bound. Layer Thi ncknes

%%Anal yt i c Boundar y Layer Thi ncknes
Rex = Vi nf *xcomsol / et a_ai r ;
ybl asi us = 5. 2*xcomsol . / sqr t ( Rex) ; %<- - Vi scous B. L. T.

%%Per cent Di f f er ence Anal ysi s
er r ybl asi us = abs( ( ycomsol - ybl asi us) ) . / ybl asi us*100;
%%Pl ot t er
f i gur e( 1)
pl ot ( xcomsol , ycomsol , ' r . ' , xcomsol , ybl asi us, ' b. ' )
gr i d on
l egend( ' COMSOL \ del t a' , ' Bl asi us \ del t a' , ' l ocat i on' , ' nor t hwest ' )

f i gur e( 2)
pl ot ( xcomsol , er r ybl asi us, ' b. ' )
t i t l e( ' Er r or ' )


This completes MATLAB modeling procedures for this problem.

Das könnte Ihnen auch gefallen