Calculating Viscosities of Gases in Matlab

To begin, run a start301 session to load your compound data, choosing to:
- Start a new session
- Mass & Energy Balances
- Use Ceng 301 Database
- Use temperature units of Kelvin
- Input a file name (or not!)
- Input the number of compounds ( in this case 3)
- Enter the names of compounds (CO2, O2, N2)
- With zero reactions
- With zero streams

Matlab now has your data loaded, and you can use the program mucalc to find the viscosity of these compounds at a low density.  A help on the program will explain the arguments and the output.  (NOTE: Watch your units - this program gives viscosity in kg/m/s when BS&L uses g/cm/s.)
_______________________

The program mucalc details:

function MU = mucalc(T,index)

% Chapman-Enskog formula for viscosity of monatomic and polyatomic gases
%
% function MU = mucalc(T,index)
%
% Argument List:
%   T     [=] temperature in the units of Tdeg
%   index [=] index of compounds in cnms whose viscosities are to be found
%              (If this argument is omitted, all viscosities will be found.)
% Returns:
%   MU    [=] viscosity in units of kg/m/s
%
% Ex:  >> clear
%      >> start402
%      >> mu = mucalc(298, 1)
%      mu =
%         0.2296e-04                                Created 3/21/95-2 Jim Lee

global mw lenjones

lj = checklj;

M=mw';
T=at(T);
if nargin==1
  [omega_mu k D] = omegacalc(T./lj(:,2));
  MU = 2.6693e-6 * sqrt(M*T) ./ (lj(:,1).^2.*omega_mu);
else
  [omega_mu k D] = omegacalc(T./lj(index,2));
  MU = 2.6693e-6 * sqrt(M(index)*T) ./ (lj(index,1).^2.*omega_mu);
end
________________________
 

Using mucalc to compute the viscosities of the 3 compounds:
>>  mucalc(293,1:3)
ans =
      1.0e-04 *
        0.1462   kg/m/s
        0.2027   kg/m/s
        0.1747   kg/m/s

For the units to check with BS&L, we must convert:
      1.0e-03 *
        0.1462   g/cm/s
        0.2027   g/cm/s
        0.1747   g/cm/s

and these turn out to be fairly close to those given in the problem statement.