Settings

This file is used to set the parameters of the fuel cell system.

computing_parameters(step_current_parameters, Hgdl, Hacl)

This function is used to set the computing parameters of the fuel cell system.

Parameters:
  • step_current_parameters (dict) –

    Parameters for the step current density function.

  • Hgdl (float) –

    Thickness of the gas diffusion layer in meters.

  • Hacl (float) –

    Thickness of the anode catalyst layer in meters.

Returns:
  • n_gdl( int ) –

    Number of model nodes placed inside each GDL.

  • t_purge( tuple ) –

    Time parameters for purging the system. It is a tuple containing the purge time 'purge_time' in seconds, and the time between two purges 'delta_purge' in seconds. delta_t_dyn_step : float

  • step_current_parameters( dict ) –

    Parameters for the step current density. It is a dictionary containing: - 'delta_t_ini_step': the initial time (in seconds) at zero current density for the stabilisation of the internal states, - 'delta_t_load_step': the loading time (in seconds) for the step current density function, from 0 to i_step, - 'delta_t_break_step': the time (in seconds) at i_step current density for the stabilisation of the internal states, - 'i_step': the current density (in A.m-2) for the step current density function, - 'delta_t_dyn_step': the time (in seconds) for dynamic display of the step current density function.

Source code in configuration/settings.py
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
def computing_parameters(step_current_parameters, Hgdl, Hacl):
    """This function is used to set the computing parameters of the fuel cell system.

    Parameters
    ----------
    step_current_parameters : dict
        Parameters for the step current density function.
    Hgdl : float
        Thickness of the gas diffusion layer in meters.
    Hacl : float
        Thickness of the anode catalyst layer in meters.

    Returns
    -------
    n_gdl : int
        Number of model nodes placed inside each GDL.
    t_purge : tuple
        Time parameters for purging the system.
        It is a tuple containing the purge time 'purge_time' in seconds, and the time between two purges
        'delta_purge' in seconds.
        delta_t_dyn_step : float
    step_current_parameters : dict
        Parameters for the step current density. It is a dictionary containing:
        - 'delta_t_ini_step': the initial time (in seconds) at zero current density for the stabilisation of the
        internal states,
        - 'delta_t_load_step': the loading time (in seconds) for the step current density function, from 0 to
        i_step,
        - 'delta_t_break_step': the time (in seconds) at i_step current density for the stabilisation of the
        internal states,
        - 'i_step': the current density (in A.m-2) for the step current density function,
        - 'delta_t_dyn_step': the time (in seconds) for dynamic display of the step current density function.
    """

    n_gdl = max(1, int(Hgdl / Hacl / 4))  # It is the number of model points placed inside each GDL.
    #                                       A good compromise is int(Hgdl/Hacl/4).
    t_purge = 0.6, 15  # (s, s). It is the time parameters for purging the system.
    delta_t_dyn_step = 5*60  # (s). Time for dynamic display of the step current density function.

    step_current_parameters['delta_t_dyn_step'] = delta_t_dyn_step # Update the step current parameters.
    return n_gdl, t_purge, step_current_parameters

current_density_parameters(type_current=None)

This function is used to set the parameters of the current density which is imposed to the fuel cell system.

Parameters:
  • type_current (str, default: None ) –

    Type of current density which is imposed to the fuel cell system. It can be "step", "polarization" or "EIS".

Returns:
  • step_current_parameters( dict ) –

    Parameters for the step current density. It is a dictionary containing: - 'delta_t_ini_step': the initial time (in seconds) at zero current density for the stabilisation of the internal states, - 'delta_t_load_step': the loading time (in seconds) for the step current density function, from 0 to i_step, - 'delta_t_break_step': the time (in seconds) at i_step current density for the stabilisation of the internal states, - 'i_step': the current density (in A.m-2) for the step current density function, - 'delta_t_dyn_step': the time (in seconds) for dynamic display of the step current density function.

  • pola_current_parameters( dict ) –

    Parameters for the polarization current density. It is a dictionary containing: - 'delta_t_ini_pola': the initial time (in seconds) at zero current density for the stabilisation of the internal states, - 'delta_t_load_pola': the loading time (in seconds) for one step current of the polarisation current density function, - 'delta_t_break_pola': the breaking time (in seconds) for one step current, for the stabilisation of the internal states, - 'delta_i_pola': the current density step (in A.m-2) for the polarisation current density function. - 'i_max_pola': the maximum current density (in A.m-2) for the polarization curve.

  • pola_current_for_cali_parameters( dict ) –

    Parameters for the polarization current density for calibration. It is a dictionary containing: - 'delta_t_ini_pola_cali': the initial time (in seconds) at zero current density for the stabilisation of the internal states, - 'delta_t_load_pola_cali': the loading time (in seconds) for one step current of the polarisation current density function, - 'delta_t_break_pola_cali': the breaking time (in seconds) for one step current, for the stabilisation of the internal states.

  • i_EIS( float ) –

    Parameters for the EIS curve. It is the current for which a perturbation is added.

  • ratio_EIS( float ) –

    Parameters for the EIS curve. It is the ratio of the current for which a perturbation is added.

  • f_EIS( tuple ) –

    Frequency parameters for the EIS_current density function. It is a tuple containing the power of the initial frequency 'f_power_min_EIS' (f_min_EIS = 10**f_power_min_EIS), the power of the final frequency 'f_power_max_EIS', the number of frequencies tested 'nb_f_EIS', and the number of points calculated per specific period 'nb_points_EIS'.

  • t_EIS( tuple ) –

    Time parameters for the EIS_current density function. It is a tuple containing the initial EIS time after stack equilibrium 't0_EIS' in seconds, a list of time parameters which gives the beginning of each frequency change 't_new_start_EIS' in seconds, the final time 'tf_EIS' in seconds, a list of time parameters which gives the estimated time for reaching equilibrium at each frequency 'delta_t_break_EIS' in seconds, and a list of time parameters which gives the estimated time for measuring the voltage response at each frequency 'delta_t_measurement_EIS' in seconds.

  • current_density( function, optional. ) –

    Current density function.

Source code in configuration/settings.py
 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
def current_density_parameters(type_current=None):
    """This function is used to set the parameters of the current density which is imposed to the fuel cell system.

    Parameters
    ----------
    type_current : str
        Type of current density which is imposed to the fuel cell system. It can be "step", "polarization" or "EIS".

    Returns
    -------
    step_current_parameters : dict
        Parameters for the step current density. It is a dictionary containing:
        - 'delta_t_ini_step': the initial time (in seconds) at zero current density for the stabilisation of the
        internal states,
        - 'delta_t_load_step': the loading time (in seconds) for the step current density function, from 0 to
        i_step,
        - 'delta_t_break_step': the time (in seconds) at i_step current density for the stabilisation of the
        internal states,
        - 'i_step': the current density (in A.m-2) for the step current density function,
        - 'delta_t_dyn_step': the time (in seconds) for dynamic display of the step current density function.
    pola_current_parameters : dict
        Parameters for the polarization current density. It is a dictionary containing:
        - 'delta_t_ini_pola': the initial time (in seconds) at zero current density for the stabilisation of the
        internal states,
        - 'delta_t_load_pola': the loading time (in seconds) for one step current of the polarisation current
        density function,
        - 'delta_t_break_pola': the breaking time (in seconds) for one step current, for the stabilisation of the
        internal states,
        - 'delta_i_pola': the current density step (in A.m-2) for the polarisation current density function.
        - 'i_max_pola': the maximum current density (in A.m-2) for the polarization curve.
    pola_current_for_cali_parameters : dict
        Parameters for the polarization current density for calibration. It is a dictionary containing:
        - 'delta_t_ini_pola_cali': the initial time (in seconds) at zero current density for the stabilisation of
        the internal states,
        - 'delta_t_load_pola_cali': the loading time (in seconds) for one step current of the polarisation current
        density function,
        - 'delta_t_break_pola_cali': the breaking time (in seconds) for one step current, for the stabilisation of
        the internal states.
    i_EIS : float
        Parameters for the EIS curve. It is the current for which a perturbation is added.
    ratio_EIS : float
        Parameters for the EIS curve. It is the ratio of the current for which a perturbation is added.
    f_EIS : tuple
        Frequency parameters for the EIS_current density function.
        It is a tuple containing the power of the initial frequency 'f_power_min_EIS'
        (f_min_EIS = 10**f_power_min_EIS), the power of the final frequency 'f_power_max_EIS', the number of
        frequencies tested 'nb_f_EIS', and the number of points calculated per specific period 'nb_points_EIS'.
    t_EIS : tuple
        Time parameters for the EIS_current density function.
        It is a tuple containing the initial EIS time after stack equilibrium 't0_EIS' in seconds, a list of time
        parameters which gives the beginning of each frequency change 't_new_start_EIS' in seconds, the final time
        'tf_EIS' in seconds, a list of time parameters which gives the estimated time for reaching equilibrium at each
        frequency 'delta_t_break_EIS' in seconds, and a list of time parameters which gives the estimated time for
        measuring the voltage response at each frequency 'delta_t_measurement_EIS' in seconds.
    current_density : function, optional.
        Current density function.
    """

    # Setting the parameters of the step current density function
    delta_t_ini_step = 120*60 # (s). Initial time at zero current density for the stabilisation of the internal states.
    delta_t_load_step = 30 # (s). Loading time for the step current density function, from 0 to i_step.
    delta_t_break_step = 15 * 60  # (s). Time at i_step current density for the stabilisation of the internal states.
    i_step = 1.5e4 # (A.m-2). Current density for the step current density function.
    step_current_parameters = {'delta_t_ini_step': delta_t_ini_step, 'delta_t_load_step': delta_t_load_step,
                               'delta_t_break_step': delta_t_break_step,'i_step': i_step}

    # Setting the parameters of the polarization current density function
    delta_t_ini_pola = 120 * 60 # (s). Initial time at zero current density for the stabilisation of the internal states.
    delta_t_load_pola = 30 # (s). Loading time for one step current of the polarisation current density function.
    delta_t_break_pola = 15 * 60 # (s). Breaking time for one step current, for the stabilisation of the internal states.
    delta_i_pola = 0.05e4 # (A.m-2). Current density step for the polarisation current density function.
    pola_current_parameters = {'delta_t_ini_pola': delta_t_ini_pola, 'delta_t_load_pola': delta_t_load_pola,
                               'delta_t_break_pola': delta_t_break_pola, 'delta_i_pola': delta_i_pola}

    # Setting the parameters of the polarization for calibration current density function
    delta_t_ini_pola_cali = 120 * 60  # (s). Initial time at zero current density for the stabilisation of the internal states.
    delta_t_load_pola_cali = 30  # (s). Loading time for one step current of the polarisation current density function.
    delta_t_break_pola_cali = 10 * 60  # (s). Breaking time for one step current, for the stabilisation of the internal states.
    pola_current_for_cali_parameters = {'delta_t_ini_pola_cali': delta_t_ini_pola_cali,
                                        'delta_t_load_pola_cali': delta_t_load_pola_cali,
                                        'delta_t_break_pola_cali': delta_t_break_pola_cali}

    # Setting the parameters of the EIS current density function
    i_EIS, ratio_EIS = 1.0e4, 5/100  # (A/m², ). Parameters for the EIS curve.
    f_EIS = -3, 5, 90, 50 # Frequency parameters for the EIS_current density function.
    t_EIS = EIS_parameters(f_EIS)  # Time parameters for the EIS_current density function.

    # Setting the current density function:
    if type_current == "step": current_density = step_current
    elif type_current == "polarization": current_density = polarization_current
    elif type_current == "polarization_for_cali": current_density = polarization_current_for_calibration
    elif type_current == "EIS": current_density = EIS_current
    elif type_current is None: current_density = None  # No current density function is set.
    else: raise ValueError('You have to specify a type_current which is on the list.')

    return (step_current_parameters, pola_current_parameters, pola_current_for_cali_parameters,
            i_EIS, ratio_EIS, f_EIS, t_EIS, current_density)

operating_inputs_function(pola_current_parameters, type_fuel_cell)

This function is used to set the operating inputs of the fuel cell system.

Parameters:
  • pola_current_parameters (dict) –

    Parameters for the polarization current density function.

  • type_fuel_cell (str) –

    Type of fuel cell system.

Returns:
  • T_des( float ) –

    Desired fuel cell temperature in Kelvin.

  • Pa_des( float ) –

    Desired anode pressure in Pascal.

  • Pc_des( float ) –

    Desired cathode pressure in Pascal.

  • Sa( float ) –

    Stoichiometric ratio of hydrogen.

  • Sc( float ) –

    Stoichiometric ratio of oxygen.

  • Phi_a_des( float ) –

    Desired anode relative humidity.

  • Phi_c_des( float ) –

    Desired cathode relative humidity.

  • pola_current_parameters( dict ) –

    Parameters for the polarization current density. It is a dictionary containing: - 'delta_t_ini_pola': the initial time (in seconds) at zero current density for the stabilisation of the internal states, - 'delta_t_load_pola': the loading time (in seconds) for one step current of the polarisation current density function, - 'delta_t_break_pola': the breaking time (in seconds) for one step current, for the stabilisation of the internal states, - 'delta_i_pola': the current density step (in A.m-2) for the polarisation current density function. - 'i_max_pola': the maximum current density (in A.m-2) for the polarization curve.

Source code in configuration/settings.py
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
163
164
165
166
def operating_inputs_function(pola_current_parameters, type_fuel_cell):
    """This function is used to set the operating inputs of the fuel cell system.

    Parameters
    ----------
    pola_current_parameters : dict
        Parameters for the polarization current density function.
    type_fuel_cell : str
        Type of fuel cell system.

    Returns
    -------
    T_des : float
        Desired fuel cell temperature in Kelvin.
    Pa_des : float
        Desired anode pressure in Pascal.
    Pc_des : float
        Desired cathode pressure in Pascal.
    Sa : float
        Stoichiometric ratio of hydrogen.
    Sc : float
        Stoichiometric ratio of oxygen.
    Phi_a_des : float
        Desired anode relative humidity.
    Phi_c_des : float
        Desired cathode relative humidity.
    pola_current_parameters : dict
        Parameters for the polarization current density. It is a dictionary containing:
        - 'delta_t_ini_pola': the initial time (in seconds) at zero current density for the stabilisation of the
        internal states,
        - 'delta_t_load_pola': the loading time (in seconds) for one step current of the polarisation current
        density function,
        - 'delta_t_break_pola': the breaking time (in seconds) for one step current, for the stabilisation of the
        internal states,
        - 'delta_i_pola': the current density step (in A.m-2) for the polarisation current density function.
        - 'i_max_pola': the maximum current density (in A.m-2) for the polarization curve.
    """

    if type_fuel_cell == "manual_setup": # Setup which are not stored in "stored_operating_inputs".
        T_des = 74 + 273.15  # K. It is the desired fuel cell temperature.
        Pa_des, Pc_des = 2.0e5, 2.0e5  # Pa. It is the desired pressure of the fuel gas (at the anode/cathode).
        Sa, Sc = 1.2, 2.0  # It is the stoichiometric ratio (of hydrogen and oxygen).
        Phi_a_des, Phi_c_des = 0.4, 0.6  # It is the desired relative humidity.
        i_max_pola = 3.0e4  # A.m-2. It is the maximum current density for the polarization curve.
    elif type_fuel_cell is None:
        T_des, Pa_des, Pc_des, Sa, Sc, Phi_a_des, Phi_c_des, i_max_pola = None, None, None, None, None, None, None, None
    else: # Stored setup in "stored_operating_inputs".
        T_des, Pa_des, Pc_des, Sa, Sc, Phi_a_des, Phi_c_des, i_max_pola = stored_operating_inputs(type_fuel_cell)

    pola_current_parameters['i_max_pola'] = i_max_pola  # Update the maximum current density for the polarization curve.
    return T_des, Pa_des, Pc_des, Sa, Sc, Phi_a_des, Phi_c_des, pola_current_parameters

physical_parameters(type_fuel_cell)

This function is used to set the physical parameters of the fuel cell system.

Parameters:
  • type_fuel_cell (str) –

    Type of fuel cell system. It can be "EH-31_1.5", "EH-31_2.0", "EH-31_2.25", "EH-31_2.5", "LF", or "manual_setup".

Returns:
  • Hacl( float ) –

    Thickness of the anode catalyst layer in meters.

  • Hacl( float ) –

    Thickness of the cathode catalyst layer in meters.

  • epsilon_mc( float ) –

    Volume fraction of ionomer in the catalyst layer.

  • Hmem( float ) –

    Thickness of the membrane in meters.

  • Hgdl( float ) –

    Thickness of the gas diffusion layer in meters.

  • epsilon_gdl( float ) –

    Anode/cathode GDL porosity.

  • epsilon_c( float ) –

    Compression ratio of the GDL.

  • Hmpl( float ) –

    Thickness of the microporous layer in meters.

  • epsilon_mpl( float ) –

    Porosity of the microporous layer.

  • Hagc( float ) –

    Thickness of the anode gas channel in meters.

  • Hcgc( float ) –

    Thickness of the cathode gas channel in meters.

  • Wagc( float ) –

    Width of the anode gas channel in meters.

  • Wcgc( float ) –

    Width of the cathode gas channel in meters.

  • Lgc( float ) –

    Length of the gas channel in meters.

  • Aact( float ) –

    Active area of the catalyst layer in meters squared.

  • e( float ) –

    Capillary exponent.

  • i0_c_ref( float ) –

    Reference exchange current density at the cathode in A.m-2.

  • kappa_co( float ) –

    Crossover correction coefficient in mol.m-1.s-1.Pa-1.

  • kappa_c( float ) –

    Overpotential correction exponent.

  • a_slim( float ) –

    One of the limit liquid saturation coefficients: the slop of slim function.

  • b_slim( float ) –

    One of the limit liquid saturation coefficients: the intercept of slim function.

  • a_switch( float ) –

    One of the limit liquid saturation coefficients: the slop of s_switch function.

  • C_dl( float ) –

    Volumetric double layer capacitance in F.m-3.

Source code in configuration/settings.py
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
def physical_parameters(type_fuel_cell):
    """This function is used to set the physical parameters of the fuel cell system.

    Parameters
    ----------
    type_fuel_cell : str
        Type of fuel cell system. It can be "EH-31_1.5", "EH-31_2.0", "EH-31_2.25", "EH-31_2.5", "LF",
        or "manual_setup".

    Returns
    -------
    Hacl : float
        Thickness of the anode catalyst layer in meters.
    Hacl : float
        Thickness of the cathode catalyst layer in meters.
    epsilon_mc : float
        Volume fraction of ionomer in the catalyst layer.
    Hmem : float
        Thickness of the membrane in meters.
    Hgdl : float
        Thickness of the gas diffusion layer in meters.
    epsilon_gdl : float
        Anode/cathode GDL porosity.
    epsilon_c : float
        Compression ratio of the GDL.
    Hmpl : float
        Thickness of the microporous layer in meters.
    epsilon_mpl : float
        Porosity of the microporous layer.
    Hagc : float
        Thickness of the anode gas channel in meters.
    Hcgc : float
        Thickness of the cathode gas channel in meters.
    Wagc : float
        Width of the anode gas channel in meters.
    Wcgc : float
        Width of the cathode gas channel in meters.
    Lgc : float
        Length of the gas channel in meters.
    Aact : float
        Active area of the catalyst layer in meters squared.
    e : float
        Capillary exponent.
    i0_c_ref : float
        Reference exchange current density at the cathode in A.m-2.
    kappa_co : float
        Crossover correction coefficient in mol.m-1.s-1.Pa-1.
    kappa_c : float
        Overpotential correction exponent.
    a_slim : float
        One of the limit liquid saturation coefficients: the slop of slim function.
    b_slim : float
        One of the limit liquid saturation coefficients: the intercept of slim function.
    a_switch : float
        One of the limit liquid saturation coefficients: the slop of s_switch function.
    C_dl : float
        Volumetric double layer capacitance in F.m-3.
    """

    if type_fuel_cell == "manual_setup": # Setup which are not stored in "stored_physical_parameters".
        # Fuel cell physical parameters: 𝜔 (which are not controllable by the system)
        #   Catalyst layer
        Aact = 8.5e-3  # m². It is the active area of the catalyst layer.
        Hacl = 8.089e-6  # m. It is the thickness of the anode catalyst layer.
        Hccl = Hacl  # m. It is the thickness of the cathode catalyst layer.
        epsilon_cl = 0.25  # It is the porosity of the catalyst layer, without units.
        epsilon_mc = 0.3949198274842546  # It is the volume fraction of ionomer in the CL.
        #   Membrane
        Hmem = 2e-5  # m. It is the thickness of the membrane.
        #   Gas diffusion layer
        Hgdl = 2e-4  # m. It is the thickness of the gas diffusion layer.
        epsilon_gdl = 0.7011156494971454  # It is the anode/cathode GDL porosity.
        epsilon_c = 0.27052745219052654  # It is the compression ratio of the GDL.
        #   Microporous layer
        Hmpl = 3e-5  # m. It is the thickness of the microporous layer.
        epsilon_mpl = 0.4  # It is the porosity of the microporous layer.
        #   Gas channel
        Hagc = 5e-4  # m. It is the thickness of the anode gas channel.
        Hcgc = Hagc  # m. It is the thickness of the cathode gas channel.
        Wagc = 4.5e-4  # m. It is the width of the anode gas channel.
        Wcgc = Wagc  # m. It is the width of the cathode gas channel.
        Lgc = 9.67  # m. It is the length of the gas channel.
        #   Interaction parameters between water and PEMFC structure
        e = 5.0  # It is the capillary exponent
        #   Voltage polarization
        i0_c_ref = 2.787917581303015  # A.m-2. It is the reference exchange current density at the cathode.
        kappa_co = 29.793535549174077  # mol.m-1.s-1.Pa-1. It is the crossover correction coefficient.
        kappa_c = 1.6136446641573106  # It is the overpotential correction exponent.
        a_slim, b_slim, a_switch = 0.0555312850726664, 0.10514269908118055, 0.6365424991141914  # It is the limit
        #                                                               liquid saturation coefficients.
        C_scl = 2e7  # F.m-3. It is the volumetric space-charge layer capacitance.
    else: # Stored setup in "stored_physical_parameters".
        (Hacl, Hccl, epsilon_mc, Hmem, Hgdl, epsilon_gdl, epsilon_cl, epsilon_c, Hmpl, epsilon_mpl, Hagc, Hcgc, Wagc,
         Wcgc, Lgc, Aact, e, i0_c_ref, kappa_co, kappa_c, a_slim, b_slim, a_switch, C_scl) = stored_physical_parameters(type_fuel_cell)

    return (Hacl, Hccl, epsilon_mc, Hmem, Hgdl, epsilon_gdl, epsilon_cl, epsilon_c, Hmpl, epsilon_mpl, Hagc, Hcgc, Wagc,
            Wcgc, Lgc, Aact, e, i0_c_ref, kappa_co, kappa_c, a_slim, b_slim, a_switch, C_scl)