Exemplo n.º 1
0
def open_circuit(c_n_surf, c_p_surf, T0, T1, param):
    """
    Computes the open circuit voltage.
    Parameters
    ----------
    c_n_surf: array_like
        The value of the concetration at the surface of the negative electrode
        particle.
    c_n_surf: array_like
        The value of the concetration at the surface of the negative electrode
        particle.
    c_e: array_like
        Array of the electrolyte concetration.
    T0: array_like
        Array of the leading-order temperature.
    T1: array_like
        Array of the first-order temperature.
    param: object
        Object containing model parameters.
    Returns
    ----------
    float
        The open circuit voltage.
    """
    U_eq = (
        ocp.U_p(c_p_surf, T0, param) - ocp.U_n(c_n_surf, T0, param) +
        param.delta *
        (ocp.dUdT_p(c_p_surf, param) * T1 - ocp.dUdT_n(c_n_surf, param) * T1))
    return U_eq
Exemplo n.º 2
0
def plot_OCP(soln, mesh, param):
    # Get variables
    c_n, c_p, c_e_n, c_e_s, c_e_p, T0, T1 = get_vars_time(soln.y, mesh)
    t = soln.t

    # Surface concentration for BV
    c_n_surf = c_n[-1, :] + (c_n[-1, :] - c_n[-2, :]) / 2
    c_p_surf = c_p[-1, :] + (c_p[-1, :] - c_p[-2, :]) / 2

    # LIONSIMBA results
    # t column 0, OCP 14 - 17
    t_LION, U_n, U_p, dUdT_n, dUdT_p = np.loadtxt('LIONSIMBA001_t.txt',
                                                  usecols=(0, 14, 15, 16, 17),
                                                  unpack=True)
    # Font stuff
    plt.rc('text', usetex=True)
    plt.rc('font', family='serif')

    # Plot OCP and entropic coefficient at a fixed T
    fig = plt.figure()
    plt.subplot(2, 2, 1)
    plt.plot(t * param.tau_d_star,
             ocp.U_n(c_n_surf, T0, param) * param.Phi_star)
    plt.plot(t_LION, U_n, 'o')
    plt.xlabel(r'$t$ [s]', fontsize=11)
    plt.ylabel(r'$U_{{\mathrm{{n}}}}$', fontsize=11)
    plt.subplot(2, 2, 3)
    plt.plot(t * param.tau_d_star,
             ocp.dUdT_n(c_n_surf, param) * param.Phi_star / param.Delta_T_star)
    plt.plot(t_LION, dUdT_n, 'o')
    plt.xlabel(r'$t$ [s]', fontsize=11)
    plt.ylabel(r'$\mathrm{{d}}U_{{\mathrm{{n}}}}$'
               r'$ / \mathrm{{d}}T$', fontsize=11)
    plt.subplot(2, 2, 2)
    plt.plot(t * param.tau_d_star,
             ocp.U_p(c_p_surf, T0, param) * param.Phi_star)
    plt.plot(t_LION, U_p, 'o')
    plt.xlabel(r'$t$ [s]', fontsize=11)
    plt.ylabel(r'$U_{{\mathrm{{p}}}}$', fontsize=11)
    plt.subplot(2, 2, 4)
    plt.plot(t * param.tau_d_star,
             ocp.dUdT_p(c_p_surf, param) * param.Phi_star / param.Delta_T_star)
    plt.plot(t_LION, dUdT_p, 'o')
    plt.xlabel(r'$t$ [s]', fontsize=11)
    plt.ylabel(r'$\mathrm{{d}}U_{{\mathrm{{p}}}}$'
               r'$ / \mathrm{{d}}T$', fontsize=11)
    fig.tight_layout()
Exemplo n.º 3
0
def rev_n_1(T, c_n_surf, param, I_app):
    """
    Computes first-order reversible heating in the negative electrode.
    Parameters
    ----------
    T: float
        First-order temperature at the current time.
    c_n_surf: float
        The value of the concetration at the surface of the negative electrode
        particle.
    param: object
        Object containing model parameters.
    I_app: float
        The applied current.
    Returns
    ----------
    float
        The first-order reversible heating in the negative electrode.
    """
    result = ((I_app / param.Ly) * T * ocp.dUdT_n(c_n_surf, param))
    return result / param.L
Exemplo n.º 4
0
def rev_n_0(T0, c_n_surf, param, I_app):
    """
    Computes leading-order reversible heating in the negative electrode.
    Parameters
    ----------
    T0: float
        The leading-order bulk temperature.
    c_n_surf: float
        The value of the concetration at the surface of the negative electrode
        particle.
    param: object
        Object containing model parameters.
    I_app: float
        The applied current.
    Returns
    ----------
    float
        The leading-order reversible heating.
    """
    result = ((I_app / param.Ly) * (1 / param.Theta + T0) *
              (ocp.dUdT_n(c_n_surf, param)))
    return result / param.L
Exemplo n.º 5
0
def plot_OCP(c, T, param):
    # Font stuff
    plt.rc("text", usetex=True)
    plt.rc("font", family="serif")

    # Plot OCP and entropic coefficient at a fixed T
    fig = plt.figure()
    plt.subplot(2, 2, 1)
    plt.plot(c, ocp.U_n(c, T, param) * param.Phi_star)
    plt.xlabel(r"$c_{{\mathrm{{n}}}}$")
    plt.ylabel(r"$U_{{\mathrm{{n}}}}$")
    plt.subplot(2, 2, 3)
    plt.plot(c, ocp.dUdT_n(c, param) * param.Phi_star / param.Delta_T_star)
    plt.xlabel(r"$c_{{\mathrm{{n}}}}$")
    plt.ylabel(r"$\frac{{\mathrm{{d}} U_{{\mathrm{{n}}}}}}{{\mathrm{{d}}T}}$")
    plt.subplot(2, 2, 2)
    plt.plot(c, ocp.U_p(c, T, param) * param.Phi_star)
    plt.xlabel(r"$c_{{\mathrm{{p}}}}$")
    plt.ylabel(r"$U_{{\mathrm{{p}}}}$")
    plt.subplot(2, 2, 4)
    plt.plot(c, ocp.dUdT_p(c, param) * param.Phi_star / param.Delta_T_star)
    plt.xlabel(r"$c_{{\mathrm{{p}}}}$")
    plt.ylabel(r"$\frac{{\mathrm{{d}} U_{{\mathrm{{p}}}}}}{{\mathrm{{d}}T}}$")
    fig.tight_layout()