def bc_phie_ps(self, phie0_p, phie1_p, phie0_s, phie1_s, u0_p, u1_p, u0_s, u1_s, T0_p, T1_p, T0_s, T1_s): kapeff_p = coeffs.electrolyteConductCoeff(pe.eps, pe.brugg, (u0_p + u1_p) / 2, (T0_p + T1_p) / 2) kapeff_s = coeffs.electrolyteConductCoeff(self.eps, self.brugg, (u0_s + u1_s) / 2, (T0_s + T1_s) / 2) bc = -kapeff_p * (phie1_p - phie0_p) / pe.hx + kapeff_s * ( phie1_s - phie0_s) / sep.hx return bc.reshape()
def bc_phie_n(self, phie0_n, phie1_n, phie0_s, phie1_s, u0_n, u1_n, u0_s, u1_s, T0_n, T1_n, T0_s, T1_s): kapeff_n = coeffs.electrolyteConductCoeff(pe.eps, pe.brugg, (u0_n + u1_n) / 2, (T0_n + T1_n) / 2) kapeff_s = coeffs.electrolyteConductCoeff(pe.eps, pe.brugg, (u0_s + u1_s) / 2, (T0_s + T1_s) / 2) bc = -kapeff_s * (phie1_s - phie0_s) / sep.hx + kapeff_n * ( phie1_n - phie0_n) / ne.hx return bc.reshape()
def Qohm(self, phien, phiep, un, up, uc, T): eps = self.eps brugg = self.brugg hx = self.hx kapeff = coeffs.electrolyteConductCoeff(eps, brugg, uc, T) ans = kapeff*( (phiep - phien)/(2*hx) )**2 + \ (2*kapeff*R*T/F)*(1-trans)*( (np.log(up) - np.log(un))/(2*hx) )*( (phiep - phien)/(2*hx) ) return ans
def electrolyte_poten(self, un, uc, up, phien, phiec, phiep, Tn, Tc, Tp): eps = self.eps brugg = self.brugg hx = self.hx umid_r = (up + uc) / 2 umid_l = (un + uc) / 2 Tmid_r = (Tp + Tc) / 2 Tmid_l = (Tn + Tc) / 2 kapeff_r = coeffs.electrolyteConductCoeff(eps, brugg, umid_r, Tmid_r) kapeff_l = coeffs.electrolyteConductCoeff(eps, brugg, umid_l, Tmid_l) ans = - ( kapeff_r*(phiep - phiec)/hx - kapeff_l*(phiec - phien)/hx )/hx + gamma*( kapeff_r*Tmid_r*(np.log(up) - np.log(uc))/hx \ - kapeff_l*Tmid_l*(np.log(uc) - np.log(un))/hx )/hx return ans.reshape()
def electrolyte_poten_phi(self, un, uc, up, phien, phiec, phiep, Tn, Tc, Tp, phisn, phisc, phisp): eps = self.eps brugg = self.brugg hx = self.hx # a = self.a; sigeff = self.sigma * (1 - self.eps - self.epsf) umid_r = (up + uc) / 2 umid_l = (un + uc) / 2 Tmid_r = (Tp + Tc) / 2 Tmid_l = (Tn + Tc) / 2 kapeff_r = coeffs.electrolyteConductCoeff(eps, brugg, umid_r, Tmid_r) kapeff_l = coeffs.electrolyteConductCoeff(eps, brugg, umid_l, Tmid_l) ans = sigeff*( phisn - 2*phisc + phisp)/hx**2 + (kapeff_r*(phiep - phiec)/hx \ - kapeff_l*(phiec - phien)/hx)/hx \ - gamma*(kapeff_r*Tmid_r*(np.log(up) - \ np.log(uc))/hx \ - kapeff_l*Tmid_l*(np.log(uc) - \ np.log(un))/hx )/hx return ans.reshape()