Calculating Viscosity of Gas Mixture 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 mixmu to find the viscosity of the mixture 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 mixmu details:

function mu=mixmu(zs,T,j)
% mixmu(zs,T,j) finds the viscosity of a low density gas mixture
% zs gives the mol fraction of each compound
% T gives the temperature in the units of Tdeg
% j gives the indices of the compounds (if missing it includes
%   all compounds.  zs must be consistent with j.
% Based on equations 1.4-19 and 20 in BS&L
% The viscosity is given in kg/m/s
global mw
if nargin<3
   j=1:length(mw);
end
[phi,mus]=mixphi(T,j);
den=phi*zs';
mu=zs*(mus./den);
___________________________
Using mixmu to compute the viscosity of the mixture:
>> mixmu([0.133 0.039 0.828],293,1:3)
ans =
       1.7084e-05   kg/m/s

or in BS&L units:
       1.7084e-04   g/cm/s

and this turns out to be fairly close to the answer calculated in the book.