@@ -314,11 +314,19 @@ impl<U: EosUnit, E: EquationOfState> State<U, E> {
314314 & ( arr1 ( & [ 1.0 ] ) * U :: reference_moles ( ) ) ,
315315 crate :: DensityInitialization :: Liquid ,
316316 ) ?;
317- state. ln_phi ( ) [ 0 ]
317+ Ok ( state. ln_phi ( ) [ 0 ] )
318318 } )
319319 . collect ( )
320320 }
321321
322+ /// Activity coefficient $\ln \gamma_i = \ln \varphi_i(T, p, \mathbf{N}) - \ln \varphi_i(T, p)$
323+ pub fn ln_symmetric_activity_coefficient ( & self ) -> EosResult < Array1 < f64 > > {
324+ match self . eos . components ( ) {
325+ 1 => Ok ( arr1 ( & [ 0.0 ] ) ) ,
326+ _ => Ok ( self . ln_phi ( ) - & self . ln_phi_pure ( ) ?) ,
327+ }
328+ }
329+
322330 /// 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}$
323331 pub fn dln_phi_dt ( & self ) -> QuantityArray1 < U > {
324332 let func = |s : & Self , evaluate : Evaluate | {
@@ -490,11 +498,6 @@ impl<U: EosUnit, E: EquationOfState> State<U, E> {
490498 . unwrap ( )
491499 }
492500
493- /// Activity coefficient $\ln \gamma_i = \ln \varphi_i(T, p, \mathbf{N}) - \ln \varphi_i(T, p)$
494- pub fn ln_symmetric_activity_coefficient ( & self ) -> Array1 < f64 > {
495- self . ln_phi ( ) - self . ln_phi_pure ( )
496- }
497-
498501 /// Helmholtz energy $A$ evaluated for each contribution of the equation of state.
499502 pub fn helmholtz_energy_contributions ( & self ) -> Vec < ( String , QuantityScalar < U > ) > {
500503 let new_state = self . derive0 ( ) ;
0 commit comments