-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
1/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
TEMPERATURE DEVELOPMENT IN TUBES Uniform Surface Heat Flux
Problem Statement
Room temperature air enters a circular tube with diameterDand lengthLat a uniform
inlet velocity Viand temperature Ti. The surface wall of the tube is heated by a uniformheat flux
sq . Formation of viscous boundary layers establishes a hydrodynamic entrance
region of the tube. Air velocity in this region is developing. At and after a certain
hydrodynamic lengthLh, the velocity distribution is developed and resembles a parabolicprofile. This portion of the tube is referred to as fully developed velocity region
(FDVR). Temperature profile is changing at the surface and throughout the tube. Of
general interest is to learn how to use COMSOL in obtaining temperature field in a tube.It is desired to obtain qualitative, as well as quantitative perspectives about thermal
development from COMSOL solution.
Temperature Development in an Isothermal TubeKnown quantities:
Fluid: Air
L = 100 cm
D = 6 cmVi= 0.04 m/s
Ti= 20 C
sq = 1000 W/m
2
Observations
This is a forced convection, internal channel flow problem. The channelconsidered is a circular tube. Both hydrodynamic and thermal considerations are
of interest. Hydrodynamic considerations were examined in a previous module.
Assuming that radial temperature distribution is symmetric at each radial cross section, the problem can be modeled in 2 dimensions. Rectangular geometry is a
suitable model for lateral cross section of the tube.
We will model this problem with constant air properties determined at incomingair temperature Tair. Later, we may also want to model the problem by varying air
properties with respect to temperature. This will enable us to see if there are any
differences in solutions when material property variation is introduced. (This isassigned as an extra credit exercise).
COMSOL can introduce marginal errors near the exit of the tube. To avoid thesesmall errors, we should always make the tube larger in length by 10 cm. Thus, the
modeling length of the tube will be 110 cm.
- 1 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
2/16
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
3/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
Modeling with COMSOL Multiphysics
Recall that we already solved for the velocity profile in the previous module. This
problem asks us to find temperature distribution of air when the walls of the tube are kept
at uniform surface flux sq . We will proceed by extending our previous module to a
Multiphysics model. Prepare the COMSOL file you saved for Laminar Flow in a Tubeby copying it to your desktop. (Note: The computers in room ST 213 do not allow you
to simply copy and paste a file from one location to Desktop. You can still save your
COMSOL file by opening it in COMSOL and choosing the option Save as from filemenu)
OPENING PREVIOUS MODULE
1. Open COMSOL model file (.mph) for Laminar Flow in a Tube. The model willload at the point where you last saved it.
MODEL NAVIGATOR: CONVECTION & CONDUCTION HEAT TRANSFER MODE
We are now ready to start applying heat transfer module to create a Multiphysics model.
This is done as follows.
1. Select Model Navigator under the Multiphysics menu.
2. Click on Multiphysics button on the bottom right corner of the window.
3. From the list of application modes select COMSOL Multiphysics HeatTransferConvection and Conduction Steady state analysis.
4. Click the Add button.
5. Click OK.
- 3 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
4/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
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, initialconditions, 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 thegeometry. In this model, we will have to specify and couple physics settings for the flow
of air and heat transfer. Since weve specified air flow physics settings before, we onlyneed to add and couple heat transfer physics settings. This is done as follows.
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 0. 02564, 1. 2042 and 1006 in the k(isotropic), , and Cpfields,respectively.
5. Enter u and v in the uand vfields, respectively.
6. Click OK to close the Subdomain Settings window.
- 4 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
5/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
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 T0field
2, 3 Heat Flux Enter 1000 in q0field
4 Convective flux
Click OK to close Boundary Settings window.
MESH GENEARATION
The mesh we created in Laminar Flow in a Tube is not quite suitable to handle heatflux boundary conditions. We shall make changes to the mesh as follows:
1. Go to the Mesh menu and select Free Mesh Parameters option.
2. From Predefined mesh sizes drop down menu, select Extremely fine option.
3. Click Remesh, followed by OK to close 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.
- 5 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
6/16
Temperature Development In Tubes: Uniform Surface Heat Flux 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, nomodifications need to be made. To enable the solver, proceed with the following steps:
1. From the Solve menu select Solve Problem. (Allow few minutes for solution)
2. Save your work on desktop by choosing File Save. Name the file accordingto the naming convention given in the Introduction to COMSOL Multiphysics
document.
The result that you obtain should resemble the following surface 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. We will use distinct colormapping options torepresent the air velocity and temperature fields.
The next section (Postprocessing and Visualization) will help you in obtaining the above
and other diagrams, such as plots of axial temperatures at various xoand a plot ofcenterline and surface temperatures Tcand Ts, respectively. We will also plot and extract
numerical data forTsand use it to find local ,x oh r x . Answer the extra credit question
to determine the effects on solution when air property variations are included COMSOL
analysis.
- 6 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
7/16
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
8/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
The 2D temperature distribution will be displayed using the hsv colormap type with
degrees Celsius as the unit of temperature. Lets now add the velocity vector field V(r, x).
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. Black is a good choice 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 6. It is a good idea to save thiscolormap 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 x field and update your view by pressing
Apply button. Notice the difference in velocity vector field representation. Try other
values.
- 8 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
9/16
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
10/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
Plotting T(r, xo) (or T(r) at xo)
To make axial temperature T(r, xo)plots at specifiedxo, we simply need to know the end
coordinates of axial lines along which T(r, xo)is to be plotted. Vertical axial lines are
described by the radius of the tube in y coordinate (or rcoordinate). Let us begin by
plotting axial temperature T(r, xo) atxo= 100 cm.
1. Under Postprocessing menu, select Cross Section Plot Parameters.
2. Switch to Line/Extrusion tab.
3. Type y in the Expression field under y axis data section of the tab.
4. Under x axis data, use radio button to enable the Expression option.
5. Click on Expression button.
6. In new x axis data window, type T in Expression field.
7. Change the Unit of temperature to degrees Celsius.
8. Click OK to apply and close x axis data window.
9. In Cross Section Plot Parameters window, enter the following coordinates inthe Cross section line data:x0=x1 = 1;y0= -0.03 andy1= 0.03.
10.Click Apply.
- 10 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
11/16
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
12/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
As a result of these steps, a new plot will be shown that graphs surface temperature Tsfor
0 x L . Do not close this plot just yet. We are going to extract this data to a text file
for comparative analysis with MATLAB.
Exporting COMSOL Data to a Data File
1. Click on Export Current Plot button in the Temperature time graph createdin the previous step.
2. Click Browse and navigate to your saving folder (say Desktop).
3. Name the file Tx_sur f ace. t xt . (Note: do not forget to type the .txt extensionin the name of the file).
4. Click OK to save the file. The file is saved in the same directory where you firstsaved COMSOL model file with extension .mph.
- 12 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
13/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
Plotting Centerline Temperature Tc(ro, x) as a Function of x
Similar to axial temperature plots, we simply need to specify proper coordinates of a line
along which we wish to plot temperature. Tube center line begins atx0= 0 meters and
terminates atx1= 1. The y coordinate (or the rcoordinate) at the center of the tube
stays at zero level asxvaries.
1. Under Postprocessing menu, select Cross Section Plot Parameters.
2. Switch to Line/Extrusion tab.
3. Type T in the Expression field under y axis data section and change theUnit of temperature to degrees Celsius.
4. In x axis data section, switch to upper radio button and select x using thedrop down menu.
5. Enter the following coordinates in the Cross section line data section: x0= 0,x1 = 1;y0=y1= 0.
6. Click OK.
Centerline temperature Tcwill be displayed as a function ofxon 0 x L . This graph isshown on the next page. It has been re plotted with MATLAB.
- 13 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
14/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
Modeling with MATLAB
This part of modeling procedures describes how to create graphs of surface heat transfer
coefficient h(x)and temperature Tsusing MATLAB. Obtain MATLAB script file named
f l ux_t ube. m from Blackboard prior to following these procedures. Save this file in the
same directory as the data file(s) (Tx_sur f ace. t xt ) from COMSOL. (Note:f l ux_tube. mfile 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 f l ux_t ube. m in a proper directory)
MATLAB script (f l ux_tube. 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 surface of the tube. Follow the steps below to complete
this problem:
,0T x
1. Open MATLAB by double clicking its icon on the Desktop.
2. Load f l ux_t ube. m file by selecting File Open Desktop flux_tube.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.
COMSOL solutions for h(x)and sT x will be plotted in Figures 1 and 2.
Results plotted with MATLAB
Does the temperature profile become invariant with distancex ? What observations do
you make regarding Tc ?
- 14 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
15/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
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 savedCOMSOL 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 Transf er % Sampl e MATLAB Scr i pt For : % ( X) Temper ature Devel opment i n Tubes - Uni f or Sur f ace Heat Fl ux% I MPORTANT: Save t hi s f i l e i n the same di r ector y wi t h% "Tx_sur f ace. tx t" f i l e. % #########################################################################%% Pr el i mi nar i escl ear % Cl ear s var i abl es f r ommemorycl c % Cl ear s t he UI prompt %%% Const ant Quanti t i es
Ti nf = 20; % Ambi ent t emper at ure, [ degC] qx = 1000; % Appl i ed heat f l ux, [ W/ m 2] %% COMSOL Dat a I mpor t & hx_comsol Computat i onl oad Tx_sur f ace. t xt ; % I mpor t s a 2- col umn dat a vect or f r om COMSOLx = Tx_surf ace( : , 1) *100 ; % Tube coor di nat e vect or, [ cm]
Ts = Tx_sur f ace( : , 2) ; % COMSOL Ts vect or , [ degC] hx_comsol = qx./ ( Ts- Ti nf ) ; % Heat t r ansf . coef f . f r omCOMSOL
%% Pl ott er and Pl ot Cosmeti csf i gure1 = f i gure( ' I nver t Hardcopy' , ' of f ' , . . . %\
' Col ormap' , [ 1 1 1 ] , . . . % | - > Set t i ng up the f i gure' Col or ' , [1 1 1] ) ; %/
pl ot( x, hx_comsol ) % Pl ot s COMSOL hbox of fgr i d ont i t l e( ' \ f ont name{Ti mes New Roman} \ f ont si ze{16} \ bf Sur f ace Heat Transf er Coef f i ci ent ' )xl abel ( ' x, [ cm] ' )yl abel ( ' h, [ W/ m 2- \ ci r cC] ' )
set ( get ( gca, ' YLabel ' ) , . . . ' f onts i ze' , 14, . . . ' Font Name' , ' Ti mes New Roman' , . . . ' FontAngl e' , ' i t al i c' )
set ( get ( gca, ' XLabel ' ) , . . . ' f onts i ze' , 14, . . . ' Font Name' , ' Ti mes New Roman' , . . . ' FontAngl e' , ' i t al i c' )
f i gure2 = f i gure( ' I nver t Hardcopy' , ' of f ' , . . . %\ ' Col ormap' , [ 1 1 1 ] , . . . % | - > Sett i ng up the f i gure' Col or ' , [1 1 1] ) ; %/
pl ot ( x, Ts ) % Pl ot s COMSOL Tsbox of fgr i d ont i t l e( ' \ f ont name{Ti mes New Roman} \ f ont si ze{16} \ bf Sur f ace Temper at ure T_s' )xl abel ( ' x, [ cm] ' )yl abel ( ' T_ s , [ \ ci r cC] ' )
set ( get ( gca, ' YLabel ' ) , . . . ' f onts i ze' , 14, . . . ' Font Name' , ' Ti mes New Roman' , . . . ' FontAngl e' , ' i t al i c' )
set ( get ( gca, ' XLabel ' ) , . . . ' f onts i ze' , 14, . . . ' Font Name' , ' Ti mes New Roman' , . . . ' Font Angl e' , ' i t al i c' )
This completes MATLAB modeling procedures for this problem.
- 15 -
-
8/13/2019 11 Temperature Development in Tubes [Uniform Surface Heat Flux]
16/16
Temperature Development In Tubes: Uniform Surface Heat Flux ME433 COMSOL INSTRUCTIONS
- 16 -
COMSOL Results and Hints for Extra Credit Question
The goal of this question is to determine how varying properties of air affect the solution.
The following results for centerline velocity ucand temperature Tcwere repotted withMATLAB. The length of the tube was increased to 5 meters.
Notice how varying air properties manifest a dramatic difference in centerline velocity.
To use varying air properties in COMSOL, follow the steps below,
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 Conductivityrho_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.
4. Use the same names of quantities defined above in Subdomain Physics Settingsto replace the previously defined constant numerical properties.
5. Resolve the problem.
COMSOL automatically determines correct property unit under the Unit column. If itdoes 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.
This completes COMSOL modeling procedures for this problem.