Вы находитесь на странице: 1из 24

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

FREE CONVECTION OF AIR OVER A HEATED VERTICAL PLATE Problem Statement A plate of 10 cm in height heated with constant heat flux q is brought to a room y temperature air environment. Due to temperature difference between air and the plate, the density of air near the plate starts to decrease. In presence of earths gravitational acceleration field, air begins to rise near the surface of the plate forming viscous and thermal boundary layers. Of general interest is to learn how to use COMSOL to generate plots of velocity and temperature boundary layers in free convection over a vertical plate. Known quantities: Geometry: vertical plate Fluid: Air Free Convection Modeling Setup

q = 1000 W/m2 y T = 20 C L = 10 cm

Observations This is a free convection, external flow problem. Considered geometry is a vertical plate. The plate is heated by constant heat flux q . y Velocity and temperature fields are coupled in free convection. Therefore, a multiphysics model involving steady state Navier Stokes and heat transfer modes must be set up and coupled in COMSOL. Boussinesq approximation will be used to model air density changes induced by temperature field. Subject to validation conditions, correlation equations from chapter 8 may be applicable. For heated vertical plates, plate surface temperature is the quantity sought. COMSOL may introduce errors in solution at the bottom and upper edges of the plate. Although the bottom edge errors are unavoidable, the upper edge error can be eliminated by extending the height of the plate by a few millimeters. Thus, we will extend the height of the plate by 5 mm at the upper edge (making the y coordinates of the plate as ybottom = 0.01m and yup = 0.115m, as shown in the figure above).

-1-

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

Assignment 1. Use COMSOL to determine and show 2D colormaps of velocity and temperature fields. Use arrows to represent velocity vector field. 2. Use COMSOL to plot 2D colormap of the density field. 3. Use COMSOL to plot axial velocity u(x,yo) and temperature T(x,yo) at yo = 6 cm. 4. Use COMSOL to plot and extract numerical data for plate surface temperature Ts as a function of y on 0 y L . Compute and plot analytic Ts given by correlation 8.29a and COMSOL Ts on the same graph. [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]

5. Calculate and plot the percent error between COMSOL Ts and Ts based on correlation 8.29a. Base your error analysis on assumption that correlation based Ts 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] 6. State the criterion for transition from laminar to turbulent flow for free convection in vertical plates. Determine whether the flow in this problem is laminar or turbulent [Hint: use COMSOL solution for temperature field to determine film temperature]. Determine whether of correlation 8.29a is applicable. 7. [Extra Credit]: Compare 2D colormaps of velocity and temperature fields from parametric solver for the following values of surface flux stepping dq: (a) 100 W/m2, and (b) 1000 W/m2. [Hint: Use available Parameter value: options under General tab of Plot Parameters window]. Explain why thermal boundary layer is larger for smaller flux (a) than for the larger flux (b). Present sufficient numerical evidence to support your answer. Intuitively speaking, would you expect this to take place prior to comparing COMSOL solutions for velocity and temperature fields?

-2-

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

Modeling with COMSOL Multiphysics

This model analyzes free convection process outside a vertical plate. The plate is heated with constant heat flux q . As warm plate heats air near its surface, air starts rising due to y changes in its density. This is called a free convection or natural convection process. When modeling this process, consider a rectangular subdomain that consists of air. The 10 cm plate is located on the left vertical wall. See the diagram in Problem Statement for this modeling geometry. The lift force responsible for natural convection process can be expressed in terms of local density change of air as fy = ( )g. The term is the density far away from the plate where the hot plate has no influence on air, g is gravitational acceleration constant and represents variable density. Boussinesq approximation can be used satisfactorily in this model to represent variable density field. We will compute according to: = [1 (T T)/T] With these assumptions and approximations, we are now ready to begin the modeling procedure.
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-

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

OPTIONS AND SETTINGS: DEFINING CONSTANTS

Continue by creating a small database of constants the model will use. 1. From the Options menu select Constants. 2. Define the following names and expressions:
NAME Tinf dq rho0 mu_air k_air Cp_air g EXPRESSION 273.15+20[K] 100[W/m^2] 1.2042[kg/m^3] 18.17e-6[kg/(s*m)] 0.02564[W/(m*degC)] 1006.1[J/(kg*degC)] 9.81[m/s^2] VALUE 293.15[K] 100[W/m ] 1.2042[kg/m ] (1.817e-5)[kg/(ms)] 0.02564[W/(mK)] 1006.1[J/(kgK)] 9.81[m/s ]
2 3 2

DESCRIPTION Temperature Far Away Heat Flux Stepping Air Density (20C) Air Dynamic Viscosity (20C) Air Conductivity (20C) Air Heat Capacity (20C) Acc. Due to Gravity

3. Click OK. COMSOL automatically determines correct units under the Value 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. It is presented here to give a short description of the constants.

-4-

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

GEOMETRY MODELING

In this step, we will create a 2 dimensional geometry that will be used as a model in our problem. According to problem statement, we will need to create a rectangle with partitioned left wall. This is done as follows. 1. In the Draw menu, select Specify Objects Rectangle 2. Enter following rectangle dimensions for R1.
R1 WIDTH HEIGHT 0.105 0.13

3. Click OK to close Rectangle definition window. 4. Click on Zoom Extents button geometry. in the main toolbar to zoom into the

5. In the Draw menu, select Specify Objects Point 6. Start by entering following point coordinates for point P1.
COORDINATES X Y P1 0 0.01 P2 0 0.115

7. When done with step 6, click OK and repeat step 6 for point P2. 8. Click OK to close Point definition window. You should see your finished modeling geometry now in the main program window. The left wall of the rectangle should be partitioned into 3 parts by 2 points.

-5-

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

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 by specifying Boussinesq approximation to model air density temperature dependence. We use Boussinesq approximation to achieve this as follows: 1. In Options menu, select Expressions Subdomain Expressions. 2. Select subdomain 1 in the Subdomain selection section. 3. Type rho in the Name field and rho0*(1-(T-Tinf)/Tinf) in the expression field.
NAME rho EXPRESSION rho0*(1-(T-Tinf)/Tinf) UNIT [kg/m ]
3

4. Click OK to close Subdomain Expressions setup window. COMSOL automatically determines correct units under the Unit column. If it does not, you are most likely entering wrong expression. Carefully check the expression you typed and make corrections, if necessary. Let us now proceed with setup of subdomain and boundary settings for flow field and heat transfer.
Incompressible Navier Stokes Subdomain Settings

1. From Mulptiphysics menu, select 1 Incompressible Navier Stokes (ns) mode. 2. From the Physics menu select Subdomain Settings (equivalently, press F8). 3. Select subdomain 1 in the Subdomain selection section. 4. Type rho and mu_air in the fields for density and dynamic viscosity . 5. Type g*(rho0-rho) in the Fy field. 6. Click OK.

-6-

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

Notice that the buoyant force Fy is set up in accordance with the condition described on page 3. This force setup (and density field variation) is responsible for driving the warm air up and making free convection possible. If the plate was in an environment where g 0, (such as inside the International Space Station), the air would not rise. Incidentally, this might be part of the reason why astronauts and cosmonauts do not have conventional cookware in space.
Incompressible Navier Stokes Boundary Settings

1. From the Physics menu open the Boundary Settings (F7) dialog box. 2. Apply the following boundary conditions:
BOUNDARIES 1, 3, 4 2, 5, 6 BOUNDARY TYPE Wall Open boundary BOUNDARY CONDITION No Slip Normal Stress Verify that field f0 is set to 0 COMMENTS

3. Click OK to close the boundary settings window. The no slip condition applied to boundaries 1, 3, and 4 assumes that velocity is zero at the wall. The remaining boundaries all have the open boundary condition, meaning that no forces act on the fluid. The open boundary condition defines the assumption that computational domain extends to infinity.

-7-

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

Convection and Conduction 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 section. 4. Enter k_air, rho and Cp_air in the k, , and Cp fields, respectively. 5. Type u and v in the u and v fields, respectively.

6. Switch to Init tab. 7. Type Tinf in T(t0) field.

8. Click OK to close the Subdomain Settings window.

-8-

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

Convection and Conduction Boundary Conditions:

1. From the Physics menu open the Boundary Settings (F7) dialog box. 2. Apply the following boundary conditions:
BOUNDARY 1, 4 2, 6 3 5 BOUNDARY CONDITION Thermal Insulation Temperature Heat Flux Convective flux Enter Tinf in T0 field Enter dq in q0 field COMMENTS

3. Click OK to close Boundary Settings window. The model keeps hot plate (boundary 3) at a constant heat flux q (we will slowly raise y heat flux step dq with parametric solver to 1000 W/m2 so that solver is able to converge system of nonlinear equations. The short boundaries below and above the vertical plate (1 and 4) are thermally insulated so that no conduction or convection occurs normal to the boundaries. Ideally you would not include the insulated parts, but they are needed to smoothen out air flow near the hot plate edges. On the bottom and the right boundaries (2 and 6), the model sets temperature equal to room temperature T. Air rises upwards through the upper horizontal boundary (5). Application of Convective Flux boundary condition assumes that convection dominates the transport of heat at this boundary.
MESH GENERATION

The following steps describe how to generate a mesh that properly resolves the velocity field near the wall without using an overly dense mesh in the far field. 1. In the Mesh menu, select Free Mesh Parameters (F9). 2. Switch to Boundary tab 3. Select boundaries 1, 3, and 4 in the boundary selection section while holding the Control (ctrl) key on your keyboard. 4. Enter 3e-4 in the Maximum element size edit field. 5. Switch to the Point tab.

-9-

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

6. Select point 2. 7. Enter 2e-5 in the Maximum element size edit field. 8. Click Remesh. 9. Click OK to close Free Mesh Parameters window.

You should get the following triangular mesh:

We are now ready to compute our solution.

- 10 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

COMPUTING AND SAVING THE SOLUTION

In this step we define the type of analysis to be performed. We are interested in stationary analysis here, which we previously selected in the Model Navigator. However, the problem is highly non linear. Several solver settings must be changed for successful convergence. To easily find an initial guess for the solution, start by solving the problem for a higher viscosity than the true value for air. Then decrease the viscosity until you reach the true value for air. Make the transition from the start value to the true value using the parametric solver in the following way: 1. In Solve menu, select Solver Parameters (F11). 2. Switch to Parametric solver. 3. Enter mu_air in the field for Name of parameter. 4. Enter 1e-4
1.817e-5

in the List of parameter values edit field.

5. Switch to Stationary tab and enable Highly nonlinear problem check box.

6. Switch to Advanced tab and select None from the Type of scaling list.

- 11 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

7. Click OK to close Solver Parameters window. 8. From the Solve menu select Solve Problem. (Allow few minutes for solution) This solution serves as the initial value for solving the model with higher plate temperatures, which you perform with these steps: 9. From the Solve menu select the Solver Manager. 10. Click Store Solution button on the bottom of the window.

11. Select 1.817e-5 as the Parameter value for solution to store. 12. Click OK.

13. In the Initial value area click the Stored solution radio button.

14. Click OK to close the Solver Manager. 15. From the Solve menu choose Solver Parameters (F11). 16. Enter dq in the field for Name of parameter. 17. Enter 100:100:1000 in the List of parameter values edit field.

18. Switch to Stationary tab. 19. Disable Highly nonlinear problem check box. - 12 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

20. Click OK to close Solver parameters window. We will now use the initial value solution to find solutions to higher plate temperatures. 21. From the Solve menu select the Solver Manager. (Allow few minutes for solution) 22. 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 surface color maps. By default, temperature field is shown for the case when plate surface heat flux is 1000 W/m2, as asked in problem statement.

By default, your immediate result will be given in Kelvin instead of degrees Celsius for temperature field. 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 colormap of air density field, plots of axial velocity u(x, yo) and temperature T(x, yo) at yo = 6 cm, and a plot of surface temperature Ts(y) on 0 y L . We will then use MATALB to compute and re plot COMSOL surface temperature Ts(y) and verify this result against correlation 8.29a. A sample MATLAB script for COMSOL results verification is given in appendix.

- 13 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

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, plotting and extracting numerical data for surface temperature Ts(y) to a text file, and 1D temperature distribution plots. You will then address the questions of COMSOL solution validity and compare the results to correlation 8.29a mainly by using MATLAB.
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.

- 14 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

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 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 13. 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 x field and update your view by pressing Apply button. Notice the difference in velocity vector field representation. Try other values.

- 15 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

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.

- 16 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

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 Air Density Field Colormap

With the Plot Parameters window open, ensure that you are under the Surface tab, 7. Type rho 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 density . Note the values on the color scale and compare them with Appendix C of your textbook.

- 17 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

Plotting Axial Temperature T(x, yo) at yo = 6 cm

1. From Postprocessing menu select Cross Section Plot Parameters option. 2. Under General tab, select 1000 as the only Solution to use option.

3. Switch to the Line/Extrusion tab. 4. Change the Unit of temperature to degrees Celsius. 5. Change the x axis data from arc length to x. 6. Enter the following coordinates in the Cross section line data: x0 = 0, x1 = 0.105; y0 = y1 = 0.06. 7. Click Apply.

- 18 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

These steps produce a plot of T(x) at y = 6 cm, from x = 0 cm (plate surface) to x = 10.5 cm (ambient environment conditions). Temperature T is plotted on the y axis and x coordinates are plotted on the x axis. To save this plot, 8. Click the save button in your figure with results. This will bring up an Export Image window. 9. Follow steps 2 4 as instructed on page 16 to finish with exporting the image.
Plotting Axial Velocity u(x, yo) at yo = 6 cm

With Cross Section Plot Parameters window open, ensure that you are under the Line/Extrusion tab, 10. Type U_ns in Expression field (without quotation marks).

11. Click OK. (Note: The unit will change automatically) These steps produce a plot of u(x) at y = 6 cm, from x = 0 cm (plate surface) to x = 10.5 cm (ambient environment conditions). Axial velocity u is plotted on the y axis and x coordinates are plotted on the x axis. To save this plot, 12. Click the save button in your figure with results. This will bring up an Export Image window. 13. Follow steps 2 4 as instructed on page 16 to finish with exporting the image.
Plotting Surface Temperature Ts(y) on 0 y L

To plot Ts(y) on 0 y L 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. - 19 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

5. Change the x axis data from x to y. 6. Enter the following coordinates in the Cross section line data: x0 = x1 = 0; y0 = 0.01, and y1 = 0.11. 7. Click OK to close Cross Section Plot Parameters window.

As a result of these steps, a new plot will be shown that graphs Ts(y) on 0 y 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 previous step. in the Temperature time graph created

2. Click Browse and navigate to your saving folder (say Desktop). 3. Name the file ts.txt. (Note: do not forget to type the .txt extension in the name of the file). 4. Click OK to save the file. This completes COMSOL modeling procedures for this problem. - 20 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

Modeling with MATLAB

This part of modeling procedures describes how to create comparative graphs of plate surface temperature Ts(y) using MATLAB. Obtain MATLAB script file named heated_vplate.m from Blackboard prior to following these procedures. Save this file in the same directory as the data file(s) (ts.txt) from COMSOL. (Note: heated_vplate.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 heated_vplate.m in a proper directory) Comparing COMSOL Solution with Correlation Solution MATLAB script (heated_vplate.m) is programmed to re plot exported COMSOL data for plate surface temperature Ts(y). The script is also programmed to calculate analytic plate surface temperature Ts(y) according to correlation 8.29a (even though one of its criteria is not strictly satisfied!) The script will ultimately produce comparative graphs that will plot both solutions. Follow the steps below to complete this problem: 1. Open MATLAB by double clicking its icon on the Desktop. 2. Load heated_vplate.m file by selecting File Open Desktop heated_vplate.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 and correlation based solutions will be plotted in Figure 1. Figure 2 plots the percent error between plate surface temperatures Ts(y) according to the equation printed on the figure. These results are shown below. Results plotted with MATLAB:

- 21 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

While in MATLAB, you may zoom into the left plot to notice departures in results based on the solution methods. Error analysis shows that most of the error is concentrated at the bottom edge of the plate. Correlation 8.29a suggests that at y = 0, plate surface temperature should reach ambient temperature T. COMSOL solution gives temperature of nearly 48 degrees Celsius at y = 0. In practice, what do you think is closer to the truth? The following 2 graphs show axial velocity and temperature at yo = 6 cm. These graphs were previously obtained in COMSOL. They have been repotted with MATLAB. The range for abscissa was reduced to about 1.6 cm and 2.5 cm for velocity and temperature graphs, respectively, so that region of activity near the plate can be better examined.

Armed with these results, you are in a position to answer most of the assigned questions.

- 22 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

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 Transfer % Sample MATLAB Script For: % (X) Free Convection of Air over a Heated Vertical Plate % IMPORTANT: Save this file in the same directory with % "ts.txt" file. % ######################################################################### % %% Preliminaries clear % Clears variables from memory clc % Clears the UI prompt %% Constant Quantities Tinf = 20; % Ambient temperature, [degC] Tf = 90; % Film temperature, [degC] g = 9.81; % acc. due to gravity, [m/s^2] Cp = 1010.3; % at Tf rho = 0.9721; %% at Tf mu = 21.35e-6; % at Tf eta = 21.96e-6; % at Tf k = 0.03059; % at Tf Pr = 0.705; % at Tf alpha = eta/Pr; % at Tf beta = 1/(Tf + 273.15); % in Kelvin^(-1) qs = 1000; % Applied heat flux, [W/m^2] %% Temperature Data Import from COMSOL Multiphysics: load ts.txt; % Loads T(0,y) as a 2 column vector y = ts(:,1); % y - coords vector, [m] Ts = ts(:,2); % COMSOL plate surface temperature, [degC] y = y - min(y); % y - coord shift (necessary for correlation eq.!), [m] %% Correlation 8.29a Ta = Tinf + ... ((4+9*Pr^(1/2)+10*Pr)/Pr^2*(eta^2/(beta*g))*(qs/k)^4*y).^(1/5);%[degC] %% Error Analysis in h(y) errT = abs(Ts - Ta)./Ta*100; % Error in Ts, [%] %% y[m]-->y[cm] y = y*100; % y - coord [m]-->[cm] conversion, [cm] %% Plotter figure1 = figure('InvertHardcopy','off',... %\ 'Colormap',[1 1 1 ],... % | -> Setting up the figure 'Color',[1 1 1]); %/ plot(y,Ts,'k',y,Ta,'k--'); % Plotting grid on box off title('\fontname{Times New Roman} \fontsize{16} \bf Plate Surface Temperature T_s') xlabel('\fontname{Times New Roman} \fontsize{14} \it \bf y, [cm]') ylabel('\fontname{Times New Roman} \fontsize{14} \it \bf T_s , [\circC]') legend('COMSOL Solution','Correlation 8.29a','location','southeast') % % figure2 = figure('InvertHardcopy','off',... %\

- 23 -

ADOPTED FROM COMSOL HEAT TRANSFER MODULE USER GUIDE

Free Convection of Air Over a Heated Vertical Plate

ME433 COMSOL INSTRUCTTIONS

'Colormap',[1 1 1 ],... % | -> Setting up the figure 'Color',[1 1 1]); %/ plot(y,errT,'k'); % Plotting grid on box off title('\fontname{Times New Roman} \fontsize{16} \bf Error Analysis') xlabel('\fontname{Times New Roman} \fontsize{14} \it \bf y, [cm]') ylabel('\fontname{Times New Roman} \fontsize{14} \it \bf Error in T_s , [%]') str1(1) = {'$${\%err={T_{s_{comsol}}-T_{s_{8.29a}}\over T_{s_{8.29a}}}\times 100} $$'}; text('units','normalized', 'position',[.32 .9], ... 'fontsize',14,... 'FontName', 'Times New Roman',... 'FontAngle', 'italic', ... 'BackgroundColor',[1 1 1],... 'interpreter','latex',... 'string', str1); %% COMSOL u(x,y0) and T(x,y0) Re-plots % ######################################################################### % Unsuppress this portion only if you wich to re-plot COMSOL u(x,y0) and % T(x,y0). Prior to reploting, make sure to extract numerical data for % velocity and temperature to text files. You must name the files as: % "velfield.txt" and "tempfield.txt" for velocity and remperature fields, % respectively and place then in the same directory as this script. % ######################################################################### % load velfield.txt; % Loads u(x,y0) as a 2 column vector % load tempfield.txt; % Loads T(x,y0) as a 2 column vector % y1 = velfield(:,1)*100; % y - coords, [cm] % u1 = velfield(:,2); % u(x), [m/s] % t1 = tempfield(:,2); % T(x), [degC] % % figure3 = figure('InvertHardcopy','off',... %\ % 'Colormap',[1 1 1 ],... % | -> Setting up the figure % 'Color',[1 1 1]); %/ % plot(y1,u1,'k--'); % Plotting % grid on % box off % title('\fontname{Times New Roman} \fontsize{16} \bf Axial velocity u at y_o = 6 cm') % xlabel('\fontname{Times New Roman} \fontsize{14} \it \bf y, [cm]') % ylabel('\fontname{Times New Roman} \fontsize{14} \it \bf u (x, y_o) , [m/s]') % %\ % figure4 = figure('InvertHardcopy','off',... % 'Colormap',[1 1 1 ],... % | -> Setting up the figure % 'Color',[1 1 1]); %/ % plot(y1,t1,'k--'); % Plotting % grid on % box off % title('\fontname{Times New Roman} \fontsize{16} \bf Axial temperature T at y_o = 6 cm') % xlabel('\fontname{Times New Roman} \fontsize{14} \it \bf y, [cm]') % ylabel('\fontname{Times New Roman} \fontsize{14} \it \bf T (x, y_o) , [\circC]')

This completes MATLAB modeling procedures for this problem.

- 24 -

Вам также может понравиться