% FLPROPS sample problem.
% By: Tom Ames                   Mark Cutler
%     thomaslames@gmail.com      markjcutler@gmail.com
% 
% The following example is problem 9-10a from "Fundamental Heat and Mass 
% Transfer, 6th Edition."  The problem statement reads as follows:
% 
% Determine the average convection heat transfer coefficient for the
% 2.5-m-high vertical walls of a home having respective interior air and
% wall surface temperatures of 20 and 10 C.

clc;
clear;

% Define air temperature (Ttinf) and wall temperature (Tw)
Tinf = 20;      % (C)
Tw = 10;        % (C)

% Convert from Celcius to Kelvin
Tinf = Tinf + 273.15;
Tw = Tw + 273.15;

% Define wall length (L) and gravity constant (grav)
L = 2.5;        % (m)
grav = 9.82;    % (m/s^2)

% Find film temperature for fluid property calculations
Tf = (Tinf + Tw)/2;

% Obtain fluid properties using FLPROPS
% For more information, type "help flprops" in the Command Window
[mu nu beta Pr k] = flprops('air',Tf,'mu','nu','beta','Pr','k');

% Calculate Grashoff and Rayleih numbers using equations 9.12 and 9.23
% respectively
Gr = grav*beta*abs(Tinf - Tw)*L^3/nu^2;
Ra = Pr*Gr;

% Calculate Nustel number using equation 9.26
num = 0.387*Ra^(1/6);
den = (1+ (0.492/Pr)^(9/16))^(8/27);
Nubar = (0.825 + num/den)^2;

% Calculate convection coefficient and display it in the Command Window.
hbar = k*Nubar/L

