@@ -6070,21 +6070,22 @@ viscosity(cxxSurface *surf_ptr)
60706070 Jones_Dole[6] contains the anion factor, 1 for Cl-, variable for other anions
60716071 f_z = (z * z + |z|) / 2, the contribution of the ion to mu_x, if z = 0: f_z = mu_x / m_i
60726072 f_I = variable, depends on d3_i > 1, or d3_i < 1.
6073+ tc is limited to 200 C.
6074+
60736075
60746076 A from Falkenhagen-Dole for a salt:
60756077 A = 4.3787e-14 * TK**1.5 / (eps_r**0.5)* (z1 + z2)**-0.5 / (D1 * D2) * psi
60766078 psi = (D1*z2 + D2*z1)/4 - z1*z2 * (D1-D2)**2 / ((D1*z1 + D2*z2)**0.5 + ((D1 + D2) * (z1 + z2))**0.5)**2
60776079 D1, z1 for the cation, D2, |z2| for the anion of the salt.
60786080 We use the harmonic mean of the Dw's, and the arithmetic mean of the z's,
60796081 both weighted by the equivalent concentration.
6080-
6081- tc is limited to 200 C.
60826082 */
60836083 LDBLE D1, D2, z1, z2, m_plus, m_min, eq_plus, eq_min, eq_dw_plus, eq_dw_min, t1, t2, t3, fan = 1 ;
6084- LDBLE A, psi, Bc = 0 , Dc = 0 , Dw = 0.0 , l_z, f_z, lm, V_an, m_an, V_Cl, l_moles, l_water, l_mu_x, dw_t_visc;
6084+ LDBLE A, psi, Bc = 0 , Dc = 0 , Dw = 0.0 , l_z, f_z, lm, V_an, m_an, V_Cl, tc, l_moles, l_water, l_mu_x, dw_t_visc;
60856085
60866086 m_plus = m_min = eq_plus = eq_min = eq_dw_plus = eq_dw_min = V_an = m_an = V_Cl = 0 ;
60876087
6088+ tc = (tc_x > 200 ) ? 200 : tc_x;
60886089 l_water = mass_water_aq_x;
60896090 l_mu_x = mu_x;
60906091
@@ -6103,8 +6104,6 @@ viscosity(cxxSurface *surf_ptr)
61036104 LDBLE ratio_surf_aq = mass_water_surfaces_x / mass_water_aq_x;
61046105 for (i1 = 0 ; i1 < i1_last; i1++)
61056106 {
6106- if (tc_x > 200 )
6107- goto highT;
61086107 Bc = Dc = Dw = m_plus = m_min = eq_plus = eq_min = eq_dw_plus = eq_dw_min = V_an = m_an = 0 ;
61096108 if (surf_ptr)
61106109 {
@@ -6182,7 +6181,7 @@ viscosity(cxxSurface *surf_ptr)
61826181 }
61836182 // find B * m and D * m * mu^d3
61846183 dw_t_visc = (s_x[i]->Jones_Dole [0 ] +
6185- s_x[i]->Jones_Dole [1 ] * exp (-s_x[i]->Jones_Dole [2 ] * tc_x )) * t1;
6184+ s_x[i]->Jones_Dole [1 ] * exp (-s_x[i]->Jones_Dole [2 ] * tc )) * t1;
61866185 Bc += dw_t_visc;
61876186 // define f_I from the exponent of the D * m^d3 term...
61886187 if (s_x[i]->Jones_Dole [5 ] >= 1 )
@@ -6191,7 +6190,7 @@ viscosity(cxxSurface *surf_ptr)
61916190 t2 = -0.8 / s_x[i]->Jones_Dole [5 ];
61926191 else
61936192 t2 = -1 ;
6194- t3 = (s_x[i]->Jones_Dole [3 ] * exp (-s_x[i]->Jones_Dole [4 ] * tc_x )) *
6193+ t3 = (s_x[i]->Jones_Dole [3 ] * exp (-s_x[i]->Jones_Dole [4 ] * tc )) *
61956194 t1 * (pow (l_mu_x, s_x[i]->Jones_Dole [5 ])*(1 + t2) + pow (t1 * f_z, s_x[i]->Jones_Dole [5 ])) / (2 + t2);
61966195 if (t3 < -1e-5 )
61976196 t3 = 0 ;
@@ -6260,35 +6259,28 @@ viscosity(cxxSurface *surf_ptr)
62606259 V_an /= m_an;
62616260 if (!V_Cl)
62626261 V_Cl = calc_vm_Cl ();
6263- if (V_an == V_Cl)
6264- fan = 1 ;
6265- else if (V_Cl >= 1 )
6262+ if (V_an && V_Cl)
62666263 fan = 2 - V_an / V_Cl;
62676264 else
6268- fan = 2 - V_an * mu_x ;
6269- // if (Dc < 0)
6270- // Dc = 0; // provisional...
6265+ fan = 1 ;
6266+ if (Dc < 0 )
6267+ Dc = 0 ; // provisional...
62716268 viscos += viscos_0 * fan * (Bc + Dc);
62726269 if (viscos < 0 )
62736270 {
62746271 viscos = viscos_0;
62756272 warning_msg (" viscosity < 0, reset to viscosity of pure water" );
62766273 }
6277-
6278- highT:
62796274 if (!surf_ptr)
62806275 {
6281- t1 = fabs (Bc + Dc);
62826276 for (i = 0 ; i < (int )this ->s_x .size (); i++)
62836277 {
62846278 if (s_x[i]->type != AQ && s_x[i]->type > HPLUS)
62856279 continue ;
6286- if (s_x[i]->lm < -9 )
6280+ if ((lm = s_x[i]->lm ) < -9 )
62876281 continue ;
6288- if (tc_x > 200 )
6289- s_x[i]->dw_t_visc = 0 ;
6290- else if (s_x[i]->Jones_Dole [0 ] || s_x[i]->Jones_Dole [1 ] || s_x[i]->Jones_Dole [3 ])
6291- s_x[i]->dw_t_visc /= t1;
6282+ if (s_x[i]->Jones_Dole [0 ] || s_x[i]->Jones_Dole [1 ] || s_x[i]->Jones_Dole [3 ])
6283+ s_x[i]->dw_t_visc /= (Bc + Dc);
62926284 }
62936285 }
62946286 else // if (surf_ptr->Get_calc_viscosity())
0 commit comments