Cell voltage

This file represents the equations for calculating the cell voltage. It is a component of the fuel cell model.

calculate_cell_voltage(variables, operating_inputs, parameters)

This function calculates the cell voltage at each time step.

Parameters:
  • variables (dict) –

    The dictionary containing the variables calculated by the solver.

  • operating_inputs (dict) –

    The dictionary containing the operating inputs.

  • parameters (dict) –

    The dictionary containing the parameters.

Returns:
  • Ucell_t( list ) –

    The cell voltage at each time step.

Source code in model/cell_voltage.py
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
def calculate_cell_voltage(variables, operating_inputs, parameters):
    """This function calculates the cell voltage at each time step.

    Parameters
    ----------
    variables : dict
        The dictionary containing the variables calculated by the solver.
    operating_inputs : dict
        The dictionary containing the operating inputs.
    parameters : dict
        The dictionary containing the parameters.

    Returns
    -------
    Ucell_t : list
        The cell voltage at each time step.
    """

    # Extraction of the variables
    t, lambda_mem_t, lambda_ccl_t = variables['t'], variables['lambda_mem'], variables['lambda_ccl']
    C_H2_acl_t, C_O2_ccl_t, eta_c_t = variables['C_H2_acl'], variables['C_O2_ccl'], variables['eta_c']
    T_acl_t, T_mem_t, T_ccl_t = variables['T_acl'], variables['T_mem'], variables['T_ccl']
    # Extraction of the operating inputs and the parameters
    Hmem, Hcl, epsilon_mc, tau = parameters['Hmem'], parameters['Hcl'], parameters['epsilon_mc'], parameters['tau']
    Re, kappa_co = parameters['Re'], parameters['kappa_co']

    # Initialisation
    n = len(t)
    Ucell_t = [0] * n

    # Loop for having Ucell_t at each time step
    for i in range(n):

        # Recovery of the already calculated variable values at each time step
        lambda_mem, lambda_ccl = lambda_mem_t[i], lambda_ccl_t[i]
        C_H2_acl, C_O2_ccl = C_H2_acl_t[i], C_O2_ccl_t[i]
        T_acl, T_mem, T_ccl = T_acl_t[i], T_mem_t[i], T_ccl_t[i]
        eta_c = eta_c_t[i]

        # Current density value at this time step
        i_fc = operating_inputs['current_density'](t[i], parameters)

        # The equilibrium potential
        Ueq = E0 - 8.5e-4 * (T_ccl - 298.15) + R * T_ccl / (2 * F) * (math.log(R * T_acl * C_H2_acl / Pref) +
                                                                  0.5 * math.log(R * T_ccl * C_O2_ccl / Pref))

        # The crossover current density
        T_acl_mem_ccl = average([T_acl, T_mem, T_ccl],
                                   weights=[Hcl/(2*Hcl + Hmem), Hmem/(2*Hcl + Hmem), Hcl/(2*Hcl + Hmem)])
        i_H2 = 2 * F * R * T_acl_mem_ccl / Hmem * C_H2_acl * k_H2(lambda_mem, T_mem, kappa_co)
        i_O2 = 4 * F * R * T_acl_mem_ccl / Hmem * C_O2_ccl * k_O2(lambda_mem, T_mem, kappa_co)
        i_n = i_H2 + i_O2

        # The proton resistance
        #       The proton resistance at the membrane : Rmem
        Rmem = Hmem / sigma_p_eff('mem', lambda_mem, T_mem)
        #       The proton resistance at the cathode catalyst layer : Rccl
        Rccl = Hcl / sigma_p_eff('ccl', lambda_ccl, T_ccl, epsilon_mc)
        #       The total proton resistance
        Rp = Rmem + Rccl  # its value is around [4-7]e-6 ohm.m².

        # The cell voltage
        Ucell_t[i] = Ueq - eta_c - (i_fc + i_n) * (Rp + Re)
    return Ucell_t

calculate_eta_c_intermediate_values(solver_variables, operating_inputs, parameters)

This function calculates the intermediate values needed for the calculation of the cathode overpotential dynamic evolution.

Parameters:
  • solver_variables (dict) –

    The dictionary containing the variables calculated by the solver.

  • operating_inputs (dict) –

    The dictionary containing the operating inputs.

  • parameters (dict) –

    The dictionary containing the parameters.

Returns:
  • dict

    The dictionary containing the crossover current density i_n at time t, and the liquid water induced voltage drop function f_drop at time t.

Source code in model/cell_voltage.py
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
def calculate_eta_c_intermediate_values(solver_variables, operating_inputs, parameters):
    """This function calculates the intermediate values needed for the calculation of the cathode overpotential dynamic
    evolution.

    Parameters
    ----------
    solver_variables : dict
        The dictionary containing the variables calculated by the solver.
    operating_inputs : dict
        The dictionary containing the operating inputs.
    parameters : dict
        The dictionary containing the parameters.

    Returns
    -------
    dict
        The dictionary containing the crossover current density i_n at time t, and the liquid water induced voltage drop
        function f_drop at time t.
    """

    # Extraction of the variables
    s_ccl, lambda_mem = solver_variables['s_ccl'], solver_variables['lambda_mem']
    C_H2_acl, C_O2_ccl = solver_variables['C_H2_acl'], solver_variables['C_O2_ccl']
    T_acl, T_mem, T_ccl = solver_variables['T_acl'], solver_variables['T_mem'], solver_variables['T_ccl']
    # Extraction of the operating inputs and the parameters
    Pc_des = operating_inputs['Pc_des']
    Hmem, Hcl = parameters['Hmem'], parameters['Hcl']
    i0_c_ref, kappa_co, kappa_c = parameters['i0_c_ref'], parameters['kappa_co'], parameters['kappa_c']
    a_slim, b_slim, a_switch = parameters['a_slim'], parameters['b_slim'], parameters['a_switch']

    # The crossover current density i_n
    T_acl_mem_ccl = average([T_acl, T_mem, T_ccl],
                               weights=[Hcl / (2 * Hcl + Hmem), Hmem / (2 * Hcl + Hmem), Hcl / (2 * Hcl + Hmem)])
    i_H2 = 2 * F * R * T_acl_mem_ccl / Hmem * C_H2_acl * k_H2(lambda_mem, T_mem, kappa_co)
    i_O2 = 4 * F * R * T_acl_mem_ccl / Hmem * C_O2_ccl * k_O2(lambda_mem, T_mem, kappa_co)
    i_n = i_H2 + i_O2

    # The liquid water induced voltage drop function f_drop
    slim = a_slim * (Pc_des / 1e5) + b_slim
    s_switch = a_switch * slim
    f_drop = 0.5 * (1.0 - math.tanh((4 * s_ccl - 2 * slim - 2 * s_switch) / (slim - s_switch)))

    return {'i_n': i_n, 'f_drop': f_drop}