Heat modules

This module is used to calculate intermediate values for the heat transfer calculation.

heat_transfer_int_values(sv, parameters)

This functions calculates intermediate values for the heat calculation.

Parameters:
  • sv (dict) –

    Variables calculated by the solver. They correspond to the fuel cell internal states. sv is a contraction of solver_variables for enhanced readability.

  • parameters (dict) –

    Parameters of the fuel cell model.

Returns:
  • k_th_eff_agc_agdl( float ) –

    Effective thermal diffusivity between the AGC and the first GDL layer (J.m-1.s-1.K-1).

  • k_th_eff_agdl_agdl( list of floats ) –

    List of effective thermal diffusivities between adjacent GDL layers on the anode side (J.m-1.s-1.K-1).

  • k_th_eff_agdl_atl( float ) –

    Effective thermal diffusivity between the last GDL layer and the anode transport layer (J.m-1.s-1.K-1).

  • k_th_eff_atl_atl( list ) –

    List of effective thermal diffusivities between adjacent transport layers on the anode side (J.m-1.s-1.K-1).

  • k_th_eff_atl_ampl( float ) –

    Effective thermal diffusivity between the anode transport layer and the first microporous layer (J.m-1.s-1.K-1).

  • k_th_eff_ampl_ampl( list of floats ) –

    List of effective thermal diffusivities between adjacent microporous layers on the anode side (J.m-1.s-1.K-1).

  • k_th_eff_ampl_acl( float ) –

    Effective thermal diffusivity between the anode microporous layer and the anode catalyst layer (J.m-1.s-1.K-1).

  • k_th_eff_acl_mem( float ) –

    Effective thermal diffusivity between the anode catalyst layer and the membrane (J.m-1.s-1.K-1).

  • k_th_eff_mem_ccl( float ) –

    Effective thermal diffusivity between the membrane and the cathode catalyst layer (J.m-1.s-1.K-1).

  • k_th_eff_ccl_cmpl( float ) –

    Effective thermal diffusivity between the cathode catalyst layer and the cathode microporous layer (J.m-1.s-1.K-1).

  • k_th_eff_cmpl_cmpl( list of floats ) –

    List of effective thermal diffusivities between adjacent microporous layers on the cathode side (J.m-1.s-1.K-1).

  • k_th_eff_cmpl_ctl( float ) –

    Effective thermal diffusivity between the last microporous layer and the cathode transport layer (J.m-1.s-1.K-1).

  • k_th_eff_ctl_ctl( list of floats ) –

    List of effective thermal diffusivities between adjacent transport layers on the cathode side (J.m-1.s-1.K-1).

  • k_th_eff_ctl_cgdl( float ) –

    Effective thermal diffusivity between the cathode transport layer and the first GDL layer (J.m-1.s-1.K-1).

  • k_th_eff_cgdl_cgdl( list of floats ) –

    List of effective thermal diffusivities between adjacent GDL layers on the cathode side (J.m-1.s-1.K-1).

  • k_th_eff_cgdl_cgc( float ) –

    Effective thermal diffusivity between the last GDL layer and the CGC (J.m-1.s-1.K-1).

Source code in modules/heat_modules.py
 14
 15
 16
 17
 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
 61
 62
 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
def heat_transfer_int_values(sv, parameters):
    """This functions calculates intermediate values for the heat calculation.

    Parameters
    ----------
    sv : dict
        Variables calculated by the solver. They correspond to the fuel cell internal states.
        sv is a contraction of solver_variables for enhanced readability.
    parameters : dict
        Parameters of the fuel cell model.

    Returns
    -------
    k_th_eff_agc_agdl : float
        Effective thermal diffusivity between the AGC and the first GDL layer (J.m-1.s-1.K-1).
    k_th_eff_agdl_agdl : list of floats
        List of effective thermal diffusivities between adjacent GDL layers on the anode side (J.m-1.s-1.K-1).
    k_th_eff_agdl_atl : float
        Effective thermal diffusivity between the last GDL layer and the anode transport layer (J.m-1.s-1.K-1).
    k_th_eff_atl_atl : list
        List of effective thermal diffusivities between adjacent transport layers on the anode side (J.m-1.s-1.K-1).
    k_th_eff_atl_ampl : float
        Effective thermal diffusivity between the anode transport layer and the first microporous layer (J.m-1.s-1.K-1).
    k_th_eff_ampl_ampl : list of floats
        List of effective thermal diffusivities between adjacent microporous layers on the anode side (J.m-1.s-1.K-1).
    k_th_eff_ampl_acl : float
        Effective thermal diffusivity between the anode microporous layer and the anode catalyst layer (J.m-1.s-1.K-1).
    k_th_eff_acl_mem : float
        Effective thermal diffusivity between the anode catalyst layer and the membrane (J.m-1.s-1.K-1).
    k_th_eff_mem_ccl : float
        Effective thermal diffusivity between the membrane and the cathode catalyst layer (J.m-1.s-1.K-1).
    k_th_eff_ccl_cmpl : float
        Effective thermal diffusivity between the cathode catalyst layer and the cathode microporous layer (J.m-1.s-1.K-1).
    k_th_eff_cmpl_cmpl : list of floats
        List of effective thermal diffusivities between adjacent microporous layers on the cathode side (J.m-1.s-1.K-1).
    k_th_eff_cmpl_ctl : float
        Effective thermal diffusivity between the last microporous layer and the cathode transport layer (J.m-1.s-1.K-1).
    k_th_eff_ctl_ctl : list of floats
        List of effective thermal diffusivities between adjacent transport layers on the cathode side (J.m-1.s-1.K-1).
    k_th_eff_ctl_cgdl : float
        Effective thermal diffusivity between the cathode transport layer and the first GDL layer (J.m-1.s-1.K-1).
    k_th_eff_cgdl_cgdl : list of floats
        List of effective thermal diffusivities between adjacent GDL layers on the cathode side (J.m-1.s-1.K-1).
    k_th_eff_cgdl_cgc : float
        Effective thermal diffusivity between the last GDL layer and the CGC (J.m-1.s-1.K-1).
    """

    # Extraction of the variables
    C_v_acl, C_v_ccl = sv['C_v_acl'], sv['C_v_ccl']
    s_acl, s_ccl = sv['s_acl'], sv['s_ccl']
    lambda_acl, lambda_mem, lambda_ccl = sv['lambda_acl'], sv['lambda_mem'], sv['lambda_ccl']
    C_H2_acl, C_O2_ccl = sv['C_H2_acl'], sv['C_O2_ccl']
    T_acl, T_mem, T_ccl = sv['T_acl'], sv['T_mem'], sv['T_ccl']

    # Extraction of the operating inputs and the parameters
    Hgdl, Hmpl, Hacl, Hccl = parameters['Hgdl'], parameters['Hmpl'], parameters['Hacl'], parameters['Hccl']
    Hmem, epsilon_mc, epsilon_gdl = parameters['Hmem'], parameters['epsilon_mc'], parameters['epsilon_gdl']
    epsilon_cl, epsilon_mpl = parameters['epsilon_cl'], parameters['epsilon_mpl']
    epsilon_c, nb_gc, nb_gdl, nb_mpl = parameters['epsilon_c'], parameters['nb_gc'], parameters['nb_gdl'], parameters['nb_mpl']

    # Calculation of intermediate values
    C_N2_a_mean = (sum(sv[f'C_N2_agc_{i}'] for i in range(1, nb_gc + 1)) / nb_gc)
    C_N2_c_mean = (sum(sv[f'C_N2_cgc_{i}'] for i in range(1, nb_gc + 1)) / nb_gc)
    Hgdl_node = Hgdl / nb_gdl
    Hmpl_node = Hmpl / nb_mpl

    # Weighted harmonic means of the effective thermal diffusivity
    k_th_eff_agc_agdl = k_th_eff('agdl', sv[f'T_agdl_{1}'], C_v=sv[f'C_v_agdl_{1}'], s=sv[f's_agdl_{1}'],
                                 C_H2=sv[f'C_H2_agdl_{1}'], C_N2=C_N2_a_mean, epsilon=epsilon_gdl, epsilon_c=epsilon_c)

    k_th_eff_agdl_agdl = [None] + [hmean([k_th_eff('agdl', sv[f'T_agdl_{i}'], C_v=sv[f'C_v_agdl_{i}'],
                                                   s=sv[f's_agdl_{i}'], C_H2=sv[f'C_H2_agdl_{i}'], C_N2=C_N2_a_mean, epsilon=epsilon_gdl,
                                                     epsilon_c=epsilon_c),
                                          k_th_eff('agdl', sv[f'T_agdl_{i + 1}'], C_v=sv[f'C_v_agdl_{i + 1}'],
                                                   s=sv[f's_agdl_{i + 1}'], C_H2=sv[f'C_H2_agdl_{i + 1}'], C_N2=C_N2_a_mean,
                                                   epsilon=epsilon_gdl, epsilon_c=epsilon_c)])
                                   for i in range(1, nb_gdl)]

    k_th_eff_agdl_ampl = hmean([k_th_eff('agdl', sv[f'T_agdl_{nb_gdl}'], C_v=sv[f'C_v_agdl_{nb_gdl}'],
                                               s=sv[f's_agdl_{nb_gdl}'], C_H2=sv[f'C_H2_agdl_{nb_gdl}'], C_N2=C_N2_a_mean,
                                               epsilon=epsilon_gdl, epsilon_c=epsilon_c),
                                     k_th_eff('ampl', sv[f'T_ampl_{1}'], C_v=sv[f'C_v_ampl_{1}'],
                                              s=sv[f's_ampl_{1}'], C_H2=sv[f'C_H2_ampl_{1}'], C_N2=C_N2_a_mean,
                                              epsilon=epsilon_mpl)],
                                   weights=[Hgdl_node / 2, Hmpl_node / 2])

    k_th_eff_ampl_ampl = [None] + [hmean([k_th_eff('ampl', sv[f'T_ampl_{i}'], C_v=sv[f'C_v_ampl_{i}'],
                                                   s=sv[f's_ampl_{i}'], C_H2=sv[f'C_H2_ampl_{i}'], C_N2=C_N2_a_mean,
                                                   epsilon=epsilon_mpl),
                                          k_th_eff('ampl', sv[f'T_ampl_{i + 1}'], C_v=sv[f'C_v_ampl_{i + 1}'],
                                                   s=sv[f's_ampl_{i + 1}'], C_H2=sv[f'C_H2_ampl_{i + 1}'], C_N2=C_N2_a_mean,
                                                   epsilon=epsilon_mpl)])
                                   for i in range(1, nb_mpl)]

    k_th_eff_ampl_acl = hmean([k_th_eff('ampl', sv[f'T_ampl_{nb_mpl}'], C_v=sv[f'C_v_ampl_{nb_mpl}'],
                                                  s=sv[f's_ampl_{nb_mpl}'], C_H2=sv[f'C_H2_ampl_{nb_mpl}'],
                                                 C_N2=C_N2_a_mean, epsilon=epsilon_mpl),
                                 k_th_eff('acl', T_acl, C_v=C_v_acl, s=s_acl, lambdaa=lambda_acl,
                                          C_H2=C_H2_acl, C_N2=C_N2_a_mean, epsilon=epsilon_cl, epsilon_mc=epsilon_mc)],
                                weights=[Hmpl_node / 2, Hacl / 2])

    k_th_eff_acl_mem = hmean([k_th_eff('acl', T_acl, C_v=C_v_acl, s=s_acl, lambdaa=lambda_acl,
                                       C_H2=C_H2_acl, C_N2=C_N2_a_mean, epsilon=epsilon_cl, epsilon_mc=epsilon_mc),
                                      k_th_eff('mem', T_mem, lambdaa=lambda_mem)],
                               weights=[Hacl / 2, Hmem / 2])

    k_th_eff_mem_ccl = hmean([k_th_eff('mem', T_mem, lambdaa=lambda_mem),
                                      k_th_eff('ccl', T_ccl, C_v=C_v_ccl, s=s_ccl, lambdaa=lambda_ccl,
                                                C_O2=C_O2_ccl, C_N2=C_N2_c_mean, epsilon=epsilon_cl, epsilon_mc=epsilon_mc)],
                               weights=[Hmem / 2, Hccl / 2])

    k_th_eff_ccl_cmpl = hmean([k_th_eff('ccl', T_ccl, C_v=C_v_ccl, s=s_ccl, lambdaa=lambda_ccl, C_O2=C_O2_ccl,
                                                C_N2=C_N2_c_mean, epsilon=epsilon_cl, epsilon_mc=epsilon_mc),
                                       k_th_eff('cmpl', sv[f'T_cmpl_{1}'], C_v=sv[f'C_v_cmpl_{1}'],
                                                 s=sv[f's_cmpl_{1}'], C_O2=sv[f'C_O2_cmpl_{1}'], C_N2=C_N2_c_mean,
                                                epsilon=epsilon_mpl)],
                                weights=[Hccl / 2, Hmpl_node / 2])

    k_th_eff_cmpl_cmpl = [None] + [hmean([k_th_eff('cmpl', sv[f'T_cmpl_{i}'], C_v=sv[f'C_v_cmpl_{i}'],
                                                   s=sv[f's_cmpl_{i}'], C_O2=sv[f'C_O2_cmpl_{i}'], C_N2=C_N2_c_mean,
                                                   epsilon=epsilon_mpl),
                                            k_th_eff('cmpl', sv[f'T_cmpl_{i + 1}'], C_v=sv[f'C_v_cmpl_{i + 1}'],
                                                    s=sv[f's_cmpl_{i + 1}'], C_O2=sv[f'C_O2_cmpl_{i + 1}'], C_N2=C_N2_c_mean,
                                                    epsilon=epsilon_mpl)])
                                      for i in range(1, nb_mpl)]

    k_th_eff_cmpl_cgdl = hmean([k_th_eff('cmpl', sv[f'T_cmpl_{nb_mpl}'], C_v=sv[f'C_v_cmpl_{nb_mpl}'],
                                               s=sv[f's_cmpl_{nb_mpl}'], C_O2=sv[f'C_O2_cmpl_{nb_mpl}'], C_N2=C_N2_c_mean,
                                               epsilon=epsilon_mpl),
                                     k_th_eff('cgdl', sv['T_cgdl_1'], C_v=sv['C_v_cgdl_1'], s=sv['s_cgdl_1'],
                                              C_O2=sv[f'C_O2_cgdl_1'], C_N2=C_N2_c_mean, epsilon=epsilon_gdl,
                                              epsilon_c=epsilon_c)],
                               weights=[Hmpl_node / 2, Hgdl_node / 2])

    k_th_eff_cgdl_cgdl = [None] + [hmean([k_th_eff('cgdl', sv[f'T_cgdl_{i}'], C_v=sv[f'C_v_cgdl_{i}'],
                                                   s=sv[f's_cgdl_{i}'], C_O2=sv[f'C_O2_cgdl_{i}'], C_N2=C_N2_c_mean,
                                                   epsilon=epsilon_gdl, epsilon_c=epsilon_c),
                                          k_th_eff('cgdl', sv[f'T_cgdl_{i + 1}'], C_v=sv[f'C_v_cgdl_{i + 1}'],
                                                   s=sv[f's_cgdl_{i + 1}'], C_O2=sv[f'C_O2_cgdl_{i + 1}'], C_N2=C_N2_c_mean,
                                                   epsilon=epsilon_gdl, epsilon_c=epsilon_c)])
                                   for i in range(1, nb_gdl)]

    k_th_eff_cgdl_cgc = k_th_eff('cgdl', sv[f'T_cgdl_{nb_gdl}'], C_v=sv[f'C_v_cgdl_{nb_gdl}'],
                                 s=sv[f's_cgdl_{nb_gdl}'], C_O2=sv[f'C_O2_cgdl_{nb_gdl}'], C_N2=C_N2_c_mean, epsilon=epsilon_gdl,
                                 epsilon_c=epsilon_c)

    return (Hgdl_node, Hmpl_node, k_th_eff_agc_agdl, k_th_eff_agdl_agdl, k_th_eff_agdl_ampl, k_th_eff_ampl_ampl,
            k_th_eff_ampl_acl, k_th_eff_acl_mem, k_th_eff_mem_ccl, k_th_eff_ccl_cmpl, k_th_eff_cmpl_cmpl,
            k_th_eff_cmpl_cgdl, k_th_eff_cgdl_cgdl, k_th_eff_cgdl_cgc)