function tpws_SetUnit(unitSet)
% Description:      Defines the unit set for use with tpws.m
% -------------------------------------------------------------------------
% Syntax:           tpws_SetUnit(unitSet)
%                   unitSet     Name of desired unit set
% -------------------------------------------------------------------------
% Supported Units
% Temperature:      K, C, R, F
%
% Pressure:         MPa, kPa, Pa, psia, bar, atm
% 
% Specific Volume:  m3/kg, mL/g, m3/mol, L/mol, ft3/lbm, ft3/lbmol
%                     
% Energy:           kJ/kg, kJ/mol, kcal/g, kcal/mol, BTU/lbm, BTU/lbmol
%  (U, H)           
%  
% Energy 2:         kJ/kg K, kJ/mol K, J/mol K, kcal/g C, kcal/mol C    
%  (S, Cp, Cv)      cal/mol C, Btu/lbm F, Btu/lbmol F
% -------------------------------------------------------------------------
% Notes:            An unlimited number of custom unit sets may be created
%                   and stored in this file.  The structure of additional
%                   unit sets should follow the format:
%                       case {'Unit Set Name'}  
%                       tpwsUnits.T   = 'K';
%                       tpwsUnits.p   = 'MPa';
%                       tpwsUnits.v   = 'm3/kg';
%                       tpwsUnits.e   = 'kJ/kg';
%                       tpwsUnits.e2  = 'kJ/kg K';
%                   Notice that all units are CASE SENSITIVE!!!

global tpwsUnits

switch unitSet
    % IAPWS Standard
    case {'IAPWS','iapws'}  
        tpwsUnits.T   = 'K';
        tpwsUnits.p   = 'MPa';
        tpwsUnits.v   = 'm3/kg';
        tpwsUnits.e   = 'kJ/kg';
        tpwsUnits.e2  = 'kJ/kg K';
    % English Units
    case {'ENG','eng','english'}  
        tpwsUnits.T   = 'F';
        tpwsUnits.p   = 'psia';
        tpwsUnits.v   = 'ft3/lbm';
        tpwsUnits.e   = 'Btu/lbm';
        tpwsUnits.e2  = 'Btu/lbm F';
    % User Defined Set
    case {'Custom'}  
        tpwsUnits.T   = 'C';
        tpwsUnits.p   = 'atm';
        tpwsUnits.v   = 'L/mol';
        tpwsUnits.e   = 'kJ/mol';
        tpwsUnits.e2  = 'kJ/mol K';
end