def pot_chem_dp_excess(self, c, ion_size, x_pair, a1_d=1, a2_d=1): """ Excess chemical potential of the dipole function :param c: concentration of ions (both + and -) mols/litre (M) :param ion_size: ionic size (in Angstrom) :param x_pair: fraction of Bjerrum pairs :param a1_d: dipole distance, in units of ion_size :param a2_d: diameter of enclosing dipole, in units of ion_size :return: excess chemical potential (ndarray) """ l_dh = dh.DebyeHuckel(self.bjerrum_object).debye_length( (1 - x_pair) * c) rho = un.mol_lit_2_mol_angstrom(c) * ion_size**3 rho1 = 0.5 * rho * (1 - x_pair) rho2 = 0.5 * rho * x_pair z = ion_size / l_dh t_star = self.bjerrum_object.temp_star(ion_size) mu_0 = -z**2 * a1_d**2 * self.omega(z * a2_d) / (t_star * a2_d) val1 = -z**2 * a1_d**2 * rho2 * self.omega( z * a2_d) / (t_star * a2_d**3) val2 = self.der_x2omega(z * a2_d) * z * a2_d mu_p = val1 * val2 * 0.5 * rho1 return np.array([mu_p, mu_p, mu_0])
def pressure_hc_excess(self, c, ion_size): """ Excess pressure for the hard core :param c: concentration of the different species mols/litre (M) :param ion_size: ionic size (in Angstrom) :return: excess pressure (float) """ cc_molecular = un.mol_lit_2_mol_angstrom(c) arg_vol = np.dot(self.b_fac, cc_molecular) * ion_size**3 pressure_hc_excess = np.sum(cc_molecular, axis=0) / (1 - arg_vol) return pressure_hc_excess
def debye_length(self, c): """ Debye length according to :cite:`Levin1996` .. math:: :label: debye_length \\lambda_D = \\frac{1}{\\sqrt{4\\pi l_B(T)n_1}} :param c: Concentration of ions (both + and -) mols/litre (M) """ c_m = un.mol_lit_2_mol_angstrom(c) debye_length = 1.0 / np.sqrt( 4 * np.pi * c_m * self.bjerrum_object.bjerrum_length) return debye_length
def free_energy_hc_excess(self, c, ion_size): """ Excess free energy of the hard core :param c: concentration of the different species mols/litre (M) :param ion_size: ionic size (in Angstrom) :return: excess free energy (ndarray) """ cc_molecular = un.mol_lit_2_mol_angstrom(c) arg_vol = np.dot(self.b_fac, cc_molecular) * ion_size**3 free_energy_hc_excess = np.sum(cc_molecular, axis=0) * np.log(1 - arg_vol) return free_energy_hc_excess
def pot_chem_hc_excess(self, c, ion_size): """ Excess chemical potential of the hard core :param c: concentration of the different species mols/litre (M) :param ion_size: ionic size (in Angstrom) :return: excess chemical potential (float) """ cc_molecular = un.mol_lit_2_mol_angstrom(c) arg_vol = np.dot(self.b_fac, cc_molecular) * ion_size**3 t1 = -np.log(1 - arg_vol) t2 = ion_size**3 * np.sum(cc_molecular, axis=0) / (1 - arg_vol) pot_chem_hc_excess = np.outer(self.b_fac, t2) + t1 return pot_chem_hc_excess
def free_energy_dp_excess(self, c, ion_size, x_pair, a1_d=1, a2_d=1): """ Excess free energy of the dipole function :param c: concentration of ions (both + and -) mols/litre (M) :param ion_size: ionic size (in Angstrom) :param x_pair: fraction of Bjerrum pairs :param a1_d: dipole distance, in units of ion_size :param a2_d: diameter of enclosing dipole, in units of ion_size :return: excess free energy in units of :math:`ion\\_size^3` (float) """ l_dh = dh.DebyeHuckel(self.bjerrum_object).debye_length( (1 - x_pair) * c) rho2 = un.mol_lit_2_mol_angstrom(c) * x_pair * 0.5 * ion_size**3 z = ion_size / l_dh t_star = self.bjerrum_object.temp_star(ion_size) f_dip = -z**2 * a1_d**2 * rho2 * self.omega(z * a2_d) / (t_star * a2_d) return f_dip
def test_mol_lit_conversion(self): # 1 Mol/litre = to Molecule /A^3 self.assertEqual(un.mol_lit_2_mol_angstrom(1), un.avogadro() / (1e-3 * un.m_2_angstrom(1)**3))