@@ -313,11 +313,19 @@ impl<U: EosUnit, E: EquationOfState> State<U, E> {
313313 & ( arr1 ( & [ 1.0 ] ) * U :: reference_moles ( ) ) ,
314314 crate :: DensityInitialization :: Liquid ,
315315 ) ?;
316- state. ln_phi ( ) [ 0 ]
316+ Ok ( state. ln_phi ( ) [ 0 ] )
317317 } )
318318 . collect ( )
319319 }
320320
321+ /// Activity coefficient $\ln \gamma_i = \ln \varphi_i(T, p, \mathbf{N}) - \ln \varphi_i(T, p)$
322+ pub fn ln_symmetric_activity_coefficient ( & self ) -> EosResult < Array1 < f64 > > {
323+ match self . eos . components ( ) {
324+ 1 => Ok ( arr1 ( & [ 0.0 ] ) ) ,
325+ _ => Ok ( self . ln_phi ( ) - & self . ln_phi_pure ( ) ?) ,
326+ }
327+ }
328+
321329 /// Partial derivative of the logarithm of the fugacity coefficient w.r.t. temperature: $\left(\frac{\partial\ln\varphi_i}{\partial T}\right)_{p,N_i}$
322330 pub fn dln_phi_dt ( & self ) -> QuantityArray1 < U > {
323331 let func = |s : & Self , evaluate : Evaluate | {
@@ -489,11 +497,6 @@ impl<U: EosUnit, E: EquationOfState> State<U, E> {
489497 . unwrap ( )
490498 }
491499
492- /// Activity coefficient $\ln \gamma_i = \ln \varphi_i(T, p, \mathbf{N}) - \ln \varphi_i(T, p)$
493- pub fn ln_symmetric_activity_coefficient ( & self ) -> Array1 < f64 > {
494- self . ln_phi ( ) - self . ln_phi_pure ( )
495- }
496-
497500 /// Helmholtz energy $A$ evaluated for each contribution of the equation of state.
498501 pub fn helmholtz_energy_contributions ( & self ) -> Vec < ( String , QuantityScalar < U > ) > {
499502 let new_state = self . derive0 ( ) ;
0 commit comments