Home > utilities > SW_Viscosity.m

SW_Viscosity

PURPOSE ^

SW_Viscosity Dynamic viscosity of seawater

SYNOPSIS ^

function mu = SW_Viscosity(T,S)

DESCRIPTION ^

 SW_Viscosity    Dynamic viscosity of seawater
=========================================================================
 USAGE:  mu = SW_Viscosity(T,S)

 DESCRIPTION:
   Dynamic viscosity of seawater at atmospheric pressure (0.1 MPa) using 
   Eq. (22) given in [1] which best fit the data of [2], [3] and [4]. 
   The pure water viscosity equation is a best fit to the data of [5]. 
   Values at temperature higher than the normal boiling temperature 
   are calculated at the saturation pressure.

 INPUT:  (all must have same dimensions)
   T = temperature [degree C] (ITS-90)
   S = salinity    [g/kg] (reference-composition salinity)

 OUTPUT:
   mu = dynamic viscosity  [kg/m s]

 AUTHOR:  
   Mostafa H. Sharqawy 12-18-2009, MIT (mhamed@mit.edu)

 DISCLAIMER:
   This software is provided "as is" without warranty of any kind.
   See the file sw_copy.m for conditions of use and licence.
 
 VALIDITY: 0 < T < 180 C and 0 < S < 150 g/kg;
 
 ACCURACY: 1.5%
 
 REFERENCES:
   [1] Sharqawy M. H., Lienhard J. H., and Zubair, S. M., Desalination and Water Treatment, 2009
   [2] B. M. Fabuss, A. Korosi, and D. F. Othmer, J., Chem. Eng. Data 14(2), 192, 1969.
   [3] J. D. Isdale, C. M. Spence, and J. S. Tudhope, Desalination, 10(4), 319 - 328, 1972
   [4] F. J. Millero, The Sea, Vol. 5, 3 � 80, John Wiley, New York, 1974
   [5] IAPWS release on the viscosity of ordinary water substance 2008
=========================================================================

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mu = SW_Viscosity(T,S)
0002 % SW_Viscosity    Dynamic viscosity of seawater
0003 %=========================================================================
0004 % USAGE:  mu = SW_Viscosity(T,S)
0005 %
0006 % DESCRIPTION:
0007 %   Dynamic viscosity of seawater at atmospheric pressure (0.1 MPa) using
0008 %   Eq. (22) given in [1] which best fit the data of [2], [3] and [4].
0009 %   The pure water viscosity equation is a best fit to the data of [5].
0010 %   Values at temperature higher than the normal boiling temperature
0011 %   are calculated at the saturation pressure.
0012 %
0013 % INPUT:  (all must have same dimensions)
0014 %   T = temperature [degree C] (ITS-90)
0015 %   S = salinity    [g/kg] (reference-composition salinity)
0016 %
0017 % OUTPUT:
0018 %   mu = dynamic viscosity  [kg/m s]
0019 %
0020 % AUTHOR:
0021 %   Mostafa H. Sharqawy 12-18-2009, MIT (mhamed@mit.edu)
0022 %
0023 % DISCLAIMER:
0024 %   This software is provided "as is" without warranty of any kind.
0025 %   See the file sw_copy.m for conditions of use and licence.
0026 %
0027 % VALIDITY: 0 < T < 180 C and 0 < S < 150 g/kg;
0028 %
0029 % ACCURACY: 1.5%
0030 %
0031 % REFERENCES:
0032 %   [1] Sharqawy M. H., Lienhard J. H., and Zubair, S. M., Desalination and Water Treatment, 2009
0033 %   [2] B. M. Fabuss, A. Korosi, and D. F. Othmer, J., Chem. Eng. Data 14(2), 192, 1969.
0034 %   [3] J. D. Isdale, C. M. Spence, and J. S. Tudhope, Desalination, 10(4), 319 - 328, 1972
0035 %   [4] F. J. Millero, The Sea, Vol. 5, 3 � 80, John Wiley, New York, 1974
0036 %   [5] IAPWS release on the viscosity of ordinary water substance 2008
0037 %=========================================================================
0038 
0039 %----------------------
0040 % CHECK INPUT ARGUMENTS
0041 %----------------------
0042 if nargin ~=2
0043     error('SW_Viscosity.m: Must pass 2 parameters')
0044 end
0045 
0046 % CHECK S,T dimensions and verify consistent
0047 [ms,ns] = size(S);
0048 [mt,nt] = size(T);
0049 
0050 % CHECK THAT S & T HAVE SAME SHAPE
0051 if (ms~=mt) | (ns~=nt)
0052     error('check_stp: S & T must have same dimensions')
0053 end
0054 
0055 % CHECK THAT S & T ARE WITHIN THE FUNCTION RANGE
0056 vectorsize=size(S);
0057 for i = 1:vectorsize(1,1)
0058     for j = 1:vectorsize(1,2)
0059         if T(i,j)<0 | T(i,j)>180
0060             disp('Temperature is out of range for Viscosity function 10<T<180 C');
0061         end
0062         if S(i,j)<0 | S(i,j)>150
0063             disp('Salinity is out of range for Viscosity function 0<S<150 g/kg');
0064         end
0065         
0066         %------
0067         % BEGIN
0068         %------
0069         S(i,j)=S(i,j)/1000;
0070         a1 = 1.5700386464E-01;a2 = 6.4992620050E+01;a3 = -9.1296496657E+01;a4 = 4.2844324477E-05;
0071         mu_w(i,j) = a4 + 1/(a1*(T(i,j)+a2)^2+a3);
0072         a5 = 1.5409136040E+00;a6 = 1.9981117208E-02;a7 = -9.5203865864E-05;
0073         a8 = 7.9739318223E+00;a9 = -7.5614568881E-02;a10 = 4.7237011074E-04;
0074         A = a5 + a6 * T(i,j) + a7 * T(i,j)^2;
0075         B = a8 + a9 * T(i,j) + a10* T(i,j)^2;
0076         mu(i,j) = mu_w(i,j)*(1 + A*S(i,j) + B*S(i,j)^2);
0077     end
0078 end
0079 end

Generated on Wed 20-Feb-2019 16:06:01 by m2html © 2005